-
Notifications
You must be signed in to change notification settings - Fork 165
fix: CI issues for openai agents #2367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6d75c8d to
def0286
Compare
b9f4e97 to
5812f7b
Compare
python/instrumentation/openinference-instrumentation-agno/tests/test_instrumentor.py
Outdated
Show resolved
Hide resolved
...-instrumentation-openai-agents/src/openinference/instrumentation/openai_agents/_processor.py
Outdated
Show resolved
Hide resolved
5812f7b to
8d2e2ad
Compare
| yield f"{prefix}{MESSAGE_CONTENT}", obj["output"] | ||
| # output can be str or complex type - serialize complex types to JSON | ||
| if output := obj.get("output"): | ||
| output_value = output if isinstance(output, str) else safe_json_dumps(output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do a type check here instead of runtime check.
assert never
| for i, item in enumerate(output): | ||
| if item["type"] == "input_text": | ||
| yield ( | ||
| f"{prefix}{MESSAGE_CONTENTS}.{i}.{MESSAGE_CONTENT_TEXT}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caroger, could you please confirm whether the attribute name is correct?. Based on my understanding, FunctionCallOutput can contain either a string or a List[Union[ResponseInputTextContentParam, ResponseInputImageContentParam, ResponseInputFileContentParam]]. I’ve assumed it will be a list of contents, so I’m passing these values as contents.
This reverts commit a18078b.
This reverts commit a18078b.
Closes #2376
Note
Handle
outputas string or list for tool/function call outputs, extractinginput_textintomessage.contents.*.message_content.text; update tests accordingly./_processor.pyto parse tool/function calloutputas eitherstrorlist.input_textitems intomessage.contents.{i}.message_content.text.input_imageandinput_filetypes.tests/test_span_attribute_helpers.py.Written by Cursor Bugbot for commit 96af527. This will update automatically on new commits. Configure here.