Skip to content

Commit

Permalink
chore: adapt to pydantic-ai changes
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Feb 24, 2025
1 parent 686ae37 commit 2537c04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/llmling_agent/messaging/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _get_content_str(self) -> str:

@property
def data(self) -> TContent:
"""Get content as typed data. Provides compat to RunResult."""
"""Get content as typed data. Provides compat to AgentRunResult."""
return self.content

def format(
Expand Down
6 changes: 4 additions & 2 deletions src/llmling_agent_providers/pydanticai/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pydantic_ai._pydantic
from pydantic_ai.messages import ModelResponse
from pydantic_ai.models import KnownModelName, Model
from pydantic_ai.result import RunResult, StreamedRunResult
from pydantic_ai.result import StreamedRunResult
from pydantic_ai.tools import RunContext
from pydantic_ai.usage import UsageLimits as PydanticAiUsageLimits

Expand Down Expand Up @@ -40,6 +40,8 @@
if TYPE_CHECKING:
from collections.abc import AsyncIterator, Awaitable, Callable

from pydantic_ai.agent import AgentRunResult

from llmling_agent.common_types import ModelType
from llmling_agent.tools.base import Tool
from llmling_agent_config.content import Content
Expand Down Expand Up @@ -267,7 +269,7 @@ async def generate_response(
to_use = model or self.model
to_use = infer_model(to_use) if isinstance(to_use, str) else to_use
limits = asdict(usage_limits) if usage_limits else {}
result: RunResult = await agent.run(
result: AgentRunResult = await agent.run(
prompt,
deps=self._context, # type: ignore
message_history=[to_model_message(m) for m in message_history],
Expand Down

0 comments on commit 2537c04

Please sign in to comment.