pyagentic-core 2.0.1a2__tar.gz → 2.0.3a1__tar.gz
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.
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/PKG-INFO +1 -1
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/_agent.py +4 -6
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/_agent_state.py +11 -1
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_info.py +1 -1
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_metaclasses.py +1 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/PKG-INFO +1 -1
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyproject.toml +1 -1
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/LICENSE +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/README.md +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/__init__.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/__init__.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/__init__.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/_agent_linking.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_exceptions.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_ref.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_spec.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_state.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_tool.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_validation.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_utils/_typing.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_utils/_warnings.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/__init__.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_anthropic.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_gemini.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_mock.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_openai.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_openaiv1.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_provider.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/logging.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/models/llm.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/models/response.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/models/tracing.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/policies/__init__.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/policies/_events.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/policies/_policy.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/__init__.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/_basic.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/_langfuse.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/_tracer.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/updates.py +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/SOURCES.txt +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/dependency_links.txt +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/requires.txt +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/top_level.txt +0 -0
- {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/setup.cfg +0 -0
|
@@ -657,8 +657,7 @@ class BaseAgent(metaclass=AgentMeta):
|
|
|
657
657
|
# Otherwise, set as normal instance attribute
|
|
658
658
|
super().__setattr__(name, value)
|
|
659
659
|
|
|
660
|
-
|
|
661
|
-
def get_tool_definition(cls, name: str) -> _ToolDefinition:
|
|
660
|
+
def get_tool_definition(self, name: str) -> _ToolDefinition:
|
|
662
661
|
"""
|
|
663
662
|
Creates a tool definition for this agent class to be used as a linked agent.
|
|
664
663
|
|
|
@@ -673,15 +672,14 @@ class BaseAgent(metaclass=AgentMeta):
|
|
|
673
672
|
Returns:
|
|
674
673
|
_ToolDefinition: A tool definition that can be sent to the LLM
|
|
675
674
|
"""
|
|
676
|
-
desc = getattr(cls, "__description__", "") or ""
|
|
677
675
|
|
|
678
676
|
# Create a fresh async wrapper function for this agent class
|
|
679
677
|
# Each class needs its own function object for the @tool decorator
|
|
680
|
-
@wraps(
|
|
678
|
+
@wraps(self.__call__)
|
|
681
679
|
async def _invoke(self, *args, **kwargs):
|
|
682
|
-
return await
|
|
680
|
+
return await self.__call__(self, *args, **kwargs)
|
|
683
681
|
|
|
684
682
|
# Apply @tool decorator to extract parameter info and create definition
|
|
685
|
-
td = tool(
|
|
683
|
+
td = tool(self.state.description)(_invoke).__tool_def__
|
|
686
684
|
td.name = name
|
|
687
685
|
return td
|
|
@@ -30,14 +30,20 @@ class _AgentState(BaseModel):
|
|
|
30
30
|
|
|
31
31
|
instructions: str
|
|
32
32
|
input_template: Optional[str] = "{{ user_message }}"
|
|
33
|
+
description_template: Optional[str] = None
|
|
33
34
|
_messages: list[Message] = PrivateAttr(default_factory=list)
|
|
34
35
|
_instructions_template: Template = PrivateAttr(default_factory=lambda: Template(source=""))
|
|
35
|
-
_input_template: Template = PrivateAttr(
|
|
36
|
+
_input_template: Template = PrivateAttr(
|
|
37
|
+
default_factory=lambda: Template(source="{{ user_message }}")
|
|
38
|
+
)
|
|
39
|
+
_description_template: Template = PrivateAttr(default_factory=lambda: Template(source=""))
|
|
36
40
|
|
|
37
41
|
def model_post_init(self, state):
|
|
38
42
|
self._instructions_template = Template(source=self.instructions)
|
|
39
43
|
if self.input_template:
|
|
40
44
|
self._input_template = Template(source=self.input_template)
|
|
45
|
+
if self.description_template:
|
|
46
|
+
self._description_template = Template(source=self.description_template)
|
|
41
47
|
return super().model_post_init(state)
|
|
42
48
|
|
|
43
49
|
def get_policies(self, state_name: str) -> list[Policy]:
|
|
@@ -254,6 +260,10 @@ class _AgentState(BaseModel):
|
|
|
254
260
|
messages.insert(0, Message(role="system", content=self.system_message))
|
|
255
261
|
return messages
|
|
256
262
|
|
|
263
|
+
@property
|
|
264
|
+
def description(self) -> str:
|
|
265
|
+
return self._description_template.render(**self.model_dump())
|
|
266
|
+
|
|
257
267
|
def add_user_message(self, message: str):
|
|
258
268
|
"""
|
|
259
269
|
Adds a user message to the message list. If an `input_template` is given then
|
|
@@ -54,7 +54,7 @@ class StateInfo(_SpecInfo):
|
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
56
|
policies: list[Policy] | None = None
|
|
57
|
-
access: Literal["read", "write", "readwrite", "hidden"] = field(default="
|
|
57
|
+
access: Literal["read", "write", "readwrite", "hidden"] = field(default="hidden")
|
|
58
58
|
get_description: str | None = None
|
|
59
59
|
set_description: str | None = None
|
|
60
60
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|