Skip to content

Commit 48d2fd1

Browse files
authored
docs social cards and cleanup (#47)
1 parent d3396ad commit 48d2fd1

File tree

10 files changed

+250
-17
lines changed

10 files changed

+250
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
env:
5555
PPPR_TOKEN: ${{ secrets.PPPR_TOKEN }}
5656

57-
- run: uv pip freeze
57+
- run: tree site
5858

5959
test:
6060
name: test on ${{ matrix.python-version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ env*/
1111
/postgres-data/
1212
.DS_Store
1313
/pydantic_ai_examples/.chat_app_messages.jsonl
14+
.cache/
1415
.docs-insiders-install

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ docs-serve-insiders: .docs-insiders-install
8585
.PHONY: cf-pages-build # Install uv, install dependencies and build the docs, used on CloudFlare Pages
8686
cf-pages-build:
8787
curl -LsSf https://astral.sh/uv/install.sh | sh
88-
${HOME}/.local/bin/uv python install 3.12
89-
${HOME}/.local/bin/uv sync --python 3.12 --frozen --group docs
90-
${HOME}/.local/bin/uv pip install -U \
88+
uv python install 3.12
89+
uv sync --python 3.12 --frozen --group docs
90+
uv pip install -U \
9191
--extra-index-url https://pydantic:$(PPPR_TOKEN)@pppr.pydantic.dev/simple/ \
9292
mkdocs-material mkdocstrings-python
93-
${HOME}/.local/bin/uv pip freeze
94-
${HOME}/.local/bin/uv run --no-sync mkdocs build
93+
uv pip freeze
94+
uv run --no-sync mkdocs build
9595

9696
.PHONY: all
9797
all: format lint typecheck testcov

docs/examples/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Then set the API key as an environment variable with:
4949

5050
### Running Examples
5151

52-
These examples are distributed with the `pydantic-ai` package so you can run them either by cloning the [pydantic-ai repo](https://github.com/pydantic/pydantic-ai) or by simply installing `pydantic-ai` from PyPI with `pip` or `uv`.
53-
5452
To run the examples (this will work whether you installed `pydantic_ai`, or cloned the repo), run:
5553

5654
```bash

docs/examples/stream-markdown.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ hide: [toc]
44

55
This example shows how to stream markdown from an agent, using the [`rich`](https://github.com/Textualize/rich) library to highlight the output in the terminal.
66

7+
It'll run the example with both OpenAI and Google Gemini models if the required environment variables are set.
8+
79
Demonstrates:
810

911
* streaming text responses

docs/examples/weather-agent.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ the `get_weather` tool to get the weather for those locations.
1616

1717
## Running the Example
1818

19-
To run this example properly, you'll need two extra API keys:
19+
To run this example properly, you might want to add two extra API keys **(Note if either key is missing, the code will fall back to dummy data, so they're not required)**:
20+
2021
* A weather API key from [tomorrow.io](https://www.tomorrow.io/weather-api/) set via `WEATHER_API_KEY`
2122
* A geocoding API key from [geocode.maps.co](https://geocode.maps.co/) set via `GEO_API_KEY`
2223

23-
**(Note if either key is missing, the code will fall back to dummy data.)**
24-
2524
With [dependencies installed and environment variables set](./index.md#usage), run:
2625

2726
```bash
28-
python/uv-run -m pydantic_ai_examples.pydantic_model
27+
python/uv-run -m pydantic_ai_examples.weather_agent
2928
```
3029

3130
## Example Code

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center">
2-
<img src="./img/pydantic-ai-dark.svg#only-dark" alt="PydanticAI">
2+
<img src="./img/pydantic-ai-dark.svg#only-dark" alt="PydanticAI" style="max-width: 600px">
33
</p>
44
<p align="center">
5-
<img src="./img/pydantic-ai-light.svg#only-light" alt="PydanticAI">
5+
<img src="./img/pydantic-ai-light.svg#only-light" alt="PydanticAI" style="max-width: 600px">
66
</p>
77
<p align="center">
88
<em>Agent Framework / shim to use Pydantic with LLMs</em>

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ watch:
135135

136136
plugins:
137137
- search
138+
- social
138139
- mkdocstrings:
139140
handlers:
140141
python:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ dev = [
7070
]
7171
docs = [
7272
"mkdocs",
73-
"mkdocs-material",
73+
"mkdocs-material[imaging]",
7474
"mkdocstrings-python",
7575
]
7676

uv.lock

Lines changed: 234 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)