mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-13 22:59:05 +00:00
remove unnecessary casting
This commit is contained in:
parent
13719df998
commit
6e2418d44b
@ -393,26 +393,26 @@ def _init_tool_calls(content: list[types.ContentBlock]) -> list[types.ContentBlo
|
||||
if isinstance(args_, dict):
|
||||
new_content.append(
|
||||
create_tool_call(
|
||||
name=cast("str", block.get("name")),
|
||||
name=block.get("name") or "",
|
||||
args=args_,
|
||||
id=cast("str", block.get("id", "")),
|
||||
id=block.get("id", ""),
|
||||
)
|
||||
)
|
||||
else:
|
||||
new_content.append(
|
||||
create_invalid_tool_call(
|
||||
name=cast("str", block.get("name", "")),
|
||||
args=cast("str", block.get("args", "")),
|
||||
id=cast("str", block.get("id", "")),
|
||||
name=block.get("name", ""),
|
||||
args=block.get("args", ""),
|
||||
id=block.get("id", ""),
|
||||
error=None,
|
||||
)
|
||||
)
|
||||
except Exception:
|
||||
new_content.append(
|
||||
create_invalid_tool_call(
|
||||
name=cast("str", block.get("name", "")),
|
||||
args=cast("str", block.get("args", "")),
|
||||
id=cast("str", block.get("id", "")),
|
||||
name=block.get("name", ""),
|
||||
args=block.get("args", ""),
|
||||
id=block.get("id", ""),
|
||||
error=None,
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user