mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
Test fixes in openai_compat
This commit is contained in:
parent
e56a3f266c
commit
d60514b57b
7 changed files with 221 additions and 7 deletions
|
@ -590,6 +590,7 @@ class InferenceRouter(Inference):
|
|||
|
||||
async def _nonstream_openai_chat_completion(self, provider: Inference, params: dict) -> OpenAIChatCompletion:
|
||||
response = await provider.openai_chat_completion(**params)
|
||||
|
||||
for choice in response.choices:
|
||||
# some providers return an empty list for no tool calls in non-streaming responses
|
||||
# but the OpenAI API returns None. So, set tool_calls to None if it's empty
|
||||
|
@ -739,7 +740,6 @@ class InferenceRouter(Inference):
|
|||
id = None
|
||||
created = None
|
||||
choices_data: dict[int, dict[str, Any]] = {}
|
||||
|
||||
try:
|
||||
async for chunk in response:
|
||||
# Skip None chunks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue