Skip to content

Conversation

@GeLi2001
Copy link
Contributor

@GeLi2001 GeLi2001 commented Oct 21, 2025

Note

Refactors semantic_conventions to use OpenInference helper functions/constants for emitting span, message, tool, and token count attributes, updating keys and serialization accordingly.

  • Refactor: replace direct SpanAttributes/MessageAttributes/Tool usage with OI helpers*
    • Use get_span_kind_attributes, get_llm_system_attributes, get_llm_model_name_attributes, get_llm_token_count_attributes, get_session_attributes, get_input_attributes, get_output_attributes, get_llm_invocation_parameter_attributes, and get_tool_attributes.
    • Swap attribute keys to _attributes constants (e.g., LLM_INPUT_MESSAGES, LLM_OUTPUT_MESSAGES, MESSAGE_ROLE, MESSAGE_CONTENT, MESSAGE_TOOL_CALLS, TOOL_CALL_*, TOOL_NAME, TOOL_DESCRIPTION).
    • Compute token counts via TokenCount dict (prompt/completion/total) and skip for agent spans.
  • Messages and events
    • Update message extraction/flattening to use new MESSAGE_* and LLM_* keys; use helpers for input/output values.
  • Tools
    • Emit tool span attributes via get_tool_attributes (yielding only TOOL_NAME/TOOL_DESCRIPTION).
    • Update tool call attributes to TOOL_CALL_* and tool definitions to LLM_TOOLS.<idx>.* with _json_serialize for TOOL_JSON_SCHEMA.

Written by Cursor Bugbot for commit debbdf5. This will update automatically on new commits. Configure here.

@GeLi2001 GeLi2001 requested a review from a team as a code owner October 21, 2025 18:17
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants