pydantic-ai-slim 0.0.10__py3-none-any.whl → 0.0.11__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/agent.py
CHANGED
|
@@ -171,11 +171,12 @@ class Agent(Generic[AgentDeps, ResultData]):
|
|
|
171
171
|
deps = self._get_deps(deps)
|
|
172
172
|
|
|
173
173
|
with _logfire.span(
|
|
174
|
-
'{
|
|
174
|
+
'{agent_name} run {prompt=}',
|
|
175
175
|
prompt=user_prompt,
|
|
176
176
|
agent=self,
|
|
177
177
|
custom_model=custom_model,
|
|
178
178
|
model_name=model_used.name(),
|
|
179
|
+
agent_name=self.name or 'agent',
|
|
179
180
|
) as run_span:
|
|
180
181
|
new_message_index, messages = await self._prepare_messages(deps, user_prompt, message_history)
|
|
181
182
|
self.last_run_messages = messages
|
|
@@ -277,11 +278,12 @@ class Agent(Generic[AgentDeps, ResultData]):
|
|
|
277
278
|
deps = self._get_deps(deps)
|
|
278
279
|
|
|
279
280
|
with _logfire.span(
|
|
280
|
-
'{
|
|
281
|
+
'{agent_name} run stream {prompt=}',
|
|
281
282
|
prompt=user_prompt,
|
|
282
283
|
agent=self,
|
|
283
284
|
custom_model=custom_model,
|
|
284
285
|
model_name=model_used.name(),
|
|
286
|
+
agent_name=self.name or 'agent',
|
|
285
287
|
) as run_span:
|
|
286
288
|
new_message_index, messages = await self._prepare_messages(deps, user_prompt, message_history)
|
|
287
289
|
self.last_run_messages = messages
|
|
@@ -837,6 +839,12 @@ class Agent(Generic[AgentDeps, ResultData]):
|
|
|
837
839
|
if item is self:
|
|
838
840
|
self.name = name
|
|
839
841
|
return
|
|
842
|
+
if parent_frame.f_locals != parent_frame.f_globals:
|
|
843
|
+
# if we couldn't find the agent in locals and globals are a different dict, try globals
|
|
844
|
+
for name, item in parent_frame.f_globals.items():
|
|
845
|
+
if item is self:
|
|
846
|
+
self.name = name
|
|
847
|
+
return
|
|
840
848
|
|
|
841
849
|
|
|
842
850
|
@dataclass
|
|
@@ -4,7 +4,7 @@ pydantic_ai/_pydantic.py,sha256=oFfcHDv_wuL1NQ7mCzVHvP1HBaVzyvb7xS-_Iiri_tA,8491
|
|
|
4
4
|
pydantic_ai/_result.py,sha256=wzcfwDpr_sro1Vkn3DkyIhCXMHTReDxL_ZYm50JzdRI,9667
|
|
5
5
|
pydantic_ai/_system_prompt.py,sha256=vFT0y9Wykl5veGMgLLkGRYiHQrgdW2BZ1rwMn4izjjo,1085
|
|
6
6
|
pydantic_ai/_utils.py,sha256=eNb7f3-ZQC8WDEa87iUcXGQ-lyuutFQG-5yBCMD4Vvs,8227
|
|
7
|
-
pydantic_ai/agent.py,sha256=
|
|
7
|
+
pydantic_ai/agent.py,sha256=5QOiDVByatRqKlxyRLba0fBUZcuaEkew3eqovFiOB5M,37311
|
|
8
8
|
pydantic_ai/exceptions.py,sha256=ko_47M0k6Rhg9mUC9P1cj7N4LCH6cC0pEsF65A2vL-U,1561
|
|
9
9
|
pydantic_ai/messages.py,sha256=I0_CPXDIGGSy-PXHuKq540oAXYOO9uyylpsfSsE4vLs,7032
|
|
10
10
|
pydantic_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -17,6 +17,6 @@ pydantic_ai/models/groq.py,sha256=Tx2yU3ysmPLBmWGsjzES-XcumzrsoBtB7spCnJBlLiM,14
|
|
|
17
17
|
pydantic_ai/models/openai.py,sha256=5ihH25CrS0tnZNW-BZw4GyPe8V-IxIHWw3B9ulPVjQE,14931
|
|
18
18
|
pydantic_ai/models/test.py,sha256=q1wch_E7TSb4qx9PCcP1YyBGZx567MGlAQhlAlON0S8,14463
|
|
19
19
|
pydantic_ai/models/vertexai.py,sha256=5wI8y2YjeRgSE51uKy5OtevQkks65uEbxIUAs5EGBaI,9161
|
|
20
|
-
pydantic_ai_slim-0.0.
|
|
21
|
-
pydantic_ai_slim-0.0.
|
|
22
|
-
pydantic_ai_slim-0.0.
|
|
20
|
+
pydantic_ai_slim-0.0.11.dist-info/METADATA,sha256=JPixjiAAN-dFKXFk6njU5-cf3_JqkwEBnXh2fUn2Ok4,2562
|
|
21
|
+
pydantic_ai_slim-0.0.11.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
22
|
+
pydantic_ai_slim-0.0.11.dist-info/RECORD,,
|
|
File without changes
|