calibrate-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_sdk-0.0.1/LICENSE +21 -0
- calibrate_sdk-0.0.1/PKG-INFO +76 -0
- calibrate_sdk-0.0.1/README.md +42 -0
- calibrate_sdk-0.0.1/pyproject.toml +98 -0
- calibrate_sdk-0.0.1/src/calibrate/__init__.py +109 -0
- calibrate_sdk-0.0.1/src/calibrate/_default_clients.py +32 -0
- calibrate_sdk-0.0.1/src/calibrate/agent_tests/__init__.py +4 -0
- calibrate_sdk-0.0.1/src/calibrate/agent_tests/client.py +350 -0
- calibrate_sdk-0.0.1/src/calibrate/agent_tests/raw_client.py +455 -0
- calibrate_sdk-0.0.1/src/calibrate/agents/__init__.py +4 -0
- calibrate_sdk-0.0.1/src/calibrate/agents/client.py +206 -0
- calibrate_sdk-0.0.1/src/calibrate/agents/raw_client.py +273 -0
- calibrate_sdk-0.0.1/src/calibrate/client.py +255 -0
- calibrate_sdk-0.0.1/src/calibrate/core/__init__.py +127 -0
- calibrate_sdk-0.0.1/src/calibrate/core/api_error.py +23 -0
- calibrate_sdk-0.0.1/src/calibrate/core/client_wrapper.py +149 -0
- calibrate_sdk-0.0.1/src/calibrate/core/datetime_utils.py +70 -0
- calibrate_sdk-0.0.1/src/calibrate/core/file.py +67 -0
- calibrate_sdk-0.0.1/src/calibrate/core/force_multipart.py +18 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_client.py +843 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_response.py +59 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_sse/__init__.py +42 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_sse/_api.py +180 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_sse/_decoders.py +61 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_sse/_exceptions.py +7 -0
- calibrate_sdk-0.0.1/src/calibrate/core/http_sse/_models.py +17 -0
- calibrate_sdk-0.0.1/src/calibrate/core/jsonable_encoder.py +120 -0
- calibrate_sdk-0.0.1/src/calibrate/core/logging.py +107 -0
- calibrate_sdk-0.0.1/src/calibrate/core/parse_error.py +36 -0
- calibrate_sdk-0.0.1/src/calibrate/core/pydantic_utilities.py +508 -0
- calibrate_sdk-0.0.1/src/calibrate/core/query_encoder.py +58 -0
- calibrate_sdk-0.0.1/src/calibrate/core/remove_none_from_dict.py +11 -0
- calibrate_sdk-0.0.1/src/calibrate/core/request_options.py +37 -0
- calibrate_sdk-0.0.1/src/calibrate/core/serialization.py +347 -0
- calibrate_sdk-0.0.1/src/calibrate/environment.py +7 -0
- calibrate_sdk-0.0.1/src/calibrate/errors/__init__.py +34 -0
- calibrate_sdk-0.0.1/src/calibrate/errors/unprocessable_entity_error.py +11 -0
- calibrate_sdk-0.0.1/src/calibrate/py.typed +0 -0
- calibrate_sdk-0.0.1/src/calibrate/types/__init__.py +83 -0
- calibrate_sdk-0.0.1/src/calibrate/types/batch_run_request.py +19 -0
- calibrate_sdk-0.0.1/src/calibrate/types/batch_test_run.py +22 -0
- calibrate_sdk-0.0.1/src/calibrate/types/batch_test_run_response.py +22 -0
- calibrate_sdk-0.0.1/src/calibrate/types/batch_test_skip.py +21 -0
- calibrate_sdk-0.0.1/src/calibrate/types/http_validation_error.py +20 -0
- calibrate_sdk-0.0.1/src/calibrate/types/judge_result.py +51 -0
- calibrate_sdk-0.0.1/src/calibrate/types/resolve_agent_names_response.py +20 -0
- calibrate_sdk-0.0.1/src/calibrate/types/routers_agent_tests_agent_response.py +27 -0
- calibrate_sdk-0.0.1/src/calibrate/types/routers_agent_tests_agent_response_type.py +5 -0
- calibrate_sdk-0.0.1/src/calibrate/types/task_create_response.py +22 -0
- calibrate_sdk-0.0.1/src/calibrate/types/test_case_result.py +33 -0
- calibrate_sdk-0.0.1/src/calibrate/types/test_output.py +21 -0
- calibrate_sdk-0.0.1/src/calibrate/types/test_run_status_response.py +37 -0
- calibrate_sdk-0.0.1/src/calibrate/types/tool_call_output.py +21 -0
- calibrate_sdk-0.0.1/src/calibrate/types/validation_error.py +22 -0
- calibrate_sdk-0.0.1/src/calibrate/types/validation_error_loc_item.py +5 -0
- calibrate_sdk-0.0.1/src/calibrate/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,76 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: calibrate-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 [Calibrate](https://calibrate.artpark.ai), a framework for evaluating AI agents which let you move from slow, manual testing to a fast, automated, and repeatable testing process for your entire agent stack.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
pip install calibrate-sdk
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or with `uv`:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
uv add calibrate-sdk
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Pre-requisites
|
|
51
|
+
|
|
52
|
+
You need to have a Calibrate API key. You can get the API key from the [UI](https://calibrate.artpark.ai/workspace-settings?tab=api-keys).
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from calibrate import Calibrate
|
|
58
|
+
|
|
59
|
+
client = Calibrate(api_key="your_api_key")
|
|
60
|
+
|
|
61
|
+
agents = client.agents.list()
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
For self-hosted Calibrate deployments, you can pass `base_url` to point the client at your API instance:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from calibrate import Calibrate
|
|
68
|
+
|
|
69
|
+
client = Calibrate(
|
|
70
|
+
base_url="https://api.calibrate.your-domain.com",
|
|
71
|
+
api_key="your_api_key",
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
agents = client.agents.list()
|
|
75
|
+
```
|
|
76
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Calibrate Python SDK
|
|
2
|
+
|
|
3
|
+
Python client for [Calibrate](https://calibrate.artpark.ai), a framework for evaluating AI agents which let you move from slow, manual testing to a fast, automated, and repeatable testing process for your entire agent stack.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install calibrate-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with `uv`:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
uv add calibrate-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Pre-requisites
|
|
18
|
+
|
|
19
|
+
You need to have a Calibrate API key. You can get the API key from the [UI](https://calibrate.artpark.ai/workspace-settings?tab=api-keys).
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from calibrate import Calibrate
|
|
25
|
+
|
|
26
|
+
client = Calibrate(api_key="your_api_key")
|
|
27
|
+
|
|
28
|
+
agents = client.agents.list()
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For self-hosted Calibrate deployments, you can pass `base_url` to point the client at your API instance:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from calibrate import Calibrate
|
|
35
|
+
|
|
36
|
+
client = Calibrate(
|
|
37
|
+
base_url="https://api.calibrate.your-domain.com",
|
|
38
|
+
api_key="your_api_key",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
agents = client.agents.list()
|
|
42
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "calibrate-sdk"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
|
|
5
|
+
[tool.poetry]
|
|
6
|
+
name = "calibrate-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 = "calibrate", 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-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)
|