athena-intelligence 0.1.52__tar.gz → 0.1.54__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 (66) hide show
  1. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/PKG-INFO +1 -1
  2. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/pyproject.toml +1 -1
  3. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/__init__.py +1 -6
  4. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/base_client.py +0 -3
  5. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/chain/client.py +8 -9
  6. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/client_wrapper.py +1 -1
  7. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/tools/client.py +9 -9
  8. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/__init__.py +0 -4
  9. athena_intelligence-0.1.52/src/athena/tasks/client.py +0 -191
  10. athena_intelligence-0.1.52/src/athena/tools/__init__.py +0 -2
  11. athena_intelligence-0.1.52/src/athena/types/plan_execute_out.py +0 -32
  12. athena_intelligence-0.1.52/src/athena/types/tool_models.py +0 -49
  13. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/README.md +0 -0
  14. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/chain/__init__.py +0 -0
  15. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/client.py +0 -0
  16. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/__init__.py +0 -0
  17. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/api_error.py +0 -0
  18. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/datetime_utils.py +0 -0
  19. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/file.py +0 -0
  20. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/http_client.py +0 -0
  21. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/jsonable_encoder.py +0 -0
  22. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/pydantic_utilities.py +0 -0
  23. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/remove_none_from_dict.py +0 -0
  24. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/core/request_options.py +0 -0
  25. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/dataset/__init__.py +0 -0
  26. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/dataset/client.py +0 -0
  27. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/environment.py +0 -0
  28. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/errors/__init__.py +0 -0
  29. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/errors/unprocessable_entity_error.py +0 -0
  30. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/message/__init__.py +0 -0
  31. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/message/client.py +0 -0
  32. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/polling_message_client.py +0 -0
  33. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/py.typed +0 -0
  34. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/query/__init__.py +0 -0
  35. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/query/client.py +0 -0
  36. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/report/__init__.py +0 -0
  37. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/report/client.py +0 -0
  38. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/search/__init__.py +0 -0
  39. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/search/client.py +0 -0
  40. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/snippet/__init__.py +0 -0
  41. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/snippet/client.py +0 -0
  42. {athena_intelligence-0.1.52/src/athena/tasks → athena_intelligence-0.1.54/src/athena/tools}/__init__.py +0 -0
  43. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/dataset.py +0 -0
  44. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/document.py +0 -0
  45. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/excecute_tool_first_workflow_out.py +0 -0
  46. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/firecrawl_scrape_url_data_reponse_dto.py +0 -0
  47. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/firecrawl_scrape_url_metadata.py +0 -0
  48. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/get_datasets_response.py +0 -0
  49. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/get_snippets_response.py +0 -0
  50. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/http_validation_error.py +0 -0
  51. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/langchain_documents_request_out.py +0 -0
  52. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/llm_model.py +0 -0
  53. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/map_reduce_chain_out.py +0 -0
  54. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/message_out.py +0 -0
  55. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/message_out_dto.py +0 -0
  56. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/model.py +0 -0
  57. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/report.py +0 -0
  58. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/snippet.py +0 -0
  59. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/sql_results.py +0 -0
  60. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/status_enum.py +0 -0
  61. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/structured_parse_result.py +0 -0
  62. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/tools.py +0 -0
  63. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/url_result.py +0 -0
  64. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/validation_error.py +0 -0
  65. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/types/validation_error_loc_item.py +0 -0
  66. {athena_intelligence-0.1.52 → athena_intelligence-0.1.54}/src/athena/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: athena-intelligence
3
- Version: 0.1.52
3
+ Version: 0.1.54
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.52"
3
+ version = "0.1.54"
4
4
  description = ""
5
5
  readme = "README.md"
6
6
  authors = []
@@ -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, tasks, tools
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
  ]
@@ -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:
@@ -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: ToolModels,
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: ToolModels.
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, ToolModels
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=ToolModels.MISTRAL_LARGE_0224,
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: ToolModels,
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: ToolModels.
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, ToolModels
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=ToolModels.MISTRAL_LARGE_0224,
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",
@@ -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.52",
20
+ "X-Fern-SDK-Version": "0.1.54",
21
21
  }
22
22
  headers["X-API-KEY"] = self.api_key
23
23
  return headers
@@ -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.tool_models import ToolModels
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[ToolModels] = OMIT,
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[ToolModels].
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 ToolModels
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=ToolModels.MISTRAL_LARGE_0224,
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[ToolModels] = OMIT,
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[ToolModels].
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 ToolModels
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=ToolModels.MISTRAL_LARGE_0224,
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"},
@@ -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,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)
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
@@ -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}
@@ -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()