mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-02 07:00:32 +00:00
fix: fix chat request params miss runtime_options (#23247)
* fix: fix chat request params miss runtime_options * fix: mypy
This commit is contained in:
parent
43d97acd21
commit
a83809de54
@ -203,6 +203,7 @@ class OpenAIClient(GenAIClient):
|
||||
"model": self.genai_config.model,
|
||||
"messages": messages,
|
||||
"timeout": self.timeout,
|
||||
**self.genai_config.runtime_options,
|
||||
}
|
||||
|
||||
if tools:
|
||||
@ -219,7 +220,7 @@ class OpenAIClient(GenAIClient):
|
||||
}
|
||||
request_params.update(provider_opts)
|
||||
|
||||
result = self.provider.chat.completions.create(**request_params) # type: ignore[call-overload]
|
||||
result = self.provider.chat.completions.create(**request_params)
|
||||
|
||||
if (
|
||||
result is None
|
||||
@ -315,6 +316,7 @@ class OpenAIClient(GenAIClient):
|
||||
"timeout": self.timeout,
|
||||
"stream": True,
|
||||
"stream_options": {"include_usage": True},
|
||||
**self.genai_config.runtime_options,
|
||||
}
|
||||
|
||||
if tools:
|
||||
@ -337,7 +339,7 @@ class OpenAIClient(GenAIClient):
|
||||
finish_reason = "stop"
|
||||
usage_stats: Optional[dict[str, Any]] = None
|
||||
|
||||
stream = self.provider.chat.completions.create(**request_params) # type: ignore[call-overload]
|
||||
stream = self.provider.chat.completions.create(**request_params)
|
||||
|
||||
for chunk in stream:
|
||||
chunk_usage = getattr(chunk, "usage", None)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user