-
Notifications
You must be signed in to change notification settings - Fork 964
feat: AG-UI adapter #2044
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?
feat: AG-UI adapter #2044
Conversation
PR Change SummaryIntroduced the AG-UI adapter for integration with the AG-UI protocol, including comprehensive examples for various features.
Added Files
How can I customize these reviews?Check out the Hyperlint AI Reviewer docs for more information on how to customize the review. If you just want to ignore it on this PR, you can add the Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add |
56fedd1
to
4f9ff50
Compare
9487756
to
1dee214
Compare
6fcf59f
to
90137ff
Compare
Ready for review @DouweM, I think I've matched all your standards. The one question is do I need to update to support 3.9? The code currently makes use of match statement which is more elegant way of checking against multiple types. Given 3.9 is 5 years old and EOL in just a few months, might be nice to keep this and just mark as 3.10+, let me know. I'm hoping we can get some simplification in if we can get ag-ui-protocol/ag-ui#49 merged in time. There is still the outstanding issue mixing AG-UI and PydanticAI tools in a single run due to no easy way to add PydanticAI tools to the history, have asked the AG-UI team about that here. I've left TODO's in the code where there's a decision to be made or a future change I could envisage. |
8ea3901
to
131d793
Compare
Quick update, I think I've figured out a way to workaround the local tool calls not being in the history using message snapshots. The fun part is testing as TestModel can't replicate that flow, so looking to expand it's capabilities to cover that. I'll discuss with @NathanTarbert what the best approach for handling this moving forward when we sync, I might have missed something in their spec which can already achieve it without a full snapshot. |
4524407
to
2b5cc15
Compare
ec3979d
to
cfefcd6
Compare
AG-UI adapter enabling integration with the AG-UI protocol via the Agent.to_ag_ui() method. This includes a full example for all features in the AG-UI dojo. Fixes: ag-ui-protocol/ag-ui/issues/5
Move pydantic_ai_ag_ui to pydantic_ai_slim as ag_ui, updating references and documentation accordingly.
Refactor to_ag_ui so it now returns a ASGI compatible server based off starlette. This makes it easier for users setup apps with minimal code. Fix some invalid references missed in the package refactor for cli and examples. Made enums, and exceptions private to the package, so they are not exposed in the public API.
Eliminate the use of match statement and dataclass(kw_only=True) to ensure compatibility with Python 3.9. Remove duplicate import of starlette outside try block, causing tests to fail when it's not installed.
Disable the deprecation warning for model_fields in Mistral.
Remove invalid no cover comment from Mistral model flagged by strict-no-cover check.
fb81b76
to
bc9e92a
Compare
AG-UI adapter enabling integration with the AG-UI protocol via the
Agent.to_ag_ui()
method.This includes examples for all features in the AG-UI dojo.
Fixes: ag-ui-protocol/ag-ui/issues/5