Skip to content

fix(py): fix double generate span in model runner#5113

Open
huangjeff5 wants to merge 1 commit intomainfrom
jh-fix-generate-span
Open

fix(py): fix double generate span in model runner#5113
huangjeff5 wants to merge 1 commit intomainfrom
jh-fix-generate-span

Conversation

@huangjeff5
Copy link
Copy Markdown
Contributor

Dev UI should be calling _generate_action() directly, which runs the generation logic without a new span. Since Dev UI is calling a registered action, there is a generate span already created.

generate_action() is reserved for the ai.generate() case. Since ai.generate() doesn't actually call a registered action, we have to inject the generate span manually there.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates generate_action_fn to call _generate_action directly and refines the documentation for generate_action to clarify span management and prevent redundant nesting in reflection runs. Additionally, it simplifies the comment regarding output format metadata for the Dev UI. I have no feedback to provide as there were no review comments.

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