athena-intelligence 0.1.28__py3-none-any.whl → 0.1.30__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/core/client_wrapper.py +1 -1
- athena/dataset/client.py +50 -4
- athena/snippet/client.py +50 -4
- athena/types/dataset.py +1 -0
- athena/types/get_datasets_response.py +4 -0
- athena/types/get_snippets_response.py +4 -0
- athena/types/model.py +8 -0
- {athena_intelligence-0.1.28.dist-info → athena_intelligence-0.1.30.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.28.dist-info → athena_intelligence-0.1.30.dist-info}/RECORD +10 -10
- {athena_intelligence-0.1.28.dist-info → athena_intelligence-0.1.30.dist-info}/WHEEL +0 -0
athena/core/client_wrapper.py
CHANGED
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
17
17
|
"X-Fern-Language": "Python",
|
18
18
|
"X-Fern-SDK-Name": "athena-intelligence",
|
19
|
-
"X-Fern-SDK-Version": "0.1.
|
19
|
+
"X-Fern-SDK-Version": "0.1.30",
|
20
20
|
}
|
21
21
|
headers["X-API-KEY"] = self.api_key
|
22
22
|
return headers
|
athena/dataset/client.py
CHANGED
@@ -9,7 +9,9 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
11
11
|
from ..core.request_options import RequestOptions
|
12
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
12
13
|
from ..types.get_datasets_response import GetDatasetsResponse
|
14
|
+
from ..types.http_validation_error import HttpValidationError
|
13
15
|
|
14
16
|
try:
|
15
17
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -21,9 +23,19 @@ class DatasetClient:
|
|
21
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
22
24
|
self._client_wrapper = client_wrapper
|
23
25
|
|
24
|
-
def get(
|
26
|
+
def get(
|
27
|
+
self,
|
28
|
+
*,
|
29
|
+
page: typing.Optional[int] = None,
|
30
|
+
page_size: typing.Optional[int] = None,
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
32
|
+
) -> GetDatasetsResponse:
|
25
33
|
"""
|
26
34
|
Parameters:
|
35
|
+
- page: typing.Optional[int]. Page number starting from 1
|
36
|
+
|
37
|
+
- page_size: typing.Optional[int]. Number of items per page
|
38
|
+
|
27
39
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
28
40
|
---
|
29
41
|
from athena.client import Athena
|
@@ -37,7 +49,17 @@ class DatasetClient:
|
|
37
49
|
"GET",
|
38
50
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/datasets"),
|
39
51
|
params=jsonable_encoder(
|
40
|
-
|
52
|
+
remove_none_from_dict(
|
53
|
+
{
|
54
|
+
"page": page,
|
55
|
+
"page_size": page_size,
|
56
|
+
**(
|
57
|
+
request_options.get("additional_query_parameters", {})
|
58
|
+
if request_options is not None
|
59
|
+
else {}
|
60
|
+
),
|
61
|
+
}
|
62
|
+
)
|
41
63
|
),
|
42
64
|
headers=jsonable_encoder(
|
43
65
|
remove_none_from_dict(
|
@@ -55,6 +77,8 @@ class DatasetClient:
|
|
55
77
|
)
|
56
78
|
if 200 <= _response.status_code < 300:
|
57
79
|
return pydantic.parse_obj_as(GetDatasetsResponse, _response.json()) # type: ignore
|
80
|
+
if _response.status_code == 422:
|
81
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
58
82
|
try:
|
59
83
|
_response_json = _response.json()
|
60
84
|
except JSONDecodeError:
|
@@ -66,9 +90,19 @@ class AsyncDatasetClient:
|
|
66
90
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
67
91
|
self._client_wrapper = client_wrapper
|
68
92
|
|
69
|
-
async def get(
|
93
|
+
async def get(
|
94
|
+
self,
|
95
|
+
*,
|
96
|
+
page: typing.Optional[int] = None,
|
97
|
+
page_size: typing.Optional[int] = None,
|
98
|
+
request_options: typing.Optional[RequestOptions] = None,
|
99
|
+
) -> GetDatasetsResponse:
|
70
100
|
"""
|
71
101
|
Parameters:
|
102
|
+
- page: typing.Optional[int]. Page number starting from 1
|
103
|
+
|
104
|
+
- page_size: typing.Optional[int]. Number of items per page
|
105
|
+
|
72
106
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
73
107
|
---
|
74
108
|
from athena.client import AsyncAthena
|
@@ -82,7 +116,17 @@ class AsyncDatasetClient:
|
|
82
116
|
"GET",
|
83
117
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/datasets"),
|
84
118
|
params=jsonable_encoder(
|
85
|
-
|
119
|
+
remove_none_from_dict(
|
120
|
+
{
|
121
|
+
"page": page,
|
122
|
+
"page_size": page_size,
|
123
|
+
**(
|
124
|
+
request_options.get("additional_query_parameters", {})
|
125
|
+
if request_options is not None
|
126
|
+
else {}
|
127
|
+
),
|
128
|
+
}
|
129
|
+
)
|
86
130
|
),
|
87
131
|
headers=jsonable_encoder(
|
88
132
|
remove_none_from_dict(
|
@@ -100,6 +144,8 @@ class AsyncDatasetClient:
|
|
100
144
|
)
|
101
145
|
if 200 <= _response.status_code < 300:
|
102
146
|
return pydantic.parse_obj_as(GetDatasetsResponse, _response.json()) # type: ignore
|
147
|
+
if _response.status_code == 422:
|
148
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
103
149
|
try:
|
104
150
|
_response_json = _response.json()
|
105
151
|
except JSONDecodeError:
|
athena/snippet/client.py
CHANGED
@@ -9,7 +9,9 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
10
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
11
11
|
from ..core.request_options import RequestOptions
|
12
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
12
13
|
from ..types.get_snippets_response import GetSnippetsResponse
|
14
|
+
from ..types.http_validation_error import HttpValidationError
|
13
15
|
|
14
16
|
try:
|
15
17
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -21,9 +23,19 @@ class SnippetClient:
|
|
21
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
22
24
|
self._client_wrapper = client_wrapper
|
23
25
|
|
24
|
-
def get(
|
26
|
+
def get(
|
27
|
+
self,
|
28
|
+
*,
|
29
|
+
page: typing.Optional[int] = None,
|
30
|
+
page_size: typing.Optional[int] = None,
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
32
|
+
) -> GetSnippetsResponse:
|
25
33
|
"""
|
26
34
|
Parameters:
|
35
|
+
- page: typing.Optional[int]. Page number starting from 1
|
36
|
+
|
37
|
+
- page_size: typing.Optional[int]. Number of items per page
|
38
|
+
|
27
39
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
28
40
|
---
|
29
41
|
from athena.client import Athena
|
@@ -37,7 +49,17 @@ class SnippetClient:
|
|
37
49
|
"GET",
|
38
50
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippets"),
|
39
51
|
params=jsonable_encoder(
|
40
|
-
|
52
|
+
remove_none_from_dict(
|
53
|
+
{
|
54
|
+
"page": page,
|
55
|
+
"page_size": page_size,
|
56
|
+
**(
|
57
|
+
request_options.get("additional_query_parameters", {})
|
58
|
+
if request_options is not None
|
59
|
+
else {}
|
60
|
+
),
|
61
|
+
}
|
62
|
+
)
|
41
63
|
),
|
42
64
|
headers=jsonable_encoder(
|
43
65
|
remove_none_from_dict(
|
@@ -55,6 +77,8 @@ class SnippetClient:
|
|
55
77
|
)
|
56
78
|
if 200 <= _response.status_code < 300:
|
57
79
|
return pydantic.parse_obj_as(GetSnippetsResponse, _response.json()) # type: ignore
|
80
|
+
if _response.status_code == 422:
|
81
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
58
82
|
try:
|
59
83
|
_response_json = _response.json()
|
60
84
|
except JSONDecodeError:
|
@@ -66,9 +90,19 @@ class AsyncSnippetClient:
|
|
66
90
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
67
91
|
self._client_wrapper = client_wrapper
|
68
92
|
|
69
|
-
async def get(
|
93
|
+
async def get(
|
94
|
+
self,
|
95
|
+
*,
|
96
|
+
page: typing.Optional[int] = None,
|
97
|
+
page_size: typing.Optional[int] = None,
|
98
|
+
request_options: typing.Optional[RequestOptions] = None,
|
99
|
+
) -> GetSnippetsResponse:
|
70
100
|
"""
|
71
101
|
Parameters:
|
102
|
+
- page: typing.Optional[int]. Page number starting from 1
|
103
|
+
|
104
|
+
- page_size: typing.Optional[int]. Number of items per page
|
105
|
+
|
72
106
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
73
107
|
---
|
74
108
|
from athena.client import AsyncAthena
|
@@ -82,7 +116,17 @@ class AsyncSnippetClient:
|
|
82
116
|
"GET",
|
83
117
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/snippets"),
|
84
118
|
params=jsonable_encoder(
|
85
|
-
|
119
|
+
remove_none_from_dict(
|
120
|
+
{
|
121
|
+
"page": page,
|
122
|
+
"page_size": page_size,
|
123
|
+
**(
|
124
|
+
request_options.get("additional_query_parameters", {})
|
125
|
+
if request_options is not None
|
126
|
+
else {}
|
127
|
+
),
|
128
|
+
}
|
129
|
+
)
|
86
130
|
),
|
87
131
|
headers=jsonable_encoder(
|
88
132
|
remove_none_from_dict(
|
@@ -100,6 +144,8 @@ class AsyncSnippetClient:
|
|
100
144
|
)
|
101
145
|
if 200 <= _response.status_code < 300:
|
102
146
|
return pydantic.parse_obj_as(GetSnippetsResponse, _response.json()) # type: ignore
|
147
|
+
if _response.status_code == 422:
|
148
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
103
149
|
try:
|
104
150
|
_response_json = _response.json()
|
105
151
|
except JSONDecodeError:
|
athena/types/dataset.py
CHANGED
@@ -16,6 +16,7 @@ class Dataset(pydantic.BaseModel):
|
|
16
16
|
name: typing.Optional[str] = None
|
17
17
|
description: typing.Optional[str] = None
|
18
18
|
database_id: int
|
19
|
+
schema_details: typing.Optional[str] = None
|
19
20
|
|
20
21
|
def json(self, **kwargs: typing.Any) -> str:
|
21
22
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -14,6 +14,10 @@ except ImportError:
|
|
14
14
|
|
15
15
|
class GetDatasetsResponse(pydantic.BaseModel):
|
16
16
|
datasets: typing.List[Dataset]
|
17
|
+
total: int
|
18
|
+
page: int
|
19
|
+
page_size: int
|
20
|
+
pages: int
|
17
21
|
|
18
22
|
def json(self, **kwargs: typing.Any) -> str:
|
19
23
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -14,6 +14,10 @@ except ImportError:
|
|
14
14
|
|
15
15
|
class GetSnippetsResponse(pydantic.BaseModel):
|
16
16
|
snippets: typing.List[Snippet]
|
17
|
+
total: int
|
18
|
+
page: int
|
19
|
+
page_size: int
|
20
|
+
pages: int
|
17
21
|
|
18
22
|
def json(self, **kwargs: typing.Any) -> str:
|
19
23
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
athena/types/model.py
CHANGED
@@ -13,6 +13,8 @@ class Model(str, enum.Enum):
|
|
13
13
|
|
14
14
|
GPT_35_TURBO = "gpt-3.5-turbo"
|
15
15
|
GPT_4_TURBO_PREVIEW = "gpt-4-turbo-preview"
|
16
|
+
GPT_4 = "gpt-4"
|
17
|
+
GPT_432_K = "gpt-4-32k"
|
16
18
|
MIXTRAL_SMALL_8_X_7_B_0211 = "mixtral-small-8x7b-0211"
|
17
19
|
MISTRAL_LARGE_0224 = "mistral-large-0224"
|
18
20
|
|
@@ -20,6 +22,8 @@ class Model(str, enum.Enum):
|
|
20
22
|
self,
|
21
23
|
gpt_35_turbo: typing.Callable[[], T_Result],
|
22
24
|
gpt_4_turbo_preview: typing.Callable[[], T_Result],
|
25
|
+
gpt_4: typing.Callable[[], T_Result],
|
26
|
+
gpt_432_k: typing.Callable[[], T_Result],
|
23
27
|
mixtral_small_8_x_7_b_0211: typing.Callable[[], T_Result],
|
24
28
|
mistral_large_0224: typing.Callable[[], T_Result],
|
25
29
|
) -> T_Result:
|
@@ -27,6 +31,10 @@ class Model(str, enum.Enum):
|
|
27
31
|
return gpt_35_turbo()
|
28
32
|
if self is Model.GPT_4_TURBO_PREVIEW:
|
29
33
|
return gpt_4_turbo_preview()
|
34
|
+
if self is Model.GPT_4:
|
35
|
+
return gpt_4()
|
36
|
+
if self is Model.GPT_432_K:
|
37
|
+
return gpt_432_k()
|
30
38
|
if self is Model.MIXTRAL_SMALL_8_X_7_B_0211:
|
31
39
|
return mixtral_small_8_x_7_b_0211()
|
32
40
|
if self is Model.MISTRAL_LARGE_0224:
|
@@ -3,7 +3,7 @@ athena/base_client.py,sha256=0V7k8HeQrYl1dK2lni53I0EkrmMwFiTVW5Pdt-fScuE,4806
|
|
3
3
|
athena/client.py,sha256=8QypiDlbZ0C1YsJh6GzhylLVCZXDQc1MCJTURo2_vvI,3576
|
4
4
|
athena/core/__init__.py,sha256=RWfyDqkzWsf8e3VGc3NV60MovfJbg5XWzNFGB2DZ0hA,790
|
5
5
|
athena/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
6
|
-
athena/core/client_wrapper.py,sha256=
|
6
|
+
athena/core/client_wrapper.py,sha256=KZ7FY-ZxhFOGj0zURiA5iNdT6Wndof8UYC71q6wRYKY,1198
|
7
7
|
athena/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
8
8
|
athena/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
|
9
9
|
athena/core/http_client.py,sha256=LI0yP3jUyE0Ue7oyBcI9nyo1pljOwh9Y5ycTeIpKwOg,4882
|
@@ -11,7 +11,7 @@ athena/core/jsonable_encoder.py,sha256=MTYkDov2EryHgee4QM46uZiBOuOXK9KTHlBdBwU-C
|
|
11
11
|
athena/core/remove_none_from_dict.py,sha256=8m91FC3YuVem0Gm9_sXhJ2tGvP33owJJdrqCLEdowGw,330
|
12
12
|
athena/core/request_options.py,sha256=-3QoOMMHI2exIyHH6Q2MD7rpo_6w-i6zMAy0nqWTN8c,1420
|
13
13
|
athena/dataset/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
14
|
-
athena/dataset/client.py,sha256=
|
14
|
+
athena/dataset/client.py,sha256=ilxpF0K9AlnGAQjrumdqZ1V1Wu3ARoM-06iDE5gQiCQ,6087
|
15
15
|
athena/environment.py,sha256=D_CljQlUahhEi9smvMslj_5Y8gMFO6D0fRCL0ydRLuM,165
|
16
16
|
athena/errors/__init__.py,sha256=pbbVUFtB9LCocA1RMWMMF_RKjsy5YkOKX5BAuE49w6g,170
|
17
17
|
athena/errors/unprocessable_entity_error.py,sha256=FvR7XPlV3Xx5nu8HNlmLhBRdk4so_gCHjYT5PyZe6sM,313
|
@@ -24,15 +24,15 @@ athena/query/client.py,sha256=UOx-Bq-xFFm-sTMTmJjWGrC6q_7vhVno3nYzmi81xwI,6243
|
|
24
24
|
athena/report/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
25
25
|
athena/report/client.py,sha256=sGJDrgk_E1SPleRYNhvspmsz-G3FQwMW-3alFzZPquE,6528
|
26
26
|
athena/snippet/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
27
|
-
athena/snippet/client.py,sha256=
|
27
|
+
athena/snippet/client.py,sha256=D0rSpm6ql9cnUj-mMe3z8OHRgRQQuk3bBW2CZSRnyp4,6087
|
28
28
|
athena/types/__init__.py,sha256=kSz8xv8p-5znJI-sg3b6yD0E0bi9pkI1J8F60D5hu78,918
|
29
|
-
athena/types/dataset.py,sha256=
|
30
|
-
athena/types/get_datasets_response.py,sha256=
|
31
|
-
athena/types/get_snippets_response.py,sha256=
|
29
|
+
athena/types/dataset.py,sha256=70OJPxKBAYu7xthGEgrUolSdyLqiyh6X49INw1oN0sA,1014
|
30
|
+
athena/types/get_datasets_response.py,sha256=BCdT8yTLfOsXeyFadlyoas4zzseFWGPAdGpkgkOuaD8,989
|
31
|
+
athena/types/get_snippets_response.py,sha256=Lpn7bHJLpPQozN93unCV-8eByAAfz1MhQWR3G3Z1vl4,989
|
32
32
|
athena/types/http_validation_error.py,sha256=Fcv_CTMMrLvCeTHjF0n5xf5tskMDgt-J6H9gp654eQw,973
|
33
33
|
athena/types/message_out.py,sha256=uvZY_Podv2XccEk8CICug9I_S2hFJTSzCBwcHiauW7A,865
|
34
34
|
athena/types/message_out_dto.py,sha256=qgRibRbDNOWVnVGP7Rribh9WdoCT2CSiPUXeIWECqq4,1051
|
35
|
-
athena/types/model.py,sha256=
|
35
|
+
athena/types/model.py,sha256=hwksocGCn7CTMDUkxkc--sHs8qqm8WzC8urIbeGsX-A,1290
|
36
36
|
athena/types/report.py,sha256=QVaqVfHMAV3s9_V2CqjIEMcRrbJhD8zmi82vrk2A8x0,946
|
37
37
|
athena/types/snippet.py,sha256=POIVJNV9iQxiVegB_qwQx-PZPPSyoIPhyxTsueNVUGA,1126
|
38
38
|
athena/types/sql_results.py,sha256=pNH32nyf1bzoYJs3FgHctLdLO02oOjyGgLkHACACB6k,900
|
@@ -40,6 +40,6 @@ athena/types/status_enum.py,sha256=0UZbhdAx215GHC-U53RS98mYHtn1N3On4VBe4j02Qtc,6
|
|
40
40
|
athena/types/tools.py,sha256=Vfb-D9CYcPZH6MBATNODgfXjFyBpCs4qbkqpCMl7eBM,1277
|
41
41
|
athena/types/validation_error.py,sha256=2JhGNJouo8QpfrMBoT_JCwYSn1nFN2Nnq0p9uPLDH-U,992
|
42
42
|
athena/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
43
|
-
athena_intelligence-0.1.
|
44
|
-
athena_intelligence-0.1.
|
45
|
-
athena_intelligence-0.1.
|
43
|
+
athena_intelligence-0.1.30.dist-info/METADATA,sha256=_0tdDHwC0b-A4kpjYlilzm-biSIGT7yBlKWeCq2ldYk,4738
|
44
|
+
athena_intelligence-0.1.30.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
45
|
+
athena_intelligence-0.1.30.dist-info/RECORD,,
|
File without changes
|