diff --git a/docs/concepts/dependencies.md b/docs/concepts/dependencies.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/index.md b/docs/concepts/index.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/message-history.md b/docs/concepts/message-history.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/result-validation.md b/docs/concepts/result-validation.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/retrievers.md b/docs/concepts/retrievers.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/streaming.md b/docs/concepts/streaming.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/system-prompt.md b/docs/concepts/system-prompt.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/concepts/testing-evals.md b/docs/concepts/testing-evals.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/chat_app.md b/docs/examples/chat-app.md similarity index 100% rename from docs/examples/chat_app.md rename to docs/examples/chat-app.md diff --git a/docs/examples/index.md b/docs/examples/index.md index ae1ee0a67f..e5f2ce89a3 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -57,7 +57,7 @@ To run the examples (this will work whether you installed `pydantic_ai`, or clon python/uv-run -m pydantic_ai_examples. ``` -For examples, to run the very simple [`pydantic_model`](./pydantic_model.md) example: +For examples, to run the very simple [`pydantic_model`](./pydantic-model.md) example: ```bash python/uv-run -m pydantic_ai_examples.pydantic_model diff --git a/docs/examples/pydantic_model.md b/docs/examples/pydantic-model.md similarity index 100% rename from docs/examples/pydantic_model.md rename to docs/examples/pydantic-model.md diff --git a/docs/examples/rag.md b/docs/examples/rag.md index 22900e3d88..20e77b526a 100644 --- a/docs/examples/rag.md +++ b/docs/examples/rag.md @@ -29,7 +29,7 @@ docker run --rm \ pgvector/pgvector:pg17 ``` -As with the [SQL gen](./sql_gen.md) example, we run postgres on port `54320` to avoid conflicts with any other postgres instances you may have running. +As with the [SQL gen](./sql-gen.md) example, we run postgres on port `54320` to avoid conflicts with any other postgres instances you may have running. We also mount the PostgreSQL `data` directory locally to persist the data if you need to stop and restart the container. With that running and [dependencies installed and environment variables set](./index.md#usage), we can build the search database with (**WARNING**: this requires the `OPENAI_API_KEY` env variable and will calling the OpenAI embedding API around 300 times to generate embeddings for each section of the documentation): diff --git a/docs/examples/sql_gen.md b/docs/examples/sql-gen.md similarity index 100% rename from docs/examples/sql_gen.md rename to docs/examples/sql-gen.md diff --git a/docs/examples/stream_markdown.md b/docs/examples/stream-markdown.md similarity index 100% rename from docs/examples/stream_markdown.md rename to docs/examples/stream-markdown.md diff --git a/docs/examples/stream_whales.md b/docs/examples/stream-whales.md similarity index 100% rename from docs/examples/stream_whales.md rename to docs/examples/stream-whales.md diff --git a/docs/examples/weather_agent.md b/docs/examples/weather-agent.md similarity index 100% rename from docs/examples/weather_agent.md rename to docs/examples/weather-agent.md diff --git a/docs/index.md b/docs/index.md index 478ba9f226..0548fbc986 100644 --- a/docs/index.md +++ b/docs/index.md @@ -32,7 +32,7 @@ PydanticAI tries to make working with LLMs feel similar to building a web applic PydanticAI is in early beta, the API is subject to change and there's a lot more to do. [Feedback](https://github.com/pydantic/pydantic-ai/issues) is very welcome! -## Retrievers and Dependency Injection +## Example — Retrievers and Dependency Injection Partial example of using retrievers to help an LLM respond to a user's query about the weather: @@ -92,4 +92,8 @@ async def main(): 10. `result.all_messages()` includes details of messages exchanged, this is useful both to understand the conversation that took place and useful if you want to continue the conversation later — messages can be passed back to later `run/sync_run` calls. !!! tip "Complete `weather_agent.py` example" - The above `weather_agent.py` example is complete for the sake of brevity, but you can find a complete example [here](examples/weather_agent.md). + This example is incomplete for the sake of brevity; you can find a complete `weather_agent.py` example [here](examples/weather-agent.md). + +## Example — Result Validation + +TODO diff --git a/mkdocs.yml b/mkdocs.yml index 81b54f8258..66aaefbbb1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,15 +13,24 @@ nav: - Introduction: - Introduction: index.md - install.md + - Concepts: + - concepts/index.md + - concepts/dependencies.md + - concepts/retrievers.md + - concepts/system-prompt.md + - concepts/result-validation.md + - concepts/message-history.md + - concepts/streaming.md + - concepts/testing-evals.md - Examples: - examples/index.md - - examples/pydantic_model.md - - examples/weather_agent.md - - examples/sql_gen.md + - examples/pydantic-model.md + - examples/weather-agent.md + - examples/sql-gen.md - examples/rag.md - - examples/stream_markdown.md - - examples/stream_whales.md - - examples/chat_app.md + - examples/stream-markdown.md + - examples/stream-whales.md + - examples/chat-app.md - API Reference: - api/agent.md - api/result.md