Skip to content

Commit

Permalink
remove model thingy when gpt-4 is always default
Browse files Browse the repository at this point in the history
  • Loading branch information
gptlang committed Feb 1, 2024
1 parent 1c068cc commit b3e3284
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rplugin/python3/handlers/chat_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def chat(
system_prompt: Optional[str] = None,
disable_start_separator: bool = False,
disable_end_separator: bool = False,
model: str = "gpt-4",
):
if system_prompt is None:
system_prompt = self._construct_system_prompt(prompt)
Expand All @@ -40,13 +39,13 @@ def chat(
self.nvim.exec_lua('require("CopilotChat.spinner").show()')

self.nvim.exec_lua(
'require("CopilotChat.utils").log_info(...)', f"Chatting with {model} model"
'require("CopilotChat.utils").log_info(...)', "Chatting with gpt-4 model"
)

if not disable_start_separator:
self._add_start_separator(system_prompt, prompt, code, filetype, winnr)

self._add_chat_messages(system_prompt, prompt, code, filetype, model=model)
self._add_chat_messages(system_prompt, prompt, code, filetype)

# Stop the spinner
self.nvim.exec_lua('require("CopilotChat.spinner").hide()')
Expand Down Expand Up @@ -180,13 +179,13 @@ def _add_folds(
self.nvim.command(full_command)

def _add_chat_messages(
self, system_prompt: str, prompt: str, code: str, file_type: str, model: str
self, system_prompt: str, prompt: str, code: str, file_type: str
):
if self.copilot is None:
self.copilot = Copilot()

for token in self.copilot.ask(
system_prompt, prompt, code, language=cast(str, file_type), model=model
system_prompt, prompt, code, language=cast(str, file_type)
):
self.nvim.exec_lua(
'require("CopilotChat.utils").log_info(...)', f"Token: {token}"
Expand Down

0 comments on commit b3e3284

Please sign in to comment.