Skip to content

Commit ad8ef59

Browse files
committed
openai-v2: use generic request seed instead of openai specific one
1 parent 3e7904f commit ad8ef59

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def get_llm_request_attributes(
220220
GenAIAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY: kwargs.get(
221221
"frequency_penalty"
222222
),
223-
GenAIAttributes.GEN_AI_OPENAI_REQUEST_SEED: kwargs.get("seed"),
223+
GenAIAttributes.GEN_AI_REQUEST_SEED: kwargs.get("seed"),
224224
}
225225
)
226226

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_async_chat_completions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ async def test_async_chat_completion_extra_params(
186186
request_service_tier="default",
187187
response_service_tier=getattr(response, "service_tier", None),
188188
)
189-
assert (
190-
spans[0].attributes[GenAIAttributes.GEN_AI_OPENAI_REQUEST_SEED] == 42
191-
)
189+
assert spans[0].attributes[GenAIAttributes.GEN_AI_REQUEST_SEED] == 42
192190
assert (
193191
spans[0].attributes[GenAIAttributes.GEN_AI_REQUEST_TEMPERATURE] == 0.5
194192
)

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_chat_completions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ def test_chat_completion_extra_params(
276276
request_service_tier="default",
277277
response_service_tier=getattr(response, "service_tier", None),
278278
)
279-
assert (
280-
spans[0].attributes[GenAIAttributes.GEN_AI_OPENAI_REQUEST_SEED] == 42
281-
)
279+
assert spans[0].attributes[GenAIAttributes.GEN_AI_REQUEST_SEED] == 42
282280
assert (
283281
spans[0].attributes[GenAIAttributes.GEN_AI_REQUEST_TEMPERATURE] == 0.5
284282
)

0 commit comments

Comments
 (0)