Skip to content

Commit 09673b7

Browse files
expect string response tool calls
1 parent c7e871b commit 09673b7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/integrations/langchain/test_langchain.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,8 @@ def test_tool_execution_span(
353353
"Tool calls should be recorded when send_default_pii=True and include_prompts=True"
354354
)
355355
tool_calls_data = chat_spans[0]["data"][SPANDATA.GEN_AI_RESPONSE_TOOL_CALLS]
356-
assert isinstance(tool_calls_data, (list, str)) # Could be serialized
357-
if isinstance(tool_calls_data, str):
358-
assert "get_word_length" in tool_calls_data
359-
elif isinstance(tool_calls_data, list) and len(tool_calls_data) > 0:
360-
# Check if tool calls contain expected function name
361-
tool_call_str = str(tool_calls_data)
362-
assert "get_word_length" in tool_call_str
356+
assert isinstance(tool_calls_data, str)
357+
assert "get_word_length" in tool_calls_data
363358
else:
364359
assert SPANDATA.GEN_AI_REQUEST_MESSAGES not in chat_spans[0].get("data", {})
365360
assert SPANDATA.GEN_AI_RESPONSE_TEXT not in chat_spans[0].get("data", {})

0 commit comments

Comments
 (0)