Skip to content

Commit d8b5838

Browse files
committed
cleanup
1 parent 668a421 commit d8b5838

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -906,25 +906,17 @@ def _get_input_attributes(template, send_pii, args, kwargs):
906906
)
907907

908908
elif key == "max_tokens" and isinstance(value, int):
909-
attributes.setdefault(SPANDATA.GEN_AI_REQUEST_MAX_TOKENS, []).append(
910-
value
911-
)
909+
attributes[SPANDATA.GEN_AI_REQUEST_MAX_TOKENS] = value
912910
elif key == "frequency_penalty" and isinstance(value, float):
913-
attributes.setdefault(
914-
SPANDATA.GEN_AI_REQUEST_FREQUENCY_PENALTY, []
915-
).append(value)
911+
attributes[SPANDATA.GEN_AI_REQUEST_FREQUENCY_PENALTY] = value
916912
elif key == "presence_penalty" and isinstance(value, float):
917-
attributes.setdefault(
918-
SPANDATA.GEN_AI_REQUEST_PRESENCE_PENALTY, []
919-
).append(value)
913+
attributes[SPANDATA.GEN_AI_REQUEST_PRESENCE_PENALTY] = value
920914
elif key == "temperature" and isinstance(value, float):
921-
attributes.setdefault(SPANDATA.GEN_AI_REQUEST_TEMPERATURE, []).append(
922-
value
923-
)
915+
attributes[SPANDATA.GEN_AI_REQUEST_TEMPERATURE] = value
924916
elif key == "top_p" and isinstance(value, float):
925-
attributes.setdefault(SPANDATA.GEN_AI_REQUEST_TOP_P, []).append(value)
917+
attributes[SPANDATA.GEN_AI_REQUEST_TOP_P] = value
926918
elif key == "top_k" and isinstance(value, int):
927-
attributes.setdefault(SPANDATA.GEN_AI_REQUEST_TOP_K, []).append(value)
919+
attributes[SPANDATA.GEN_AI_REQUEST_TOP_K] = value
928920

929921
if template == SpanTemplate.AI_TOOL:
930922
if send_pii:

0 commit comments

Comments
 (0)