agentx-python 0.4.12__py3-none-any.whl → 0.4.13__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.
- agentx/agentx.py +4 -1
- agentx/tracing/ingest_client.py +13 -4
- agentx/version.py +1 -1
- {agentx_python-0.4.12.dist-info → agentx_python-0.4.13.dist-info}/METADATA +2 -3
- {agentx_python-0.4.12.dist-info → agentx_python-0.4.13.dist-info}/RECORD +8 -8
- {agentx_python-0.4.12.dist-info → agentx_python-0.4.13.dist-info}/WHEEL +0 -0
- {agentx_python-0.4.12.dist-info → agentx_python-0.4.13.dist-info}/licenses/LICENSE +0 -0
- {agentx_python-0.4.12.dist-info → agentx_python-0.4.13.dist-info}/top_level.txt +0 -0
agentx/agentx.py
CHANGED
|
@@ -10,7 +10,7 @@ from agentx.resources.workforce import Workforce
|
|
|
10
10
|
|
|
11
11
|
class AgentX:
|
|
12
12
|
|
|
13
|
-
def __init__(self, api_key: str = None, base_url: str = None):
|
|
13
|
+
def __init__(self, api_key: str = None, base_url: str = None, workspace_id: str = None):
|
|
14
14
|
self.api_key = api_key or os.getenv("AGENTX_API_KEY")
|
|
15
15
|
if self.api_key and not os.getenv("AGENTX_API_KEY"):
|
|
16
16
|
os.environ["AGENTX_API_KEY"] = self.api_key
|
|
@@ -20,6 +20,8 @@ class AgentX:
|
|
|
20
20
|
if self.base_url:
|
|
21
21
|
os.environ["AGENTX_API_BASE_URL"] = self.base_url
|
|
22
22
|
|
|
23
|
+
self.workspace_id = workspace_id or os.getenv("AGENTX_WORKSPACE_ID")
|
|
24
|
+
|
|
23
25
|
from agentx.evaluations.client import EvaluationsClient
|
|
24
26
|
from agentx.evaluations.runner import EvaluationsRunner
|
|
25
27
|
from agentx.tracing.ingest_client import IngestClient
|
|
@@ -37,6 +39,7 @@ class AgentX:
|
|
|
37
39
|
api_key=self.api_key,
|
|
38
40
|
sdk_version=VERSION,
|
|
39
41
|
base_url=self.base_url,
|
|
42
|
+
workspace_id=self.workspace_id,
|
|
40
43
|
)
|
|
41
44
|
self.tracer = Tracer(_ingest_client)
|
|
42
45
|
|
agentx/tracing/ingest_client.py
CHANGED
|
@@ -41,10 +41,13 @@ class IngestClient:
|
|
|
41
41
|
api_key: str,
|
|
42
42
|
sdk_version: str = "unknown",
|
|
43
43
|
base_url: Optional[str] = None,
|
|
44
|
+
workspace_id: Optional[str] = None,
|
|
44
45
|
) -> None:
|
|
45
46
|
if not api_key:
|
|
46
47
|
raise ValueError("AGENTX_API_KEY is required")
|
|
47
48
|
|
|
49
|
+
self._workspace_id = workspace_id or os.getenv("AGENTX_WORKSPACE_ID")
|
|
50
|
+
|
|
48
51
|
self._api_key = api_key
|
|
49
52
|
self._sdk_version = sdk_version
|
|
50
53
|
|
|
@@ -76,6 +79,8 @@ class IngestClient:
|
|
|
76
79
|
|
|
77
80
|
def enqueue(self, payload: Dict[str, Any]) -> None:
|
|
78
81
|
"""Add a trace payload to the send queue. Never blocks; drops silently on overflow."""
|
|
82
|
+
if self._workspace_id:
|
|
83
|
+
payload = {**payload, "workspaceId": self._workspace_id}
|
|
79
84
|
try:
|
|
80
85
|
self._queue.put_nowait(payload)
|
|
81
86
|
except queue.Full:
|
|
@@ -105,6 +110,8 @@ class IngestClient:
|
|
|
105
110
|
payload: Dict[str, Any] = {"datasetId": dataset_id}
|
|
106
111
|
if question_index is not None:
|
|
107
112
|
payload["question_index"] = question_index
|
|
113
|
+
if self._workspace_id:
|
|
114
|
+
payload["workspaceId"] = self._workspace_id
|
|
108
115
|
|
|
109
116
|
resp = self._session.post(url, json=payload, timeout=60)
|
|
110
117
|
resp.raise_for_status()
|
|
@@ -131,8 +138,9 @@ class IngestClient:
|
|
|
131
138
|
payload["pass_rate_threshold"] = pass_rate_threshold
|
|
132
139
|
if git_context:
|
|
133
140
|
payload["git_context"] = git_context
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
resolved_workspace = workspace_id or self._workspace_id
|
|
142
|
+
if resolved_workspace:
|
|
143
|
+
payload["workspaceId"] = resolved_workspace
|
|
136
144
|
|
|
137
145
|
url = f"{self._base_url}/ingest/ci-runs"
|
|
138
146
|
resp = self._session.post(url, json=payload, timeout=30)
|
|
@@ -212,8 +220,9 @@ class IngestClient:
|
|
|
212
220
|
) -> Dict[str, Any]:
|
|
213
221
|
"""Fetch test case queries for a dataset without creating a CI run."""
|
|
214
222
|
params: Dict[str, str] = {}
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
resolved_workspace = workspace_id or self._workspace_id
|
|
224
|
+
if resolved_workspace:
|
|
225
|
+
params["workspaceId"] = resolved_workspace
|
|
217
226
|
url = f"{self._base_url}/ingest/datasets/{dataset_id}/test-cases"
|
|
218
227
|
resp = self._session.get(url, params=params, timeout=15)
|
|
219
228
|
self._raise_for_ci_status(resp)
|
agentx/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = "0.4.
|
|
1
|
+
VERSION = "0.4.13"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentx-python
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.13
|
|
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
|
|
@@ -14,8 +14,7 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: urllib3>=1.26.11
|
|
15
15
|
Requires-Dist: certifi
|
|
16
16
|
Requires-Dist: requests
|
|
17
|
-
Requires-Dist: pydantic
|
|
18
|
-
Requires-Dist: pydantic_core
|
|
17
|
+
Requires-Dist: pydantic>=2.0.0
|
|
19
18
|
Provides-Extra: langchain
|
|
20
19
|
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
|
|
21
20
|
Provides-Extra: crewai
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
agentx/__init__.py,sha256=4iMiGLNU4S-I-WyX0Z7l0BFUY_krVJ3seMQPqyO-ReA,602
|
|
2
|
-
agentx/agentx.py,sha256=
|
|
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=
|
|
5
|
+
agentx/version.py,sha256=dO83YWKEtJW3A7sv1BcvYqTJgQZCIf7sMXiONZFOY_Q,19
|
|
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
|
|
@@ -28,10 +28,10 @@ agentx/resources/conversation.py,sha256=HK7gEGK6qIUz0KvG-ItUip08otWZdkP5S6qHiznv
|
|
|
28
28
|
agentx/resources/workforce.py,sha256=lfGVkoV9lcOp-lZScjTvwRarJMkhzfMfLm4syJDujGc,4168
|
|
29
29
|
agentx/tracing/__init__.py,sha256=l2mIRILE-wWrCD0fekgrIOQUEvtDObzdrkgpQUtXroU,408
|
|
30
30
|
agentx/tracing/ci_types.py,sha256=zFVcZGvc1qbVDdOlEPQ1i5R6terqJHxCzFF4ZjouxxI,1423
|
|
31
|
-
agentx/tracing/ingest_client.py,sha256=
|
|
31
|
+
agentx/tracing/ingest_client.py,sha256=8aLabvWecgZsn0pkajZkI1it2TOk5boP0kC3o6TO52o,11487
|
|
32
32
|
agentx/tracing/tracer.py,sha256=nJILoeQg6HV4SR05xJPy6EiSiZCpkp4yFBTrN1BO_1w,16951
|
|
33
|
-
agentx_python-0.4.
|
|
34
|
-
agentx_python-0.4.
|
|
35
|
-
agentx_python-0.4.
|
|
36
|
-
agentx_python-0.4.
|
|
37
|
-
agentx_python-0.4.
|
|
33
|
+
agentx_python-0.4.13.dist-info/licenses/LICENSE,sha256=6ZbiPNFmv3xBb44LGhAa3PZYK0ROAztsd5LRFZDlGFE,1074
|
|
34
|
+
agentx_python-0.4.13.dist-info/METADATA,sha256=nDiVYt09aeyL89w3-ro9WfjsD7abgG0DdyujwsOdC5Q,6630
|
|
35
|
+
agentx_python-0.4.13.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
36
|
+
agentx_python-0.4.13.dist-info/top_level.txt,sha256=s-q-HB9Gb_QdrZNacSeQyF_c25gQooMy7DlxzgLOHPk,7
|
|
37
|
+
agentx_python-0.4.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|