athena-intelligence 0.1.4__tar.gz → 0.1.5__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 (31) hide show
  1. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/PKG-INFO +1 -1
  2. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/pyproject.toml +1 -1
  3. athena_intelligence-0.1.5/src/athena/__init__.py +17 -0
  4. athena_intelligence-0.1.5/src/athena/client.py +419 -0
  5. athena_intelligence-0.1.5/src/athena/core/client_wrapper.py +33 -0
  6. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/environment.py +1 -1
  7. athena_intelligence-0.1.5/src/athena/types/__init__.py +19 -0
  8. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/types/http_validation_error.py +1 -1
  9. athena_intelligence-0.1.5/src/athena/types/message_out.py +28 -0
  10. athena_intelligence-0.1.5/src/athena/types/message_out_dto.py +33 -0
  11. athena_intelligence-0.1.5/src/athena/types/model.py +29 -0
  12. athena_intelligence-0.1.5/src/athena/types/tools.py +45 -0
  13. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/types/validation_error.py +4 -3
  14. athena_intelligence-0.1.4/src/athena/resources/__init__.py → athena_intelligence-0.1.5/src/athena/types/validation_error_loc_item.py +2 -2
  15. athena_intelligence-0.1.4/src/athena/__init__.py +0 -8
  16. athena_intelligence-0.1.4/src/athena/client.py +0 -100
  17. athena_intelligence-0.1.4/src/athena/core/client_wrapper.py +0 -45
  18. athena_intelligence-0.1.4/src/athena/resources/message/__init__.py +0 -2
  19. athena_intelligence-0.1.4/src/athena/resources/message/client.py +0 -329
  20. athena_intelligence-0.1.4/src/athena/types/__init__.py +0 -6
  21. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/README.md +0 -0
  22. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/__init__.py +0 -0
  23. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/api_error.py +0 -0
  24. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/datetime_utils.py +0 -0
  25. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/file.py +0 -0
  26. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/jsonable_encoder.py +0 -0
  27. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/remove_none_from_dict.py +0 -0
  28. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/core/request_options.py +0 -0
  29. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/errors/__init__.py +0 -0
  30. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/errors/unprocessable_entity_error.py +0 -0
  31. {athena_intelligence-0.1.4 → athena_intelligence-0.1.5}/src/athena/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: athena-intelligence
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "athena-intelligence"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  description = ""
5
5
  readme = "README.md"
6
6
  authors = []
@@ -0,0 +1,17 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import HttpValidationError, MessageOut, MessageOutDto, Model, Tools, ValidationError, ValidationErrorLocItem
4
+ from .errors import UnprocessableEntityError
5
+ from .environment import AthenaEnvironment
6
+
7
+ __all__ = [
8
+ "AthenaEnvironment",
9
+ "HttpValidationError",
10
+ "MessageOut",
11
+ "MessageOutDto",
12
+ "Model",
13
+ "Tools",
14
+ "UnprocessableEntityError",
15
+ "ValidationError",
16
+ "ValidationErrorLocItem",
17
+ ]
@@ -0,0 +1,419 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ import urllib.parse
5
+ from json.decoder import JSONDecodeError
6
+
7
+ import httpx
8
+
9
+ from .core.api_error import ApiError
10
+ from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
+ from .core.jsonable_encoder import jsonable_encoder
12
+ from .core.remove_none_from_dict import remove_none_from_dict
13
+ from .core.request_options import RequestOptions
14
+ from .environment import AthenaEnvironment
15
+ from .errors.unprocessable_entity_error import UnprocessableEntityError
16
+ from .types.http_validation_error import HttpValidationError
17
+ from .types.message_out import MessageOut
18
+ from .types.message_out_dto import MessageOutDto
19
+ from .types.model import Model
20
+ from .types.tools import Tools
21
+
22
+ try:
23
+ import pydantic.v1 as pydantic # type: ignore
24
+ except ImportError:
25
+ import pydantic # type: ignore
26
+
27
+ # this is used as the default value for optional parameters
28
+ OMIT = typing.cast(typing.Any, ...)
29
+
30
+
31
+ class Athena:
32
+ """
33
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
34
+
35
+ Parameters:
36
+ - base_url: typing.Optional[str]. The base url to use for requests from the client.
37
+
38
+ - environment: AthenaEnvironment. The environment to use for requests from the client. from .environment import AthenaEnvironment
39
+
40
+ Defaults to AthenaEnvironment.DEFAULT
41
+
42
+ - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.
43
+
44
+ - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
45
+ ---
46
+ from athena.client import Athena
47
+
48
+ client = Athena()
49
+ """
50
+
51
+ def __init__(
52
+ self,
53
+ *,
54
+ base_url: typing.Optional[str] = None,
55
+ environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
56
+ timeout: typing.Optional[float] = 60,
57
+ httpx_client: typing.Optional[httpx.Client] = None,
58
+ ):
59
+ self._client_wrapper = SyncClientWrapper(
60
+ base_url=_get_base_url(base_url=base_url, environment=environment),
61
+ httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
62
+ )
63
+
64
+ def health_check(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
65
+ """
66
+ Checks the health of a project.
67
+
68
+ It returns 200 if the project is healthy.
69
+
70
+ Parameters:
71
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
72
+ ---
73
+ from athena.client import Athena
74
+
75
+ client = Athena()
76
+ client.health_check()
77
+ """
78
+ _response = self._client_wrapper.httpx_client.request(
79
+ "GET",
80
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/health"),
81
+ params=jsonable_encoder(
82
+ request_options.get("additional_query_parameters") if request_options is not None else None
83
+ ),
84
+ headers=jsonable_encoder(
85
+ remove_none_from_dict(
86
+ {
87
+ **self._client_wrapper.get_headers(),
88
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
89
+ }
90
+ )
91
+ ),
92
+ timeout=request_options.get("timeout_in_seconds")
93
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
94
+ else 60,
95
+ )
96
+ if 200 <= _response.status_code < 300:
97
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
98
+ try:
99
+ _response_json = _response.json()
100
+ except JSONDecodeError:
101
+ raise ApiError(status_code=_response.status_code, body=_response.text)
102
+ raise ApiError(status_code=_response.status_code, body=_response_json)
103
+
104
+ def athena_get_message(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> MessageOutDto:
105
+ """
106
+ Parameters:
107
+ - id: str.
108
+
109
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
110
+ ---
111
+ from athena.client import Athena
112
+
113
+ client = Athena()
114
+ client.athena_get_message(
115
+ id="id",
116
+ )
117
+ """
118
+ _response = self._client_wrapper.httpx_client.request(
119
+ "GET",
120
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v0/message/{jsonable_encoder(id)}"),
121
+ params=jsonable_encoder(
122
+ request_options.get("additional_query_parameters") if request_options is not None else None
123
+ ),
124
+ headers=jsonable_encoder(
125
+ remove_none_from_dict(
126
+ {
127
+ **self._client_wrapper.get_headers(),
128
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
129
+ }
130
+ )
131
+ ),
132
+ timeout=request_options.get("timeout_in_seconds")
133
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
134
+ else 60,
135
+ )
136
+ if 200 <= _response.status_code < 300:
137
+ return pydantic.parse_obj_as(MessageOutDto, _response.json()) # type: ignore
138
+ if _response.status_code == 422:
139
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
140
+ try:
141
+ _response_json = _response.json()
142
+ except JSONDecodeError:
143
+ raise ApiError(status_code=_response.status_code, body=_response.text)
144
+ raise ApiError(status_code=_response.status_code, body=_response_json)
145
+
146
+ def post_message(
147
+ self,
148
+ *,
149
+ content: str,
150
+ model: typing.Optional[Model] = OMIT,
151
+ tools: typing.Optional[typing.Sequence[Tools]] = OMIT,
152
+ conversation_id: typing.Optional[str] = OMIT,
153
+ conversation_name: typing.Optional[str] = OMIT,
154
+ request_options: typing.Optional[RequestOptions] = None,
155
+ ) -> MessageOut:
156
+ """
157
+ Parameters:
158
+ - content: str.
159
+
160
+ - model: typing.Optional[Model].
161
+
162
+ - tools: typing.Optional[typing.Sequence[Tools]].
163
+
164
+ - conversation_id: typing.Optional[str].
165
+
166
+ - conversation_name: typing.Optional[str].
167
+
168
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
169
+ ---
170
+ from athena.client import Athena
171
+
172
+ client = Athena()
173
+ client.post_message(
174
+ content="content",
175
+ )
176
+ """
177
+ _request: typing.Dict[str, typing.Any] = {"content": content}
178
+ if model is not OMIT:
179
+ _request["model"] = model.value if model is not None else None
180
+ if tools is not OMIT:
181
+ _request["tools"] = tools
182
+ if conversation_id is not OMIT:
183
+ _request["conversation_id"] = conversation_id
184
+ if conversation_name is not OMIT:
185
+ _request["conversation_name"] = conversation_name
186
+ _response = self._client_wrapper.httpx_client.request(
187
+ "POST",
188
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/message"),
189
+ params=jsonable_encoder(
190
+ request_options.get("additional_query_parameters") if request_options is not None else None
191
+ ),
192
+ json=jsonable_encoder(_request)
193
+ if request_options is None or request_options.get("additional_body_parameters") is None
194
+ else {
195
+ **jsonable_encoder(_request),
196
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
197
+ },
198
+ headers=jsonable_encoder(
199
+ remove_none_from_dict(
200
+ {
201
+ **self._client_wrapper.get_headers(),
202
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
203
+ }
204
+ )
205
+ ),
206
+ timeout=request_options.get("timeout_in_seconds")
207
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
208
+ else 60,
209
+ )
210
+ if 200 <= _response.status_code < 300:
211
+ return pydantic.parse_obj_as(MessageOut, _response.json()) # type: ignore
212
+ if _response.status_code == 422:
213
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
214
+ try:
215
+ _response_json = _response.json()
216
+ except JSONDecodeError:
217
+ raise ApiError(status_code=_response.status_code, body=_response.text)
218
+ raise ApiError(status_code=_response.status_code, body=_response_json)
219
+
220
+
221
+ class AsyncAthena:
222
+ """
223
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
224
+
225
+ Parameters:
226
+ - base_url: typing.Optional[str]. The base url to use for requests from the client.
227
+
228
+ - environment: AthenaEnvironment. The environment to use for requests from the client. from .environment import AthenaEnvironment
229
+
230
+ Defaults to AthenaEnvironment.DEFAULT
231
+
232
+ - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.
233
+
234
+ - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
235
+ ---
236
+ from athena.client import AsyncAthena
237
+
238
+ client = AsyncAthena()
239
+ """
240
+
241
+ def __init__(
242
+ self,
243
+ *,
244
+ base_url: typing.Optional[str] = None,
245
+ environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
246
+ timeout: typing.Optional[float] = 60,
247
+ httpx_client: typing.Optional[httpx.AsyncClient] = None,
248
+ ):
249
+ self._client_wrapper = AsyncClientWrapper(
250
+ base_url=_get_base_url(base_url=base_url, environment=environment),
251
+ httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
252
+ )
253
+
254
+ async def health_check(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
255
+ """
256
+ Checks the health of a project.
257
+
258
+ It returns 200 if the project is healthy.
259
+
260
+ Parameters:
261
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
262
+ ---
263
+ from athena.client import AsyncAthena
264
+
265
+ client = AsyncAthena()
266
+ await client.health_check()
267
+ """
268
+ _response = await self._client_wrapper.httpx_client.request(
269
+ "GET",
270
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/health"),
271
+ params=jsonable_encoder(
272
+ request_options.get("additional_query_parameters") if request_options is not None else None
273
+ ),
274
+ headers=jsonable_encoder(
275
+ remove_none_from_dict(
276
+ {
277
+ **self._client_wrapper.get_headers(),
278
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
279
+ }
280
+ )
281
+ ),
282
+ timeout=request_options.get("timeout_in_seconds")
283
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
284
+ else 60,
285
+ )
286
+ if 200 <= _response.status_code < 300:
287
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
288
+ try:
289
+ _response_json = _response.json()
290
+ except JSONDecodeError:
291
+ raise ApiError(status_code=_response.status_code, body=_response.text)
292
+ raise ApiError(status_code=_response.status_code, body=_response_json)
293
+
294
+ async def athena_get_message(
295
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
296
+ ) -> MessageOutDto:
297
+ """
298
+ Parameters:
299
+ - id: str.
300
+
301
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
302
+ ---
303
+ from athena.client import AsyncAthena
304
+
305
+ client = AsyncAthena()
306
+ await client.athena_get_message(
307
+ id="id",
308
+ )
309
+ """
310
+ _response = await self._client_wrapper.httpx_client.request(
311
+ "GET",
312
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v0/message/{jsonable_encoder(id)}"),
313
+ params=jsonable_encoder(
314
+ request_options.get("additional_query_parameters") if request_options is not None else None
315
+ ),
316
+ headers=jsonable_encoder(
317
+ remove_none_from_dict(
318
+ {
319
+ **self._client_wrapper.get_headers(),
320
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
321
+ }
322
+ )
323
+ ),
324
+ timeout=request_options.get("timeout_in_seconds")
325
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
326
+ else 60,
327
+ )
328
+ if 200 <= _response.status_code < 300:
329
+ return pydantic.parse_obj_as(MessageOutDto, _response.json()) # type: ignore
330
+ if _response.status_code == 422:
331
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
332
+ try:
333
+ _response_json = _response.json()
334
+ except JSONDecodeError:
335
+ raise ApiError(status_code=_response.status_code, body=_response.text)
336
+ raise ApiError(status_code=_response.status_code, body=_response_json)
337
+
338
+ async def post_message(
339
+ self,
340
+ *,
341
+ content: str,
342
+ model: typing.Optional[Model] = OMIT,
343
+ tools: typing.Optional[typing.Sequence[Tools]] = OMIT,
344
+ conversation_id: typing.Optional[str] = OMIT,
345
+ conversation_name: typing.Optional[str] = OMIT,
346
+ request_options: typing.Optional[RequestOptions] = None,
347
+ ) -> MessageOut:
348
+ """
349
+ Parameters:
350
+ - content: str.
351
+
352
+ - model: typing.Optional[Model].
353
+
354
+ - tools: typing.Optional[typing.Sequence[Tools]].
355
+
356
+ - conversation_id: typing.Optional[str].
357
+
358
+ - conversation_name: typing.Optional[str].
359
+
360
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
361
+ ---
362
+ from athena.client import AsyncAthena
363
+
364
+ client = AsyncAthena()
365
+ await client.post_message(
366
+ content="content",
367
+ )
368
+ """
369
+ _request: typing.Dict[str, typing.Any] = {"content": content}
370
+ if model is not OMIT:
371
+ _request["model"] = model.value if model is not None else None
372
+ if tools is not OMIT:
373
+ _request["tools"] = tools
374
+ if conversation_id is not OMIT:
375
+ _request["conversation_id"] = conversation_id
376
+ if conversation_name is not OMIT:
377
+ _request["conversation_name"] = conversation_name
378
+ _response = await self._client_wrapper.httpx_client.request(
379
+ "POST",
380
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/message"),
381
+ params=jsonable_encoder(
382
+ request_options.get("additional_query_parameters") if request_options is not None else None
383
+ ),
384
+ json=jsonable_encoder(_request)
385
+ if request_options is None or request_options.get("additional_body_parameters") is None
386
+ else {
387
+ **jsonable_encoder(_request),
388
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
389
+ },
390
+ headers=jsonable_encoder(
391
+ remove_none_from_dict(
392
+ {
393
+ **self._client_wrapper.get_headers(),
394
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
395
+ }
396
+ )
397
+ ),
398
+ timeout=request_options.get("timeout_in_seconds")
399
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
400
+ else 60,
401
+ )
402
+ if 200 <= _response.status_code < 300:
403
+ return pydantic.parse_obj_as(MessageOut, _response.json()) # type: ignore
404
+ if _response.status_code == 422:
405
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
406
+ try:
407
+ _response_json = _response.json()
408
+ except JSONDecodeError:
409
+ raise ApiError(status_code=_response.status_code, body=_response.text)
410
+ raise ApiError(status_code=_response.status_code, body=_response_json)
411
+
412
+
413
+ def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AthenaEnvironment) -> str:
414
+ if base_url is not None:
415
+ return base_url
416
+ elif environment is not None:
417
+ return environment.value
418
+ else:
419
+ raise Exception("Please pass in either base_url or environment to construct the client")
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import httpx
6
+
7
+
8
+ class BaseClientWrapper:
9
+ def __init__(self, *, base_url: str):
10
+ self._base_url = base_url
11
+
12
+ def get_headers(self) -> typing.Dict[str, str]:
13
+ headers: typing.Dict[str, str] = {
14
+ "X-Fern-Language": "Python",
15
+ "X-Fern-SDK-Name": "athena-intelligence",
16
+ "X-Fern-SDK-Version": "0.1.5",
17
+ }
18
+ return headers
19
+
20
+ def get_base_url(self) -> str:
21
+ return self._base_url
22
+
23
+
24
+ class SyncClientWrapper(BaseClientWrapper):
25
+ def __init__(self, *, base_url: str, httpx_client: httpx.Client):
26
+ super().__init__(base_url=base_url)
27
+ self.httpx_client = httpx_client
28
+
29
+
30
+ class AsyncClientWrapper(BaseClientWrapper):
31
+ def __init__(self, *, base_url: str, httpx_client: httpx.AsyncClient):
32
+ super().__init__(base_url=base_url)
33
+ self.httpx_client = httpx_client
@@ -4,4 +4,4 @@ import enum
4
4
 
5
5
 
6
6
  class AthenaEnvironment(enum.Enum):
7
- PRODUCTION = "https://api.athenaintelligence.ai"
7
+ DEFAULT = "https://api.athenaintelligence.ai"
@@ -0,0 +1,19 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .http_validation_error import HttpValidationError
4
+ from .message_out import MessageOut
5
+ from .message_out_dto import MessageOutDto
6
+ from .model import Model
7
+ from .tools import Tools
8
+ from .validation_error import ValidationError
9
+ from .validation_error_loc_item import ValidationErrorLocItem
10
+
11
+ __all__ = [
12
+ "HttpValidationError",
13
+ "MessageOut",
14
+ "MessageOutDto",
15
+ "Model",
16
+ "Tools",
17
+ "ValidationError",
18
+ "ValidationErrorLocItem",
19
+ ]
@@ -13,7 +13,7 @@ except ImportError:
13
13
 
14
14
 
15
15
  class HttpValidationError(pydantic.BaseModel):
16
- detail: typing.List[ValidationError]
16
+ detail: typing.Optional[typing.List[ValidationError]] = None
17
17
 
18
18
  def json(self, **kwargs: typing.Any) -> str:
19
19
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -0,0 +1,28 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
13
+
14
+ class MessageOut(pydantic.BaseModel):
15
+ id: str
16
+
17
+ def json(self, **kwargs: typing.Any) -> str:
18
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
+ return super().json(**kwargs_with_defaults)
20
+
21
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().dict(**kwargs_with_defaults)
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
13
+
14
+ class MessageOutDto(pydantic.BaseModel):
15
+ id: str
16
+ conversation_id: str
17
+ logs: typing.Optional[str] = None
18
+ content: typing.Optional[str] = None
19
+ created_at: str
20
+ status: str
21
+
22
+ def json(self, **kwargs: typing.Any) -> str:
23
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
+ return super().json(**kwargs_with_defaults)
25
+
26
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28
+ return super().dict(**kwargs_with_defaults)
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,29 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import enum
4
+ import typing
5
+
6
+ T_Result = typing.TypeVar("T_Result")
7
+
8
+
9
+ class Model(str, enum.Enum):
10
+ """
11
+ An enumeration.
12
+ """
13
+
14
+ GPT_4 = "gpt_4"
15
+ GPT_4_TURBO_PREVIEW = "gpt_4_turbo_preview"
16
+ GPT_3_5_TURBO = "gpt_3_5_turbo"
17
+
18
+ def visit(
19
+ self,
20
+ gpt_4: typing.Callable[[], T_Result],
21
+ gpt_4_turbo_preview: typing.Callable[[], T_Result],
22
+ gpt_3_5_turbo: typing.Callable[[], T_Result],
23
+ ) -> T_Result:
24
+ if self is Model.GPT_4:
25
+ return gpt_4()
26
+ if self is Model.GPT_4_TURBO_PREVIEW:
27
+ return gpt_4_turbo_preview()
28
+ if self is Model.GPT_3_5_TURBO:
29
+ return gpt_3_5_turbo()
@@ -0,0 +1,45 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import enum
4
+ import typing
5
+
6
+ T_Result = typing.TypeVar("T_Result")
7
+
8
+
9
+ class Tools(str, enum.Enum):
10
+ """
11
+ An enumeration.
12
+ """
13
+
14
+ SEARCH = "search"
15
+ BROWSE = "browse"
16
+ DATABASE_METADATA = "database_metadata"
17
+ QUERY = "query"
18
+ CHART = "chart"
19
+ ENRICH_PERSON = "enrich_person"
20
+ ENRICH_COMPANY = "enrich_company"
21
+
22
+ def visit(
23
+ self,
24
+ search: typing.Callable[[], T_Result],
25
+ browse: typing.Callable[[], T_Result],
26
+ database_metadata: typing.Callable[[], T_Result],
27
+ query: typing.Callable[[], T_Result],
28
+ chart: typing.Callable[[], T_Result],
29
+ enrich_person: typing.Callable[[], T_Result],
30
+ enrich_company: typing.Callable[[], T_Result],
31
+ ) -> T_Result:
32
+ if self is Tools.SEARCH:
33
+ return search()
34
+ if self is Tools.BROWSE:
35
+ return browse()
36
+ if self is Tools.DATABASE_METADATA:
37
+ return database_metadata()
38
+ if self is Tools.QUERY:
39
+ return query()
40
+ if self is Tools.CHART:
41
+ return chart()
42
+ if self is Tools.ENRICH_PERSON:
43
+ return enrich_person()
44
+ if self is Tools.ENRICH_COMPANY:
45
+ return enrich_company()
@@ -4,6 +4,7 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from .validation_error_loc_item import ValidationErrorLocItem
7
8
 
8
9
  try:
9
10
  import pydantic.v1 as pydantic # type: ignore
@@ -12,9 +13,9 @@ except ImportError:
12
13
 
13
14
 
14
15
  class ValidationError(pydantic.BaseModel):
15
- loc: typing.Optional[typing.List[str]] = None
16
- msg: typing.Optional[str] = None
17
- type: typing.Optional[str] = None
16
+ loc: typing.List[ValidationErrorLocItem]
17
+ msg: str
18
+ type: str
18
19
 
19
20
  def json(self, **kwargs: typing.Any) -> str:
20
21
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -1,5 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from . import message
3
+ import typing
4
4
 
5
- __all__ = ["message"]
5
+ ValidationErrorLocItem = typing.Union[str, int]
@@ -1,8 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .types import HttpValidationError, ValidationError
4
- from .errors import UnprocessableEntityError
5
- from .resources import message
6
- from .environment import AthenaEnvironment
7
-
8
- __all__ = ["AthenaEnvironment", "HttpValidationError", "UnprocessableEntityError", "ValidationError", "message"]
@@ -1,100 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- import httpx
6
-
7
- from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
- from .environment import AthenaEnvironment
9
- from .resources.message.client import AsyncMessageClient, MessageClient
10
-
11
-
12
- class Athena:
13
- """
14
- Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
15
-
16
- Parameters:
17
- - base_url: typing.Optional[str]. The base url to use for requests from the client.
18
-
19
- - environment: AthenaEnvironment. The environment to use for requests from the client. from .environment import AthenaEnvironment
20
-
21
- Defaults to AthenaEnvironment.PRODUCTION
22
-
23
- - token: typing.Union[str, typing.Callable[[], str]].
24
-
25
- - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.
26
-
27
- - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
28
- ---
29
- from athena.client import Athena
30
-
31
- client = Athena(
32
- token="YOUR_TOKEN",
33
- )
34
- """
35
-
36
- def __init__(
37
- self,
38
- *,
39
- base_url: typing.Optional[str] = None,
40
- environment: AthenaEnvironment = AthenaEnvironment.PRODUCTION,
41
- token: typing.Union[str, typing.Callable[[], str]],
42
- timeout: typing.Optional[float] = 60,
43
- httpx_client: typing.Optional[httpx.Client] = None
44
- ):
45
- self._client_wrapper = SyncClientWrapper(
46
- base_url=_get_base_url(base_url=base_url, environment=environment),
47
- token=token,
48
- httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
49
- )
50
- self.message = MessageClient(client_wrapper=self._client_wrapper)
51
-
52
-
53
- class AsyncAthena:
54
- """
55
- Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
56
-
57
- Parameters:
58
- - base_url: typing.Optional[str]. The base url to use for requests from the client.
59
-
60
- - environment: AthenaEnvironment. The environment to use for requests from the client. from .environment import AthenaEnvironment
61
-
62
- Defaults to AthenaEnvironment.PRODUCTION
63
-
64
- - token: typing.Union[str, typing.Callable[[], str]].
65
-
66
- - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.
67
-
68
- - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
69
- ---
70
- from athena.client import AsyncAthena
71
-
72
- client = AsyncAthena(
73
- token="YOUR_TOKEN",
74
- )
75
- """
76
-
77
- def __init__(
78
- self,
79
- *,
80
- base_url: typing.Optional[str] = None,
81
- environment: AthenaEnvironment = AthenaEnvironment.PRODUCTION,
82
- token: typing.Union[str, typing.Callable[[], str]],
83
- timeout: typing.Optional[float] = 60,
84
- httpx_client: typing.Optional[httpx.AsyncClient] = None
85
- ):
86
- self._client_wrapper = AsyncClientWrapper(
87
- base_url=_get_base_url(base_url=base_url, environment=environment),
88
- token=token,
89
- httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
90
- )
91
- self.message = AsyncMessageClient(client_wrapper=self._client_wrapper)
92
-
93
-
94
- def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AthenaEnvironment) -> str:
95
- if base_url is not None:
96
- return base_url
97
- elif environment is not None:
98
- return environment.value
99
- else:
100
- raise Exception("Please pass in either base_url or environment to construct the client")
@@ -1,45 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- import httpx
6
-
7
-
8
- class BaseClientWrapper:
9
- def __init__(self, *, token: typing.Union[str, typing.Callable[[], str]], base_url: str):
10
- self._token = token
11
- self._base_url = base_url
12
-
13
- def get_headers(self) -> typing.Dict[str, str]:
14
- headers: typing.Dict[str, str] = {
15
- "X-Fern-Language": "Python",
16
- "X-Fern-SDK-Name": "athena-intelligence",
17
- "X-Fern-SDK-Version": "0.1.4",
18
- }
19
- headers["Authorization"] = f"Bearer {self._get_token()}"
20
- return headers
21
-
22
- def _get_token(self) -> str:
23
- if isinstance(self._token, str):
24
- return self._token
25
- else:
26
- return self._token()
27
-
28
- def get_base_url(self) -> str:
29
- return self._base_url
30
-
31
-
32
- class SyncClientWrapper(BaseClientWrapper):
33
- def __init__(
34
- self, *, token: typing.Union[str, typing.Callable[[], str]], base_url: str, httpx_client: httpx.Client
35
- ):
36
- super().__init__(token=token, base_url=base_url)
37
- self.httpx_client = httpx_client
38
-
39
-
40
- class AsyncClientWrapper(BaseClientWrapper):
41
- def __init__(
42
- self, *, token: typing.Union[str, typing.Callable[[], str]], base_url: str, httpx_client: httpx.AsyncClient
43
- ):
44
- super().__init__(token=token, base_url=base_url)
45
- self.httpx_client = httpx_client
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
@@ -1,329 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- import urllib.parse
5
- from json.decoder import JSONDecodeError
6
-
7
- from ...core.api_error import ApiError
8
- from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
- from ...core.jsonable_encoder import jsonable_encoder
10
- from ...core.remove_none_from_dict import remove_none_from_dict
11
- from ...core.request_options import RequestOptions
12
- from ...errors.unprocessable_entity_error import UnprocessableEntityError
13
- from ...types.http_validation_error import HttpValidationError
14
-
15
- try:
16
- import pydantic.v1 as pydantic # type: ignore
17
- except ImportError:
18
- import pydantic # type: ignore
19
-
20
- # this is used as the default value for optional parameters
21
- OMIT = typing.cast(typing.Any, ...)
22
-
23
-
24
- class MessageClient:
25
- def __init__(self, *, client_wrapper: SyncClientWrapper):
26
- self._client_wrapper = client_wrapper
27
-
28
- def get(self, *, message_id: str, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
29
- """
30
- Parameters:
31
- - message_id: str. The ID of the message to retrieve
32
-
33
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
34
- ---
35
- from athena.client import Athena
36
-
37
- client = Athena(
38
- token="YOUR_TOKEN",
39
- )
40
- client.message.get(
41
- message_id="message_id",
42
- )
43
- """
44
- _response = self._client_wrapper.httpx_client.request(
45
- "GET",
46
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/auth/athena-get-message"),
47
- params=jsonable_encoder(
48
- remove_none_from_dict(
49
- {
50
- "message_id": message_id,
51
- **(
52
- request_options.get("additional_query_parameters", {})
53
- if request_options is not None
54
- else {}
55
- ),
56
- }
57
- )
58
- ),
59
- headers=jsonable_encoder(
60
- remove_none_from_dict(
61
- {
62
- **self._client_wrapper.get_headers(),
63
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
64
- }
65
- )
66
- ),
67
- timeout=request_options.get("timeout_in_seconds")
68
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
69
- else 60,
70
- )
71
- if 200 <= _response.status_code < 300:
72
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
73
- if _response.status_code == 422:
74
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
75
- try:
76
- _response_json = _response.json()
77
- except JSONDecodeError:
78
- raise ApiError(status_code=_response.status_code, body=_response.text)
79
- raise ApiError(status_code=_response.status_code, body=_response_json)
80
-
81
- def submit(
82
- self,
83
- *,
84
- additional_context: typing.Optional[str] = OMIT,
85
- config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
86
- content: str,
87
- conversation_id: typing.Optional[str] = OMIT,
88
- conversation_name: typing.Optional[str] = OMIT,
89
- documents: typing.Optional[typing.Sequence[str]] = OMIT,
90
- model: typing.Optional[str] = OMIT,
91
- sdataset_ids: typing.Optional[typing.Sequence[str]] = OMIT,
92
- tools: typing.Optional[typing.Sequence[str]] = OMIT,
93
- request_options: typing.Optional[RequestOptions] = None,
94
- ) -> typing.Any:
95
- """
96
- Parameters:
97
- - additional_context: typing.Optional[str].
98
-
99
- - config: typing.Optional[typing.Dict[str, typing.Any]].
100
-
101
- - content: str.
102
-
103
- - conversation_id: typing.Optional[str].
104
-
105
- - conversation_name: typing.Optional[str].
106
-
107
- - documents: typing.Optional[typing.Sequence[str]].
108
-
109
- - model: typing.Optional[str].
110
-
111
- - sdataset_ids: typing.Optional[typing.Sequence[str]].
112
-
113
- - tools: typing.Optional[typing.Sequence[str]].
114
-
115
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
116
- ---
117
- from athena.client import Athena
118
-
119
- client = Athena(
120
- token="YOUR_TOKEN",
121
- )
122
- client.message.submit(
123
- content="content",
124
- )
125
- """
126
- _request: typing.Dict[str, typing.Any] = {"content": content}
127
- if additional_context is not OMIT:
128
- _request["additional_context"] = additional_context
129
- if config is not OMIT:
130
- _request["config"] = config
131
- if conversation_id is not OMIT:
132
- _request["conversation_id"] = conversation_id
133
- if conversation_name is not OMIT:
134
- _request["conversation_name"] = conversation_name
135
- if documents is not OMIT:
136
- _request["documents"] = documents
137
- if model is not OMIT:
138
- _request["model"] = model
139
- if sdataset_ids is not OMIT:
140
- _request["sdataset_ids"] = sdataset_ids
141
- if tools is not OMIT:
142
- _request["tools"] = tools
143
- _response = self._client_wrapper.httpx_client.request(
144
- "POST",
145
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/auth/athena-submit-message"),
146
- params=jsonable_encoder(
147
- request_options.get("additional_query_parameters") if request_options is not None else None
148
- ),
149
- json=jsonable_encoder(_request)
150
- if request_options is None or request_options.get("additional_body_parameters") is None
151
- else {
152
- **jsonable_encoder(_request),
153
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
154
- },
155
- headers=jsonable_encoder(
156
- remove_none_from_dict(
157
- {
158
- **self._client_wrapper.get_headers(),
159
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
160
- }
161
- )
162
- ),
163
- timeout=request_options.get("timeout_in_seconds")
164
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
165
- else 60,
166
- )
167
- if 200 <= _response.status_code < 300:
168
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
169
- if _response.status_code == 422:
170
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
171
- try:
172
- _response_json = _response.json()
173
- except JSONDecodeError:
174
- raise ApiError(status_code=_response.status_code, body=_response.text)
175
- raise ApiError(status_code=_response.status_code, body=_response_json)
176
-
177
-
178
- class AsyncMessageClient:
179
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
180
- self._client_wrapper = client_wrapper
181
-
182
- async def get(self, *, message_id: str, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
183
- """
184
- Parameters:
185
- - message_id: str. The ID of the message to retrieve
186
-
187
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
188
- ---
189
- from athena.client import AsyncAthena
190
-
191
- client = AsyncAthena(
192
- token="YOUR_TOKEN",
193
- )
194
- await client.message.get(
195
- message_id="message_id",
196
- )
197
- """
198
- _response = await self._client_wrapper.httpx_client.request(
199
- "GET",
200
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/auth/athena-get-message"),
201
- params=jsonable_encoder(
202
- remove_none_from_dict(
203
- {
204
- "message_id": message_id,
205
- **(
206
- request_options.get("additional_query_parameters", {})
207
- if request_options is not None
208
- else {}
209
- ),
210
- }
211
- )
212
- ),
213
- headers=jsonable_encoder(
214
- remove_none_from_dict(
215
- {
216
- **self._client_wrapper.get_headers(),
217
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
218
- }
219
- )
220
- ),
221
- timeout=request_options.get("timeout_in_seconds")
222
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
223
- else 60,
224
- )
225
- if 200 <= _response.status_code < 300:
226
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
227
- if _response.status_code == 422:
228
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
229
- try:
230
- _response_json = _response.json()
231
- except JSONDecodeError:
232
- raise ApiError(status_code=_response.status_code, body=_response.text)
233
- raise ApiError(status_code=_response.status_code, body=_response_json)
234
-
235
- async def submit(
236
- self,
237
- *,
238
- additional_context: typing.Optional[str] = OMIT,
239
- config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
240
- content: str,
241
- conversation_id: typing.Optional[str] = OMIT,
242
- conversation_name: typing.Optional[str] = OMIT,
243
- documents: typing.Optional[typing.Sequence[str]] = OMIT,
244
- model: typing.Optional[str] = OMIT,
245
- sdataset_ids: typing.Optional[typing.Sequence[str]] = OMIT,
246
- tools: typing.Optional[typing.Sequence[str]] = OMIT,
247
- request_options: typing.Optional[RequestOptions] = None,
248
- ) -> typing.Any:
249
- """
250
- Parameters:
251
- - additional_context: typing.Optional[str].
252
-
253
- - config: typing.Optional[typing.Dict[str, typing.Any]].
254
-
255
- - content: str.
256
-
257
- - conversation_id: typing.Optional[str].
258
-
259
- - conversation_name: typing.Optional[str].
260
-
261
- - documents: typing.Optional[typing.Sequence[str]].
262
-
263
- - model: typing.Optional[str].
264
-
265
- - sdataset_ids: typing.Optional[typing.Sequence[str]].
266
-
267
- - tools: typing.Optional[typing.Sequence[str]].
268
-
269
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
270
- ---
271
- from athena.client import AsyncAthena
272
-
273
- client = AsyncAthena(
274
- token="YOUR_TOKEN",
275
- )
276
- await client.message.submit(
277
- content="content",
278
- )
279
- """
280
- _request: typing.Dict[str, typing.Any] = {"content": content}
281
- if additional_context is not OMIT:
282
- _request["additional_context"] = additional_context
283
- if config is not OMIT:
284
- _request["config"] = config
285
- if conversation_id is not OMIT:
286
- _request["conversation_id"] = conversation_id
287
- if conversation_name is not OMIT:
288
- _request["conversation_name"] = conversation_name
289
- if documents is not OMIT:
290
- _request["documents"] = documents
291
- if model is not OMIT:
292
- _request["model"] = model
293
- if sdataset_ids is not OMIT:
294
- _request["sdataset_ids"] = sdataset_ids
295
- if tools is not OMIT:
296
- _request["tools"] = tools
297
- _response = await self._client_wrapper.httpx_client.request(
298
- "POST",
299
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/auth/athena-submit-message"),
300
- params=jsonable_encoder(
301
- request_options.get("additional_query_parameters") if request_options is not None else None
302
- ),
303
- json=jsonable_encoder(_request)
304
- if request_options is None or request_options.get("additional_body_parameters") is None
305
- else {
306
- **jsonable_encoder(_request),
307
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
308
- },
309
- headers=jsonable_encoder(
310
- remove_none_from_dict(
311
- {
312
- **self._client_wrapper.get_headers(),
313
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
314
- }
315
- )
316
- ),
317
- timeout=request_options.get("timeout_in_seconds")
318
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
319
- else 60,
320
- )
321
- if 200 <= _response.status_code < 300:
322
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
323
- if _response.status_code == 422:
324
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
325
- try:
326
- _response_json = _response.json()
327
- except JSONDecodeError:
328
- raise ApiError(status_code=_response.status_code, body=_response.text)
329
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -1,6 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .http_validation_error import HttpValidationError
4
- from .validation_error import ValidationError
5
-
6
- __all__ = ["HttpValidationError", "ValidationError"]