Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ repos:
language: system
types: [python]
pass_filenames: false

- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion docs/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ class Feedback(BaseNode[State, None, Email]):
async def main():
user = User(
name='John Doe',
email='john.joe@exmaple.com',
email='john.joe@example.com',
interests=['Haskel', 'Lisp', 'Fortran'],
)
state = State(user)
Expand Down
2 changes: 1 addition & 1 deletion docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ sequenceDiagram

## Registering Function Tools via kwarg

As well as using the decorators, we can register tools via the `tools` argument to the [`Agent` constructor][pydantic_ai.Agent.__init__]. This is useful when you want to re-use tools, and can also give more fine-grained control over the tools.
As well as using the decorators, we can register tools via the `tools` argument to the [`Agent` constructor][pydantic_ai.Agent.__init__]. This is useful when you want to reuse tools, and can also give more fine-grained control over the tools.

```python {title="dice_game_tool_kwarg.py"}
import random
Expand Down
2 changes: 1 addition & 1 deletion pydantic_ai_slim/pydantic_ai/models/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def _map_content(content: MistralOptionalNullable[MistralContent]) -> str | None
elif isinstance(content, str):
result = content

# Note: Check len to handle potential mismatch between function calls and responses from the API. (`msg: not the same number of function class and reponses`)
# Note: Check len to handle potential mismatch between function calls and responses from the API. (`msg: not the same number of function class and responses`)
if result and len(result) == 0:
result = None

Expand Down
2 changes: 1 addition & 1 deletion pydantic_ai_slim/pydantic_ai/models/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(
):
"""Initialize an Ollama model.
Ollama has built-in compatability for the OpenAI chat completions API ([source](https://ollama.com/blog/openai-compatibility)), so we reuse the
Ollama has built-in compatibility for the OpenAI chat completions API ([source](https://ollama.com/blog/openai-compatibility)), so we reuse the
[`OpenAIModel`][pydantic_ai.models.openai.OpenAIModel] here.
Args:
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,11 @@ ignore_no_config = true
[tool.inline-snapshot.shortcuts]
snap-fix=["create", "fix"]
snap=["create"]

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.svg,*.lock,*.css'
check-hidden = true
# Ignore "formatting" like **L**anguage
ignore-regex = '\*\*[A-Z]\*\*[a-z]+\b'
# ignore-words-list = ''
4 changes: 2 additions & 2 deletions tests/typed_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ def run_g5() -> None:
g5.run_sync(A()) # pyright: ignore[reportArgumentType]
g5.run_sync(A(), state=MyState(x=1)) # pyright: ignore[reportArgumentType]
g5.run_sync(A(), deps=MyDeps(y='y')) # pyright: ignore[reportArgumentType]
ans, history = g5.run_sync(A(), state=MyState(x=1), deps=MyDeps(y='y'))
assert_type(ans, int)
answer, history = g5.run_sync(A(), state=MyState(x=1), deps=MyDeps(y='y'))
assert_type(answer, int)
assert_type(history, list[HistoryStep[MyState, int]])
Loading