-
Notifications
You must be signed in to change notification settings - Fork 3k
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
A suggestion for #40518 - don't serialize args and simplify code #40597
Conversation
@@ -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() |
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.
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) |
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 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) |
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.
same here, dumping results in a string rather than object
No description provided.