Skip to content
Merged
Changes from all 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 @@ -20,7 +20,6 @@
from google.genai.types import GenerateContentConfig
from pydantic import BaseModel, Field

from opentelemetry._events import Event
from opentelemetry.instrumentation._semconv import (
_OpenTelemetrySemanticConventionStability,
_OpenTelemetryStabilitySignalType,
Expand Down Expand Up @@ -324,7 +323,7 @@ def test_new_semconv_record_completion_as_log(self):
event.attributes,
)
else:
attrs = {
expected_event_attributes = {
gen_ai_attributes.GEN_AI_INPUT_MESSAGES: (
{
"role": "user",
Expand All @@ -346,31 +345,27 @@ def test_new_semconv_record_completion_as_log(self):
{"content": sys_instr, "type": "text"},
),
}
expected_event = Event(
"gen_ai.client.inference.operation.details",
attributes=attrs,
)
self.assertEqual(
event.attributes[
gen_ai_attributes.GEN_AI_INPUT_MESSAGES
],
expected_event.attributes[
expected_event_attributes[
gen_ai_attributes.GEN_AI_INPUT_MESSAGES
],
)
self.assertEqual(
event.attributes[
gen_ai_attributes.GEN_AI_OUTPUT_MESSAGES
],
expected_event.attributes[
expected_event_attributes[
gen_ai_attributes.GEN_AI_OUTPUT_MESSAGES
],
)
self.assertEqual(
event.attributes[
gen_ai_attributes.GEN_AI_SYSTEM_INSTRUCTIONS
],
expected_event.attributes[
expected_event_attributes[
gen_ai_attributes.GEN_AI_SYSTEM_INSTRUCTIONS
],
)
Expand Down
Loading