Skip to content

Commit ad7f198

Browse files
committed
model fallback to gpt-3.5-turbo
1 parent d467eb1 commit ad7f198

File tree

1 file changed

+3
-2
lines changed
  • instrumentation/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,15 @@ def non_numerical_value_is_set(value: Optional[Union[bool, str]]):
140140

141141
def get_llm_request_attributes(
142142
kwargs,
143-
model=None,
144143
operation_name=GenAIAttributes.GenAiOperationNameValues.CHAT.value,
145144
):
146145

147146
return {
148147
GenAIAttributes.GEN_AI_OPERATION_NAME: operation_name,
149148
GenAIAttributes.GEN_AI_SYSTEM: GenAIAttributes.GenAiSystemValues.OPENAI.value,
150-
GenAIAttributes.GEN_AI_REQUEST_MODEL: model or kwargs.get("model"),
149+
GenAIAttributes.GEN_AI_REQUEST_MODEL: kwargs.get(
150+
"model", "gpt-3.5-turbo"
151+
),
151152
GenAIAttributes.GEN_AI_REQUEST_TEMPERATURE: kwargs.get("temperature"),
152153
GenAIAttributes.GEN_AI_REQUEST_TOP_P: kwargs.get("p")
153154
or kwargs.get("top_p"),

0 commit comments

Comments
 (0)