remove placeholder error message (#20340)

This commit is contained in:
ccurme 2024-04-26 09:48:48 -04:00 committed by GitHub
parent 4c437ebb9c
commit 7d8d0229fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -124,7 +124,7 @@ class AIMessageChunk(AIMessage, BaseMessageChunk):
name=chunk["name"], name=chunk["name"],
args=chunk["args"], args=chunk["args"],
id=chunk["id"], id=chunk["id"],
error="Malformed args.", error=None,
) )
) )
values["tool_calls"] = tool_calls values["tool_calls"] = tool_calls

View File

@ -149,7 +149,7 @@ def default_tool_parser(
name=function_name, name=function_name,
args=tool_call["function"]["arguments"], args=tool_call["function"]["arguments"],
id=tool_call.get("id"), id=tool_call.get("id"),
error="Malformed args.", error=None,
) )
) )
return tool_calls, invalid_tool_calls return tool_calls, invalid_tool_calls

View File

@ -53,7 +53,7 @@ def test_serdes_message_chunk() -> None:
"name": "foobad", "name": "foobad",
"args": "blah", "args": "blah",
"id": "booz", "id": "booz",
"error": "Malformed args.", "error": None,
} }
], ],
"tool_call_chunks": [ "tool_call_chunks": [

View File

@ -306,8 +306,8 @@ def test_message_chunk_to_message() -> None:
{"name": "tool2", "args": {}, "id": "2"}, {"name": "tool2", "args": {}, "id": "2"},
], ],
invalid_tool_calls=[ invalid_tool_calls=[
{"name": "tool3", "args": None, "id": "3", "error": "Malformed args."}, {"name": "tool3", "args": None, "id": "3", "error": None},
{"name": "tool4", "args": "abc", "id": "4", "error": "Malformed args."}, {"name": "tool4", "args": "abc", "id": "4", "error": None},
], ],
) )
assert message_chunk_to_message(chunk) == expected assert message_chunk_to_message(chunk) == expected