Skip to content

Commit

Permalink
v2.0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Nov 10, 2023
1 parent eb23703 commit 04c55b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions phi/llm/openai/chat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from typing import Optional, List, Iterator, Dict, Any, Union, Tuple

from phi.llm.base import LLM
Expand Down Expand Up @@ -139,7 +140,6 @@ def invoke_model_stream(self, messages: List[Message]) -> Iterator[ChatCompletio
if get_from_env("OPENAI_API_KEY") is None:
logger.debug("--o-o-- Using phi-proxy")
try:
import json
from phi.api.llm import openai_chat_stream

for chunk in openai_chat_stream(
Expand All @@ -157,7 +157,7 @@ def invoke_model_stream(self, messages: List[Message]) -> Iterator[ChatCompletio
chunks = "[" + chunk.replace("}{", "},{") + "]"
for completion_chunk in json.loads(chunks):
try:
yield ChatCompletionChunk.model_validate_json(completion_chunk)
yield ChatCompletionChunk.model_validate(completion_chunk)
except Exception as e:
logger.warning(e)
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "phidata"
version = "2.0.37"
version = "2.0.38"
description = "AI Toolkit for Engineers"
requires-python = ">=3.7"
readme = "README.md"
Expand Down

0 comments on commit 04c55b7

Please sign in to comment.