Skip to content

Commit

Permalink
fix objects
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Aug 28, 2024
1 parent e4c139c commit 3bbdadb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def traced_method(wrapped, instance, args, kwargs):
choice_content = {
"index": choice.index,
"finish_reason": choice.finish_reason,
"message": {"content": _choice_to_message(choice)},
"message": _choice_to_message(choice),
}
event_logger.emit(Event(name="gen_ai.choice", body=choice_content))
span.set_attribute(gen_ai_attributes.GEN_AI_RESPONSE_FINISH_REASONS, finish_reasons)
Expand Down Expand Up @@ -151,7 +151,7 @@ def _message_to_event(message):
body["content"] = content
return Event(name="gen_ai.assistant.message", body=body)
elif role == "tool":
return Event(name="gen_ai.tool.message", body={"content": content})
return Event(name="gen_ai.tool.message", body={"content": content, "id": _get_prop(message, "tool_call_id")})

def _set_response_attributes(span, response_model, response_id, usage_input_tokens, usage_output_tokens):
if not span.is_recording():
Expand Down

0 comments on commit 3bbdadb

Please sign in to comment.