diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd9b668dd6..c1957e2697 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ on: env: CI: true COLUMNS: 120 + UV_PYTHON: 3.12 permissions: contents: read @@ -21,12 +22,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true - name: Install dependencies - run: uv sync --python 3.12 --frozen --all-extras --all-packages --group lint + run: uv sync --frozen --all-extras --all-packages --group lint - uses: pre-commit/action@v3.0.0 with: @@ -43,12 +44,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true - name: Install dependencies - run: uv sync --python 3.12 --frozen --no-dev --group lint + run: uv sync --frozen --no-dev --group lint - run: make typecheck-mypy @@ -57,11 +58,11 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true - - run: uv sync --python 3.12 --frozen --group docs + - run: uv sync --frozen --group docs # always build docs to check it works without insiders packages - run: make docs @@ -80,7 +81,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true @@ -90,7 +91,6 @@ jobs: - run: > uv run - --python 3.12 --frozen --package pydantic-ai-slim --extra openai @@ -122,7 +122,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true @@ -162,7 +162,7 @@ jobs: merge-multiple: true path: coverage - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true @@ -205,7 +205,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32a4f0b49c..714e9156f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,13 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/sirosen/texthooks + rev: 0.6.8 + hooks: + - id: fix-smartquotes + - id: fix-spaces + - id: fix-ligatures + - repo: local hooks: - id: format diff --git a/Makefile b/Makefile index 3a704d4a38..494e990113 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,8 @@ else ifeq ($(PPPR_TOKEN),) @exit 1 else @echo 'installing insiders packages...' - @uv pip install -U \ + @uv pip uninstall mkdocs-material mkdocstrings-python + @uv pip install \ --extra-index-url https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ \ mkdocs-material mkdocstrings-python endif @@ -103,6 +104,7 @@ cf-pages-build: ## Install uv, install dependencies and build the docs, used on curl -LsSf https://astral.sh/uv/install.sh | sh uv python install 3.12 uv sync --python 3.12 --frozen --group docs + uv pip uninstall mkdocs-material mkdocstrings-python uv pip install -U \ --extra-index-url https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ \ mkdocs-material mkdocstrings-python diff --git a/README.md b/README.md index fcdc578811..752615007a 100644 --- a/README.md +++ b/README.md @@ -37,26 +37,26 @@ We built PydanticAI with one simple aim: to bring that FastAPI feeling to GenAI 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). * __Model-agnostic__ -Supports OpenAI, Anthropic, Gemini, Ollama, Groq, and Mistral, and there is a simple interface to implement support for [other models](models.md). +Supports OpenAI, Anthropic, Gemini, Ollama, Groq, and Mistral, and there is a simple interface to implement support for [other models](https://ai.pydantic.dev/models/). * __Pydantic Logfire Integration__ -Seamlessly [integrates](logfire.md) with [Pydantic Logfire](https://pydantic.dev/logfire) for real-time debugging, performance monitoring, and behavior tracking of your LLM-powered applications. +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 as useful as possible for you, so it [integrates](agents.md#static-type-checking) well with static type checkers, like [`mypy`](https://github.com/python/mypy) and [`pyright`](https://github.com/microsoft/pyright). +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 +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](results.md#structured-result-validation) model outputs, ensuring responses are consistent across runs. +Harnesses the power of [Pydantic](https://docs.pydantic.dev/latest/) to [validate and structure](https://ai.pydantic.dev/results/#structured-result-validation) model outputs, ensuring responses are consistent across runs. * __Dependency Injection System__ -Offers an optional [dependency injection](dependencies.md) system to provide data and services to your agent's [system prompts](agents.md#system-prompts), [tools](tools.md) and [result validators](results.md#result-validators-functions). +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 [result validators](https://ai.pydantic.dev/results/#result-validators-functions). This is useful for testing and eval-driven iterative development. * __Streamed Responses__ -Provides the ability to [stream](results.md#streamed-results) LLM outputs continuously, with immediate validation, ensuring rapid and accurate results. +Provides the ability to [stream](https://ai.pydantic.dev/results/#streamed-results) LLM outputs continuously, with immediate validation, ensuring rapid and accurate results. ## In Beta! diff --git a/docs/index.md b/docs/index.md index 7321292f1d..6459f91a4a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,10 +23,10 @@ Supports OpenAI, Anthropic, Gemini, Ollama, Groq, and Mistral, and there is a si Seamlessly [integrates](logfire.md) with [Pydantic Logfire](https://pydantic.dev/logfire) for real-time debugging, performance monitoring, and behavior tracking of your LLM-powered applications. :material-shield-check:{ .md .middle .secure-green } Type-safe
-Designed to make type checking as useful as possible for you, so it [integrates](agents.md#static-type-checking) well with static type checkers, like [`mypy`](https://github.com/python/mypy) and [`pyright`](https://github.com/microsoft/pyright). +Designed to make [type checking](agents.md#static-type-checking) as powerful and informative as possible for you. :snake:{ .md .middle } 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 +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. :simple-pydantic:{ .md .middle .pydantic-pink } Structured Responses
Harnesses the power of [Pydantic](https://docs.pydantic.dev/latest/) to [validate and structure](results.md#structured-result-validation) model outputs, ensuring responses are consistent across runs.