Skip to content

Commit

Permalink
Chat and REPL modes output fix after function calls (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
save196 authored Apr 1, 2024
1 parent bb63eba commit be138cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sgpt/handlers/chat_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Generator[str, None, None]:
if not kwargs.get("messages"):
return
if not chat_id:
yield from func(*args, **kwargs, caching=False)
yield from func(*args, **kwargs)
return
previous_messages = self._read(chat_id)
for message in kwargs["messages"]:
Expand Down
7 changes: 6 additions & 1 deletion sgpt/handlers/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ def get_completion(
if chunk.choices[0].finish_reason == "function_call":
yield from self.handle_function_call(messages, name, arguments)
yield from self.get_completion(
model, temperature, top_p, messages, functions, caching=False
model=model,
temperature=temperature,
top_p=top_p,
messages=messages,
functions=functions,
caching=False,
)
return

Expand Down

0 comments on commit be138cb

Please sign in to comment.