Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Oct 12, 2024
1 parent d97ba8a commit c5d5f24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Shim to use Pydantic with LLMs.
## Example of usage

```py
from pydantic_ai import Agent, CallContext
from pydantic_ai import Agent

# An agent that can tell users about the weather in a particular location.
# Agents combine a system prompt, a response type (here `str`) and one or more
Expand All @@ -17,8 +17,8 @@ weather_agent = Agent(


# retrievers let you register "tools" which the LLM can call while trying to respond to a user.
@weather_agent.retriever_context(retries=2)
async def get_location(_: CallContext[None], location_description: str) -> str:
@weather_agent.retriever_plain(retries=2)
async def get_location(location_description: str) -> str:
"""
Get the latitude and longitude of a location by its description.
Expand All @@ -41,8 +41,8 @@ async def get_location(_: CallContext[None], location_description: str) -> str:
return json.dumps(lat_lng)


@weather_agent.retriever_context
async def get_weather(_: CallContext[None], lat: float, lng: float):
@weather_agent.retriever_plain
async def get_weather(lat: float, lng: float):
"""
Get the weather at a location by its latitude and longitude.
"""
Expand Down
4 changes: 2 additions & 2 deletions pydantic_ai/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from collections.abc import AsyncIterable
from dataclasses import dataclass
from typing import Any, Generic, TypedDict, TypeVar
from typing import Any, Generic, TypeVar

from pydantic import TypeAdapter, ValidationError
from typing_extensions import Self
from typing_extensions import Self, TypedDict

from . import _utils, messages

Expand Down

0 comments on commit c5d5f24

Please sign in to comment.