File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1039,7 +1039,10 @@ def inner(events, include_event_type=True):
10391039
10401040@pytest .fixture
10411041def get_model_response ():
1042- def inner (response_content , serialize_pydantic = False , request_headers = {}):
1042+ def inner (response_content , serialize_pydantic = False , request_headers = None ):
1043+ if request_headers is None :
1044+ request_headers = {}
1045+
10431046 model_request = HttpxRequest (
10441047 "POST" ,
10451048 "/responses" ,
Original file line number Diff line number Diff line change @@ -411,9 +411,6 @@ def test_tool_execution_span(
411411 assert chat_spans [1 ]["origin" ] == "auto.ai.langchain"
412412 assert tool_exec_span ["origin" ] == "auto.ai.langchain"
413413
414- # We can't guarantee anything about the "shape" of the langchain execution graph
415- assert len (list (x for x in tx ["spans" ] if x ["op" ] == "gen_ai.chat" )) > 0
416-
417414 # Token usage is only available in newer versions of langchain (v0.2+)
418415 # where usage_metadata is supported on AIMessageChunk
419416 if "gen_ai.usage.input_tokens" in chat_spans [0 ]["data" ]:
@@ -808,6 +805,9 @@ def test_langchain_openai_tools_agent(
808805 # Verify that available tools are always recorded regardless of PII settings
809806 for chat_span in chat_spans :
810807 tools_data = chat_span ["data" ][SPANDATA .GEN_AI_REQUEST_AVAILABLE_TOOLS ]
808+ assert tools_data is not None , (
809+ "Available tools should always be recorded regardless of PII settings"
810+ )
811811 assert "get_word_length" in tools_data
812812
813813
You can’t perform that action at this time.
0 commit comments