mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 12:06:04 +00:00
Add protection to response_format
This commit is contained in:
parent
bf7950338e
commit
37a9d4fb05
1 changed files with 3 additions and 1 deletions
|
|
@ -217,7 +217,9 @@ class StreamingResponseOrchestrator:
|
||||||
while True:
|
while True:
|
||||||
# Text is the default response format for chat completion so don't need to pass it
|
# Text is the default response format for chat completion so don't need to pass it
|
||||||
# (some providers don't support non-empty response_format when tools are present)
|
# (some providers don't support non-empty response_format when tools are present)
|
||||||
response_format = None if self.ctx.response_format.type == "text" else self.ctx.response_format
|
response_format = (
|
||||||
|
None if getattr(self.ctx.response_format, "type", None) == "text" else self.ctx.response_format
|
||||||
|
)
|
||||||
logger.debug(f"calling openai_chat_completion with tools: {self.ctx.chat_tools}")
|
logger.debug(f"calling openai_chat_completion with tools: {self.ctx.chat_tools}")
|
||||||
|
|
||||||
params = OpenAIChatCompletionRequestWithExtraBody(
|
params = OpenAIChatCompletionRequestWithExtraBody(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue