calibrate-python-sdk 0.0.1__tar.gz → 0.0.2__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.
Files changed (56) hide show
  1. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/PKG-INFO +1 -1
  2. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/pyproject.toml +1 -1
  3. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/agent_tests/client.py +6 -12
  4. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/agents/client.py +4 -8
  5. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/client.py +8 -21
  6. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/client_wrapper.py +9 -23
  7. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/LICENSE +0 -0
  8. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/README.md +0 -0
  9. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/__init__.py +0 -0
  10. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/_default_clients.py +0 -0
  11. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/agent_tests/__init__.py +0 -0
  12. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/agent_tests/raw_client.py +0 -0
  13. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/agents/__init__.py +0 -0
  14. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/agents/raw_client.py +0 -0
  15. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/__init__.py +0 -0
  16. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/api_error.py +0 -0
  17. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/datetime_utils.py +0 -0
  18. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/file.py +0 -0
  19. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/force_multipart.py +0 -0
  20. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_client.py +0 -0
  21. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_response.py +0 -0
  22. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_sse/__init__.py +0 -0
  23. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_sse/_api.py +0 -0
  24. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_sse/_decoders.py +0 -0
  25. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_sse/_exceptions.py +0 -0
  26. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/http_sse/_models.py +0 -0
  27. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/jsonable_encoder.py +0 -0
  28. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/logging.py +0 -0
  29. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/parse_error.py +0 -0
  30. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/pydantic_utilities.py +0 -0
  31. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/query_encoder.py +0 -0
  32. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/remove_none_from_dict.py +0 -0
  33. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/request_options.py +0 -0
  34. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/core/serialization.py +0 -0
  35. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/environment.py +0 -0
  36. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/errors/__init__.py +0 -0
  37. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/errors/unprocessable_entity_error.py +0 -0
  38. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/py.typed +0 -0
  39. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/__init__.py +0 -0
  40. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/batch_run_request.py +0 -0
  41. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/batch_test_run.py +0 -0
  42. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/batch_test_run_response.py +0 -0
  43. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/batch_test_skip.py +0 -0
  44. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/http_validation_error.py +0 -0
  45. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/judge_result.py +0 -0
  46. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/resolve_agent_names_response.py +0 -0
  47. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/routers_agent_tests_agent_response.py +0 -0
  48. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/routers_agent_tests_agent_response_type.py +0 -0
  49. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/task_create_response.py +0 -0
  50. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/test_case_result.py +0 -0
  51. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/test_output.py +0 -0
  52. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/test_run_status_response.py +0 -0
  53. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/tool_call_output.py +0 -0
  54. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/validation_error.py +0 -0
  55. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/types/validation_error_loc_item.py +0 -0
  56. {calibrate_python_sdk-0.0.1 → calibrate_python_sdk-0.0.2}/src/artpark/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: calibrate-python-sdk
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.10,<4.0
@@ -4,7 +4,7 @@ dynamic = ["version"]
4
4
 
5
5
  [tool.poetry]
6
6
  name = "calibrate-python-sdk"
7
- version = "0.0.1"
7
+ version = "0.0.2"
8
8
  description = ""
9
9
  readme = "README.md"
10
10
  authors = []
@@ -66,9 +66,8 @@ class AgentTestsClient:
66
66
  from artpark import Calibrate
67
67
 
68
68
  client = Calibrate(
69
- api_key="YOUR_API_KEY",
70
69
  org_uuid="YOUR_ORG_UUID",
71
- token="YOUR_TOKEN",
70
+ api_key="YOUR_API_KEY",
72
71
  )
73
72
  client.agent_tests.run(
74
73
  agent_uuid="agent_uuid",
@@ -120,9 +119,8 @@ class AgentTestsClient:
120
119
  from artpark import BatchRunRequest, Calibrate
121
120
 
122
121
  client = Calibrate(
123
- api_key="YOUR_API_KEY",
124
122
  org_uuid="YOUR_ORG_UUID",
125
- token="YOUR_TOKEN",
123
+ api_key="YOUR_API_KEY",
126
124
  )
127
125
  client.agent_tests.run_batch(
128
126
  request=BatchRunRequest(),
@@ -161,9 +159,8 @@ class AgentTestsClient:
161
159
  from artpark import Calibrate
162
160
 
163
161
  client = Calibrate(
164
- api_key="YOUR_API_KEY",
165
162
  org_uuid="YOUR_ORG_UUID",
166
- token="YOUR_TOKEN",
163
+ api_key="YOUR_API_KEY",
167
164
  )
168
165
  client.agent_tests.get_run(
169
166
  task_id="task_id",
@@ -227,9 +224,8 @@ class AsyncAgentTestsClient:
227
224
  from artpark import AsyncCalibrate
228
225
 
229
226
  client = AsyncCalibrate(
230
- api_key="YOUR_API_KEY",
231
227
  org_uuid="YOUR_ORG_UUID",
232
- token="YOUR_TOKEN",
228
+ api_key="YOUR_API_KEY",
233
229
  )
234
230
 
235
231
 
@@ -289,9 +285,8 @@ class AsyncAgentTestsClient:
289
285
  from artpark import AsyncCalibrate, BatchRunRequest
290
286
 
291
287
  client = AsyncCalibrate(
292
- api_key="YOUR_API_KEY",
293
288
  org_uuid="YOUR_ORG_UUID",
294
- token="YOUR_TOKEN",
289
+ api_key="YOUR_API_KEY",
295
290
  )
296
291
 
297
292
 
@@ -338,9 +333,8 @@ class AsyncAgentTestsClient:
338
333
  from artpark import AsyncCalibrate
339
334
 
340
335
  client = AsyncCalibrate(
341
- api_key="YOUR_API_KEY",
342
336
  org_uuid="YOUR_ORG_UUID",
343
- token="YOUR_TOKEN",
337
+ api_key="YOUR_API_KEY",
344
338
  )
345
339
 
346
340
 
@@ -56,9 +56,8 @@ class AgentsClient:
56
56
  from artpark import Calibrate
57
57
 
58
58
  client = Calibrate(
59
- api_key="YOUR_API_KEY",
60
59
  org_uuid="YOUR_ORG_UUID",
61
- token="YOUR_TOKEN",
60
+ api_key="YOUR_API_KEY",
62
61
  )
63
62
  client.agents.resolve(
64
63
  names=["names"],
@@ -93,9 +92,8 @@ class AgentsClient:
93
92
  from artpark import Calibrate
94
93
 
95
94
  client = Calibrate(
96
- api_key="YOUR_API_KEY",
97
95
  org_uuid="YOUR_ORG_UUID",
98
- token="YOUR_TOKEN",
96
+ api_key="YOUR_API_KEY",
99
97
  )
100
98
  client.agents.list()
101
99
  """
@@ -149,9 +147,8 @@ class AsyncAgentsClient:
149
147
  from artpark import AsyncCalibrate
150
148
 
151
149
  client = AsyncCalibrate(
152
- api_key="YOUR_API_KEY",
153
150
  org_uuid="YOUR_ORG_UUID",
154
- token="YOUR_TOKEN",
151
+ api_key="YOUR_API_KEY",
155
152
  )
156
153
 
157
154
 
@@ -194,9 +191,8 @@ class AsyncAgentsClient:
194
191
  from artpark import AsyncCalibrate
195
192
 
196
193
  client = AsyncCalibrate(
197
- api_key="YOUR_API_KEY",
198
194
  org_uuid="YOUR_ORG_UUID",
199
- token="YOUR_TOKEN",
195
+ api_key="YOUR_API_KEY",
200
196
  )
201
197
 
202
198
 
@@ -32,9 +32,8 @@ class Calibrate:
32
32
 
33
33
 
34
34
 
35
- api_key : typing.Optional[str]
36
35
  org_uuid : typing.Optional[str]
37
- token : typing.Union[str, typing.Callable[[], str]]
36
+ api_key : str
38
37
  headers : typing.Optional[typing.Dict[str, str]]
39
38
  Additional headers to send with every request.
40
39
 
@@ -64,9 +63,8 @@ class Calibrate:
64
63
  from artpark import Calibrate
65
64
 
66
65
  client = Calibrate(
67
- api_key="YOUR_API_KEY",
68
66
  org_uuid="YOUR_ORG_UUID",
69
- token="YOUR_TOKEN",
67
+ api_key="YOUR_API_KEY",
70
68
  )
71
69
  """
72
70
 
@@ -75,9 +73,8 @@ class Calibrate:
75
73
  *,
76
74
  base_url: typing.Optional[str] = None,
77
75
  environment: CalibrateEnvironment = CalibrateEnvironment.PRODUCTION,
78
- api_key: typing.Optional[str] = None,
79
76
  org_uuid: typing.Optional[str] = None,
80
- token: typing.Union[str, typing.Callable[[], str]],
77
+ api_key: str,
81
78
  headers: typing.Optional[typing.Dict[str, str]] = None,
82
79
  timeout: typing.Optional[float] = None,
83
80
  max_retries: typing.Optional[int] = None,
@@ -91,9 +88,8 @@ class Calibrate:
91
88
  _defaulted_max_retries = max_retries if max_retries is not None else 2
92
89
  self._client_wrapper = SyncClientWrapper(
93
90
  base_url=_get_base_url(base_url=base_url, environment=environment),
94
- api_key=api_key,
95
91
  org_uuid=org_uuid,
96
- token=token,
92
+ api_key=api_key,
97
93
  headers=headers,
98
94
  httpx_client=httpx_client
99
95
  if httpx_client is not None
@@ -162,15 +158,11 @@ class AsyncCalibrate:
162
158
 
163
159
 
164
160
 
165
- api_key : typing.Optional[str]
166
161
  org_uuid : typing.Optional[str]
167
- token : typing.Union[str, typing.Callable[[], str]]
162
+ api_key : str
168
163
  headers : typing.Optional[typing.Dict[str, str]]
169
164
  Additional headers to send with every request.
170
165
 
171
- async_token : typing.Optional[typing.Callable[[], typing.Awaitable[str]]]
172
- An async callable that returns a bearer token. Use this when token acquisition involves async I/O (e.g., refreshing tokens via an async HTTP client). When provided, this is used instead of the synchronous token for async requests.
173
-
174
166
  timeout : typing.Optional[float]
175
167
  The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
176
168
 
@@ -197,9 +189,8 @@ class AsyncCalibrate:
197
189
  from artpark import AsyncCalibrate
198
190
 
199
191
  client = AsyncCalibrate(
200
- api_key="YOUR_API_KEY",
201
192
  org_uuid="YOUR_ORG_UUID",
202
- token="YOUR_TOKEN",
193
+ api_key="YOUR_API_KEY",
203
194
  )
204
195
  """
205
196
 
@@ -208,11 +199,9 @@ class AsyncCalibrate:
208
199
  *,
209
200
  base_url: typing.Optional[str] = None,
210
201
  environment: CalibrateEnvironment = CalibrateEnvironment.PRODUCTION,
211
- api_key: typing.Optional[str] = None,
212
202
  org_uuid: typing.Optional[str] = None,
213
- token: typing.Union[str, typing.Callable[[], str]],
203
+ api_key: str,
214
204
  headers: typing.Optional[typing.Dict[str, str]] = None,
215
- async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None,
216
205
  timeout: typing.Optional[float] = None,
217
206
  max_retries: typing.Optional[int] = None,
218
207
  stream_reconnection_enabled: typing.Optional[bool] = None,
@@ -225,11 +214,9 @@ class AsyncCalibrate:
225
214
  _defaulted_max_retries = max_retries if max_retries is not None else 2
226
215
  self._client_wrapper = AsyncClientWrapper(
227
216
  base_url=_get_base_url(base_url=base_url, environment=environment),
228
- api_key=api_key,
229
217
  org_uuid=org_uuid,
230
- token=token,
218
+ api_key=api_key,
231
219
  headers=headers,
232
- async_token=async_token,
233
220
  httpx_client=httpx_client
234
221
  if httpx_client is not None
235
222
  else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects),
@@ -11,9 +11,8 @@ class BaseClientWrapper:
11
11
  def __init__(
12
12
  self,
13
13
  *,
14
- api_key: typing.Optional[str] = None,
15
14
  org_uuid: typing.Optional[str] = None,
16
- token: typing.Union[str, typing.Callable[[], str]],
15
+ api_key: str,
17
16
  headers: typing.Optional[typing.Dict[str, str]] = None,
18
17
  base_url: str,
19
18
  timeout: typing.Optional[float] = None,
@@ -22,9 +21,8 @@ class BaseClientWrapper:
22
21
  max_stream_reconnection_attempts: typing.Optional[int] = None,
23
22
  logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
24
23
  ):
25
- self._api_key = api_key
26
24
  self._org_uuid = org_uuid
27
- self._token = token
25
+ self.api_key = api_key
28
26
  self._headers = headers
29
27
  self._base_url = base_url
30
28
  self._timeout = timeout
@@ -37,27 +35,19 @@ class BaseClientWrapper:
37
35
  import platform
38
36
 
39
37
  headers: typing.Dict[str, str] = {
40
- "User-Agent": "calibrate-python-sdk/0.0.1",
38
+ "User-Agent": "calibrate-python-sdk/0.0.2",
41
39
  "X-Fern-Language": "Python",
42
40
  "X-Fern-Runtime": f"python/{platform.python_version()}",
43
41
  "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
44
42
  "X-Fern-SDK-Name": "calibrate-python-sdk",
45
- "X-Fern-SDK-Version": "0.0.1",
43
+ "X-Fern-SDK-Version": "0.0.2",
46
44
  **(self.get_custom_headers() or {}),
47
45
  }
48
- if self._api_key is not None:
49
- headers["X-API-Key"] = self._api_key
50
46
  if self._org_uuid is not None:
51
47
  headers["X-Org-UUID"] = self._org_uuid
52
- headers["Authorization"] = f"Bearer {self._get_token()}"
48
+ headers["X-API-Key"] = self.api_key
53
49
  return headers
54
50
 
55
- def _get_token(self) -> str:
56
- if isinstance(self._token, str):
57
- return self._token
58
- else:
59
- return self._token()
60
-
61
51
  def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]:
62
52
  return self._headers
63
53
 
@@ -81,9 +71,8 @@ class SyncClientWrapper(BaseClientWrapper):
81
71
  def __init__(
82
72
  self,
83
73
  *,
84
- api_key: typing.Optional[str] = None,
85
74
  org_uuid: typing.Optional[str] = None,
86
- token: typing.Union[str, typing.Callable[[], str]],
75
+ api_key: str,
87
76
  headers: typing.Optional[typing.Dict[str, str]] = None,
88
77
  base_url: str,
89
78
  timeout: typing.Optional[float] = None,
@@ -94,9 +83,8 @@ class SyncClientWrapper(BaseClientWrapper):
94
83
  httpx_client: httpx.Client,
95
84
  ):
96
85
  super().__init__(
97
- api_key=api_key,
98
86
  org_uuid=org_uuid,
99
- token=token,
87
+ api_key=api_key,
100
88
  headers=headers,
101
89
  base_url=base_url,
102
90
  timeout=timeout,
@@ -119,9 +107,8 @@ class AsyncClientWrapper(BaseClientWrapper):
119
107
  def __init__(
120
108
  self,
121
109
  *,
122
- api_key: typing.Optional[str] = None,
123
110
  org_uuid: typing.Optional[str] = None,
124
- token: typing.Union[str, typing.Callable[[], str]],
111
+ api_key: str,
125
112
  headers: typing.Optional[typing.Dict[str, str]] = None,
126
113
  base_url: str,
127
114
  timeout: typing.Optional[float] = None,
@@ -133,9 +120,8 @@ class AsyncClientWrapper(BaseClientWrapper):
133
120
  httpx_client: httpx.AsyncClient,
134
121
  ):
135
122
  super().__init__(
136
- api_key=api_key,
137
123
  org_uuid=org_uuid,
138
- token=token,
124
+ api_key=api_key,
139
125
  headers=headers,
140
126
  base_url=base_url,
141
127
  timeout=timeout,