mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-15 15:46:47 +00:00
lint
This commit is contained in:
parent
719c9dfaaa
commit
d4ac8ff5f7
@ -90,7 +90,7 @@ def _generate_response_from_error(error: BaseException) -> list[AIMessageV1]:
|
||||
if hasattr(response, "status_code"):
|
||||
metadata["status_code"] = response.status_code
|
||||
if hasattr(error, "request_id"):
|
||||
metadata["request_id"] = error.request_id # type: ignore[arg-type]
|
||||
metadata["request_id"] = error.request_id
|
||||
# Permit response_metadata without model_name, model_provider fields
|
||||
generations = [AIMessageV1(content=[], response_metadata=metadata)] # type: ignore[arg-type]
|
||||
else:
|
||||
|
@ -385,15 +385,12 @@ def _init_tool_calls(content: list[types.ContentBlock]) -> list[types.ContentBlo
|
||||
new_content.append(block)
|
||||
continue
|
||||
try:
|
||||
args_ = (
|
||||
parse_partial_json(cast("str", block.get("args") or ""))
|
||||
if block.get("args")
|
||||
else {}
|
||||
)
|
||||
args_str = block.get("args")
|
||||
args_ = parse_partial_json(args_str) if args_str else {}
|
||||
if isinstance(args_, dict):
|
||||
new_content.append(
|
||||
create_tool_call(
|
||||
name=cast("str", block.get("name") or ""),
|
||||
name=cast("str", block.get("name")),
|
||||
args=args_,
|
||||
id=cast("str", block.get("id", "")),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user