Skip to content

A suggestion for #40518 - don't serialize args and simplify code #40597

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

lmolkova
Copy link
Member

No description provided.

@@ -306,17 +304,17 @@ def _create_event_attributes(

if cancelled_at:
if isinstance(cancelled_at, datetime):
attrs[GEN_AI_RUNSTEP_CANCEL_TIMESTAMP] = cancelled_at.isoformat()
Copy link
Member Author

Choose a reason for hiding this comment

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

we record status of step on line 289, no need to make it part of the attribute name

@@ -408,41 +380,24 @@ def _process_tool_calls(self, step: RunStep) -> List[Dict[str, Any]]:
},
}
elif isinstance(t, RunStepCodeInterpreterToolCall):
try:
parsed_outputs = json.dumps(t.code_interpreter.outputs)
Copy link
Member Author

Choose a reason for hiding this comment

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

this results in a huge escaped string, there is no need to dump it.

},
}
elif isinstance(t, RunStepBingGroundingToolCall):
bing_grounding = {}
try:
bing_grounding = json.dumps(t.bing_grounding)
Copy link
Member Author

Choose a reason for hiding this comment

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

same here, dumping results in a string rather than object

@lmolkova lmolkova changed the title A suggestion for #40518 - don't dump args and simplify code A suggestion for #40518 - don't serialize args and simplify code Apr 18, 2025
@M-Hietala M-Hietala mentioned this pull request Apr 18, 2025
6 tasks
@lmolkova lmolkova closed this Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant