Skip to content

Commit defdf9f

Browse files
polish: using output type enum value.
1 parent 5ab8432 commit defdf9f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2

instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/response_extractors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def _extract_output_type_from_value(text_config: object) -> str | None:
134134

135135
format_type = _get_field(format_config, "type")
136136
if format_type == "json_schema":
137-
return "json"
137+
return GenAIAttributes.GenAiOutputTypeValues.JSON.value
138+
if format_type == "text":
139+
return GenAIAttributes.GenAiOutputTypeValues.TEXT.value
138140
if isinstance(format_type, str):
139141
return format_type
140142
return None

0 commit comments

Comments
 (0)