Skip to content

Conversation

@codefromthecrypt
Copy link
Contributor

@codefromthecrypt codefromthecrypt commented Nov 12, 2025

Remove hardcoded constant and outdated TODO comment. Use the official SpanAttributes.EMBEDDING_INVOCATION_PARAMETERS constant that was released in semantic conventions v0.1.25.

Bump openinference-semantic-conventions from >=0.1.23 to >=0.1.25.


Note

Serializes non-string tool outputs into message.content for agents and switches OpenAI instrumentation to the official EMBEDDING_INVOCATION_PARAMETERS attribute (bumping semantic conventions).

  • OpenAI Agents:
    • Tool output extraction: custom_tool_call_output and function_call_output now set message.content; non-string outputs are JSON-serialized via safe_json_dumps.
    • Tests: Add cases for string/list/dict custom tool outputs; adjust function call output expectations.
  • OpenAI Instrumentation:
    • Replace hardcoded embedding parameter key with SpanAttributes.EMBEDDING_INVOCATION_PARAMETERS.
    • Bump openinference-semantic-conventions to >=0.1.25.
  • Tooling:
    • Add mypy override to disable warn_unused_ignores for tests.test_span_attribute_helpers.

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

@codefromthecrypt codefromthecrypt force-pushed the chore/openai-semconv-cleanup branch from 35592bb to a83c407 Compare November 13, 2025 13:31
@codefromthecrypt codefromthecrypt marked this pull request as ready for review November 13, 2025 13:41
@codefromthecrypt codefromthecrypt requested a review from a team as a code owner November 13, 2025 13:41
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 13, 2025
axiomofjoy and others added 3 commits November 21, 2025 12:04
Remove hardcoded constant and outdated TODO comment. Use the official
SpanAttributes.EMBEDDING_INVOCATION_PARAMETERS constant that was
released in semantic conventions v0.1.25.

Bump openinference-semantic-conventions from >=0.1.23 to >=0.1.25.
…uteValue compatibility

Handle edge cases where FunctionCallOutput and ResponseCustomToolCallOutputParam contain complex output types (lists, dicts) that don't match AttributeValue type. Serialize these to JSON strings while preserving None and string values.
@axiomofjoy axiomofjoy force-pushed the chore/openai-semconv-cleanup branch from 87bdaa8 to 7d97d96 Compare November 21, 2025 20:07
@axiomofjoy axiomofjoy merged commit dc9b1ae into Arize-ai:main Nov 21, 2025
20 checks passed
yield f"{prefix}{MESSAGE_ROLE}", "tool"
yield f"{prefix}{MESSAGE_TOOL_CALL_ID}", obj["call_id"]
if (output := obj.get("output")) is not None:
output = obj["output"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing key existence check for output field

The function directly accesses obj["output"] without checking if the key exists, which could raise a KeyError if the field is optional. The old code used obj.get("output") for safe access, and the similar function _get_attributes_from_response_custom_tool_call_output_param checks if "output" in obj: before accessing. This inconsistency could cause runtime errors if FunctionCallOutput ever has a missing output key.

Fix in Cursor Fix in Web

@codefromthecrypt codefromthecrypt deleted the chore/openai-semconv-cleanup branch November 24, 2025 03:42
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: Done

Development

Successfully merging this pull request may close these issues.

2 participants