Skip to content

Commit 91cd300

Browse files
jsonbaileyclaude
andcommitted
fix: mutate track data dict in place and guard tool_calls with isinstance check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a183f12 commit 91cd300

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/ai-providers/server-ai-langchain/src/ldai_langchain/langchain_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def get_tool_calls_from_response(response: Any) -> List[str]:
125125
:return: List of tool names in order, or empty list if none
126126
"""
127127
names: List[str] = []
128-
if hasattr(response, 'tool_calls') and response.tool_calls:
128+
if hasattr(response, 'tool_calls') and isinstance(response.tool_calls, list):
129129
for tc in response.tool_calls:
130130
n = tc.get('name')
131131
if n:

packages/sdk/server-ai/src/ldai/tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __get_track_data(self, graph_key: Optional[str] = None) -> dict:
113113
"providerName": self._provider_name,
114114
}
115115
if graph_key is not None:
116-
return {**data, "graphKey": graph_key}
116+
data['graphKey'] = graph_key
117117
return data
118118

119119
def track_duration(self, duration: int, *, graph_key: Optional[str] = None) -> None:

0 commit comments

Comments
 (0)