Skip to content

Commit 7a1aa33

Browse files
fix tests
1 parent 58966df commit 7a1aa33

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

tests/observability/extensions/agentframework/integration/test_observability_pipeline.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
2020

2121
try:
22-
from agent_framework import RawAgent, ai_function
22+
from agent_framework import RawAgent, tool as ai_function
2323
from agent_framework.azure import AzureOpenAIChatClient
2424
from agent_framework.observability import enable_instrumentation
2525
from azure.identity import AzureCliCredential
@@ -205,9 +205,8 @@ async def test_pipeline_invoke_agent_with_tool_call(
205205
request=request,
206206
scope_details=InvokeAgentScopeDetails(),
207207
agent_details=agent_details,
208-
) as invoke_scope:
208+
):
209209
result = await agent.run("What is 15 + 27?")
210-
invoke_scope.set_output("42")
211210

212211
assert result is not None
213212
assert len(result.text) > 0
@@ -352,9 +351,8 @@ async def test_pipeline_invoke_agent_simple_inference(
352351
request=request,
353352
scope_details=InvokeAgentScopeDetails(),
354353
agent_details=agent_details,
355-
) as invoke_scope:
354+
):
356355
result = await agent.run("Say hello in exactly 5 words.")
357-
invoke_scope.set_output(result.text)
358356

359357
assert result is not None
360358
assert len(result.text) > 0

tests/observability/extensions/langchain/integration/test_observability_pipeline.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ async def test_pipeline_invoke_agent_with_tool_call(
194194
request=request,
195195
scope_details=InvokeAgentScopeDetails(),
196196
agent_details=agent_details,
197-
) as invoke_scope:
197+
):
198198
messages = [
199199
SystemMessage(
200200
content=(
@@ -217,10 +217,8 @@ async def test_pipeline_invoke_agent_with_tool_call(
217217

218218
# Second LLM call with tool results
219219
final_response = await llm_with_tools.ainvoke(messages)
220-
invoke_scope.set_output(str(final_response.content))
221220
else:
222221
final_response = ai_response
223-
invoke_scope.set_output(str(final_response.content))
224222

225223
assert final_response is not None
226224
assert len(str(final_response.content)) > 0
@@ -345,13 +343,12 @@ async def test_pipeline_invoke_agent_simple_inference(
345343
request=request,
346344
scope_details=InvokeAgentScopeDetails(),
347345
agent_details=agent_details,
348-
) as invoke_scope:
346+
):
349347
messages = [
350348
SystemMessage(content="You are a helpful assistant. Reply in one sentence."),
351349
HumanMessage(content="Say hello in exactly 5 words."),
352350
]
353351
result = await llm.ainvoke(messages)
354-
invoke_scope.set_output(str(result.content))
355352

356353
assert result is not None
357354
assert len(str(result.content)) > 0

0 commit comments

Comments
 (0)