agentx-python 0.5.1__py3-none-any.whl → 0.5.2__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.
@@ -75,6 +75,9 @@ class AgentXADKPlugin(BasePlugin):
75
75
  self._session_id = session_id
76
76
  # invocation_id → accumulated run state
77
77
  self._runs: Dict[str, Dict[str, Any]] = {}
78
+ # invocation_id → pre-buffered user input text
79
+ # (on_user_message_callback fires *before* before_run_callback)
80
+ self._pending_inputs: Dict[str, str] = {}
78
81
  # id(tool_context) → start time float
79
82
  self._tool_starts: Dict[int, float] = {}
80
83
 
@@ -82,30 +85,29 @@ class AgentXADKPlugin(BasePlugin):
82
85
  # Run lifecycle
83
86
  # ------------------------------------------------------------------
84
87
 
88
+ async def on_user_message_callback(
89
+ self, *, invocation_context: Any, user_message: Any
90
+ ) -> None:
91
+ # Called *before* before_run_callback, so self._runs doesn't exist yet.
92
+ # Buffer the input and consume it in before_run_callback.
93
+ inv_id = invocation_context.invocation_id
94
+ text = _content_to_text(user_message)
95
+ if text:
96
+ self._pending_inputs[inv_id] = text
97
+
85
98
  async def before_run_callback(self, *, invocation_context: Any) -> None:
86
99
  inv_id = invocation_context.invocation_id
87
100
  agent_name = getattr(invocation_context.agent, "name", None) or self._agent_name
88
101
  self._runs[inv_id] = {
89
102
  "start": time.time(),
90
103
  "name": agent_name,
91
- "input": None,
104
+ "input": self._pending_inputs.pop(inv_id, None),
92
105
  "output": None,
93
106
  "model": None,
94
107
  "tool_calls": [],
95
108
  "error": None,
96
109
  }
97
110
 
98
- async def on_user_message_callback(
99
- self, *, invocation_context: Any, user_message: Any
100
- ) -> None:
101
- inv_id = invocation_context.invocation_id
102
- state = self._runs.get(inv_id)
103
- if state is None:
104
- return
105
- text = _content_to_text(user_message)
106
- if text and state["input"] is None:
107
- state["input"] = text
108
-
109
111
  async def after_run_callback(self, *, invocation_context: Any) -> None:
110
112
  inv_id = invocation_context.invocation_id
111
113
  state = self._runs.pop(inv_id, None)
agentx/version.py CHANGED
@@ -1 +1 @@
1
- VERSION = "0.5.1"
1
+ VERSION = "0.5.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentx-python
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Official Python SDK for AgentX (https://www.agentx.so/)
5
5
  Home-page: https://github.com/AgentX-ai/AgentX-python
6
6
  Author: Robin Wang and AgentX Team
@@ -2,7 +2,7 @@ agentx/__init__.py,sha256=4iMiGLNU4S-I-WyX0Z7l0BFUY_krVJ3seMQPqyO-ReA,602
2
2
  agentx/agentx.py,sha256=tw3CUnkvTM1eopoO7u8TgKnAz9t0HNSxrVcjIJsytAg,3469
3
3
  agentx/exceptions.py,sha256=TKooc1_pQ2P_4DqpLfZx_ap-6cfrjFLW8JS2qaGx_1M,1237
4
4
  agentx/util.py,sha256=yOV3VVdc0KUbw5pEkSRiO2lZzEtL1vOsnB_f5tFk948,665
5
- agentx/version.py,sha256=Rm_tMXSiQe1ocDOCUKKIk-I7ZEL21NXSJBaSKX1ooCs,18
5
+ agentx/version.py,sha256=H_2wzkwt5P7u9zKSCOnQry4NWS9DJ3fCbX50CHsFMtA,18
6
6
  agentx/evaluations/__init__.py,sha256=OmdCHiBO3Qcsck0UkOyVqSvfRs6nXbSi-2FXzyRfsog,89
7
7
  agentx/evaluations/_term.py,sha256=S4blZgH66wHvkt2hR29h8JE5xnakBeD7dlZdUW9Wfoo,2065
8
8
  agentx/evaluations/client.py,sha256=3mC0uSBRk9uO4F3a7kIMM_UUsyypF99_97E5MSpYFzM,7736
@@ -20,7 +20,7 @@ agentx/evaluations/adapters/raw.py,sha256=FkDq_mdf21-xt5EHnGyIGcS6VZxkEkFcmM9VTd
20
20
  agentx/integrations/__init__.py,sha256=xpgFqfqdMqXSdCSucQoPRaewj9w5upSmkcaQtBKrtRE,545
21
21
  agentx/integrations/anthropic.py,sha256=VzRdeICYm_zfgNBy6PEu6bYSUa9iKuSoRX6HSivWQpM,4802
22
22
  agentx/integrations/crewai.py,sha256=o7tgFE1I2T7fxOc2lG7aY1nAAwihejV3y-EJII6z1j0,3488
23
- agentx/integrations/google_adk.py,sha256=270HRdOuHo_4AWULoN0oyJ9XlrBKTeb4Ipjk5EZxzrY,6938
23
+ agentx/integrations/google_adk.py,sha256=ydpor3DAdGN1LbaWsZHL_f-L48mJ3s7ckfgQLxHXnEo,7200
24
24
  agentx/integrations/google_genai.py,sha256=fNKyoqegBYhxAeADYuRaI5K6-p1h6ntAdpBaNhFziQQ,5147
25
25
  agentx/integrations/langchain.py,sha256=hSy2aRi0QzVo0eDpIRRacZg7ulJG-XqY_tH7C5YvNd0,12848
26
26
  agentx/integrations/openai_agents.py,sha256=JscJELxs8sTj3toi9ixY5TOpH-lCVBtpgxYgahIaezE,8162
@@ -32,8 +32,8 @@ agentx/tracing/__init__.py,sha256=l2mIRILE-wWrCD0fekgrIOQUEvtDObzdrkgpQUtXroU,40
32
32
  agentx/tracing/ci_types.py,sha256=zFVcZGvc1qbVDdOlEPQ1i5R6terqJHxCzFF4ZjouxxI,1423
33
33
  agentx/tracing/ingest_client.py,sha256=8aLabvWecgZsn0pkajZkI1it2TOk5boP0kC3o6TO52o,11487
34
34
  agentx/tracing/tracer.py,sha256=nJILoeQg6HV4SR05xJPy6EiSiZCpkp4yFBTrN1BO_1w,16951
35
- agentx_python-0.5.1.dist-info/licenses/LICENSE,sha256=6ZbiPNFmv3xBb44LGhAa3PZYK0ROAztsd5LRFZDlGFE,1074
36
- agentx_python-0.5.1.dist-info/METADATA,sha256=gq6txrb4Xjdar5TAzk-aHMiON2zM-i7CA4njI8UFLK8,6901
37
- agentx_python-0.5.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
38
- agentx_python-0.5.1.dist-info/top_level.txt,sha256=s-q-HB9Gb_QdrZNacSeQyF_c25gQooMy7DlxzgLOHPk,7
39
- agentx_python-0.5.1.dist-info/RECORD,,
35
+ agentx_python-0.5.2.dist-info/licenses/LICENSE,sha256=6ZbiPNFmv3xBb44LGhAa3PZYK0ROAztsd5LRFZDlGFE,1074
36
+ agentx_python-0.5.2.dist-info/METADATA,sha256=hgVDJgwMhUSMtriS7IkHO-F7-G97r1sAse6ztHH6b4k,6901
37
+ agentx_python-0.5.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
38
+ agentx_python-0.5.2.dist-info/top_level.txt,sha256=s-q-HB9Gb_QdrZNacSeQyF_c25gQooMy7DlxzgLOHPk,7
39
+ agentx_python-0.5.2.dist-info/RECORD,,