-
Notifications
You must be signed in to change notification settings - Fork 155
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
base: main
Are you sure you want to change the base?
Conversation
6d75c8d to
def0286
Compare
b9f4e97 to
5812f7b
Compare
| version = agno.__version__.split(".") | ||
| vcr_path = "team_coordinate_run.yaml" | ||
| if version[0] == "2" and version[1] == "1": | ||
| vcr_path = "team_coordinate_run21.yaml" |
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.
this is brittle, and test would fail again when agno 2.2 is released because it would use to recorded vcr yaml from older response again, correct?
# Parse version into tuple for comparison
version_parts = tuple(map(int, agno.__version__.split(".")[:2])) # Major.minor only
vcr_path = "team_coordinate_run21.yaml" if version_parts >= (2, 1) else "team_coordinate_run.yaml"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.
This change is not required as we are instrmenting the latest package of agno, also moved the changes related agno to different MR
...-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.
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.