forked from phoenix/litellm-mirror
fix ModelResponseIterator
This commit is contained in:
parent
c3a2c77b55
commit
a866bdb01e
2 changed files with 6 additions and 1 deletions
|
@ -644,7 +644,9 @@ class AnthropicChatCompletion(BaseLLM):
|
|||
|
||||
|
||||
class ModelResponseIterator:
|
||||
def __init__(self, streaming_response, sync_stream: bool, json_mode: bool):
|
||||
def __init__(
|
||||
self, streaming_response, sync_stream: bool, json_mode: Optional[bool] = False
|
||||
):
|
||||
self.streaming_response = streaming_response
|
||||
self.response_iterator = self.streaming_response
|
||||
self.content_blocks: List[ContentBlockDelta] = []
|
||||
|
|
|
@ -45,6 +45,9 @@ class BaseLLMChatTest(ABC):
|
|||
)
|
||||
assert response is not None
|
||||
|
||||
# for OpenAI the content contains the JSON schema, so we need to assert that the content is not None
|
||||
assert response.choices[0].message.content is not None
|
||||
|
||||
def test_message_with_name(self):
|
||||
base_completion_call_args = self.get_base_completion_call_args()
|
||||
messages = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue