athena-intelligence 0.1.54__py3-none-any.whl → 0.1.56__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- athena/__init__.py +2 -0
- athena/core/client_wrapper.py +1 -1
- athena/snippet/client.py +112 -0
- athena/types/__init__.py +2 -0
- athena/types/get_snippet_out.py +25 -0
- {athena_intelligence-0.1.54.dist-info → athena_intelligence-0.1.56.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.54.dist-info → athena_intelligence-0.1.56.dist-info}/RECORD +8 -7
- {athena_intelligence-0.1.54.dist-info → athena_intelligence-0.1.56.dist-info}/WHEEL +0 -0
athena/__init__.py
CHANGED
@@ -7,6 +7,7 @@ from .types import (
|
|
7
7
|
FirecrawlScrapeUrlDataReponseDto,
|
8
8
|
FirecrawlScrapeUrlMetadata,
|
9
9
|
GetDatasetsResponse,
|
10
|
+
GetSnippetOut,
|
10
11
|
GetSnippetsResponse,
|
11
12
|
HttpValidationError,
|
12
13
|
LangchainDocumentsRequestOut,
|
@@ -38,6 +39,7 @@ __all__ = [
|
|
38
39
|
"FirecrawlScrapeUrlDataReponseDto",
|
39
40
|
"FirecrawlScrapeUrlMetadata",
|
40
41
|
"GetDatasetsResponse",
|
42
|
+
"GetSnippetOut",
|
41
43
|
"GetSnippetsResponse",
|
42
44
|
"HttpValidationError",
|
43
45
|
"LangchainDocumentsRequestOut",
|
athena/core/client_wrapper.py
CHANGED
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
18
18
|
"X-Fern-Language": "Python",
|
19
19
|
"X-Fern-SDK-Name": "athena-intelligence",
|
20
|
-
"X-Fern-SDK-Version": "0.1.
|
20
|
+
"X-Fern-SDK-Version": "0.1.56",
|
21
21
|
}
|
22
22
|
headers["X-API-KEY"] = self.api_key
|
23
23
|
return headers
|
athena/snippet/client.py
CHANGED
@@ -11,9 +11,13 @@ from ..core.pydantic_utilities import pydantic_v1
|
|
11
11
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
12
|
from ..core.request_options import RequestOptions
|
13
13
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
14
|
+
from ..types.get_snippet_out import GetSnippetOut
|
14
15
|
from ..types.get_snippets_response import GetSnippetsResponse
|
15
16
|
from ..types.http_validation_error import HttpValidationError
|
16
17
|
|
18
|
+
# this is used as the default value for optional parameters
|
19
|
+
OMIT = typing.cast(typing.Any, ...)
|
20
|
+
|
17
21
|
|
18
22
|
class SnippetClient:
|
19
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
@@ -83,6 +87,60 @@ class SnippetClient:
|
|
83
87
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
84
88
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
85
89
|
|
90
|
+
def get_by_id(self, *, id: str, request_options: typing.Optional[RequestOptions] = None) -> GetSnippetOut:
|
91
|
+
"""
|
92
|
+
Parameters:
|
93
|
+
- id: str.
|
94
|
+
|
95
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
96
|
+
---
|
97
|
+
from athena.client import Athena
|
98
|
+
|
99
|
+
client = Athena(
|
100
|
+
api_key="YOUR_API_KEY",
|
101
|
+
)
|
102
|
+
client.snippet.get_by_id(
|
103
|
+
id="snippet_02329f1b-f6ad-4e93-be84-355c33202024b",
|
104
|
+
)
|
105
|
+
"""
|
106
|
+
_response = self._client_wrapper.httpx_client.request(
|
107
|
+
method="POST",
|
108
|
+
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippet"),
|
109
|
+
params=jsonable_encoder(
|
110
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
111
|
+
),
|
112
|
+
json=jsonable_encoder({"id": id})
|
113
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
114
|
+
else {
|
115
|
+
**jsonable_encoder({"id": id}),
|
116
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
117
|
+
},
|
118
|
+
headers=jsonable_encoder(
|
119
|
+
remove_none_from_dict(
|
120
|
+
{
|
121
|
+
**self._client_wrapper.get_headers(),
|
122
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
123
|
+
}
|
124
|
+
)
|
125
|
+
),
|
126
|
+
timeout=request_options.get("timeout_in_seconds")
|
127
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
128
|
+
else self._client_wrapper.get_timeout(),
|
129
|
+
retries=0,
|
130
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
131
|
+
)
|
132
|
+
if 200 <= _response.status_code < 300:
|
133
|
+
return pydantic_v1.parse_obj_as(GetSnippetOut, _response.json()) # type: ignore
|
134
|
+
if _response.status_code == 422:
|
135
|
+
raise UnprocessableEntityError(
|
136
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
137
|
+
)
|
138
|
+
try:
|
139
|
+
_response_json = _response.json()
|
140
|
+
except JSONDecodeError:
|
141
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
142
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
143
|
+
|
86
144
|
|
87
145
|
class AsyncSnippetClient:
|
88
146
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -151,3 +209,57 @@ class AsyncSnippetClient:
|
|
151
209
|
except JSONDecodeError:
|
152
210
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
153
211
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
212
|
+
|
213
|
+
async def get_by_id(self, *, id: str, request_options: typing.Optional[RequestOptions] = None) -> GetSnippetOut:
|
214
|
+
"""
|
215
|
+
Parameters:
|
216
|
+
- id: str.
|
217
|
+
|
218
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
219
|
+
---
|
220
|
+
from athena.client import AsyncAthena
|
221
|
+
|
222
|
+
client = AsyncAthena(
|
223
|
+
api_key="YOUR_API_KEY",
|
224
|
+
)
|
225
|
+
await client.snippet.get_by_id(
|
226
|
+
id="snippet_02329f1b-f6ad-4e93-be84-355c33202024b",
|
227
|
+
)
|
228
|
+
"""
|
229
|
+
_response = await self._client_wrapper.httpx_client.request(
|
230
|
+
method="POST",
|
231
|
+
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippet"),
|
232
|
+
params=jsonable_encoder(
|
233
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
234
|
+
),
|
235
|
+
json=jsonable_encoder({"id": id})
|
236
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
237
|
+
else {
|
238
|
+
**jsonable_encoder({"id": id}),
|
239
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
240
|
+
},
|
241
|
+
headers=jsonable_encoder(
|
242
|
+
remove_none_from_dict(
|
243
|
+
{
|
244
|
+
**self._client_wrapper.get_headers(),
|
245
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
246
|
+
}
|
247
|
+
)
|
248
|
+
),
|
249
|
+
timeout=request_options.get("timeout_in_seconds")
|
250
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
251
|
+
else self._client_wrapper.get_timeout(),
|
252
|
+
retries=0,
|
253
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
254
|
+
)
|
255
|
+
if 200 <= _response.status_code < 300:
|
256
|
+
return pydantic_v1.parse_obj_as(GetSnippetOut, _response.json()) # type: ignore
|
257
|
+
if _response.status_code == 422:
|
258
|
+
raise UnprocessableEntityError(
|
259
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
260
|
+
)
|
261
|
+
try:
|
262
|
+
_response_json = _response.json()
|
263
|
+
except JSONDecodeError:
|
264
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
265
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
athena/types/__init__.py
CHANGED
@@ -6,6 +6,7 @@ from .excecute_tool_first_workflow_out import ExcecuteToolFirstWorkflowOut
|
|
6
6
|
from .firecrawl_scrape_url_data_reponse_dto import FirecrawlScrapeUrlDataReponseDto
|
7
7
|
from .firecrawl_scrape_url_metadata import FirecrawlScrapeUrlMetadata
|
8
8
|
from .get_datasets_response import GetDatasetsResponse
|
9
|
+
from .get_snippet_out import GetSnippetOut
|
9
10
|
from .get_snippets_response import GetSnippetsResponse
|
10
11
|
from .http_validation_error import HttpValidationError
|
11
12
|
from .langchain_documents_request_out import LangchainDocumentsRequestOut
|
@@ -31,6 +32,7 @@ __all__ = [
|
|
31
32
|
"FirecrawlScrapeUrlDataReponseDto",
|
32
33
|
"FirecrawlScrapeUrlMetadata",
|
33
34
|
"GetDatasetsResponse",
|
35
|
+
"GetSnippetOut",
|
34
36
|
"GetSnippetsResponse",
|
35
37
|
"HttpValidationError",
|
36
38
|
"LangchainDocumentsRequestOut",
|
@@ -0,0 +1,25 @@
|
|
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
|
+
from ..core.pydantic_utilities import pydantic_v1
|
8
|
+
|
9
|
+
|
10
|
+
class GetSnippetOut(pydantic_v1.BaseModel):
|
11
|
+
response: typing.Dict[str, typing.Any]
|
12
|
+
|
13
|
+
def json(self, **kwargs: typing.Any) -> str:
|
14
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
15
|
+
return super().json(**kwargs_with_defaults)
|
16
|
+
|
17
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
18
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
19
|
+
return super().dict(**kwargs_with_defaults)
|
20
|
+
|
21
|
+
class Config:
|
22
|
+
frozen = True
|
23
|
+
smart_union = True
|
24
|
+
extra = pydantic_v1.Extra.allow
|
25
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
athena/__init__.py,sha256=
|
1
|
+
athena/__init__.py,sha256=Zbr-pFLQvl_-yQBOb4j7BJGZi0wLMqIJIz0j8pxMLYU,1539
|
2
2
|
athena/base_client.py,sha256=fvX5_TUXA5iDSVojGglWQNSvXM3u22BaMtOJH2XyKEA,6659
|
3
3
|
athena/chain/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
4
4
|
athena/chain/client.py,sha256=2vSu7d4RvgbGc7jbWpKkCs5dU-ryCIJ1i0I1EsoCEdQ,16177
|
5
5
|
athena/client.py,sha256=8QypiDlbZ0C1YsJh6GzhylLVCZXDQc1MCJTURo2_vvI,3576
|
6
6
|
athena/core/__init__.py,sha256=1pNSKkwyQvMl_F0wohBqmoQAITptg3zlvCwsoSSzy7c,853
|
7
7
|
athena/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
8
|
-
athena/core/client_wrapper.py,sha256
|
8
|
+
athena/core/client_wrapper.py,sha256=-r2AY4Ig66E4WdHz70Zw-JyKQJNkLJeo7LTwSKNncko,1495
|
9
9
|
athena/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
10
10
|
athena/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
|
11
11
|
athena/core/http_client.py,sha256=5ok6hqgZDJhg57EHvMnr0BBaHdG50QxFPKaCZ9aVWTc,5059
|
@@ -29,16 +29,17 @@ athena/report/client.py,sha256=rSNGKHf2wImbOmY06jXClMK3S5B4sQPCvQOPxrb9lXk,6623
|
|
29
29
|
athena/search/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
30
30
|
athena/search/client.py,sha256=8ukNlqy1Wv-uci1tJ7uz-lhOF6OK7_kF31kNO1MGpok,7610
|
31
31
|
athena/snippet/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
32
|
-
athena/snippet/client.py,sha256=
|
32
|
+
athena/snippet/client.py,sha256=EE2ADdtSvk_c3-NkVMfwS1r29-y7YhozPoqXc4DPj8k,11323
|
33
33
|
athena/tools/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
34
34
|
athena/tools/client.py,sha256=eD5_pLFcWfeP4ECYHlsbnS_eyEz2vQgNZHnxIzXdeI8,20094
|
35
|
-
athena/types/__init__.py,sha256=
|
35
|
+
athena/types/__init__.py,sha256=oKVInlV6KCa5h-IUcxF66N0lDUQmb96DrUiceOhYSA4,1742
|
36
36
|
athena/types/dataset.py,sha256=ShFYop4Pj-pscWrjWZQFboUmK5TDX3NzP0xNRZimpp8,994
|
37
37
|
athena/types/document.py,sha256=evK_-wGk07kB8y5xyPMFCgqDbItuxCAawdUN20b6zFg,1061
|
38
38
|
athena/types/excecute_tool_first_workflow_out.py,sha256=T4GxP3yzTY3XkumdpUdXbn8Tx_iNc1exed8N2SnwV2w,875
|
39
39
|
athena/types/firecrawl_scrape_url_data_reponse_dto.py,sha256=-MkjjhzRTpuyoypLmiGtvH01TjeoVQxpX-HsALUSFUM,1001
|
40
40
|
athena/types/firecrawl_scrape_url_metadata.py,sha256=kIKb0mMGxw7-49GSsagfx6AperguHDKOvODGPjFtOxU,1143
|
41
41
|
athena/types/get_datasets_response.py,sha256=kbv8BI2nEo34-HJZV33dPhKWKrA1FiIS_OUkUYJj1ZQ,969
|
42
|
+
athena/types/get_snippet_out.py,sha256=AkkF6YJcYysiQVnOvhRerHMsHkBTu1BP9tYZC8wETmM,879
|
42
43
|
athena/types/get_snippets_response.py,sha256=pgwYqmddU5shKeVaE4RQSFN9SLsVAeQp3sqIkQlvzoU,969
|
43
44
|
athena/types/http_validation_error.py,sha256=u4t-1U0DI0u3Zj_Oz7AmGmpL4sqBzoS_5nZHImWQbmM,953
|
44
45
|
athena/types/langchain_documents_request_out.py,sha256=O1v7mcgt0ryaY4e8YODpAHYJKyUY7jYFBc0s93A1sgo,892
|
@@ -57,6 +58,6 @@ athena/types/url_result.py,sha256=lIgnQeyKy_UfFFPe7HMrrRzb-SK089RxcKcKN9Q3DNQ,87
|
|
57
58
|
athena/types/validation_error.py,sha256=yqombbKLBSzTPFn6CJH_hbo7tpS68T3JvMdd7kBtO1g,972
|
58
59
|
athena/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
59
60
|
athena/version.py,sha256=8aYAOJtVLaJLpRp6mTiEIhnl8gXA7yE0aDtZ-3mKQ4k,87
|
60
|
-
athena_intelligence-0.1.
|
61
|
-
athena_intelligence-0.1.
|
62
|
-
athena_intelligence-0.1.
|
61
|
+
athena_intelligence-0.1.56.dist-info/METADATA,sha256=L1j-TF4kbKqsNqbKFvye-1GwnLY-tsmhmslvpregcTI,4738
|
62
|
+
athena_intelligence-0.1.56.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
63
|
+
athena_intelligence-0.1.56.dist-info/RECORD,,
|
File without changes
|