Skip to content

Commit

Permalink
Fix Assistant schema
Browse files Browse the repository at this point in the history
  • Loading branch information
artitw committed Oct 7, 2024
1 parent b838be8 commit fcd9fcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="text2text",
version="1.6.9",
version="1.7.0",
author="artitw",
author_email="artitw@gmail.com",
description="Text2Text: Crosslingual NLP/G toolkit",
Expand Down
4 changes: 2 additions & 2 deletions text2text/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ def chat_completion(self, messages=[{"role": "user", "content": "hello"}], strea
if not result or not result.get("models"):
warnings.warn("No model loaded. Retrying...")
self.load_model()
return self.chat_completion(messages=messages, stream=stream, **kwargs)
return self.chat_completion(messages=messages, stream=stream, schema=schema, **kwargs)
except Exception as e:
warnings.warn(str(e))
warnings.warn("Retrying...")
self.load_model()
return self.chat_completion(messages=messages, stream=stream, **kwargs)
return self.chat_completion(messages=messages, stream=stream, schema=schema, **kwargs)

if schema:
msgs = [ChatMessage(**m) for m in messages]
Expand Down

0 comments on commit fcd9fcc

Please sign in to comment.