-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add on_complete
callback to AG-UI functions to get access to AgentRunResult
#2429
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?
Add on_complete
callback to AG-UI functions to get access to AgentRunResult
#2429
Conversation
on_complete
callback to AG-UI functions to get access to AgentRunResult
7100b97
to
a3ad970
Compare
a3ad970
to
73af2b7
Compare
if _utils.is_async_callable(on_complete): | ||
await on_complete(run) | ||
else: | ||
await _utils.run_in_executor(on_complete, run) |
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.
@DouweM not sure this is what you meant...
if _utils.is_async_callable(on_complete):
await on_complete(run)
"None" is not awaitable
"None" is incompatible with protocol "Awaitable[_T_co@Awaitable]"
"await" is not present
And
else:
await _utils.run_in_executor(on_complete, run)
Is saying it's unreachable.
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.
FWIW, I just ran in my project with both a sync and async callback and it seems to work as expected... Maybe just a type issue?
Fixes #2398