-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Docs for PAIG #3382
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?
Docs for PAIG #3382
Conversation
Docs Preview
|
docs/ai_gateway/usage.md
Outdated
| import openai | ||
|
|
||
| client = openai.Client( | ||
| base_url='https://gateway.pydantic.dev/proxy/openai/', |
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 has changed to:
| base_url='https://gateway.pydantic.dev/proxy/openai/', | |
| base_url='https://gateway.pydantic.dev/proxy/chat/', |
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.
I tested now and both seem to work 🤔 is this by design?
docs/gateway.md
Outdated
| from pydantic_ai import Agent | ||
|
|
||
| agent = Agent( | ||
| 'gateway/openai:gpt-4.1', |
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.
| 'gateway/openai:gpt-4.1', | |
| 'gateway/chat:gpt-4.1', |
|
|
||
| ```python {title="roulette_wheel.py"} | ||
| from pydantic_ai import Agent, RunContext | ||
| === "Pydantic AI Gateway" |
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.
I think this should be the second tab, so we don't make things unnecessarily complicated for new users
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.
If we keep it like this, we should at least link to the gateway docs
|
|
||
| | **Provider** | **Provider ID** | **Example Model** | | ||
| | --- | --- | --- | | ||
| | OpenAI | `openai` | `gateway/openai:gpt-4.1` | |
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 will need to be updated with API types rather than provider IDs.
| #> False | ||
| ``` | ||
|
|
||
| 1. Create an agent, which expects an integer dependency and produces a boolean output. This agent will have type `#!python Agent[int, bool]`. |
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.
Do these tooltips actually get properly rendered on both code examples? We may need to repeat them on each tab.
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.
For consistency with other parts of the docs, I think they should all be under docs/gateway/, this should be docs/gateway/overview.md, and we can add a redirect from /gateway to gateway/overview in docs-site/src/index.ts
Docs for the Pydantic AI Gateway, including guides for getting started, usage examples, and an overview of features. The navigation in
mkdocs.ymlhas been updated to include these new sections, and a minor theme enhancement has been made.For now, most of the docs are a copy of what we have in Notion. I'm working now on updating the existing PAI examples to use PAIG and testing the gateway to update the descriptions.