Skip to content

Commit 388bd2d

Browse files
.
1 parent 07f4f67 commit 388bd2d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • deepeval/integrations/pydantic_ai

deepeval/integrations/pydantic_ai/agent.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Generic, Optional, List, Any
1+
from typing import AsyncGenerator, Generic, Optional, List, Any
22
from contextvars import ContextVar
33
from contextlib import asynccontextmanager
44
from collections.abc import Sequence
@@ -17,6 +17,7 @@
1717
HistoryProcessor,
1818
EventStreamHandler,
1919
InstrumentationSettings,
20+
AgentRunResult,
2021
)
2122
from pydantic_ai.agent.abstract import RunOutputDataT
2223
from pydantic_ai import messages as _messages
@@ -185,7 +186,7 @@ async def run(
185186
thread_id: Optional[str] = None,
186187
metrics: Optional[List[BaseMetric]] = None,
187188
metric_collection: Optional[str] = None,
188-
):
189+
) -> AgentRunResult[Any]:
189190
input = user_prompt
190191

191192
agent_name = super().name if super().name is not None else "Agent"
@@ -271,8 +272,7 @@ def run_sync(
271272
user_id: Optional[str] = None,
272273
metric_collection: Optional[str] = None,
273274
metrics: Optional[List[BaseMetric]] = None,
274-
**kwargs
275-
):
275+
) -> AgentRunResult[Any]:
276276
input = user_prompt
277277

278278
token = _IS_RUN_SYNC.set(True)
@@ -364,7 +364,7 @@ async def run_stream(
364364
user_id: Optional[str] = None,
365365
metric_collection: Optional[str] = None,
366366
metrics: Optional[List[BaseMetric]] = None,
367-
):
367+
) -> AsyncGenerator[AgentRunResult[Any], None]:
368368
input = user_prompt
369369

370370
agent_name = super().name if super().name is not None else "Agent"
@@ -464,7 +464,7 @@ def tool(
464464

465465
metrics: Optional[List[BaseMetric]] = None,
466466
metric_collection: Optional[str] = None,
467-
):
467+
) -> Any:
468468
# Direct decoration: @agent.tool
469469
if func is not None and callable(func):
470470
patched_func = create_patched_tool(func, metrics, metric_collection)

0 commit comments

Comments
 (0)