athena-intelligence 0.1.52__py3-none-any.whl → 0.1.54__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 +1 -6
- athena/base_client.py +0 -3
- athena/chain/client.py +8 -9
- athena/core/client_wrapper.py +1 -1
- athena/tools/client.py +9 -9
- athena/types/__init__.py +0 -4
- {athena_intelligence-0.1.52.dist-info → athena_intelligence-0.1.54.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.52.dist-info → athena_intelligence-0.1.54.dist-info}/RECORD +9 -13
- athena/tasks/__init__.py +0 -2
- athena/tasks/client.py +0 -191
- athena/types/plan_execute_out.py +0 -32
- athena/types/tool_models.py +0 -49
- {athena_intelligence-0.1.52.dist-info → athena_intelligence-0.1.54.dist-info}/WHEEL +0 -0
athena/__init__.py
CHANGED
@@ -15,20 +15,18 @@ from .types import (
|
|
15
15
|
MessageOut,
|
16
16
|
MessageOutDto,
|
17
17
|
Model,
|
18
|
-
PlanExecuteOut,
|
19
18
|
Report,
|
20
19
|
Snippet,
|
21
20
|
SqlResults,
|
22
21
|
StatusEnum,
|
23
22
|
StructuredParseResult,
|
24
|
-
ToolModels,
|
25
23
|
Tools,
|
26
24
|
UrlResult,
|
27
25
|
ValidationError,
|
28
26
|
ValidationErrorLocItem,
|
29
27
|
)
|
30
28
|
from .errors import UnprocessableEntityError
|
31
|
-
from . import chain, dataset, message, query, report, search, snippet,
|
29
|
+
from . import chain, dataset, message, query, report, search, snippet, tools
|
32
30
|
from .environment import AthenaEnvironment
|
33
31
|
from .version import __version__
|
34
32
|
|
@@ -48,13 +46,11 @@ __all__ = [
|
|
48
46
|
"MessageOut",
|
49
47
|
"MessageOutDto",
|
50
48
|
"Model",
|
51
|
-
"PlanExecuteOut",
|
52
49
|
"Report",
|
53
50
|
"Snippet",
|
54
51
|
"SqlResults",
|
55
52
|
"StatusEnum",
|
56
53
|
"StructuredParseResult",
|
57
|
-
"ToolModels",
|
58
54
|
"Tools",
|
59
55
|
"UnprocessableEntityError",
|
60
56
|
"UrlResult",
|
@@ -68,6 +64,5 @@ __all__ = [
|
|
68
64
|
"report",
|
69
65
|
"search",
|
70
66
|
"snippet",
|
71
|
-
"tasks",
|
72
67
|
"tools",
|
73
68
|
]
|
athena/base_client.py
CHANGED
@@ -13,7 +13,6 @@ from .query.client import AsyncQueryClient, QueryClient
|
|
13
13
|
from .report.client import AsyncReportClient, ReportClient
|
14
14
|
from .search.client import AsyncSearchClient, SearchClient
|
15
15
|
from .snippet.client import AsyncSnippetClient, SnippetClient
|
16
|
-
from .tasks.client import AsyncTasksClient, TasksClient
|
17
16
|
from .tools.client import AsyncToolsClient, ToolsClient
|
18
17
|
|
19
18
|
|
@@ -72,7 +71,6 @@ class BaseAthena:
|
|
72
71
|
self.search = SearchClient(client_wrapper=self._client_wrapper)
|
73
72
|
self.chain = ChainClient(client_wrapper=self._client_wrapper)
|
74
73
|
self.tools = ToolsClient(client_wrapper=self._client_wrapper)
|
75
|
-
self.tasks = TasksClient(client_wrapper=self._client_wrapper)
|
76
74
|
|
77
75
|
|
78
76
|
class AsyncBaseAthena:
|
@@ -130,7 +128,6 @@ class AsyncBaseAthena:
|
|
130
128
|
self.search = AsyncSearchClient(client_wrapper=self._client_wrapper)
|
131
129
|
self.chain = AsyncChainClient(client_wrapper=self._client_wrapper)
|
132
130
|
self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper)
|
133
|
-
self.tasks = AsyncTasksClient(client_wrapper=self._client_wrapper)
|
134
131
|
|
135
132
|
|
136
133
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AthenaEnvironment) -> str:
|
athena/chain/client.py
CHANGED
@@ -16,7 +16,6 @@ from ..types.http_validation_error import HttpValidationError
|
|
16
16
|
from ..types.llm_model import LlmModel
|
17
17
|
from ..types.map_reduce_chain_out import MapReduceChainOut
|
18
18
|
from ..types.structured_parse_result import StructuredParseResult
|
19
|
-
from ..types.tool_models import ToolModels
|
20
19
|
|
21
20
|
# this is used as the default value for optional parameters
|
22
21
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -98,7 +97,7 @@ class ChainClient:
|
|
98
97
|
self,
|
99
98
|
*,
|
100
99
|
documents: typing.Sequence[Document],
|
101
|
-
model:
|
100
|
+
model: LlmModel,
|
102
101
|
operator_prompt: str,
|
103
102
|
reducer_prompt: str,
|
104
103
|
input: str,
|
@@ -108,7 +107,7 @@ class ChainClient:
|
|
108
107
|
Parameters:
|
109
108
|
- documents: typing.Sequence[Document].
|
110
109
|
|
111
|
-
- model:
|
110
|
+
- model: LlmModel.
|
112
111
|
|
113
112
|
- operator_prompt: str.
|
114
113
|
|
@@ -118,7 +117,7 @@ class ChainClient:
|
|
118
117
|
|
119
118
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
120
119
|
---
|
121
|
-
from athena import Document,
|
120
|
+
from athena import Document, LlmModel
|
122
121
|
from athena.client import Athena
|
123
122
|
|
124
123
|
client = Athena(
|
@@ -130,7 +129,7 @@ class ChainClient:
|
|
130
129
|
page_content="Athena is an AI-native analytics platform and artificial employee built to accelerate analytics workflows by offering enterprise teams co-pilot and auto-pilot modes. Athena learns your workflow as a co-pilot, allowing you to hand over controls to her for autonomous execution with confidence.",
|
131
130
|
)
|
132
131
|
],
|
133
|
-
model=
|
132
|
+
model=LlmModel.MISTRAL_LARGE_0224,
|
134
133
|
operator_prompt="summarize the content",
|
135
134
|
reducer_prompt="Combine these summaries",
|
136
135
|
input="return a summary in a single sentence",
|
@@ -267,7 +266,7 @@ class AsyncChainClient:
|
|
267
266
|
self,
|
268
267
|
*,
|
269
268
|
documents: typing.Sequence[Document],
|
270
|
-
model:
|
269
|
+
model: LlmModel,
|
271
270
|
operator_prompt: str,
|
272
271
|
reducer_prompt: str,
|
273
272
|
input: str,
|
@@ -277,7 +276,7 @@ class AsyncChainClient:
|
|
277
276
|
Parameters:
|
278
277
|
- documents: typing.Sequence[Document].
|
279
278
|
|
280
|
-
- model:
|
279
|
+
- model: LlmModel.
|
281
280
|
|
282
281
|
- operator_prompt: str.
|
283
282
|
|
@@ -287,7 +286,7 @@ class AsyncChainClient:
|
|
287
286
|
|
288
287
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
289
288
|
---
|
290
|
-
from athena import Document,
|
289
|
+
from athena import Document, LlmModel
|
291
290
|
from athena.client import AsyncAthena
|
292
291
|
|
293
292
|
client = AsyncAthena(
|
@@ -299,7 +298,7 @@ class AsyncChainClient:
|
|
299
298
|
page_content="Athena is an AI-native analytics platform and artificial employee built to accelerate analytics workflows by offering enterprise teams co-pilot and auto-pilot modes. Athena learns your workflow as a co-pilot, allowing you to hand over controls to her for autonomous execution with confidence.",
|
300
299
|
)
|
301
300
|
],
|
302
|
-
model=
|
301
|
+
model=LlmModel.MISTRAL_LARGE_0224,
|
303
302
|
operator_prompt="summarize the content",
|
304
303
|
reducer_prompt="Combine these summaries",
|
305
304
|
input="return a summary in a single sentence",
|
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.54",
|
21
21
|
}
|
22
22
|
headers["X-API-KEY"] = self.api_key
|
23
23
|
return headers
|
athena/tools/client.py
CHANGED
@@ -15,7 +15,7 @@ from ..types.excecute_tool_first_workflow_out import ExcecuteToolFirstWorkflowOu
|
|
15
15
|
from ..types.firecrawl_scrape_url_data_reponse_dto import FirecrawlScrapeUrlDataReponseDto
|
16
16
|
from ..types.http_validation_error import HttpValidationError
|
17
17
|
from ..types.langchain_documents_request_out import LangchainDocumentsRequestOut
|
18
|
-
from ..types.
|
18
|
+
from ..types.llm_model import LlmModel
|
19
19
|
|
20
20
|
# this is used as the default value for optional parameters
|
21
21
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -167,7 +167,7 @@ class ToolsClient:
|
|
167
167
|
def tool_first_workflow(
|
168
168
|
self,
|
169
169
|
*,
|
170
|
-
model: typing.Optional[
|
170
|
+
model: typing.Optional[LlmModel] = OMIT,
|
171
171
|
tool_name: str,
|
172
172
|
content: str,
|
173
173
|
tool_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
@@ -175,7 +175,7 @@ class ToolsClient:
|
|
175
175
|
) -> ExcecuteToolFirstWorkflowOut:
|
176
176
|
"""
|
177
177
|
Parameters:
|
178
|
-
- model: typing.Optional[
|
178
|
+
- model: typing.Optional[LlmModel].
|
179
179
|
|
180
180
|
- tool_name: str.
|
181
181
|
|
@@ -185,14 +185,14 @@ class ToolsClient:
|
|
185
185
|
|
186
186
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
187
187
|
---
|
188
|
-
from athena import
|
188
|
+
from athena import LlmModel
|
189
189
|
from athena.client import Athena
|
190
190
|
|
191
191
|
client = Athena(
|
192
192
|
api_key="YOUR_API_KEY",
|
193
193
|
)
|
194
194
|
client.tools.tool_first_workflow(
|
195
|
-
model=
|
195
|
+
model=LlmModel.MISTRAL_LARGE_0224,
|
196
196
|
tool_name="tavily_search",
|
197
197
|
content="summarize the website in one paragraph",
|
198
198
|
tool_kwargs={"query": "website: www.athenaintelligence.ai"},
|
@@ -388,7 +388,7 @@ class AsyncToolsClient:
|
|
388
388
|
async def tool_first_workflow(
|
389
389
|
self,
|
390
390
|
*,
|
391
|
-
model: typing.Optional[
|
391
|
+
model: typing.Optional[LlmModel] = OMIT,
|
392
392
|
tool_name: str,
|
393
393
|
content: str,
|
394
394
|
tool_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
@@ -396,7 +396,7 @@ class AsyncToolsClient:
|
|
396
396
|
) -> ExcecuteToolFirstWorkflowOut:
|
397
397
|
"""
|
398
398
|
Parameters:
|
399
|
-
- model: typing.Optional[
|
399
|
+
- model: typing.Optional[LlmModel].
|
400
400
|
|
401
401
|
- tool_name: str.
|
402
402
|
|
@@ -406,14 +406,14 @@ class AsyncToolsClient:
|
|
406
406
|
|
407
407
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
408
408
|
---
|
409
|
-
from athena import
|
409
|
+
from athena import LlmModel
|
410
410
|
from athena.client import AsyncAthena
|
411
411
|
|
412
412
|
client = AsyncAthena(
|
413
413
|
api_key="YOUR_API_KEY",
|
414
414
|
)
|
415
415
|
await client.tools.tool_first_workflow(
|
416
|
-
model=
|
416
|
+
model=LlmModel.MISTRAL_LARGE_0224,
|
417
417
|
tool_name="tavily_search",
|
418
418
|
content="summarize the website in one paragraph",
|
419
419
|
tool_kwargs={"query": "website: www.athenaintelligence.ai"},
|
athena/types/__init__.py
CHANGED
@@ -14,13 +14,11 @@ from .map_reduce_chain_out import MapReduceChainOut
|
|
14
14
|
from .message_out import MessageOut
|
15
15
|
from .message_out_dto import MessageOutDto
|
16
16
|
from .model import Model
|
17
|
-
from .plan_execute_out import PlanExecuteOut
|
18
17
|
from .report import Report
|
19
18
|
from .snippet import Snippet
|
20
19
|
from .sql_results import SqlResults
|
21
20
|
from .status_enum import StatusEnum
|
22
21
|
from .structured_parse_result import StructuredParseResult
|
23
|
-
from .tool_models import ToolModels
|
24
22
|
from .tools import Tools
|
25
23
|
from .url_result import UrlResult
|
26
24
|
from .validation_error import ValidationError
|
@@ -41,13 +39,11 @@ __all__ = [
|
|
41
39
|
"MessageOut",
|
42
40
|
"MessageOutDto",
|
43
41
|
"Model",
|
44
|
-
"PlanExecuteOut",
|
45
42
|
"Report",
|
46
43
|
"Snippet",
|
47
44
|
"SqlResults",
|
48
45
|
"StatusEnum",
|
49
46
|
"StructuredParseResult",
|
50
|
-
"ToolModels",
|
51
47
|
"Tools",
|
52
48
|
"UrlResult",
|
53
49
|
"ValidationError",
|
@@ -1,11 +1,11 @@
|
|
1
|
-
athena/__init__.py,sha256=
|
2
|
-
athena/base_client.py,sha256=
|
1
|
+
athena/__init__.py,sha256=ENtw_OVFvddf4LzLEru5FHvk9MwUfM7o-KLFT77YuQg,1499
|
2
|
+
athena/base_client.py,sha256=fvX5_TUXA5iDSVojGglWQNSvXM3u22BaMtOJH2XyKEA,6659
|
3
3
|
athena/chain/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
4
|
-
athena/chain/client.py,sha256=
|
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=Lbdz5YxVMQxz_uK1awzwq6gz0jNwtKHjBPb06w19CFc,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
|
@@ -30,11 +30,9 @@ 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
32
|
athena/snippet/client.py,sha256=7wVWdr4Ox6e5dAyEZIxuP0FUO4GHYOHMjJzwHvkyhcU,6182
|
33
|
-
athena/tasks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
34
|
-
athena/tasks/client.py,sha256=v9URzz_gWK25J0StAOdutLAm653W_mu5LfBBDAD6rwg,8234
|
35
33
|
athena/tools/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
36
|
-
athena/tools/client.py,sha256=
|
37
|
-
athena/types/__init__.py,sha256=
|
34
|
+
athena/tools/client.py,sha256=eD5_pLFcWfeP4ECYHlsbnS_eyEz2vQgNZHnxIzXdeI8,20094
|
35
|
+
athena/types/__init__.py,sha256=s-so1mZUVCkSKvvP7pj1b49kb3jWlIVsPcwd-IDg3zo,1678
|
38
36
|
athena/types/dataset.py,sha256=ShFYop4Pj-pscWrjWZQFboUmK5TDX3NzP0xNRZimpp8,994
|
39
37
|
athena/types/document.py,sha256=evK_-wGk07kB8y5xyPMFCgqDbItuxCAawdUN20b6zFg,1061
|
40
38
|
athena/types/excecute_tool_first_workflow_out.py,sha256=T4GxP3yzTY3XkumdpUdXbn8Tx_iNc1exed8N2SnwV2w,875
|
@@ -49,18 +47,16 @@ athena/types/map_reduce_chain_out.py,sha256=6R-fuxHaww60dhUAuwrdZPp5lV-DyFZh9SGL
|
|
49
47
|
athena/types/message_out.py,sha256=HJZizmFH7crD3OHm0fdTy3189F2gv5qR8aaUbTTfWFI,845
|
50
48
|
athena/types/message_out_dto.py,sha256=1G8srlYaIYmoYRstLKm97xZGxK87DK57CiO9hYnt3gQ,1031
|
51
49
|
athena/types/model.py,sha256=73jxfZPxAtK0iFex4bluPRrfpF5sY3Y6VFa9iALykBw,2991
|
52
|
-
athena/types/plan_execute_out.py,sha256=g9RrUTu32KYm-r8acfZ8Gl4-jTOvFJ_Du1Rxv3YokcE,1034
|
53
50
|
athena/types/report.py,sha256=km2CgCbHBXQQbPai1y5sGlsQpO7WAlUVvdsRC_7f4KI,926
|
54
51
|
athena/types/snippet.py,sha256=Mrc92_hBABJQjCSToAA-FgwhvO-Jn8Kjm-lYI6aMlUY,1106
|
55
52
|
athena/types/sql_results.py,sha256=ExPFds4vZ425AxGt0jhykbPhOjkplZPGQwVKb0LHg_g,880
|
56
53
|
athena/types/status_enum.py,sha256=0UZbhdAx215GHC-U53RS98mYHtn1N3On4VBe4j02Qtc,672
|
57
54
|
athena/types/structured_parse_result.py,sha256=fph7KrT_X_2BKDCOFN1UEufeaMmpSEvT0Oi6aM-e3kU,885
|
58
|
-
athena/types/tool_models.py,sha256=ltl4RX0QhFIj_wsKLZMDip72_Ko7P-7v0aL9HACXVFo,1829
|
59
55
|
athena/types/tools.py,sha256=mhRkKAwlsDud-fFOhsx2T3hBD-FAtuCnGHyU9cLPcGU,1422
|
60
56
|
athena/types/url_result.py,sha256=lIgnQeyKy_UfFFPe7HMrrRzb-SK089RxcKcKN9Q3DNQ,873
|
61
57
|
athena/types/validation_error.py,sha256=yqombbKLBSzTPFn6CJH_hbo7tpS68T3JvMdd7kBtO1g,972
|
62
58
|
athena/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
63
59
|
athena/version.py,sha256=8aYAOJtVLaJLpRp6mTiEIhnl8gXA7yE0aDtZ-3mKQ4k,87
|
64
|
-
athena_intelligence-0.1.
|
65
|
-
athena_intelligence-0.1.
|
66
|
-
athena_intelligence-0.1.
|
60
|
+
athena_intelligence-0.1.54.dist-info/METADATA,sha256=qyrm_bloeOYXJNRKLfS_ZnsAhp2zhdjm0imOl4_dXig,4738
|
61
|
+
athena_intelligence-0.1.54.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
62
|
+
athena_intelligence-0.1.54.dist-info/RECORD,,
|
athena/tasks/__init__.py
DELETED
athena/tasks/client.py
DELETED
@@ -1,191 +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.pydantic_utilities import pydantic_v1
|
11
|
-
from ..core.remove_none_from_dict import remove_none_from_dict
|
12
|
-
from ..core.request_options import RequestOptions
|
13
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
14
|
-
from ..types.http_validation_error import HttpValidationError
|
15
|
-
from ..types.plan_execute_out import PlanExecuteOut
|
16
|
-
from ..types.tool_models import ToolModels
|
17
|
-
|
18
|
-
# this is used as the default value for optional parameters
|
19
|
-
OMIT = typing.cast(typing.Any, ...)
|
20
|
-
|
21
|
-
|
22
|
-
class TasksClient:
|
23
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
24
|
-
self._client_wrapper = client_wrapper
|
25
|
-
|
26
|
-
def planned_task(
|
27
|
-
self,
|
28
|
-
*,
|
29
|
-
model: ToolModels,
|
30
|
-
instructions: str,
|
31
|
-
input_data: str,
|
32
|
-
output_format: str,
|
33
|
-
request_options: typing.Optional[RequestOptions] = None,
|
34
|
-
) -> PlanExecuteOut:
|
35
|
-
"""
|
36
|
-
Parameters:
|
37
|
-
- model: ToolModels.
|
38
|
-
|
39
|
-
- instructions: str.
|
40
|
-
|
41
|
-
- input_data: str.
|
42
|
-
|
43
|
-
- output_format: str.
|
44
|
-
|
45
|
-
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
46
|
-
---
|
47
|
-
from athena import ToolModels
|
48
|
-
from athena.client import Athena
|
49
|
-
|
50
|
-
client = Athena(
|
51
|
-
api_key="YOUR_API_KEY",
|
52
|
-
)
|
53
|
-
client.tasks.planned_task(
|
54
|
-
model=ToolModels.MISTRAL_LARGE_0224,
|
55
|
-
instructions="summarize the content",
|
56
|
-
input_data="Athena is an AI-native analytics platform and artificial employee built to accelerate analytics workflows by offering enterprise teams co-pilot and auto-pilot modes. Athena learns your workflow as a co-pilot, allowing you to hand over controls to her for autonomous execution with confidence.",
|
57
|
-
output_format="return a summary in a single sentence",
|
58
|
-
)
|
59
|
-
"""
|
60
|
-
_response = self._client_wrapper.httpx_client.request(
|
61
|
-
method="POST",
|
62
|
-
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tasks/planned-task"),
|
63
|
-
params=jsonable_encoder(
|
64
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
65
|
-
),
|
66
|
-
json=jsonable_encoder(
|
67
|
-
{"model": model, "instructions": instructions, "input_data": input_data, "output_format": output_format}
|
68
|
-
)
|
69
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
70
|
-
else {
|
71
|
-
**jsonable_encoder(
|
72
|
-
{
|
73
|
-
"model": model,
|
74
|
-
"instructions": instructions,
|
75
|
-
"input_data": input_data,
|
76
|
-
"output_format": output_format,
|
77
|
-
}
|
78
|
-
),
|
79
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
80
|
-
},
|
81
|
-
headers=jsonable_encoder(
|
82
|
-
remove_none_from_dict(
|
83
|
-
{
|
84
|
-
**self._client_wrapper.get_headers(),
|
85
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
86
|
-
}
|
87
|
-
)
|
88
|
-
),
|
89
|
-
timeout=request_options.get("timeout_in_seconds")
|
90
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
91
|
-
else self._client_wrapper.get_timeout(),
|
92
|
-
retries=0,
|
93
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
94
|
-
)
|
95
|
-
if 200 <= _response.status_code < 300:
|
96
|
-
return pydantic_v1.parse_obj_as(PlanExecuteOut, _response.json()) # type: ignore
|
97
|
-
if _response.status_code == 422:
|
98
|
-
raise UnprocessableEntityError(
|
99
|
-
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
100
|
-
)
|
101
|
-
try:
|
102
|
-
_response_json = _response.json()
|
103
|
-
except JSONDecodeError:
|
104
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
105
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
106
|
-
|
107
|
-
|
108
|
-
class AsyncTasksClient:
|
109
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
110
|
-
self._client_wrapper = client_wrapper
|
111
|
-
|
112
|
-
async def planned_task(
|
113
|
-
self,
|
114
|
-
*,
|
115
|
-
model: ToolModels,
|
116
|
-
instructions: str,
|
117
|
-
input_data: str,
|
118
|
-
output_format: str,
|
119
|
-
request_options: typing.Optional[RequestOptions] = None,
|
120
|
-
) -> PlanExecuteOut:
|
121
|
-
"""
|
122
|
-
Parameters:
|
123
|
-
- model: ToolModels.
|
124
|
-
|
125
|
-
- instructions: str.
|
126
|
-
|
127
|
-
- input_data: str.
|
128
|
-
|
129
|
-
- output_format: str.
|
130
|
-
|
131
|
-
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
132
|
-
---
|
133
|
-
from athena import ToolModels
|
134
|
-
from athena.client import AsyncAthena
|
135
|
-
|
136
|
-
client = AsyncAthena(
|
137
|
-
api_key="YOUR_API_KEY",
|
138
|
-
)
|
139
|
-
await client.tasks.planned_task(
|
140
|
-
model=ToolModels.MISTRAL_LARGE_0224,
|
141
|
-
instructions="summarize the content",
|
142
|
-
input_data="Athena is an AI-native analytics platform and artificial employee built to accelerate analytics workflows by offering enterprise teams co-pilot and auto-pilot modes. Athena learns your workflow as a co-pilot, allowing you to hand over controls to her for autonomous execution with confidence.",
|
143
|
-
output_format="return a summary in a single sentence",
|
144
|
-
)
|
145
|
-
"""
|
146
|
-
_response = await self._client_wrapper.httpx_client.request(
|
147
|
-
method="POST",
|
148
|
-
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v0/tasks/planned-task"),
|
149
|
-
params=jsonable_encoder(
|
150
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
151
|
-
),
|
152
|
-
json=jsonable_encoder(
|
153
|
-
{"model": model, "instructions": instructions, "input_data": input_data, "output_format": output_format}
|
154
|
-
)
|
155
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
156
|
-
else {
|
157
|
-
**jsonable_encoder(
|
158
|
-
{
|
159
|
-
"model": model,
|
160
|
-
"instructions": instructions,
|
161
|
-
"input_data": input_data,
|
162
|
-
"output_format": output_format,
|
163
|
-
}
|
164
|
-
),
|
165
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
166
|
-
},
|
167
|
-
headers=jsonable_encoder(
|
168
|
-
remove_none_from_dict(
|
169
|
-
{
|
170
|
-
**self._client_wrapper.get_headers(),
|
171
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
172
|
-
}
|
173
|
-
)
|
174
|
-
),
|
175
|
-
timeout=request_options.get("timeout_in_seconds")
|
176
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
177
|
-
else self._client_wrapper.get_timeout(),
|
178
|
-
retries=0,
|
179
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
180
|
-
)
|
181
|
-
if 200 <= _response.status_code < 300:
|
182
|
-
return pydantic_v1.parse_obj_as(PlanExecuteOut, _response.json()) # type: ignore
|
183
|
-
if _response.status_code == 422:
|
184
|
-
raise UnprocessableEntityError(
|
185
|
-
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
186
|
-
)
|
187
|
-
try:
|
188
|
-
_response_json = _response.json()
|
189
|
-
except JSONDecodeError:
|
190
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
191
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
athena/types/plan_execute_out.py
DELETED
@@ -1,32 +0,0 @@
|
|
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 PlanExecuteOut(pydantic_v1.BaseModel):
|
11
|
-
input: str
|
12
|
-
instructions: str
|
13
|
-
input_data: str
|
14
|
-
output_format: str
|
15
|
-
plan: typing.List[str]
|
16
|
-
past_steps: typing.List[typing.List[typing.Any]]
|
17
|
-
final_output: str
|
18
|
-
done: bool
|
19
|
-
|
20
|
-
def json(self, **kwargs: typing.Any) -> str:
|
21
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
-
return super().json(**kwargs_with_defaults)
|
23
|
-
|
24
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
-
return super().dict(**kwargs_with_defaults)
|
27
|
-
|
28
|
-
class Config:
|
29
|
-
frozen = True
|
30
|
-
smart_union = True
|
31
|
-
extra = pydantic_v1.Extra.allow
|
32
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
athena/types/tool_models.py
DELETED
@@ -1,49 +0,0 @@
|
|
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 ToolModels(str, enum.Enum):
|
10
|
-
"""
|
11
|
-
An enumeration.
|
12
|
-
"""
|
13
|
-
|
14
|
-
GPT_4_TURBO = "gpt-4-turbo"
|
15
|
-
GPT_4_TURBO_PREVIEW = "gpt-4-turbo-preview"
|
16
|
-
GPT_4 = "gpt-4"
|
17
|
-
MIXTRAL_SMALL_8_X_7_B_0211 = "mixtral-small-8x7b-0211"
|
18
|
-
MISTRAL_LARGE_0224 = "mistral-large-0224"
|
19
|
-
CLAUDE_3_OPUS_20240229 = "claude-3-opus-20240229"
|
20
|
-
CLAUDE_3_SONNET_20240229 = "claude-3-sonnet-20240229"
|
21
|
-
CLAUDE_3_HAIKU_20240307 = "claude-3-haiku-20240307"
|
22
|
-
|
23
|
-
def visit(
|
24
|
-
self,
|
25
|
-
gpt_4_turbo: typing.Callable[[], T_Result],
|
26
|
-
gpt_4_turbo_preview: typing.Callable[[], T_Result],
|
27
|
-
gpt_4: typing.Callable[[], T_Result],
|
28
|
-
mixtral_small_8_x_7_b_0211: typing.Callable[[], T_Result],
|
29
|
-
mistral_large_0224: typing.Callable[[], T_Result],
|
30
|
-
claude_3_opus_20240229: typing.Callable[[], T_Result],
|
31
|
-
claude_3_sonnet_20240229: typing.Callable[[], T_Result],
|
32
|
-
claude_3_haiku_20240307: typing.Callable[[], T_Result],
|
33
|
-
) -> T_Result:
|
34
|
-
if self is ToolModels.GPT_4_TURBO:
|
35
|
-
return gpt_4_turbo()
|
36
|
-
if self is ToolModels.GPT_4_TURBO_PREVIEW:
|
37
|
-
return gpt_4_turbo_preview()
|
38
|
-
if self is ToolModels.GPT_4:
|
39
|
-
return gpt_4()
|
40
|
-
if self is ToolModels.MIXTRAL_SMALL_8_X_7_B_0211:
|
41
|
-
return mixtral_small_8_x_7_b_0211()
|
42
|
-
if self is ToolModels.MISTRAL_LARGE_0224:
|
43
|
-
return mistral_large_0224()
|
44
|
-
if self is ToolModels.CLAUDE_3_OPUS_20240229:
|
45
|
-
return claude_3_opus_20240229()
|
46
|
-
if self is ToolModels.CLAUDE_3_SONNET_20240229:
|
47
|
-
return claude_3_sonnet_20240229()
|
48
|
-
if self is ToolModels.CLAUDE_3_HAIKU_20240307:
|
49
|
-
return claude_3_haiku_20240307()
|
File without changes
|