Skip to content

Commit

Permalink
add docs stubs (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Nov 13, 2024
1 parent 65ef1db commit d3396ad
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 10 deletions.
Empty file added docs/concepts/dependencies.md
Empty file.
Empty file added docs/concepts/index.md
Empty file.
Empty file.
Empty file.
Empty file added docs/concepts/retrievers.md
Empty file.
Empty file added docs/concepts/streaming.md
Empty file.
Empty file added docs/concepts/system-prompt.md
Empty file.
Empty file added docs/concepts/testing-evals.md
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<example_module_name>
```

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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/examples/rag.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
21 changes: 15 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3396ad

Please sign in to comment.