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.
Files changed (45) hide show
  1. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/PKG-INFO +1 -1
  2. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/_agent.py +4 -6
  3. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/_agent_state.py +11 -1
  4. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_info.py +1 -1
  5. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_metaclasses.py +1 -0
  6. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/PKG-INFO +1 -1
  7. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyproject.toml +1 -1
  8. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/LICENSE +0 -0
  9. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/README.md +0 -0
  10. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/__init__.py +0 -0
  11. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/__init__.py +0 -0
  12. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/__init__.py +0 -0
  13. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_agent/_agent_linking.py +0 -0
  14. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_exceptions.py +0 -0
  15. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_ref.py +0 -0
  16. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_spec.py +0 -0
  17. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_state.py +0 -0
  18. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_tool.py +0 -0
  19. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_base/_validation.py +0 -0
  20. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_utils/_typing.py +0 -0
  21. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/_utils/_warnings.py +0 -0
  22. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/__init__.py +0 -0
  23. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_anthropic.py +0 -0
  24. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_gemini.py +0 -0
  25. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_mock.py +0 -0
  26. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_openai.py +0 -0
  27. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_openaiv1.py +0 -0
  28. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/llm/_provider.py +0 -0
  29. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/logging.py +0 -0
  30. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/models/llm.py +0 -0
  31. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/models/response.py +0 -0
  32. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/models/tracing.py +0 -0
  33. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/policies/__init__.py +0 -0
  34. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/policies/_events.py +0 -0
  35. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/policies/_policy.py +0 -0
  36. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/__init__.py +0 -0
  37. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/_basic.py +0 -0
  38. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/_langfuse.py +0 -0
  39. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/tracing/_tracer.py +0 -0
  40. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic/updates.py +0 -0
  41. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/SOURCES.txt +0 -0
  42. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/dependency_links.txt +0 -0
  43. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/requires.txt +0 -0
  44. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/pyagentic_core.egg-info/top_level.txt +0 -0
  45. {pyagentic_core-2.0.1a2 → pyagentic_core-2.0.3a1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyagentic-core
3
- Version: 2.0.1a2
3
+ Version: 2.0.3a1
4
4
  Summary: Build LLM Agents in a Pythonic way
5
5
  Author-email: Ryan Mikulec <rmikulec.dev@gmail.com>
6
6
  License: MIT
@@ -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
- @classmethod
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(cls.__call__)
678
+ @wraps(self.__call__)
681
679
  async def _invoke(self, *args, **kwargs):
682
- return await cls.__call__(self, *args, **kwargs)
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(desc)(_invoke).__tool_def__
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(default_factory=lambda: Template(source="{{ user_message }}"))
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="read")
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
 
@@ -372,6 +372,7 @@ class AgentMeta(type):
372
372
  self.state = self.__state_class__(
373
373
  instructions=self.__system_message__,
374
374
  input_template=self.__input_template__,
375
+ description_template=self.__description__,
375
376
  **compiled,
376
377
  )
377
378
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyagentic-core
3
- Version: 2.0.1a2
3
+ Version: 2.0.3a1
4
4
  Summary: Build LLM Agents in a Pythonic way
5
5
  Author-email: Ryan Mikulec <rmikulec.dev@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyagentic-core"
3
- version = "2.0.1-a.2"
3
+ version = "2.0.3-a.1"
4
4
  description = "Build LLM Agents in a Pythonic way"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"