Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sgpt/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Generator[str, None, None]:
result += i
yield i
if "@FunctionCall" not in result:
file.write_text(result)
file.write_text(result, encoding="utf-8")
self._delete_oldest_files(self.length) # type: ignore

return wrapper
Expand Down
2 changes: 2 additions & 0 deletions sgpt/handlers/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def get_completion(

try:
for chunk in response:
if not chunk.choices:
continue
delta = chunk.choices[0].delta

# LiteLLM uses dict instead of Pydantic object like OpenAI does.
Expand Down