pydantic-ai-slim 0.0.12__py3-none-any.whl → 0.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pydantic-ai-slim might be problematic. Click here for more details.
- pydantic_ai/_pydantic.py +7 -25
- pydantic_ai/_result.py +34 -16
- pydantic_ai/_system_prompt.py +1 -1
- pydantic_ai/_utils.py +9 -2
- pydantic_ai/agent.py +333 -148
- pydantic_ai/messages.py +87 -48
- pydantic_ai/models/__init__.py +30 -6
- pydantic_ai/models/anthropic.py +344 -0
- pydantic_ai/models/function.py +59 -31
- pydantic_ai/models/gemini.py +150 -108
- pydantic_ai/models/groq.py +94 -74
- pydantic_ai/models/mistral.py +680 -0
- pydantic_ai/models/ollama.py +1 -1
- pydantic_ai/models/openai.py +102 -76
- pydantic_ai/models/test.py +62 -51
- pydantic_ai/models/vertexai.py +7 -3
- pydantic_ai/result.py +35 -37
- pydantic_ai/settings.py +72 -0
- pydantic_ai/tools.py +28 -18
- {pydantic_ai_slim-0.0.12.dist-info → pydantic_ai_slim-0.0.13.dist-info}/METADATA +8 -3
- pydantic_ai_slim-0.0.13.dist-info/RECORD +26 -0
- {pydantic_ai_slim-0.0.12.dist-info → pydantic_ai_slim-0.0.13.dist-info}/WHEEL +1 -1
- pydantic_ai_slim-0.0.12.dist-info/RECORD +0 -23
pydantic_ai/result.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
from __future__ import annotations as _annotations
|
|
2
2
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
|
-
from collections.abc import AsyncIterator, Callable
|
|
4
|
+
from collections.abc import AsyncIterator, Awaitable, Callable
|
|
5
5
|
from dataclasses import dataclass, field
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing import Generic, TypeVar, cast
|
|
8
8
|
|
|
9
9
|
import logfire_api
|
|
10
10
|
|
|
11
|
-
from . import _result, _utils, exceptions, messages, models
|
|
11
|
+
from . import _result, _utils, exceptions, messages as _messages, models
|
|
12
12
|
from .tools import AgentDeps
|
|
13
13
|
|
|
14
14
|
__all__ = (
|
|
@@ -71,19 +71,19 @@ class _BaseRunResult(ABC, Generic[ResultData]):
|
|
|
71
71
|
You should not import or use this type directly, instead use its subclasses `RunResult` and `StreamedRunResult`.
|
|
72
72
|
"""
|
|
73
73
|
|
|
74
|
-
_all_messages: list[
|
|
74
|
+
_all_messages: list[_messages.ModelMessage]
|
|
75
75
|
_new_message_index: int
|
|
76
76
|
|
|
77
|
-
def all_messages(self) -> list[
|
|
78
|
-
"""Return the history of
|
|
77
|
+
def all_messages(self) -> list[_messages.ModelMessage]:
|
|
78
|
+
"""Return the history of _messages."""
|
|
79
79
|
# this is a method to be consistent with the other methods
|
|
80
80
|
return self._all_messages
|
|
81
81
|
|
|
82
82
|
def all_messages_json(self) -> bytes:
|
|
83
|
-
"""Return all messages from [`all_messages`][
|
|
84
|
-
return
|
|
83
|
+
"""Return all messages from [`all_messages`][pydantic_ai.result._BaseRunResult.all_messages] as JSON bytes."""
|
|
84
|
+
return _messages.ModelMessagesTypeAdapter.dump_json(self.all_messages())
|
|
85
85
|
|
|
86
|
-
def new_messages(self) -> list[
|
|
86
|
+
def new_messages(self) -> list[_messages.ModelMessage]:
|
|
87
87
|
"""Return new messages associated with this run.
|
|
88
88
|
|
|
89
89
|
System prompts and any messages from older runs are excluded.
|
|
@@ -91,8 +91,8 @@ class _BaseRunResult(ABC, Generic[ResultData]):
|
|
|
91
91
|
return self.all_messages()[self._new_message_index :]
|
|
92
92
|
|
|
93
93
|
def new_messages_json(self) -> bytes:
|
|
94
|
-
"""Return new messages from [`new_messages`][
|
|
95
|
-
return
|
|
94
|
+
"""Return new messages from [`new_messages`][pydantic_ai.result._BaseRunResult.new_messages] as JSON bytes."""
|
|
95
|
+
return _messages.ModelMessagesTypeAdapter.dump_json(self.new_messages())
|
|
96
96
|
|
|
97
97
|
@abstractmethod
|
|
98
98
|
def cost(self) -> Cost:
|
|
@@ -122,7 +122,8 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
122
122
|
_result_schema: _result.ResultSchema[ResultData] | None
|
|
123
123
|
_deps: AgentDeps
|
|
124
124
|
_result_validators: list[_result.ResultValidator[AgentDeps, ResultData]]
|
|
125
|
-
|
|
125
|
+
_result_tool_name: str | None
|
|
126
|
+
_on_complete: Callable[[], Awaitable[None]]
|
|
126
127
|
is_complete: bool = field(default=False, init=False)
|
|
127
128
|
"""Whether the stream has all been received.
|
|
128
129
|
|
|
@@ -205,11 +206,11 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
205
206
|
combined = await self._validate_text_result(''.join(chunks))
|
|
206
207
|
yield combined
|
|
207
208
|
lf_span.set_attribute('combined_text', combined)
|
|
208
|
-
self._marked_completed(
|
|
209
|
+
await self._marked_completed(_messages.ModelResponse.from_text(combined))
|
|
209
210
|
|
|
210
211
|
async def stream_structured(
|
|
211
212
|
self, *, debounce_by: float | None = 0.1
|
|
212
|
-
) -> AsyncIterator[tuple[
|
|
213
|
+
) -> AsyncIterator[tuple[_messages.ModelResponse, bool]]:
|
|
213
214
|
"""Stream the response as an async iterable of Structured LLM Messages.
|
|
214
215
|
|
|
215
216
|
!!! note
|
|
@@ -230,17 +231,21 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
230
231
|
else:
|
|
231
232
|
# we should already have a message at this point, yield that first if it has any content
|
|
232
233
|
msg = self._stream_response.get()
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
for item in msg.parts:
|
|
235
|
+
if isinstance(item, _messages.ToolCallPart) and item.has_content():
|
|
236
|
+
yield msg, False
|
|
237
|
+
break
|
|
235
238
|
async with _utils.group_by_temporal(self._stream_response, debounce_by) as group_iter:
|
|
236
239
|
async for _ in group_iter:
|
|
237
240
|
msg = self._stream_response.get()
|
|
238
|
-
|
|
239
|
-
|
|
241
|
+
for item in msg.parts:
|
|
242
|
+
if isinstance(item, _messages.ToolCallPart) and item.has_content():
|
|
243
|
+
yield msg, False
|
|
244
|
+
break
|
|
240
245
|
msg = self._stream_response.get(final=True)
|
|
241
246
|
yield msg, True
|
|
242
247
|
lf_span.set_attribute('structured_response', msg)
|
|
243
|
-
self._marked_completed(
|
|
248
|
+
await self._marked_completed(msg)
|
|
244
249
|
|
|
245
250
|
async def get_data(self) -> ResultData:
|
|
246
251
|
"""Stream the whole response, validate and return it."""
|
|
@@ -249,12 +254,12 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
249
254
|
if isinstance(self._stream_response, models.StreamTextResponse):
|
|
250
255
|
text = ''.join(self._stream_response.get(final=True))
|
|
251
256
|
text = await self._validate_text_result(text)
|
|
252
|
-
self._marked_completed(text
|
|
257
|
+
await self._marked_completed(_messages.ModelResponse.from_text(text))
|
|
253
258
|
return cast(ResultData, text)
|
|
254
259
|
else:
|
|
255
|
-
|
|
256
|
-
self._marked_completed(
|
|
257
|
-
return await self.validate_structured_result(
|
|
260
|
+
message = self._stream_response.get(final=True)
|
|
261
|
+
await self._marked_completed(message)
|
|
262
|
+
return await self.validate_structured_result(message)
|
|
258
263
|
|
|
259
264
|
@property
|
|
260
265
|
def is_structured(self) -> bool:
|
|
@@ -274,11 +279,12 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
274
279
|
return self._stream_response.timestamp()
|
|
275
280
|
|
|
276
281
|
async def validate_structured_result(
|
|
277
|
-
self, message:
|
|
282
|
+
self, message: _messages.ModelResponse, *, allow_partial: bool = False
|
|
278
283
|
) -> ResultData:
|
|
279
284
|
"""Validate a structured result message."""
|
|
280
285
|
assert self._result_schema is not None, 'Expected _result_schema to not be None'
|
|
281
|
-
|
|
286
|
+
assert self._result_tool_name is not None, 'Expected _result_tool_name to not be None'
|
|
287
|
+
match = self._result_schema.find_named_tool(message.parts, self._result_tool_name)
|
|
282
288
|
if match is None:
|
|
283
289
|
raise exceptions.UnexpectedModelBehavior(
|
|
284
290
|
f'Invalid message, unable to find tool: {self._result_schema.tool_names()}'
|
|
@@ -288,7 +294,7 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
288
294
|
result_data = result_tool.validate(call, allow_partial=allow_partial, wrap_validation_errors=False)
|
|
289
295
|
|
|
290
296
|
for validator in self._result_validators:
|
|
291
|
-
result_data = await validator.validate(result_data, self._deps, 0, call)
|
|
297
|
+
result_data = await validator.validate(result_data, self._deps, 0, call, self._all_messages)
|
|
292
298
|
return result_data
|
|
293
299
|
|
|
294
300
|
async def _validate_text_result(self, text: str) -> str:
|
|
@@ -298,19 +304,11 @@ class StreamedRunResult(_BaseRunResult[ResultData], Generic[AgentDeps, ResultDat
|
|
|
298
304
|
self._deps,
|
|
299
305
|
0,
|
|
300
306
|
None,
|
|
307
|
+
self._all_messages,
|
|
301
308
|
)
|
|
302
309
|
return text
|
|
303
310
|
|
|
304
|
-
def _marked_completed(
|
|
305
|
-
self, *, text: str | None = None, structured_message: messages.ModelStructuredResponse | None = None
|
|
306
|
-
) -> None:
|
|
311
|
+
async def _marked_completed(self, message: _messages.ModelResponse) -> None:
|
|
307
312
|
self.is_complete = True
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
self._all_messages.append(
|
|
311
|
-
messages.ModelTextResponse(content=text, timestamp=self._stream_response.timestamp())
|
|
312
|
-
)
|
|
313
|
-
else:
|
|
314
|
-
assert structured_message is not None, 'Either text or structured_message should provided, not both'
|
|
315
|
-
self._all_messages.append(structured_message)
|
|
316
|
-
self._on_complete(self._all_messages)
|
|
313
|
+
self._all_messages.append(message)
|
|
314
|
+
await self._on_complete()
|
pydantic_ai/settings.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from httpx import Timeout
|
|
4
|
+
from typing_extensions import TypedDict
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ModelSettings(TypedDict, total=False):
|
|
8
|
+
"""Settings to configure an LLM.
|
|
9
|
+
|
|
10
|
+
Here we include only settings which apply to multiple models / model providers.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
max_tokens: int
|
|
14
|
+
"""The maximum number of tokens to generate before stopping.
|
|
15
|
+
|
|
16
|
+
Supported by:
|
|
17
|
+
* Gemini
|
|
18
|
+
* Anthropic
|
|
19
|
+
* OpenAI
|
|
20
|
+
* Groq
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
temperature: float
|
|
24
|
+
"""Amount of randomness injected into the response.
|
|
25
|
+
|
|
26
|
+
Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to a model's
|
|
27
|
+
maximum `temperature` for creative and generative tasks.
|
|
28
|
+
|
|
29
|
+
Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
|
|
30
|
+
|
|
31
|
+
Supported by:
|
|
32
|
+
* Gemini
|
|
33
|
+
* Anthropic
|
|
34
|
+
* OpenAI
|
|
35
|
+
* Groq
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
top_p: float
|
|
39
|
+
"""An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
|
|
40
|
+
|
|
41
|
+
So 0.1 means only the tokens comprising the top 10% probability mass are considered.
|
|
42
|
+
|
|
43
|
+
You should either alter `temperature` or `top_p`, but not both.
|
|
44
|
+
|
|
45
|
+
Supported by:
|
|
46
|
+
* Gemini
|
|
47
|
+
* Anthropic
|
|
48
|
+
* OpenAI
|
|
49
|
+
* Groq
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
timeout: float | Timeout
|
|
53
|
+
"""Override the client-level default timeout for a request, in seconds.
|
|
54
|
+
|
|
55
|
+
Supported by:
|
|
56
|
+
* Gemini
|
|
57
|
+
* Anthropic
|
|
58
|
+
* OpenAI
|
|
59
|
+
* Groq
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def merge_model_settings(base: ModelSettings | None, overrides: ModelSettings | None) -> ModelSettings | None:
|
|
64
|
+
"""Merge two sets of model settings, preferring the overrides.
|
|
65
|
+
|
|
66
|
+
A common use case is: merge_model_settings(<agent settings>, <run settings>)
|
|
67
|
+
"""
|
|
68
|
+
# Note: we may want merge recursively if/when we add non-primitive values
|
|
69
|
+
if base and overrides:
|
|
70
|
+
return base | overrides
|
|
71
|
+
else:
|
|
72
|
+
return base or overrides
|
pydantic_ai/tools.py
CHANGED
|
@@ -9,7 +9,7 @@ from pydantic import ValidationError
|
|
|
9
9
|
from pydantic_core import SchemaValidator
|
|
10
10
|
from typing_extensions import Concatenate, ParamSpec, TypeAlias
|
|
11
11
|
|
|
12
|
-
from . import _pydantic, _utils, messages
|
|
12
|
+
from . import _pydantic, _utils, messages as _messages
|
|
13
13
|
from .exceptions import ModelRetry, UnexpectedModelBehavior
|
|
14
14
|
|
|
15
15
|
if TYPE_CHECKING:
|
|
@@ -45,7 +45,9 @@ class RunContext(Generic[AgentDeps]):
|
|
|
45
45
|
"""Dependencies for the agent."""
|
|
46
46
|
retry: int
|
|
47
47
|
"""Number of retries so far."""
|
|
48
|
-
|
|
48
|
+
messages: list[_messages.ModelMessage]
|
|
49
|
+
"""Messages exchanged in the conversation so far."""
|
|
50
|
+
tool_name: str | None
|
|
49
51
|
"""Name of the tool being called."""
|
|
50
52
|
|
|
51
53
|
|
|
@@ -87,7 +89,7 @@ ToolFuncPlain = Callable[ToolParams, Any]
|
|
|
87
89
|
Usage `ToolPlainFunc[ToolParams]`.
|
|
88
90
|
"""
|
|
89
91
|
ToolFuncEither = Union[ToolFuncContext[AgentDeps, ToolParams], ToolFuncPlain[ToolParams]]
|
|
90
|
-
"""Either
|
|
92
|
+
"""Either part_kind of tool function.
|
|
91
93
|
|
|
92
94
|
This is just a union of [`ToolFuncContext`][pydantic_ai.tools.ToolFuncContext] and
|
|
93
95
|
[`ToolFuncPlain`][pydantic_ai.tools.ToolFuncPlain].
|
|
@@ -97,11 +99,11 @@ Usage `ToolFuncEither[AgentDeps, ToolParams]`.
|
|
|
97
99
|
ToolPrepareFunc: TypeAlias = 'Callable[[RunContext[AgentDeps], ToolDefinition], Awaitable[ToolDefinition | None]]'
|
|
98
100
|
"""Definition of a function that can prepare a tool definition at call time.
|
|
99
101
|
|
|
100
|
-
See [tool docs](../
|
|
102
|
+
See [tool docs](../tools.md#tool-prepare) for more information.
|
|
101
103
|
|
|
102
104
|
Example — here `only_if_42` is valid as a `ToolPrepareFunc`:
|
|
103
105
|
|
|
104
|
-
```
|
|
106
|
+
```python {lint="not-imports"}
|
|
105
107
|
from typing import Union
|
|
106
108
|
|
|
107
109
|
from pydantic_ai import RunContext, Tool
|
|
@@ -157,7 +159,7 @@ class Tool(Generic[AgentDeps]):
|
|
|
157
159
|
|
|
158
160
|
Example usage:
|
|
159
161
|
|
|
160
|
-
```
|
|
162
|
+
```python {lint="not-imports"}
|
|
161
163
|
from pydantic_ai import Agent, RunContext, Tool
|
|
162
164
|
|
|
163
165
|
async def my_tool(ctx: RunContext[int], x: int, y: int) -> str:
|
|
@@ -168,7 +170,7 @@ class Tool(Generic[AgentDeps]):
|
|
|
168
170
|
|
|
169
171
|
or with a custom prepare method:
|
|
170
172
|
|
|
171
|
-
```
|
|
173
|
+
```python {lint="not-imports"}
|
|
172
174
|
from typing import Union
|
|
173
175
|
|
|
174
176
|
from pydantic_ai import Agent, RunContext, Tool
|
|
@@ -235,17 +237,19 @@ class Tool(Generic[AgentDeps]):
|
|
|
235
237
|
else:
|
|
236
238
|
return tool_def
|
|
237
239
|
|
|
238
|
-
async def run(
|
|
240
|
+
async def run(
|
|
241
|
+
self, deps: AgentDeps, message: _messages.ToolCallPart, conv_messages: list[_messages.ModelMessage]
|
|
242
|
+
) -> _messages.ModelRequestPart:
|
|
239
243
|
"""Run the tool function asynchronously."""
|
|
240
244
|
try:
|
|
241
|
-
if isinstance(message.args,
|
|
245
|
+
if isinstance(message.args, _messages.ArgsJson):
|
|
242
246
|
args_dict = self._validator.validate_json(message.args.args_json)
|
|
243
247
|
else:
|
|
244
248
|
args_dict = self._validator.validate_python(message.args.args_dict)
|
|
245
249
|
except ValidationError as e:
|
|
246
250
|
return self._on_error(e, message)
|
|
247
251
|
|
|
248
|
-
args, kwargs = self._call_args(deps, args_dict, message)
|
|
252
|
+
args, kwargs = self._call_args(deps, args_dict, message, conv_messages)
|
|
249
253
|
try:
|
|
250
254
|
if self._is_async:
|
|
251
255
|
function = cast(Callable[[Any], Awaitable[str]], self.function)
|
|
@@ -257,19 +261,23 @@ class Tool(Generic[AgentDeps]):
|
|
|
257
261
|
return self._on_error(e, message)
|
|
258
262
|
|
|
259
263
|
self.current_retry = 0
|
|
260
|
-
return
|
|
264
|
+
return _messages.ToolReturnPart(
|
|
261
265
|
tool_name=message.tool_name,
|
|
262
266
|
content=response_content,
|
|
263
|
-
|
|
267
|
+
tool_call_id=message.tool_call_id,
|
|
264
268
|
)
|
|
265
269
|
|
|
266
270
|
def _call_args(
|
|
267
|
-
self,
|
|
271
|
+
self,
|
|
272
|
+
deps: AgentDeps,
|
|
273
|
+
args_dict: dict[str, Any],
|
|
274
|
+
message: _messages.ToolCallPart,
|
|
275
|
+
conv_messages: list[_messages.ModelMessage],
|
|
268
276
|
) -> tuple[list[Any], dict[str, Any]]:
|
|
269
277
|
if self._single_arg_name:
|
|
270
278
|
args_dict = {self._single_arg_name: args_dict}
|
|
271
279
|
|
|
272
|
-
args = [RunContext(deps, self.current_retry, message.tool_name)] if self.takes_ctx else []
|
|
280
|
+
args = [RunContext(deps, self.current_retry, conv_messages, message.tool_name)] if self.takes_ctx else []
|
|
273
281
|
for positional_field in self._positional_fields:
|
|
274
282
|
args.append(args_dict.pop(positional_field))
|
|
275
283
|
if self._var_positional_field:
|
|
@@ -277,7 +285,9 @@ class Tool(Generic[AgentDeps]):
|
|
|
277
285
|
|
|
278
286
|
return args, args_dict
|
|
279
287
|
|
|
280
|
-
def _on_error(
|
|
288
|
+
def _on_error(
|
|
289
|
+
self, exc: ValidationError | ModelRetry, call_message: _messages.ToolCallPart
|
|
290
|
+
) -> _messages.RetryPromptPart:
|
|
281
291
|
self.current_retry += 1
|
|
282
292
|
if self.max_retries is None or self.current_retry > self.max_retries:
|
|
283
293
|
raise UnexpectedModelBehavior(f'Tool exceeded max retries count of {self.max_retries}') from exc
|
|
@@ -286,10 +296,10 @@ class Tool(Generic[AgentDeps]):
|
|
|
286
296
|
content = exc.errors(include_url=False)
|
|
287
297
|
else:
|
|
288
298
|
content = exc.message
|
|
289
|
-
return
|
|
299
|
+
return _messages.RetryPromptPart(
|
|
290
300
|
tool_name=call_message.tool_name,
|
|
291
301
|
content=content,
|
|
292
|
-
|
|
302
|
+
tool_call_id=call_message.tool_call_id,
|
|
293
303
|
)
|
|
294
304
|
|
|
295
305
|
|
|
@@ -298,7 +308,7 @@ ObjectJsonSchema: TypeAlias = dict[str, Any]
|
|
|
298
308
|
|
|
299
309
|
This type is used to define tools parameters (aka arguments) in [ToolDefinition][pydantic_ai.tools.ToolDefinition].
|
|
300
310
|
|
|
301
|
-
With PEP-728 this should be a TypedDict with `type: Literal['object']`, and `
|
|
311
|
+
With PEP-728 this should be a TypedDict with `type: Literal['object']`, and `extra_parts=Any`
|
|
302
312
|
"""
|
|
303
313
|
|
|
304
314
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-slim
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Summary: Agent Framework / shim to use Pydantic with LLMs, slim package
|
|
5
5
|
Author-email: Samuel Colvin <samuel@pydantic.dev>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Classifier: Development Status :: 4 - Beta
|
|
8
8
|
Classifier: Environment :: Console
|
|
9
9
|
Classifier: Environment :: MacOS X
|
|
@@ -29,10 +29,15 @@ Requires-Dist: griffe>=1.3.2
|
|
|
29
29
|
Requires-Dist: httpx>=0.27.2
|
|
30
30
|
Requires-Dist: logfire-api>=1.2.0
|
|
31
31
|
Requires-Dist: pydantic>=2.10
|
|
32
|
+
Provides-Extra: anthropic
|
|
33
|
+
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
|
|
32
34
|
Provides-Extra: groq
|
|
33
35
|
Requires-Dist: groq>=0.12.0; extra == 'groq'
|
|
34
36
|
Provides-Extra: logfire
|
|
35
37
|
Requires-Dist: logfire>=2.3; extra == 'logfire'
|
|
38
|
+
Provides-Extra: mistral
|
|
39
|
+
Requires-Dist: json-repair>=0.30.3; extra == 'mistral'
|
|
40
|
+
Requires-Dist: mistralai>=1.2.5; extra == 'mistral'
|
|
36
41
|
Provides-Extra: openai
|
|
37
42
|
Requires-Dist: openai>=1.54.3; extra == 'openai'
|
|
38
43
|
Provides-Extra: vertexai
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
pydantic_ai/__init__.py,sha256=a29NqQz0JyW4BoCjcRh23fBBfwY17_n57moE4QrFWM4,324
|
|
2
|
+
pydantic_ai/_griffe.py,sha256=pRjCJ6B1hhx6k46XJgl9zF6aRYxRmqEZKFok8unp4Iw,3449
|
|
3
|
+
pydantic_ai/_pydantic.py,sha256=qXi5IsyiYOHeg_-qozCdxkfeqw2z0gBTjqgywBCiJWo,8125
|
|
4
|
+
pydantic_ai/_result.py,sha256=LycNJR_Whc9P7sz2uD-Ce5bs9kQBU6eYqQxCUDNiNxU,10453
|
|
5
|
+
pydantic_ai/_system_prompt.py,sha256=2Ui7fYAXxR_aZZLJdwMnOAecBOIbrKwx1yV4Qz523WQ,1089
|
|
6
|
+
pydantic_ai/_utils.py,sha256=skWNgm89US_x1EpxdRy5wCkghBrm1XgxFCiEh6wAkAo,8753
|
|
7
|
+
pydantic_ai/agent.py,sha256=sDQE20lQXyWO-SrodqSNlzzGwtaLNSkla6NgyJXPKTU,48568
|
|
8
|
+
pydantic_ai/exceptions.py,sha256=ko_47M0k6Rhg9mUC9P1cj7N4LCH6cC0pEsF65A2vL-U,1561
|
|
9
|
+
pydantic_ai/messages.py,sha256=Qa9H5kf9qeI1NqB-XgRjPJ-wwgVKvDZxqam7gnsLtrc,8106
|
|
10
|
+
pydantic_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
pydantic_ai/result.py,sha256=ZhaYArCiVl9JlrTllaeFIl2vU2foiIgpQYGby55G4cQ,13664
|
|
12
|
+
pydantic_ai/settings.py,sha256=3sUaDMVMBX9Pku4Bh7lpv6VizX1utenHd5kVIRJvHyY,1908
|
|
13
|
+
pydantic_ai/tools.py,sha256=hhhe5_ELeyYpaRoETMLjml83FAbMY7cpo5us7qwbOWg,11532
|
|
14
|
+
pydantic_ai/models/__init__.py,sha256=y1tkHgWjIGLhZX95dIeOXcljSiAiRGma2T55hNi8EwA,10897
|
|
15
|
+
pydantic_ai/models/anthropic.py,sha256=YBqiYjvOVqsSHPNT2Vt2aMaAAa8nMK57IMPONrtBCyc,13430
|
|
16
|
+
pydantic_ai/models/function.py,sha256=i54ce97lqmy1p7Vqc162EiF_72oA3khc7z2uBGZbuWg,10731
|
|
17
|
+
pydantic_ai/models/gemini.py,sha256=3oy0FVHLOP8SEOvpvoWtlUhRCJpddRj4-J_IPXaEkLE,28277
|
|
18
|
+
pydantic_ai/models/groq.py,sha256=dorqZk8xbZ4ZDzZothJoWbUkoD8TWHb6lftdkNDlsu0,15821
|
|
19
|
+
pydantic_ai/models/mistral.py,sha256=S0K73J5AGKwJc0UU0ifCrPmcxR2QMvVS6L1Cq19xDrk,26793
|
|
20
|
+
pydantic_ai/models/ollama.py,sha256=i3mMXkXu9xL6f4c52Eyx3j4aHKfYoloFondlGHPtkS4,3971
|
|
21
|
+
pydantic_ai/models/openai.py,sha256=fo3ocIOylD8YTuJMTJR1eXcRAQDGFKWFIYYrSOQS1C0,16569
|
|
22
|
+
pydantic_ai/models/test.py,sha256=mBQ0vJYjEMHv01A3yyHR2porkxekpmqIUBkK-W8d-L8,15530
|
|
23
|
+
pydantic_ai/models/vertexai.py,sha256=DBCBfpvpIhZaMG7cKvRl5rugCZqJqqEFm74uBc45weo,9259
|
|
24
|
+
pydantic_ai_slim-0.0.13.dist-info/METADATA,sha256=57JLefiQcRnSOVvkDHcik6wQ24FZ3HOmPrfCaBUe4X8,2785
|
|
25
|
+
pydantic_ai_slim-0.0.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
pydantic_ai_slim-0.0.13.dist-info/RECORD,,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
pydantic_ai/__init__.py,sha256=a29NqQz0JyW4BoCjcRh23fBBfwY17_n57moE4QrFWM4,324
|
|
2
|
-
pydantic_ai/_griffe.py,sha256=pRjCJ6B1hhx6k46XJgl9zF6aRYxRmqEZKFok8unp4Iw,3449
|
|
3
|
-
pydantic_ai/_pydantic.py,sha256=0rrns3p6BY8reGT0CVrYpq7VSiO5lDrCyugbMEZyvx8,8600
|
|
4
|
-
pydantic_ai/_result.py,sha256=X8sk5Z_JFXBrs7dJQpT0N3U7KhhKnfVsQBJX9qHOsHU,9732
|
|
5
|
-
pydantic_ai/_system_prompt.py,sha256=l9YD3SU3eu34ibTvLPDGbPsMz62yK4KTaOc3ORcDtKU,1079
|
|
6
|
-
pydantic_ai/_utils.py,sha256=LnPjvL79gsC2vCcwdVdPt0N5bRVz9lr-ypRMYSwcQbg,8349
|
|
7
|
-
pydantic_ai/agent.py,sha256=v_32DqnRKZpMrOvCb-uGveD6lMSr1Ssm5M67HpH55qU,40480
|
|
8
|
-
pydantic_ai/exceptions.py,sha256=ko_47M0k6Rhg9mUC9P1cj7N4LCH6cC0pEsF65A2vL-U,1561
|
|
9
|
-
pydantic_ai/messages.py,sha256=eyZfgk1yNomyEOji-1Z72UH2KeFlu6BK2_QRtUCH8_U,7190
|
|
10
|
-
pydantic_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
pydantic_ai/result.py,sha256=UB3vFOcDAceeNLXh_f_3PKy2J0A6FIHdgDFJxPH6OJk,13651
|
|
12
|
-
pydantic_ai/tools.py,sha256=o26Nbbn4P6DA6DBzOGm60ghnjGBjR6jBRmq-Of9MO7c,11105
|
|
13
|
-
pydantic_ai/models/__init__.py,sha256=OSBkwXhZCN6I0ofRACkU-D4RHswJqcAZyu94Na5yK44,10056
|
|
14
|
-
pydantic_ai/models/function.py,sha256=oNalT5TyL5Kd-QVtV3ZePw6xqD-pnh3Ycg8-5YIkPzg,9873
|
|
15
|
-
pydantic_ai/models/gemini.py,sha256=qqkAHmlawKSeMAD12mlmunIxdhj783GmfmQSAJblzhA,26517
|
|
16
|
-
pydantic_ai/models/groq.py,sha256=AqqFCwTntdifEhys4GQDE6GEnqz9dzMjJC9mdoIVsa0,14661
|
|
17
|
-
pydantic_ai/models/ollama.py,sha256=nlxI4HNS6mmHointSc-xHa-dMwfzblAiv4hyy8_ZPXA,3966
|
|
18
|
-
pydantic_ai/models/openai.py,sha256=XPsjkiDst8v46FONeVQ-hgC3yt74bQCYVRrtu1POkwQ,14971
|
|
19
|
-
pydantic_ai/models/test.py,sha256=p99eMjzZeBhVdkHQx5pdnBlOnG__hcZnDHfedPut9jI,15042
|
|
20
|
-
pydantic_ai/models/vertexai.py,sha256=DctkdayyIBXvolGWpWUG0YZRDb8M9U-cmZxRWq7ydzI,9126
|
|
21
|
-
pydantic_ai_slim-0.0.12.dist-info/METADATA,sha256=MIZtH_6kLJj81yi7QrT-vtSteGH6gh5sXkoeKVbNTP0,2562
|
|
22
|
-
pydantic_ai_slim-0.0.12.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
23
|
-
pydantic_ai_slim-0.0.12.dist-info/RECORD,,
|