From fcd9fcc8e364e4f3ec04276730f28cea4061fcea Mon Sep 17 00:00:00 2001 From: artitw Date: Mon, 7 Oct 2024 07:29:37 +0000 Subject: [PATCH] Fix Assistant schema --- setup.py | 2 +- text2text/assistant.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 17e7c9b..5d13ccc 100755 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/text2text/assistant.py b/text2text/assistant.py index 549c599..a033cfc 100644 --- a/text2text/assistant.py +++ b/text2text/assistant.py @@ -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]