mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-04 20:04:44 +00:00
Fix for json_object tests I broke in #373
This commit is contained in:
parent
53f80dd531
commit
184273876f
1 changed files with 4 additions and 4 deletions
|
|
@ -233,9 +233,9 @@ class Chat(Model):
|
|||
default_max_tokens = None
|
||||
|
||||
class Options(SharedOptions):
|
||||
json_object: bool = Field(
|
||||
json_object: Optional[bool] = Field(
|
||||
description="Output a valid JSON object {...}. Prompt must mention JSON.",
|
||||
default=False,
|
||||
default=None,
|
||||
)
|
||||
|
||||
def __init__(
|
||||
|
|
@ -320,11 +320,11 @@ class Chat(Model):
|
|||
kwargs["api_version"] = self.api_version
|
||||
if self.api_engine:
|
||||
kwargs["engine"] = self.api_engine
|
||||
if json_object:
|
||||
kwargs["response_format"] = {"type": "json_object"}
|
||||
if self.needs_key:
|
||||
if self.key:
|
||||
kwargs["api_key"] = self.key
|
||||
if json_object:
|
||||
kwargs["response_format"] = {"type": "json_object"}
|
||||
else:
|
||||
# OpenAI-compatible models don't need a key, but the
|
||||
# openai client library requires one
|
||||
|
|
|
|||
Loading…
Reference in a new issue