From b0100fe0cd5d71dfc0e67d96c196f975bf8bc50f Mon Sep 17 00:00:00 2001 From: codewithsathish9094 Date: Tue, 30 Sep 2025 22:51:20 +0530 Subject: [PATCH] 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 --- libs/oci/langchain_oci/chat_models/oci_generative_ai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/oci/langchain_oci/chat_models/oci_generative_ai.py b/libs/oci/langchain_oci/chat_models/oci_generative_ai.py index 8d8ce34..492296c 100644 --- a/libs/oci/langchain_oci/chat_models/oci_generative_ai.py +++ b/libs/oci/langchain_oci/chat_models/oci_generative_ai.py @@ -97,9 +97,9 @@ def convert_oci_tool_call_to_langchain(tool_call: Any) -> ToolCall: return ToolCall( name=tool_call.name, args=json.loads(tool_call.arguments) - if "arguments" in tool_call.attribute_map + if tool_call.attribute_map and "arguments" in tool_call.attribute_map else tool_call.parameters, - id=tool_call.id if "id" in tool_call.attribute_map else uuid.uuid4().hex[:], + id=tool_call.id if tool_call.attribute_map and "id" in tool_call.attribute_map else uuid.uuid4().hex[:], )