File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
pydantic_ai_slim/pydantic_ai Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 1212import anyio
1313from opentelemetry .trace import NoOpTracer , use_span
1414from pydantic .json_schema import GenerateJsonSchema
15- from typing_extensions import TypeVar , deprecated
15+ from typing_extensions import Self , TypeVar , deprecated
1616
1717from pydantic_graph import Graph
1818
@@ -1355,7 +1355,7 @@ def _prepare_output_schema(
13551355
13561356 return schema # pyright: ignore[reportReturnType]
13571357
1358- async def __aenter__ (self ) -> AbstractAgent [ AgentDepsT , OutputDataT ] :
1358+ async def __aenter__ (self ) -> Self :
13591359 """Enter the agent context.
13601360
13611361 This will start all [`MCPServerStdio`s][pydantic_ai.mcp.MCPServerStdio] registered as `toolsets` so they are ready to be used.
Original file line number Diff line number Diff line change 2020
2121from pydantic_ai .tools import RunContext , ToolDefinition
2222
23+ from .direct import model_request
2324from .toolsets .abstract import AbstractToolset , ToolsetTool
2425
2526try :
@@ -329,11 +330,7 @@ async def _sampling_callback(
329330 if stop_sequences := params .stopSequences : # pragma: no branch
330331 model_settings ['stop_sequences' ] = stop_sequences
331332
332- model_response = await self .sampling_model .request (
333- pai_messages ,
334- model_settings ,
335- models .ModelRequestParameters (),
336- )
333+ model_response = await model_request (self .sampling_model , pai_messages , model_settings = model_settings )
337334 return mcp_types .CreateMessageResult (
338335 role = 'assistant' ,
339336 content = _mcp .map_from_model_response (model_response ),
You can’t perform that action at this time.
0 commit comments