Skip to content

update logos, favicon and brand names #2193

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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
- run: rm coverage/.coverage.*-py3.9-* # Exclude 3.9 coverage as it gets the wrong line numbers, causing invalid failures.
- run: uv run coverage combine coverage

- run: uv run coverage html --show-contexts --title "PydanticAI coverage for ${{ github.sha }}"
- run: uv run coverage html --show-contexts --title "Pydantic AI coverage for ${{ github.sha }}"

- name: Store coverage html
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -417,7 +417,7 @@ jobs:
env:
VERSION: ${{ needs.release.outputs.package-version }}
TWEET: |
PydanticAI version {version} is out! 🎉
Pydantic AI version {version} is out! 🎉
https://github.com/pydantic/pydantic-ai/releases/tag/v{version}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
Expand Down
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://ai.pydantic.dev/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://ai.pydantic.dev/img/pydantic-ai-dark.svg">
<img src="https://ai.pydantic.dev/img/pydantic-ai-light.svg" alt="PydanticAI">
<img src="https://ai.pydantic.dev/img/pydantic-ai-light.svg" alt="Pydantic AI">
</picture>
</a>
</div>
Expand All @@ -24,47 +24,47 @@

---

PydanticAI is a Python agent framework designed to make it less painful to build production grade applications with Generative AI.
Pydantic AI is a Python agent framework designed to make it less painful to build production grade applications with Generative AI.

FastAPI revolutionized web development by offering an innovative and ergonomic design, built on the foundation of [Pydantic](https://docs.pydantic.dev).
FastAPI revolutionized web development by offering an innovative and ergonomic design, built on the foundation of [Pydantic Validation](https://docs.pydantic.dev).

Similarly, virtually every agent framework and LLM library in Python uses Pydantic, yet when we began to use LLMs in [Pydantic Logfire](https://pydantic.dev/logfire), we couldn't find anything that gave us the same feeling.
Similarly, virtually every agent framework and LLM library in Python uses Pydantic Validation, yet when we began to use LLMs in [Pydantic Logfire](https://pydantic.dev/logfire), we couldn't find anything that gave us the same feeling.

We built PydanticAI with one simple aim: to bring that FastAPI feeling to GenAI app development.
We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI app development.

## Why use PydanticAI
## Why use Pydantic AI

* __Built by the Pydantic Team__
Built by the team behind [Pydantic](https://docs.pydantic.dev/latest/) (the validation layer of the OpenAI SDK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more).
- **Built by the Pydantic Team**
Built by the team behind [Pydantic Validation](https://docs.pydantic.dev/latest/) (the validation layer of the OpenAI SDK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more).

* __Model-agnostic__
Supports OpenAI, Anthropic, Gemini, Deepseek, Ollama, Groq, Cohere, and Mistral, and there is a simple interface to implement support for [other models](https://ai.pydantic.dev/models/).
- **Model-agnostic**
Supports OpenAI, Anthropic, Gemini, Deepseek, Ollama, Groq, Cohere, and Mistral, and there is a simple interface to implement support for [other models](https://ai.pydantic.dev/models/).

* __Pydantic Logfire Integration__
Seamlessly [integrates](https://ai.pydantic.dev/logfire/) with [Pydantic Logfire](https://pydantic.dev/logfire) for real-time debugging, performance monitoring, and behavior tracking of your LLM-powered applications.
- **Pydantic Logfire Integration**
Seamlessly [integrates](https://ai.pydantic.dev/logfire/) with [Pydantic Logfire](https://pydantic.dev/logfire) for real-time debugging, performance monitoring, and behavior tracking of your LLM-powered applications.

* __Type-safe__
Designed to make [type checking](https://ai.pydantic.dev/agents/#static-type-checking) as powerful and informative as possible for you.
- **Type-safe**
Designed to make [type checking](https://ai.pydantic.dev/agents/#static-type-checking) as powerful and informative as possible for you.

* __Python-centric Design__
Leverages Python's familiar control flow and agent composition to build your AI-driven projects, making it easy to apply standard Python best practices you'd use in any other (non-AI) project.
- **Python-centric Design**
Leverages Python's familiar control flow and agent composition to build your AI-driven projects, making it easy to apply standard Python best practices you'd use in any other (non-AI) project.

* __Structured Responses__
Harnesses the power of [Pydantic](https://docs.pydantic.dev/latest/) to [validate and structure](https://ai.pydantic.dev/output/#structured-output) model outputs, ensuring responses are consistent across runs.
- **Structured Responses**
Harnesses the power of [Pydantic Validation](https://docs.pydantic.dev/latest/) to [validate and structure](https://ai.pydantic.dev/output/#structured-output) model outputs, ensuring responses are consistent across runs.

* __Dependency Injection System__
Offers an optional [dependency injection](https://ai.pydantic.dev/dependencies/) system to provide data and services to your agent's [system prompts](https://ai.pydantic.dev/agents/#system-prompts), [tools](https://ai.pydantic.dev/tools/) and [output validators](https://ai.pydantic.dev/output/#output-validator-functions).
This is useful for testing and eval-driven iterative development.
- **Dependency Injection System**
Offers an optional [dependency injection](https://ai.pydantic.dev/dependencies/) system to provide data and services to your agent's [system prompts](https://ai.pydantic.dev/agents/#system-prompts), [tools](https://ai.pydantic.dev/tools/) and [output validators](https://ai.pydantic.dev/output/#output-validator-functions).
This is useful for testing and eval-driven iterative development.

* __Streamed Responses__
Provides the ability to [stream](https://ai.pydantic.dev/output/#streamed-results) LLM outputs continuously, with immediate validation, ensuring rapid and accurate outputs.
- **Streamed Responses**
Provides the ability to [stream](https://ai.pydantic.dev/output/#streamed-results) LLM outputs continuously, with immediate validation, ensuring rapid and accurate outputs.

* __Graph Support__
[Pydantic Graph](https://ai.pydantic.dev/graph) provides a powerful way to define graphs using typing hints, this is useful in complex applications where standard control flow can degrade to spaghetti code.
- **Graph Support**
[Pydantic Graph](https://ai.pydantic.dev/graph) provides a powerful way to define graphs using typing hints, this is useful in complex applications where standard control flow can degrade to spaghetti code.

## Hello World Example

Here's a minimal example of PydanticAI:
Here's a minimal example of Pydantic AI:

```python
from pydantic_ai import Agent
Expand All @@ -78,7 +78,7 @@ agent = Agent(
)

# Run the agent synchronously, conducting a conversation with the LLM.
# Here the exchange should be very short: PydanticAI will send the system prompt and the user query to the LLM,
# Here the exchange should be very short: Pydantic AI will send the system prompt and the user query to the LLM,
# the model will return a text response. See below for a more complex run.
result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
Expand All @@ -93,7 +93,7 @@ Not very interesting yet, but we can easily add "tools", dynamic system prompts,

## Tools & Dependency Injection Example

Here is a concise example using PydanticAI to build a support agent for a bank:
Here is a concise example using Pydantic AI to build a support agent for a bank:

**(Better documented example [in the docs](https://ai.pydantic.dev/#tools-dependency-injection-example))**

Expand Down Expand Up @@ -187,8 +187,8 @@ async def main():

## Next Steps

To try PydanticAI yourself, follow the instructions [in the examples](https://ai.pydantic.dev/examples/).
To try Pydantic AI yourself, follow the instructions [in the examples](https://ai.pydantic.dev/examples/).

Read the [docs](https://ai.pydantic.dev/agents/) to learn more about building applications with PydanticAI.
Read the [docs](https://ai.pydantic.dev/agents/) to learn more about building applications with Pydantic AI.

Read the [API Reference](https://ai.pydantic.dev/api/agent/) to understand PydanticAI's interface.
Read the [API Reference](https://ai.pydantic.dev/api/agent/) to understand Pydantic AI's interface.
4 changes: 2 additions & 2 deletions clai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

(pronounced "clay")

Command line interface to chat to LLMs, part of the [PydanticAI project](https://github.com/pydantic/pydantic-ai).
Command line interface to chat to LLMs, part of the [Pydantic AI project](https://github.com/pydantic/pydantic-ai).

## Usage

Expand Down Expand Up @@ -55,7 +55,7 @@ Either way, running `clai` will start an interactive session where you can chat
```
usage: clai [-h] [-m [MODEL]] [-a AGENT] [-l] [-t [CODE_THEME]] [--no-stream] [--version] [prompt]
PydanticAI CLI v...
Pydantic AI CLI v...
Special prompts:
* `/exit` - exit the interactive mode (ctrl-c and ctrl-d also work)
Expand Down
2 changes: 1 addition & 1 deletion clai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bump = true
[project]
name = "clai"
dynamic = ["version", "dependencies"]
description = "PydanticAI CLI: command line interface to chat to LLMs"
description = "Pydantic AI CLI: command line interface to chat to LLMs"
authors = [
{ name = "Samuel Colvin", email = "[email protected]" },
{ name = "Marcelo Trylesinski", email = "[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion clai/update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_cli_help(capfd: pytest.CaptureFixture[str]):

help_output = capfd.readouterr().out.strip()
# TODO change when we reach v1
help_output = re.sub(r'(PydanticAI CLI v).+', r'\1...', help_output)
help_output = re.sub(r'(Pydantic AI CLI v).+', r'\1...', help_output)

this_dir = Path(__file__).parent
readme = this_dir / 'README.md'
Expand Down
8 changes: 5 additions & 3 deletions docs/.overrides/.icons/logfire/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 14 additions & 7 deletions docs/.partials/index-header.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<div class="text-center">
<img class="index-header off-glb" src="./img/pydantic-ai-dark.svg#only-dark" alt="PydanticAI">
<img class="index-header off-glb" src="./img/pydantic-ai-dark.svg#only-dark" alt="Pydantic AI">
</div>
<div class="text-center">
<img class="index-header off-glb" src="./img/pydantic-ai-light.svg#only-light" alt="PydanticAI">
<img
class="index-header off-glb"
src="./img/pydantic-ai-light.svg#only-light"
alt="Pydantic AI">
</div>
<p class="text-center">
<em>Agent Framework / shim to use Pydantic with LLMs</em>
</p>
<p class="text-center">
<a href="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml?query=branch%3Amain">
<img src="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml/badge.svg?event=push" alt="CI">
<img
src="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml/badge.svg?event=push"
alt="CI">
</a>
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/pydantic/pydantic-ai">
<img src="https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic-ai.svg" alt="Coverage">
<img
src="https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic-ai.svg"
alt="Coverage">
</a>
<a href="https://pypi.python.org/pypi/pydantic-ai">
<img src="https://img.shields.io/pypi/v/pydantic-ai.svg" alt="PyPI">
Expand All @@ -24,11 +31,11 @@
<img src="https://img.shields.io/github/license/pydantic/pydantic-ai.svg" alt="license">
</a>
<a href="https://logfire.pydantic.dev/docs/join-slack/">
<img src="https://img.shields.io/badge/Slack-Join%20Slack-4A154B?logo=slack" alt="Join Slack" />
<img src="https://img.shields.io/badge/Slack-Join%20Slack-4A154B?logo=slack" alt="Join Slack">
</a>
</p>

<p class="text-emphasis">
PydanticAI is a Python agent framework designed to make it less painful to
build production grade applications with Generative AI.
Pydantic AI is a Python agent framework designed to make it less painful to build production grade
applications with Generative AI.
</p>
17 changes: 8 additions & 9 deletions docs/a2a.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ communication and interoperability between AI agents, regardless of the framewor

At Pydantic, we built the [FastA2A](#fasta2a) library to make it easier to implement the A2A protocol in Python.

We also built a convenience method that expose PydanticAI agents as A2A servers - let's have a quick look at how to use it:
We also built a convenience method that expose Pydantic AI agents as A2A servers - let's have a quick look at how to use it:

```py {title="agent_to_a2a.py" hl_lines="4"}
from pydantic_ai import Agent
Expand All @@ -18,12 +18,12 @@ _You can run the example with `uvicorn agent_to_a2a:app --host 0.0.0.0 --port 80

This will expose the agent as an A2A server, and you can start sending requests to it.

See more about [exposing PydanticAI agents as A2A servers](#pydanticai-agent-to-a2a-server).
See more about [exposing Pydantic AI agents as A2A servers](#pydantic-ai-agent-to-a2a-server).

## FastA2A

**FastA2A** is an agentic framework agnostic implementation of the A2A protocol in Python.
The library is designed to be used with any agentic framework, and is **not exclusive to PydanticAI**.
The library is designed to be used with any agentic framework, and is **not exclusive to Pydantic AI**.

### Design

Expand Down Expand Up @@ -75,8 +75,7 @@ The [`Storage`][fasta2a.Storage] component serves two purposes:

This design allows for agents to store rich internal state (e.g., tool calls, reasoning traces) as well as store task-specific A2A-formatted messages and artifacts.

For example, a PydanticAI agent might store its complete internal message format (including tool calls and responses) in the context storage, while storing only the A2A-compliant messages in the task history.

For example, a Pydantic AI agent might store its complete internal message format (including tool calls and responses) in the context storage, while storing only the A2A-compliant messages in the task history.

### Installation

Expand All @@ -92,15 +91,15 @@ The only dependencies are:
- [pydantic](https://pydantic.dev): to validate the request/response messages
- [opentelemetry-api](https://opentelemetry-python.readthedocs.io/en/latest): to provide tracing capabilities

You can install PydanticAI with the `a2a` extra to include **FastA2A**:
You can install Pydantic AI with the `a2a` extra to include **FastA2A**:

```bash
pip/uv-add 'pydantic-ai-slim[a2a]'
```

### PydanticAI Agent to A2A Server
### Pydantic AI Agent to A2A Server

To expose a PydanticAI agent as an A2A server, you can use the `to_a2a` method:
To expose a Pydantic AI agent as an A2A server, you can use the `to_a2a` method:

```python {title="agent_to_a2a.py"}
from pydantic_ai import Agent
Expand All @@ -117,7 +116,7 @@ uvicorn agent_to_a2a:app --host 0.0.0.0 --port 8000

Since the goal of `to_a2a` is to be a convenience method, it accepts the same arguments as the [`FastA2A`][fasta2a.FastA2A] constructor.

When using `to_a2a()`, PydanticAI automatically:
When using `to_a2a()`, Pydantic AI automatically:

- Stores the complete conversation history (including tool calls and responses) in the context storage
- Ensures that subsequent messages with the same `context_id` have access to the full conversation history
Expand Down
Loading