agentx-python 0.6.3__tar.gz → 0.6.4__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.
- {agentx_python-0.6.3/agentx_python.egg-info → agentx_python-0.6.4}/PKG-INFO +63 -4
- {agentx_python-0.6.3 → agentx_python-0.6.4}/README.md +62 -3
- agentx_python-0.6.4/agentx/version.py +1 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4/agentx_python.egg-info}/PKG-INFO +63 -4
- agentx_python-0.6.3/agentx/version.py +0 -1
- {agentx_python-0.6.3 → agentx_python-0.6.4}/LICENSE +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/__init__.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/agentx.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/__init__.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/_term.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/adapters/__init__.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/adapters/http_endpoint.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/adapters/precomputed.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/adapters/raw.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/client.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/datasets.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/models.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/redaction.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/reporting.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/results.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/runner.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/evaluations/tracing.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/exceptions.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/__init__.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/_perf.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/anthropic.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/crewai.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/google_adk.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/google_genai.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/langchain.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/integrations/openai_agents.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/resources/__init__.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/resources/agent.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/resources/conversation.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/resources/workforce.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/tracing/__init__.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/tracing/ci_types.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/tracing/ingest_client.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/tracing/tracer.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx/util.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx_python.egg-info/SOURCES.txt +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx_python.egg-info/dependency_links.txt +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx_python.egg-info/requires.txt +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/agentx_python.egg-info/top_level.txt +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/setup.cfg +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/setup.py +0 -0
- {agentx_python-0.6.3 → agentx_python-0.6.4}/tests/test_integration.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentx-python
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
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
|
|
@@ -49,8 +49,12 @@ Dynamic: summary
|
|
|
49
49
|

|
|
50
50
|
|
|
51
51
|
[](https://pypi.org/project/agentx-python/)
|
|
52
|
+
[](https://pypi.org/project/agentx-python/)
|
|
53
|
+
[](LICENSE)
|
|
52
54
|
|
|
53
|
-
The official Python SDK for **[AgentX](https://
|
|
55
|
+
The official Python SDK for **[AgentX](https://app.agentx.so/)** — build, chat with, orchestrate, and trace AI agents in a few lines of code.
|
|
56
|
+
|
|
57
|
+
Also see [SDK Developer Docs](https://developers.agentx.so), [API Reference Docs](https://docs.agentx.so/reference)
|
|
54
58
|
|
|
55
59
|
---
|
|
56
60
|
|
|
@@ -64,8 +68,9 @@ The official Python SDK for **[AgentX](https://www.agentx.so/)** — build, chat
|
|
|
64
68
|
- [List agents](#list-agents)
|
|
65
69
|
- [Start a conversation](#start-a-conversation)
|
|
66
70
|
- [Chat (streaming and non-streaming)](#chat-streaming-and-non-streaming)
|
|
67
|
-
- [Workforce (multi-agent orchestration)](#workforce-multi-agent-orchestration)
|
|
68
|
-
- [
|
|
71
|
+
- [Workforce (multi-agent orchestration)](#workforce-multi-agent-orchestration) — teams of agents with a designated manager
|
|
72
|
+
- [Production tracing](#production-tracing) — record live agent runs from any framework
|
|
73
|
+
- [Custom agent evaluations](#custom-agent-evaluations) — LLM-as-a-judge, cosine / Jaccard similarity
|
|
69
74
|
- [Links](#links)
|
|
70
75
|
|
|
71
76
|
---
|
|
@@ -78,6 +83,7 @@ The official Python SDK for **[AgentX](https://www.agentx.so/)** — build, chat
|
|
|
78
83
|
- **Batteries included** — voice (ASR/TTS), image generation, document/CSV/Excel/OCR, RAG with built-in re-ranking.
|
|
79
84
|
- **MCP support** — connect any Model Context Protocol server.
|
|
80
85
|
- **Multi-agent orchestration** — workforces of agents with a designated manager, across LLM vendors.
|
|
86
|
+
- **Production tracing** — one decorator or context manager records every agent run (input, output, latency, tool calls, token usage) into your workspace, for any framework.
|
|
81
87
|
- **Agent Evaluations** — score any agent (LangChain, CrewAI, OpenAI, Anthropic, HTTP, …) with LLM-as-a-judge ratings plus optional cosine and Jaccard similarity metrics.
|
|
82
88
|
- **A2A** — Each agent can be published with agent-to-agent protocol compatible.
|
|
83
89
|
|
|
@@ -187,6 +193,58 @@ for chunk in workforce.chat_stream(conversation.id, "How can you help me with th
|
|
|
187
193
|
|
|
188
194
|
---
|
|
189
195
|
|
|
196
|
+
## Production tracing
|
|
197
|
+
|
|
198
|
+
Record live agent runs into your workspace with a single decorator or context manager — no changes to your agent's logic. Traces appear in the **Live Traces** tab and can be evaluated against your test datasets with [`tracer.evaluate_trace()`](TRACING.md#tracerevaluate_trace).
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
from agentx import AgentX
|
|
202
|
+
|
|
203
|
+
client = AgentX.from_env()
|
|
204
|
+
tracer = client.tracer
|
|
205
|
+
|
|
206
|
+
@tracer.trace("customer-support-agent", framework="langchain", model="gpt-4o")
|
|
207
|
+
def handle_query(query: str) -> str:
|
|
208
|
+
return chain.invoke(query)
|
|
209
|
+
|
|
210
|
+
# Every call is automatically traced: input, output, latency, tool calls, token usage
|
|
211
|
+
handle_query("How do I reset my password?")
|
|
212
|
+
tracer.flush(timeout=10) # ensure delivery before the process exits
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Prefer full control over what gets captured? Use the context manager instead:
|
|
216
|
+
|
|
217
|
+
```python
|
|
218
|
+
with tracer.trace("rag-agent", framework="langchain") as span:
|
|
219
|
+
span.input = {"query": query, "user_id": user_id}
|
|
220
|
+
|
|
221
|
+
kb_result = search_knowledge_base(query)
|
|
222
|
+
span.add_tool_call("search_knowledge_base", input=query, output=kb_result, latency_ms=190)
|
|
223
|
+
|
|
224
|
+
span.output = llm.invoke(f"Context: {kb_result}\n\nQuery: {query}")
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Framework integrations
|
|
228
|
+
|
|
229
|
+
Each integration auto-captures LLM calls, tool calls, and token usage — install the matching extra:
|
|
230
|
+
|
|
231
|
+
| Framework | Install | Integration |
|
|
232
|
+
| --------------------- | -------------------------------------------- | ------------------------ |
|
|
233
|
+
| LangChain | `pip install "agentx-python[langchain]"` | `AgentXCallbackHandler` |
|
|
234
|
+
| CrewAI | `pip install "agentx-python[crewai]"` | `AgentXCrewObserver` |
|
|
235
|
+
| OpenAI Agents SDK | `pip install "agentx-python[openai-agents]"` | `AgentXTracingProcessor` |
|
|
236
|
+
| Anthropic | `pip install "agentx-python[anthropic]"` | `patch_anthropic_client` |
|
|
237
|
+
| Google ADK | `pip install "agentx-python[google-adk]"` | `AgentXADKPlugin` |
|
|
238
|
+
| Google GenAI (Gemini) | `pip install "agentx-python[google-genai]"` | `patch_genai_client` |
|
|
239
|
+
|
|
240
|
+
Or plain Python — wrap any function with `@tracer.trace(...)` and it just works, no framework required.
|
|
241
|
+
|
|
242
|
+
Running specialist agents in parallel with a `ThreadPoolExecutor`? Wrap each worker body in `tracer.use_span(span)` so their steps land on the parent trace instead of becoming independent traces — see [TRACING.md](TRACING.md) for the full pattern.
|
|
243
|
+
|
|
244
|
+
See **[TRACING.md](TRACING.md)** for the complete guide — session grouping, error handling, async support, and the full API reference.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
190
248
|
## Custom agent evaluations
|
|
191
249
|
|
|
192
250
|
Evaluate **any** AI agent — LangChain, CrewAI, AutoGen, LlamaIndex, OpenAI, Anthropic, HTTP endpoints, or plain Python — using AgentX as the scoring and reporting backend. Includes optional **cosine** and **Jaccard** similarity metrics alongside LLM-graded ratings.
|
|
@@ -214,4 +272,5 @@ See **[EVALUATIONS.md](EVALUATIONS.md)** for the full guide — dataset builder,
|
|
|
214
272
|
- **Dashboard** — [app.agentx.so](https://app.agentx.so)
|
|
215
273
|
- **Website** — [agentx.so](https://www.agentx.so/)
|
|
216
274
|
- **PyPI** — [agentx-python](https://pypi.org/project/agentx-python/)
|
|
275
|
+
- **Tracing docs** — [TRACING.md](TRACING.md)
|
|
217
276
|
- **Evaluations docs** — [EVALUATIONS.md](EVALUATIONS.md)
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/agentx-python/)
|
|
4
|
+
[](https://pypi.org/project/agentx-python/)
|
|
5
|
+
[](LICENSE)
|
|
4
6
|
|
|
5
|
-
The official Python SDK for **[AgentX](https://
|
|
7
|
+
The official Python SDK for **[AgentX](https://app.agentx.so/)** — build, chat with, orchestrate, and trace AI agents in a few lines of code.
|
|
8
|
+
|
|
9
|
+
Also see [SDK Developer Docs](https://developers.agentx.so), [API Reference Docs](https://docs.agentx.so/reference)
|
|
6
10
|
|
|
7
11
|
---
|
|
8
12
|
|
|
@@ -16,8 +20,9 @@ The official Python SDK for **[AgentX](https://www.agentx.so/)** — build, chat
|
|
|
16
20
|
- [List agents](#list-agents)
|
|
17
21
|
- [Start a conversation](#start-a-conversation)
|
|
18
22
|
- [Chat (streaming and non-streaming)](#chat-streaming-and-non-streaming)
|
|
19
|
-
- [Workforce (multi-agent orchestration)](#workforce-multi-agent-orchestration)
|
|
20
|
-
- [
|
|
23
|
+
- [Workforce (multi-agent orchestration)](#workforce-multi-agent-orchestration) — teams of agents with a designated manager
|
|
24
|
+
- [Production tracing](#production-tracing) — record live agent runs from any framework
|
|
25
|
+
- [Custom agent evaluations](#custom-agent-evaluations) — LLM-as-a-judge, cosine / Jaccard similarity
|
|
21
26
|
- [Links](#links)
|
|
22
27
|
|
|
23
28
|
---
|
|
@@ -30,6 +35,7 @@ The official Python SDK for **[AgentX](https://www.agentx.so/)** — build, chat
|
|
|
30
35
|
- **Batteries included** — voice (ASR/TTS), image generation, document/CSV/Excel/OCR, RAG with built-in re-ranking.
|
|
31
36
|
- **MCP support** — connect any Model Context Protocol server.
|
|
32
37
|
- **Multi-agent orchestration** — workforces of agents with a designated manager, across LLM vendors.
|
|
38
|
+
- **Production tracing** — one decorator or context manager records every agent run (input, output, latency, tool calls, token usage) into your workspace, for any framework.
|
|
33
39
|
- **Agent Evaluations** — score any agent (LangChain, CrewAI, OpenAI, Anthropic, HTTP, …) with LLM-as-a-judge ratings plus optional cosine and Jaccard similarity metrics.
|
|
34
40
|
- **A2A** — Each agent can be published with agent-to-agent protocol compatible.
|
|
35
41
|
|
|
@@ -139,6 +145,58 @@ for chunk in workforce.chat_stream(conversation.id, "How can you help me with th
|
|
|
139
145
|
|
|
140
146
|
---
|
|
141
147
|
|
|
148
|
+
## Production tracing
|
|
149
|
+
|
|
150
|
+
Record live agent runs into your workspace with a single decorator or context manager — no changes to your agent's logic. Traces appear in the **Live Traces** tab and can be evaluated against your test datasets with [`tracer.evaluate_trace()`](TRACING.md#tracerevaluate_trace).
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from agentx import AgentX
|
|
154
|
+
|
|
155
|
+
client = AgentX.from_env()
|
|
156
|
+
tracer = client.tracer
|
|
157
|
+
|
|
158
|
+
@tracer.trace("customer-support-agent", framework="langchain", model="gpt-4o")
|
|
159
|
+
def handle_query(query: str) -> str:
|
|
160
|
+
return chain.invoke(query)
|
|
161
|
+
|
|
162
|
+
# Every call is automatically traced: input, output, latency, tool calls, token usage
|
|
163
|
+
handle_query("How do I reset my password?")
|
|
164
|
+
tracer.flush(timeout=10) # ensure delivery before the process exits
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Prefer full control over what gets captured? Use the context manager instead:
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
with tracer.trace("rag-agent", framework="langchain") as span:
|
|
171
|
+
span.input = {"query": query, "user_id": user_id}
|
|
172
|
+
|
|
173
|
+
kb_result = search_knowledge_base(query)
|
|
174
|
+
span.add_tool_call("search_knowledge_base", input=query, output=kb_result, latency_ms=190)
|
|
175
|
+
|
|
176
|
+
span.output = llm.invoke(f"Context: {kb_result}\n\nQuery: {query}")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Framework integrations
|
|
180
|
+
|
|
181
|
+
Each integration auto-captures LLM calls, tool calls, and token usage — install the matching extra:
|
|
182
|
+
|
|
183
|
+
| Framework | Install | Integration |
|
|
184
|
+
| --------------------- | -------------------------------------------- | ------------------------ |
|
|
185
|
+
| LangChain | `pip install "agentx-python[langchain]"` | `AgentXCallbackHandler` |
|
|
186
|
+
| CrewAI | `pip install "agentx-python[crewai]"` | `AgentXCrewObserver` |
|
|
187
|
+
| OpenAI Agents SDK | `pip install "agentx-python[openai-agents]"` | `AgentXTracingProcessor` |
|
|
188
|
+
| Anthropic | `pip install "agentx-python[anthropic]"` | `patch_anthropic_client` |
|
|
189
|
+
| Google ADK | `pip install "agentx-python[google-adk]"` | `AgentXADKPlugin` |
|
|
190
|
+
| Google GenAI (Gemini) | `pip install "agentx-python[google-genai]"` | `patch_genai_client` |
|
|
191
|
+
|
|
192
|
+
Or plain Python — wrap any function with `@tracer.trace(...)` and it just works, no framework required.
|
|
193
|
+
|
|
194
|
+
Running specialist agents in parallel with a `ThreadPoolExecutor`? Wrap each worker body in `tracer.use_span(span)` so their steps land on the parent trace instead of becoming independent traces — see [TRACING.md](TRACING.md) for the full pattern.
|
|
195
|
+
|
|
196
|
+
See **[TRACING.md](TRACING.md)** for the complete guide — session grouping, error handling, async support, and the full API reference.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
142
200
|
## Custom agent evaluations
|
|
143
201
|
|
|
144
202
|
Evaluate **any** AI agent — LangChain, CrewAI, AutoGen, LlamaIndex, OpenAI, Anthropic, HTTP endpoints, or plain Python — using AgentX as the scoring and reporting backend. Includes optional **cosine** and **Jaccard** similarity metrics alongside LLM-graded ratings.
|
|
@@ -166,4 +224,5 @@ See **[EVALUATIONS.md](EVALUATIONS.md)** for the full guide — dataset builder,
|
|
|
166
224
|
- **Dashboard** — [app.agentx.so](https://app.agentx.so)
|
|
167
225
|
- **Website** — [agentx.so](https://www.agentx.so/)
|
|
168
226
|
- **PyPI** — [agentx-python](https://pypi.org/project/agentx-python/)
|
|
227
|
+
- **Tracing docs** — [TRACING.md](TRACING.md)
|
|
169
228
|
- **Evaluations docs** — [EVALUATIONS.md](EVALUATIONS.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "0.6.4"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentx-python
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
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
|
|
@@ -49,8 +49,12 @@ Dynamic: summary
|
|
|
49
49
|

|
|
50
50
|
|
|
51
51
|
[](https://pypi.org/project/agentx-python/)
|
|
52
|
+
[](https://pypi.org/project/agentx-python/)
|
|
53
|
+
[](LICENSE)
|
|
52
54
|
|
|
53
|
-
The official Python SDK for **[AgentX](https://
|
|
55
|
+
The official Python SDK for **[AgentX](https://app.agentx.so/)** — build, chat with, orchestrate, and trace AI agents in a few lines of code.
|
|
56
|
+
|
|
57
|
+
Also see [SDK Developer Docs](https://developers.agentx.so), [API Reference Docs](https://docs.agentx.so/reference)
|
|
54
58
|
|
|
55
59
|
---
|
|
56
60
|
|
|
@@ -64,8 +68,9 @@ The official Python SDK for **[AgentX](https://www.agentx.so/)** — build, chat
|
|
|
64
68
|
- [List agents](#list-agents)
|
|
65
69
|
- [Start a conversation](#start-a-conversation)
|
|
66
70
|
- [Chat (streaming and non-streaming)](#chat-streaming-and-non-streaming)
|
|
67
|
-
- [Workforce (multi-agent orchestration)](#workforce-multi-agent-orchestration)
|
|
68
|
-
- [
|
|
71
|
+
- [Workforce (multi-agent orchestration)](#workforce-multi-agent-orchestration) — teams of agents with a designated manager
|
|
72
|
+
- [Production tracing](#production-tracing) — record live agent runs from any framework
|
|
73
|
+
- [Custom agent evaluations](#custom-agent-evaluations) — LLM-as-a-judge, cosine / Jaccard similarity
|
|
69
74
|
- [Links](#links)
|
|
70
75
|
|
|
71
76
|
---
|
|
@@ -78,6 +83,7 @@ The official Python SDK for **[AgentX](https://www.agentx.so/)** — build, chat
|
|
|
78
83
|
- **Batteries included** — voice (ASR/TTS), image generation, document/CSV/Excel/OCR, RAG with built-in re-ranking.
|
|
79
84
|
- **MCP support** — connect any Model Context Protocol server.
|
|
80
85
|
- **Multi-agent orchestration** — workforces of agents with a designated manager, across LLM vendors.
|
|
86
|
+
- **Production tracing** — one decorator or context manager records every agent run (input, output, latency, tool calls, token usage) into your workspace, for any framework.
|
|
81
87
|
- **Agent Evaluations** — score any agent (LangChain, CrewAI, OpenAI, Anthropic, HTTP, …) with LLM-as-a-judge ratings plus optional cosine and Jaccard similarity metrics.
|
|
82
88
|
- **A2A** — Each agent can be published with agent-to-agent protocol compatible.
|
|
83
89
|
|
|
@@ -187,6 +193,58 @@ for chunk in workforce.chat_stream(conversation.id, "How can you help me with th
|
|
|
187
193
|
|
|
188
194
|
---
|
|
189
195
|
|
|
196
|
+
## Production tracing
|
|
197
|
+
|
|
198
|
+
Record live agent runs into your workspace with a single decorator or context manager — no changes to your agent's logic. Traces appear in the **Live Traces** tab and can be evaluated against your test datasets with [`tracer.evaluate_trace()`](TRACING.md#tracerevaluate_trace).
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
from agentx import AgentX
|
|
202
|
+
|
|
203
|
+
client = AgentX.from_env()
|
|
204
|
+
tracer = client.tracer
|
|
205
|
+
|
|
206
|
+
@tracer.trace("customer-support-agent", framework="langchain", model="gpt-4o")
|
|
207
|
+
def handle_query(query: str) -> str:
|
|
208
|
+
return chain.invoke(query)
|
|
209
|
+
|
|
210
|
+
# Every call is automatically traced: input, output, latency, tool calls, token usage
|
|
211
|
+
handle_query("How do I reset my password?")
|
|
212
|
+
tracer.flush(timeout=10) # ensure delivery before the process exits
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Prefer full control over what gets captured? Use the context manager instead:
|
|
216
|
+
|
|
217
|
+
```python
|
|
218
|
+
with tracer.trace("rag-agent", framework="langchain") as span:
|
|
219
|
+
span.input = {"query": query, "user_id": user_id}
|
|
220
|
+
|
|
221
|
+
kb_result = search_knowledge_base(query)
|
|
222
|
+
span.add_tool_call("search_knowledge_base", input=query, output=kb_result, latency_ms=190)
|
|
223
|
+
|
|
224
|
+
span.output = llm.invoke(f"Context: {kb_result}\n\nQuery: {query}")
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Framework integrations
|
|
228
|
+
|
|
229
|
+
Each integration auto-captures LLM calls, tool calls, and token usage — install the matching extra:
|
|
230
|
+
|
|
231
|
+
| Framework | Install | Integration |
|
|
232
|
+
| --------------------- | -------------------------------------------- | ------------------------ |
|
|
233
|
+
| LangChain | `pip install "agentx-python[langchain]"` | `AgentXCallbackHandler` |
|
|
234
|
+
| CrewAI | `pip install "agentx-python[crewai]"` | `AgentXCrewObserver` |
|
|
235
|
+
| OpenAI Agents SDK | `pip install "agentx-python[openai-agents]"` | `AgentXTracingProcessor` |
|
|
236
|
+
| Anthropic | `pip install "agentx-python[anthropic]"` | `patch_anthropic_client` |
|
|
237
|
+
| Google ADK | `pip install "agentx-python[google-adk]"` | `AgentXADKPlugin` |
|
|
238
|
+
| Google GenAI (Gemini) | `pip install "agentx-python[google-genai]"` | `patch_genai_client` |
|
|
239
|
+
|
|
240
|
+
Or plain Python — wrap any function with `@tracer.trace(...)` and it just works, no framework required.
|
|
241
|
+
|
|
242
|
+
Running specialist agents in parallel with a `ThreadPoolExecutor`? Wrap each worker body in `tracer.use_span(span)` so their steps land on the parent trace instead of becoming independent traces — see [TRACING.md](TRACING.md) for the full pattern.
|
|
243
|
+
|
|
244
|
+
See **[TRACING.md](TRACING.md)** for the complete guide — session grouping, error handling, async support, and the full API reference.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
190
248
|
## Custom agent evaluations
|
|
191
249
|
|
|
192
250
|
Evaluate **any** AI agent — LangChain, CrewAI, AutoGen, LlamaIndex, OpenAI, Anthropic, HTTP endpoints, or plain Python — using AgentX as the scoring and reporting backend. Includes optional **cosine** and **Jaccard** similarity metrics alongside LLM-graded ratings.
|
|
@@ -214,4 +272,5 @@ See **[EVALUATIONS.md](EVALUATIONS.md)** for the full guide — dataset builder,
|
|
|
214
272
|
- **Dashboard** — [app.agentx.so](https://app.agentx.so)
|
|
215
273
|
- **Website** — [agentx.so](https://www.agentx.so/)
|
|
216
274
|
- **PyPI** — [agentx-python](https://pypi.org/project/agentx-python/)
|
|
275
|
+
- **Tracing docs** — [TRACING.md](TRACING.md)
|
|
217
276
|
- **Evaluations docs** — [EVALUATIONS.md](EVALUATIONS.md)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "0.6.3"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|