Skip to content

Commit c7e871b

Browse files
assert that there is only one tool span
1 parent 1b4b2ba commit c7e871b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/integrations/langchain/test_langchain.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,12 @@ def test_tool_execution_span(
325325
assert tx["contexts"]["trace"]["origin"] == "manual"
326326

327327
chat_spans = list(x for x in tx["spans"] if x["op"] == "gen_ai.chat")
328-
tool_exec_span = next(x for x in tx["spans"] if x["op"] == "gen_ai.execute_tool")
329-
330328
assert len(chat_spans) == 2
331329

330+
tool_exec_spans = list(x for x in tx["spans"] if x["op"] == "gen_ai.execute_tool")
331+
assert len(tool_exec_spans) == 1
332+
tool_exec_span = tool_exec_spans[0]
333+
332334
assert chat_spans[0]["origin"] == "auto.ai.langchain"
333335
assert chat_spans[1]["origin"] == "auto.ai.langchain"
334336
assert tool_exec_span["origin"] == "auto.ai.langchain"

0 commit comments

Comments
 (0)