Skip to content

Commit b0100fe

Browse files
Handling Type Error
File "/Users/sathraje/.venv/lib/python3.11/site-packages/langchain_oci/chat_models/oci_generative_ai.py", line 100, in convert_oci_tool_call_to_langchain if "arguments" in tool_call.attribute_map ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable
1 parent c694b3f commit b0100fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/oci/langchain_oci/chat_models/oci_generative_ai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ def convert_oci_tool_call_to_langchain(tool_call: Any) -> ToolCall:
9797
return ToolCall(
9898
name=tool_call.name,
9999
args=json.loads(tool_call.arguments)
100-
if "arguments" in tool_call.attribute_map
100+
if tool_call.attribute_map and "arguments" in tool_call.attribute_map
101101
else tool_call.parameters,
102-
id=tool_call.id if "id" in tool_call.attribute_map else uuid.uuid4().hex[:],
102+
id=tool_call.id if tool_call.attribute_map and "id" in tool_call.attribute_map else uuid.uuid4().hex[:],
103103
)
104104

105105

0 commit comments

Comments
 (0)