From f4dab8aba06adad1e1e9b655638e609d4c6c6e6d Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Fri, 15 Dec 2023 12:44:32 -0500 Subject: [PATCH] move tests --- instructor/function_calls.py | 11 ++++++----- tests/openai/util.py | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/instructor/function_calls.py b/instructor/function_calls.py index 53cb6d5..4fc6321 100644 --- a/instructor/function_calls.py +++ b/instructor/function_calls.py @@ -122,12 +122,12 @@ class OpenAISchema(BaseModel): Returns: cls (OpenAISchema): An instance of the class """ - if completion.choices[0].finish_reason == "length": - raise IncompleteOutputException() - if stream_multitask: return cls.from_streaming_response(completion, mode) + if completion.choices[0].finish_reason == "length": + raise IncompleteOutputException() + message = completion.choices[0].message if mode == Mode.FUNCTIONS: @@ -183,12 +183,13 @@ class OpenAISchema(BaseModel): Returns: cls (OpenAISchema): An instance of the class """ - if completion.choices[0].finish_reason == "length": - raise IncompleteOutputException() if stream_multitask: return await cls.from_streaming_response_async(completion, mode) + if completion.choices[0].finish_reason == "length": + raise IncompleteOutputException() + message = completion.choices[0].message if mode == Mode.FUNCTIONS: diff --git a/tests/openai/util.py b/tests/openai/util.py index 9ef2461..1234286 100644 --- a/tests/openai/util.py +++ b/tests/openai/util.py @@ -5,5 +5,4 @@ modes = [ instructor.Mode.FUNCTIONS, instructor.Mode.JSON, instructor.Mode.TOOLS, - instructor.Mode.MD_JSON, ]