calibrate-python-sdk 0.0.1__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.
- calibrate_python_sdk-0.0.1/LICENSE +21 -0
- calibrate_python_sdk-0.0.1/PKG-INFO +55 -0
- calibrate_python_sdk-0.0.1/README.md +21 -0
- calibrate_python_sdk-0.0.1/pyproject.toml +98 -0
- calibrate_python_sdk-0.0.1/src/artpark/__init__.py +109 -0
- calibrate_python_sdk-0.0.1/src/artpark/_default_clients.py +32 -0
- calibrate_python_sdk-0.0.1/src/artpark/agent_tests/__init__.py +4 -0
- calibrate_python_sdk-0.0.1/src/artpark/agent_tests/client.py +356 -0
- calibrate_python_sdk-0.0.1/src/artpark/agent_tests/raw_client.py +455 -0
- calibrate_python_sdk-0.0.1/src/artpark/agents/__init__.py +4 -0
- calibrate_python_sdk-0.0.1/src/artpark/agents/client.py +210 -0
- calibrate_python_sdk-0.0.1/src/artpark/agents/raw_client.py +273 -0
- calibrate_python_sdk-0.0.1/src/artpark/client.py +268 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/__init__.py +127 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/api_error.py +23 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/client_wrapper.py +163 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/datetime_utils.py +70 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/file.py +67 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/force_multipart.py +18 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_client.py +843 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_response.py +59 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_sse/__init__.py +42 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_sse/_api.py +180 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_sse/_decoders.py +61 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_sse/_exceptions.py +7 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/http_sse/_models.py +17 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/jsonable_encoder.py +120 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/logging.py +107 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/parse_error.py +36 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/pydantic_utilities.py +508 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/query_encoder.py +58 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/remove_none_from_dict.py +11 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/request_options.py +37 -0
- calibrate_python_sdk-0.0.1/src/artpark/core/serialization.py +347 -0
- calibrate_python_sdk-0.0.1/src/artpark/environment.py +7 -0
- calibrate_python_sdk-0.0.1/src/artpark/errors/__init__.py +34 -0
- calibrate_python_sdk-0.0.1/src/artpark/errors/unprocessable_entity_error.py +11 -0
- calibrate_python_sdk-0.0.1/src/artpark/py.typed +0 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/__init__.py +83 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/batch_run_request.py +19 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/batch_test_run.py +22 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/batch_test_run_response.py +22 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/batch_test_skip.py +21 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/http_validation_error.py +20 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/judge_result.py +51 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/resolve_agent_names_response.py +20 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/routers_agent_tests_agent_response.py +27 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/routers_agent_tests_agent_response_type.py +5 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/task_create_response.py +22 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/test_case_result.py +33 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/test_output.py +21 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/test_run_status_response.py +37 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/tool_call_output.py +21 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/validation_error.py +22 -0
- calibrate_python_sdk-0.0.1/src/artpark/types/validation_error_loc_item.py +5 -0
- calibrate_python_sdk-0.0.1/src/artpark/version.py +3 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Artpark.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: calibrate-python-sdk
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary:
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10,<4.0
|
|
7
|
+
Classifier: Intended Audience :: Developers
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: MacOS
|
|
10
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Operating System :: POSIX
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Provides-Extra: aiohttp
|
|
25
|
+
Requires-Dist: aiohttp (>=3.14.1,<4) ; (python_version >= "3.10") and (extra == "aiohttp")
|
|
26
|
+
Requires-Dist: httpx (>=0.21.2)
|
|
27
|
+
Requires-Dist: httpx-aiohttp (==0.1.8) ; (python_version >= "3.10") and (extra == "aiohttp")
|
|
28
|
+
Requires-Dist: pydantic (>=1.9.2)
|
|
29
|
+
Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
|
|
30
|
+
Requires-Dist: typing_extensions (>=4.0.0)
|
|
31
|
+
Project-URL: Repository, https://github.com/dalmia/calibrate-python-sdk
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Calibrate Python SDK
|
|
35
|
+
|
|
36
|
+
Python client for the [Calibrate](https://pense-backend.artpark.ai) API.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
pip install calibrate-python-sdk
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from calibrate_python_sdk import Calibrate
|
|
48
|
+
|
|
49
|
+
client = Calibrate(token="sk_your_api_key")
|
|
50
|
+
|
|
51
|
+
agents = client.agents.list()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This SDK is generated from Calibrate's public API with [Fern](https://buildwithfern.com).
|
|
55
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Calibrate Python SDK
|
|
2
|
+
|
|
3
|
+
Python client for the [Calibrate](https://pense-backend.artpark.ai) API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install calibrate-python-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from calibrate_python_sdk import Calibrate
|
|
15
|
+
|
|
16
|
+
client = Calibrate(token="sk_your_api_key")
|
|
17
|
+
|
|
18
|
+
agents = client.agents.list()
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This SDK is generated from Calibrate's public API with [Fern](https://buildwithfern.com).
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "calibrate-python-sdk"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
|
|
5
|
+
[tool.poetry]
|
|
6
|
+
name = "calibrate-python-sdk"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = ""
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = []
|
|
11
|
+
keywords = []
|
|
12
|
+
license = "MIT"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"Programming Language :: Python",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"Programming Language :: Python :: 3.15",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
"Operating System :: POSIX",
|
|
25
|
+
"Operating System :: MacOS",
|
|
26
|
+
"Operating System :: POSIX :: Linux",
|
|
27
|
+
"Operating System :: Microsoft :: Windows",
|
|
28
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
29
|
+
"Typing :: Typed",
|
|
30
|
+
"License :: OSI Approved :: MIT License"
|
|
31
|
+
]
|
|
32
|
+
packages = [
|
|
33
|
+
{ include = "artpark", from = "src"}
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[tool.poetry.urls]
|
|
37
|
+
Repository = 'https://github.com/dalmia/calibrate-python-sdk'
|
|
38
|
+
|
|
39
|
+
[tool.poetry.dependencies]
|
|
40
|
+
python = "^3.10"
|
|
41
|
+
aiohttp = { version = ">=3.14.1,<4", optional = true, python = ">=3.10"}
|
|
42
|
+
httpx = ">=0.21.2"
|
|
43
|
+
httpx-aiohttp = { version = "0.1.8", optional = true, python = ">=3.10"}
|
|
44
|
+
pydantic = ">= 1.9.2"
|
|
45
|
+
pydantic-core = ">=2.18.2,<3.0.0"
|
|
46
|
+
typing_extensions = ">= 4.0.0"
|
|
47
|
+
|
|
48
|
+
[tool.poetry.group.dev.dependencies]
|
|
49
|
+
mypy = "==1.13.0"
|
|
50
|
+
pytest = "^9.0.3"
|
|
51
|
+
pytest-asyncio = "^1.0.0"
|
|
52
|
+
pytest-xdist = "^3.6.1"
|
|
53
|
+
python-dateutil = "^2.9.0"
|
|
54
|
+
types-python-dateutil = "^2.9.0.20240316"
|
|
55
|
+
urllib3 = ">=2.6.3,<3.0.0"
|
|
56
|
+
ruff = "==0.11.5"
|
|
57
|
+
|
|
58
|
+
[tool.pytest.ini_options]
|
|
59
|
+
testpaths = [ "tests" ]
|
|
60
|
+
asyncio_mode = "auto"
|
|
61
|
+
norecursedirs = [ "src" ]
|
|
62
|
+
markers = [
|
|
63
|
+
"aiohttp: tests that require httpx_aiohttp to be installed",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[tool.mypy]
|
|
67
|
+
plugins = ["pydantic.mypy"]
|
|
68
|
+
|
|
69
|
+
[tool.ruff]
|
|
70
|
+
line-length = 120
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint]
|
|
73
|
+
select = [
|
|
74
|
+
"E", # pycodestyle errors
|
|
75
|
+
"F", # pyflakes
|
|
76
|
+
"I", # isort
|
|
77
|
+
]
|
|
78
|
+
ignore = [
|
|
79
|
+
"E402", # Module level import not at top of file
|
|
80
|
+
"E501", # Line too long
|
|
81
|
+
"E711", # Comparison to `None` should be `cond is not None`
|
|
82
|
+
"E712", # Avoid equality comparisons to `True`; use `if ...:` checks
|
|
83
|
+
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
|
|
84
|
+
"E722", # Do not use bare `except`
|
|
85
|
+
"E731", # Do not assign a `lambda` expression, use a `def`
|
|
86
|
+
"F821", # Undefined name
|
|
87
|
+
"F841" # Local variable ... is assigned to but never used
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[tool.ruff.lint.isort]
|
|
91
|
+
section-order = ["future", "standard-library", "third-party", "first-party"]
|
|
92
|
+
|
|
93
|
+
[build-system]
|
|
94
|
+
requires = ["poetry-core"]
|
|
95
|
+
build-backend = "poetry.core.masonry.api"
|
|
96
|
+
|
|
97
|
+
[tool.poetry.extras]
|
|
98
|
+
aiohttp=["aiohttp", "httpx-aiohttp"]
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
BatchRunRequest,
|
|
11
|
+
BatchTestRun,
|
|
12
|
+
BatchTestRunResponse,
|
|
13
|
+
BatchTestSkip,
|
|
14
|
+
HttpValidationError,
|
|
15
|
+
JudgeResult,
|
|
16
|
+
ResolveAgentNamesResponse,
|
|
17
|
+
RoutersAgentTestsAgentResponse,
|
|
18
|
+
RoutersAgentTestsAgentResponseType,
|
|
19
|
+
TaskCreateResponse,
|
|
20
|
+
TestCaseResult,
|
|
21
|
+
TestOutput,
|
|
22
|
+
TestRunStatusResponse,
|
|
23
|
+
ToolCallOutput,
|
|
24
|
+
ValidationError,
|
|
25
|
+
ValidationErrorLocItem,
|
|
26
|
+
)
|
|
27
|
+
from .errors import UnprocessableEntityError
|
|
28
|
+
from . import agent_tests, agents
|
|
29
|
+
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
30
|
+
from .client import AsyncCalibrate, Calibrate
|
|
31
|
+
from .environment import CalibrateEnvironment
|
|
32
|
+
from .version import __version__
|
|
33
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
34
|
+
"AsyncCalibrate": ".client",
|
|
35
|
+
"BatchRunRequest": ".types",
|
|
36
|
+
"BatchTestRun": ".types",
|
|
37
|
+
"BatchTestRunResponse": ".types",
|
|
38
|
+
"BatchTestSkip": ".types",
|
|
39
|
+
"Calibrate": ".client",
|
|
40
|
+
"CalibrateEnvironment": ".environment",
|
|
41
|
+
"DefaultAioHttpClient": "._default_clients",
|
|
42
|
+
"DefaultAsyncHttpxClient": "._default_clients",
|
|
43
|
+
"HttpValidationError": ".types",
|
|
44
|
+
"JudgeResult": ".types",
|
|
45
|
+
"ResolveAgentNamesResponse": ".types",
|
|
46
|
+
"RoutersAgentTestsAgentResponse": ".types",
|
|
47
|
+
"RoutersAgentTestsAgentResponseType": ".types",
|
|
48
|
+
"TaskCreateResponse": ".types",
|
|
49
|
+
"TestCaseResult": ".types",
|
|
50
|
+
"TestOutput": ".types",
|
|
51
|
+
"TestRunStatusResponse": ".types",
|
|
52
|
+
"ToolCallOutput": ".types",
|
|
53
|
+
"UnprocessableEntityError": ".errors",
|
|
54
|
+
"ValidationError": ".types",
|
|
55
|
+
"ValidationErrorLocItem": ".types",
|
|
56
|
+
"__version__": ".version",
|
|
57
|
+
"agent_tests": ".agent_tests",
|
|
58
|
+
"agents": ".agents",
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
63
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
64
|
+
if module_name is None:
|
|
65
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
66
|
+
try:
|
|
67
|
+
module = import_module(module_name, __package__)
|
|
68
|
+
if module_name == f".{attr_name}":
|
|
69
|
+
return module
|
|
70
|
+
else:
|
|
71
|
+
return getattr(module, attr_name)
|
|
72
|
+
except ImportError as e:
|
|
73
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
74
|
+
except AttributeError as e:
|
|
75
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def __dir__():
|
|
79
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
80
|
+
return sorted(lazy_attrs)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
__all__ = [
|
|
84
|
+
"AsyncCalibrate",
|
|
85
|
+
"BatchRunRequest",
|
|
86
|
+
"BatchTestRun",
|
|
87
|
+
"BatchTestRunResponse",
|
|
88
|
+
"BatchTestSkip",
|
|
89
|
+
"Calibrate",
|
|
90
|
+
"CalibrateEnvironment",
|
|
91
|
+
"DefaultAioHttpClient",
|
|
92
|
+
"DefaultAsyncHttpxClient",
|
|
93
|
+
"HttpValidationError",
|
|
94
|
+
"JudgeResult",
|
|
95
|
+
"ResolveAgentNamesResponse",
|
|
96
|
+
"RoutersAgentTestsAgentResponse",
|
|
97
|
+
"RoutersAgentTestsAgentResponseType",
|
|
98
|
+
"TaskCreateResponse",
|
|
99
|
+
"TestCaseResult",
|
|
100
|
+
"TestOutput",
|
|
101
|
+
"TestRunStatusResponse",
|
|
102
|
+
"ToolCallOutput",
|
|
103
|
+
"UnprocessableEntityError",
|
|
104
|
+
"ValidationError",
|
|
105
|
+
"ValidationErrorLocItem",
|
|
106
|
+
"__version__",
|
|
107
|
+
"agent_tests",
|
|
108
|
+
"agents",
|
|
109
|
+
]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
SDK_DEFAULT_TIMEOUT = 60
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import httpx_aiohttp # type: ignore[import-not-found]
|
|
11
|
+
except ImportError:
|
|
12
|
+
|
|
13
|
+
class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
|
|
14
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
15
|
+
raise RuntimeError(
|
|
16
|
+
"To use the aiohttp client, install the aiohttp extra: pip install calibrate-python-sdk[aiohttp]"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
|
|
22
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
23
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
24
|
+
kwargs.setdefault("follow_redirects", True)
|
|
25
|
+
super().__init__(**kwargs)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DefaultAsyncHttpxClient(httpx.AsyncClient):
|
|
29
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
30
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
31
|
+
kwargs.setdefault("follow_redirects", True)
|
|
32
|
+
super().__init__(**kwargs)
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.batch_run_request import BatchRunRequest
|
|
8
|
+
from ..types.batch_test_run_response import BatchTestRunResponse
|
|
9
|
+
from ..types.task_create_response import TaskCreateResponse
|
|
10
|
+
from ..types.test_run_status_response import TestRunStatusResponse
|
|
11
|
+
from .raw_client import AsyncRawAgentTestsClient, RawAgentTestsClient
|
|
12
|
+
|
|
13
|
+
# this is used as the default value for optional parameters
|
|
14
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AgentTestsClient:
|
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
19
|
+
self._raw_client = RawAgentTestsClient(client_wrapper=client_wrapper)
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def with_raw_response(self) -> RawAgentTestsClient:
|
|
23
|
+
"""
|
|
24
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
RawAgentTestsClient
|
|
29
|
+
"""
|
|
30
|
+
return self._raw_client
|
|
31
|
+
|
|
32
|
+
def run(
|
|
33
|
+
self,
|
|
34
|
+
agent_uuid: str,
|
|
35
|
+
*,
|
|
36
|
+
test_uuids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
37
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
38
|
+
) -> TaskCreateResponse:
|
|
39
|
+
"""
|
|
40
|
+
Run one or more tests for an agent.
|
|
41
|
+
|
|
42
|
+
This starts a background task that runs the calibrate LLM tests command
|
|
43
|
+
with the agent's config and the combined test cases from all specified tests.
|
|
44
|
+
|
|
45
|
+
Returns a task ID that can be used to poll for status and results.
|
|
46
|
+
|
|
47
|
+
Auth: requires either a JWT (frontend) or an `sk_` API key. The agent
|
|
48
|
+
must belong to the caller's org or this 404s.
|
|
49
|
+
|
|
50
|
+
Parameters
|
|
51
|
+
----------
|
|
52
|
+
agent_uuid : str
|
|
53
|
+
|
|
54
|
+
test_uuids : typing.Optional[typing.Sequence[str]]
|
|
55
|
+
|
|
56
|
+
request_options : typing.Optional[RequestOptions]
|
|
57
|
+
Request-specific configuration.
|
|
58
|
+
|
|
59
|
+
Returns
|
|
60
|
+
-------
|
|
61
|
+
TaskCreateResponse
|
|
62
|
+
Successful Response
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
from artpark import Calibrate
|
|
67
|
+
|
|
68
|
+
client = Calibrate(
|
|
69
|
+
api_key="YOUR_API_KEY",
|
|
70
|
+
org_uuid="YOUR_ORG_UUID",
|
|
71
|
+
token="YOUR_TOKEN",
|
|
72
|
+
)
|
|
73
|
+
client.agent_tests.run(
|
|
74
|
+
agent_uuid="agent_uuid",
|
|
75
|
+
)
|
|
76
|
+
"""
|
|
77
|
+
_response = self._raw_client.run(agent_uuid, test_uuids=test_uuids, request_options=request_options)
|
|
78
|
+
return _response.data
|
|
79
|
+
|
|
80
|
+
def run_batch(
|
|
81
|
+
self,
|
|
82
|
+
*,
|
|
83
|
+
request: typing.Optional[BatchRunRequest] = None,
|
|
84
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
85
|
+
) -> BatchTestRunResponse:
|
|
86
|
+
"""
|
|
87
|
+
Run every linked test for a set of agents, one ``llm-unit-test`` job per agent.
|
|
88
|
+
|
|
89
|
+
Scope is driven by the optional ``agent_names`` payload:
|
|
90
|
+
|
|
91
|
+
- **Provided (non-empty)** — run only those agents. Names are unique per org
|
|
92
|
+
and **all are validated up front**: if any doesn't resolve to a
|
|
93
|
+
(non-deleted) agent in the caller's org, the call 404s with the offending
|
|
94
|
+
names and NO jobs are created.
|
|
95
|
+
- **Omitted / null / empty** — run every agent in the caller's org.
|
|
96
|
+
|
|
97
|
+
For each selected agent, its linked tests are launched as one job. Agents
|
|
98
|
+
with no linked tests or an unverified connection are reported under
|
|
99
|
+
``skipped`` instead of failing the batch. Subject to the normal per-org
|
|
100
|
+
concurrency queue, so over-limit jobs come back ``queued``.
|
|
101
|
+
|
|
102
|
+
Auth accepts a JWT (frontend) or an `sk_` API key (programmatic clients).
|
|
103
|
+
Returns one ``runs`` entry per launched agent with ``agent_name``,
|
|
104
|
+
``agent_uuid``, ``task_id``, and ``status``.
|
|
105
|
+
|
|
106
|
+
Parameters
|
|
107
|
+
----------
|
|
108
|
+
request : typing.Optional[BatchRunRequest]
|
|
109
|
+
|
|
110
|
+
request_options : typing.Optional[RequestOptions]
|
|
111
|
+
Request-specific configuration.
|
|
112
|
+
|
|
113
|
+
Returns
|
|
114
|
+
-------
|
|
115
|
+
BatchTestRunResponse
|
|
116
|
+
Successful Response
|
|
117
|
+
|
|
118
|
+
Examples
|
|
119
|
+
--------
|
|
120
|
+
from artpark import BatchRunRequest, Calibrate
|
|
121
|
+
|
|
122
|
+
client = Calibrate(
|
|
123
|
+
api_key="YOUR_API_KEY",
|
|
124
|
+
org_uuid="YOUR_ORG_UUID",
|
|
125
|
+
token="YOUR_TOKEN",
|
|
126
|
+
)
|
|
127
|
+
client.agent_tests.run_batch(
|
|
128
|
+
request=BatchRunRequest(),
|
|
129
|
+
)
|
|
130
|
+
"""
|
|
131
|
+
_response = self._raw_client.run_batch(request=request, request_options=request_options)
|
|
132
|
+
return _response.data
|
|
133
|
+
|
|
134
|
+
def get_run(
|
|
135
|
+
self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
136
|
+
) -> TestRunStatusResponse:
|
|
137
|
+
"""
|
|
138
|
+
Get the status of an agent test run.
|
|
139
|
+
|
|
140
|
+
Requires either a JWT (frontend) or an `sk_` API key, plus org
|
|
141
|
+
ownership of the run. Unauthenticated access to a completed run is only
|
|
142
|
+
possible once it is made public, via the share-token endpoint in the public
|
|
143
|
+
router.
|
|
144
|
+
|
|
145
|
+
Returns the current status and, if done, the test results.
|
|
146
|
+
|
|
147
|
+
Parameters
|
|
148
|
+
----------
|
|
149
|
+
task_id : str
|
|
150
|
+
|
|
151
|
+
request_options : typing.Optional[RequestOptions]
|
|
152
|
+
Request-specific configuration.
|
|
153
|
+
|
|
154
|
+
Returns
|
|
155
|
+
-------
|
|
156
|
+
TestRunStatusResponse
|
|
157
|
+
Successful Response
|
|
158
|
+
|
|
159
|
+
Examples
|
|
160
|
+
--------
|
|
161
|
+
from artpark import Calibrate
|
|
162
|
+
|
|
163
|
+
client = Calibrate(
|
|
164
|
+
api_key="YOUR_API_KEY",
|
|
165
|
+
org_uuid="YOUR_ORG_UUID",
|
|
166
|
+
token="YOUR_TOKEN",
|
|
167
|
+
)
|
|
168
|
+
client.agent_tests.get_run(
|
|
169
|
+
task_id="task_id",
|
|
170
|
+
)
|
|
171
|
+
"""
|
|
172
|
+
_response = self._raw_client.get_run(task_id, request_options=request_options)
|
|
173
|
+
return _response.data
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class AsyncAgentTestsClient:
|
|
177
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
178
|
+
self._raw_client = AsyncRawAgentTestsClient(client_wrapper=client_wrapper)
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
def with_raw_response(self) -> AsyncRawAgentTestsClient:
|
|
182
|
+
"""
|
|
183
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
184
|
+
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
AsyncRawAgentTestsClient
|
|
188
|
+
"""
|
|
189
|
+
return self._raw_client
|
|
190
|
+
|
|
191
|
+
async def run(
|
|
192
|
+
self,
|
|
193
|
+
agent_uuid: str,
|
|
194
|
+
*,
|
|
195
|
+
test_uuids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
196
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
197
|
+
) -> TaskCreateResponse:
|
|
198
|
+
"""
|
|
199
|
+
Run one or more tests for an agent.
|
|
200
|
+
|
|
201
|
+
This starts a background task that runs the calibrate LLM tests command
|
|
202
|
+
with the agent's config and the combined test cases from all specified tests.
|
|
203
|
+
|
|
204
|
+
Returns a task ID that can be used to poll for status and results.
|
|
205
|
+
|
|
206
|
+
Auth: requires either a JWT (frontend) or an `sk_` API key. The agent
|
|
207
|
+
must belong to the caller's org or this 404s.
|
|
208
|
+
|
|
209
|
+
Parameters
|
|
210
|
+
----------
|
|
211
|
+
agent_uuid : str
|
|
212
|
+
|
|
213
|
+
test_uuids : typing.Optional[typing.Sequence[str]]
|
|
214
|
+
|
|
215
|
+
request_options : typing.Optional[RequestOptions]
|
|
216
|
+
Request-specific configuration.
|
|
217
|
+
|
|
218
|
+
Returns
|
|
219
|
+
-------
|
|
220
|
+
TaskCreateResponse
|
|
221
|
+
Successful Response
|
|
222
|
+
|
|
223
|
+
Examples
|
|
224
|
+
--------
|
|
225
|
+
import asyncio
|
|
226
|
+
|
|
227
|
+
from artpark import AsyncCalibrate
|
|
228
|
+
|
|
229
|
+
client = AsyncCalibrate(
|
|
230
|
+
api_key="YOUR_API_KEY",
|
|
231
|
+
org_uuid="YOUR_ORG_UUID",
|
|
232
|
+
token="YOUR_TOKEN",
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
async def main() -> None:
|
|
237
|
+
await client.agent_tests.run(
|
|
238
|
+
agent_uuid="agent_uuid",
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
asyncio.run(main())
|
|
243
|
+
"""
|
|
244
|
+
_response = await self._raw_client.run(agent_uuid, test_uuids=test_uuids, request_options=request_options)
|
|
245
|
+
return _response.data
|
|
246
|
+
|
|
247
|
+
async def run_batch(
|
|
248
|
+
self,
|
|
249
|
+
*,
|
|
250
|
+
request: typing.Optional[BatchRunRequest] = None,
|
|
251
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
252
|
+
) -> BatchTestRunResponse:
|
|
253
|
+
"""
|
|
254
|
+
Run every linked test for a set of agents, one ``llm-unit-test`` job per agent.
|
|
255
|
+
|
|
256
|
+
Scope is driven by the optional ``agent_names`` payload:
|
|
257
|
+
|
|
258
|
+
- **Provided (non-empty)** — run only those agents. Names are unique per org
|
|
259
|
+
and **all are validated up front**: if any doesn't resolve to a
|
|
260
|
+
(non-deleted) agent in the caller's org, the call 404s with the offending
|
|
261
|
+
names and NO jobs are created.
|
|
262
|
+
- **Omitted / null / empty** — run every agent in the caller's org.
|
|
263
|
+
|
|
264
|
+
For each selected agent, its linked tests are launched as one job. Agents
|
|
265
|
+
with no linked tests or an unverified connection are reported under
|
|
266
|
+
``skipped`` instead of failing the batch. Subject to the normal per-org
|
|
267
|
+
concurrency queue, so over-limit jobs come back ``queued``.
|
|
268
|
+
|
|
269
|
+
Auth accepts a JWT (frontend) or an `sk_` API key (programmatic clients).
|
|
270
|
+
Returns one ``runs`` entry per launched agent with ``agent_name``,
|
|
271
|
+
``agent_uuid``, ``task_id``, and ``status``.
|
|
272
|
+
|
|
273
|
+
Parameters
|
|
274
|
+
----------
|
|
275
|
+
request : typing.Optional[BatchRunRequest]
|
|
276
|
+
|
|
277
|
+
request_options : typing.Optional[RequestOptions]
|
|
278
|
+
Request-specific configuration.
|
|
279
|
+
|
|
280
|
+
Returns
|
|
281
|
+
-------
|
|
282
|
+
BatchTestRunResponse
|
|
283
|
+
Successful Response
|
|
284
|
+
|
|
285
|
+
Examples
|
|
286
|
+
--------
|
|
287
|
+
import asyncio
|
|
288
|
+
|
|
289
|
+
from artpark import AsyncCalibrate, BatchRunRequest
|
|
290
|
+
|
|
291
|
+
client = AsyncCalibrate(
|
|
292
|
+
api_key="YOUR_API_KEY",
|
|
293
|
+
org_uuid="YOUR_ORG_UUID",
|
|
294
|
+
token="YOUR_TOKEN",
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
async def main() -> None:
|
|
299
|
+
await client.agent_tests.run_batch(
|
|
300
|
+
request=BatchRunRequest(),
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
asyncio.run(main())
|
|
305
|
+
"""
|
|
306
|
+
_response = await self._raw_client.run_batch(request=request, request_options=request_options)
|
|
307
|
+
return _response.data
|
|
308
|
+
|
|
309
|
+
async def get_run(
|
|
310
|
+
self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
311
|
+
) -> TestRunStatusResponse:
|
|
312
|
+
"""
|
|
313
|
+
Get the status of an agent test run.
|
|
314
|
+
|
|
315
|
+
Requires either a JWT (frontend) or an `sk_` API key, plus org
|
|
316
|
+
ownership of the run. Unauthenticated access to a completed run is only
|
|
317
|
+
possible once it is made public, via the share-token endpoint in the public
|
|
318
|
+
router.
|
|
319
|
+
|
|
320
|
+
Returns the current status and, if done, the test results.
|
|
321
|
+
|
|
322
|
+
Parameters
|
|
323
|
+
----------
|
|
324
|
+
task_id : str
|
|
325
|
+
|
|
326
|
+
request_options : typing.Optional[RequestOptions]
|
|
327
|
+
Request-specific configuration.
|
|
328
|
+
|
|
329
|
+
Returns
|
|
330
|
+
-------
|
|
331
|
+
TestRunStatusResponse
|
|
332
|
+
Successful Response
|
|
333
|
+
|
|
334
|
+
Examples
|
|
335
|
+
--------
|
|
336
|
+
import asyncio
|
|
337
|
+
|
|
338
|
+
from artpark import AsyncCalibrate
|
|
339
|
+
|
|
340
|
+
client = AsyncCalibrate(
|
|
341
|
+
api_key="YOUR_API_KEY",
|
|
342
|
+
org_uuid="YOUR_ORG_UUID",
|
|
343
|
+
token="YOUR_TOKEN",
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
async def main() -> None:
|
|
348
|
+
await client.agent_tests.get_run(
|
|
349
|
+
task_id="task_id",
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
asyncio.run(main())
|
|
354
|
+
"""
|
|
355
|
+
_response = await self._raw_client.get_run(task_id, request_options=request_options)
|
|
356
|
+
return _response.data
|