Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ def _add_instructions_event(
event_body: Dict[str, Any] = {}
if _trace_agents_content and (instructions or additional_instructions):
if instructions and additional_instructions:
event_body["content"] = f"{instructions} {additional_instructions}"
event_body["text"] = f"{instructions} {additional_instructions}"
else:
event_body["content"] = instructions or additional_instructions
event_body["text"] = instructions or additional_instructions

attributes = self._create_event_attributes(agent_id=agent_id, thread_id=thread_id)
attributes[GEN_AI_EVENT_CONTENT] = json.dumps(event_body, ensure_ascii=False)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def check_span_events(self, span, expected_events):
raise AssertionError("check_span_events: event not found")

if len(span_events) > 0: # If there are any additional events in the span_events
raise AssertionError("check_span_events: unexpected event found")
unexpected_event_names = [event.name for event in span_events]
raise AssertionError(f"check_span_events: unexpected event(s) found: {unexpected_event_names}")

return True
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_agent_creation_with_tracing_content_recording_enabled(self, **kwargs):
"name": "gen_ai.system.instruction",
"attributes": {
"gen_ai.system": "az.ai.agents",
"gen_ai.event.content": '{"content": "You are a helpful AI assistant. Be polite and provide accurate information."}',
"gen_ai.event.content": '{"text": "You are a helpful AI assistant. Be polite and provide accurate information."}',
},
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async def test_create_agent_with_tracing_content_recording_enabled(self, **kwarg
"name": "gen_ai.system.instruction",
"attributes": {
"gen_ai.system": "az.ai.agents",
"gen_ai.event.content": '{"content": "You are a helpful AI assistant. Always be polite and provide accurate information."}',
"gen_ai.event.content": '{"text": "You are a helpful AI assistant. Always be polite and provide accurate information."}',
},
}
]
Expand Down
Loading
Loading