Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alizenhom committed Oct 22, 2024
1 parent 9e273f6 commit 8e667de
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def traced_method(wrapped, instance, args, kwargs):
name=span_name, kind=SpanKind.CLIENT, attributes=span_attributes
)
if span.is_recording():
_set_input_attributes(span, span_attributes)
set_event_prompt(span, json.dumps(llm_prompts))

try:
Expand Down Expand Up @@ -83,6 +84,12 @@ def traced_method(wrapped, instance, args, kwargs):
return traced_method


@silently_fail
def _set_input_attributes(span, attributes):
for field, value in attributes.items():
set_span_attribute(span, field, value)


@silently_fail
def _set_response_attributes(span, result):
set_span_attribute(
Expand Down

0 comments on commit 8e667de

Please sign in to comment.