mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-18 14:48:41 +00:00
raise error if input has function_call_output with no matching function_call
This commit is contained in:
parent
012088e084
commit
e40a212af4
2 changed files with 18 additions and 7 deletions
|
|
@ -157,8 +157,10 @@ async def convert_response_input_to_chat_messages(
|
|||
f"Llama Stack OpenAI Responses does not yet support message role '{input_item.role}' in this context"
|
||||
)
|
||||
messages.append(message_type(content=content))
|
||||
for result in tool_call_results.values():
|
||||
messages.append(result)
|
||||
if len(tool_call_results):
|
||||
raise ValueError(
|
||||
f"Received function_call_output(s) with call_id(s) {tool_call_results.keys()}, but no corresponding function_call"
|
||||
)
|
||||
else:
|
||||
messages.append(OpenAIUserMessageParam(content=input))
|
||||
return messages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue