mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 15:19:33 +00:00
remove placeholder error message (#20340)
This commit is contained in:
parent
4c437ebb9c
commit
7d8d0229fa
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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": [
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user