athena-intelligence 0.1.93__py3-none-any.whl → 0.1.95__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.
Files changed (67) hide show
  1. athena/__init__.py +1 -76
  2. athena/base_client.py +4 -31
  3. athena/client.py +4 -9
  4. athena/core/client_wrapper.py +1 -1
  5. athena/environment.py +1 -1
  6. athena/tools/client.py +61 -916
  7. athena/tools/types/tools_data_frame_request_columns_item.py +1 -1
  8. athena/types/__init__.py +0 -66
  9. athena/types/data_frame_parsing_error.py +1 -1
  10. athena/types/data_frame_request_out.py +5 -1
  11. athena/types/data_frame_unknown_format_error.py +1 -1
  12. {athena_intelligence-0.1.93.dist-info → athena_intelligence-0.1.95.dist-info}/METADATA +1 -1
  13. athena_intelligence-0.1.95.dist-info/RECORD +40 -0
  14. athena/chain/__init__.py +0 -2
  15. athena/chain/client.py +0 -302
  16. athena/dataset/__init__.py +0 -2
  17. athena/dataset/client.py +0 -124
  18. athena/message/__init__.py +0 -2
  19. athena/message/client.py +0 -249
  20. athena/polling_message_client.py +0 -125
  21. athena/query/__init__.py +0 -2
  22. athena/query/client.py +0 -123
  23. athena/report/__init__.py +0 -2
  24. athena/report/client.py +0 -125
  25. athena/search/__init__.py +0 -2
  26. athena/search/client.py +0 -171
  27. athena/snippet/__init__.py +0 -2
  28. athena/snippet/client.py +0 -208
  29. athena/types/athena_document_v_2_out.py +0 -29
  30. athena/types/convert_pdf_to_sheet_out.py +0 -30
  31. athena/types/dataset.py +0 -33
  32. athena/types/document.py +0 -47
  33. athena/types/excecute_tool_first_workflow_out.py +0 -29
  34. athena/types/file_data_response.py +0 -36
  35. athena/types/filter_model.py +0 -32
  36. athena/types/filter_operator.py +0 -73
  37. athena/types/firecrawl_scrape_url_data_reponse_dto.py +0 -32
  38. athena/types/firecrawl_scrape_url_metadata.py +0 -34
  39. athena/types/get_datasets_response.py +0 -34
  40. athena/types/get_snippet_out.py +0 -29
  41. athena/types/get_snippets_response.py +0 -34
  42. athena/types/langchain_documents_request_out.py +0 -29
  43. athena/types/llm_model.py +0 -141
  44. athena/types/map_reduce_chain_out.py +0 -32
  45. athena/types/message_out.py +0 -29
  46. athena/types/message_out_dto.py +0 -35
  47. athena/types/model.py +0 -93
  48. athena/types/publish_formats.py +0 -31
  49. athena/types/query_model.py +0 -40
  50. athena/types/report.py +0 -32
  51. athena/types/researcher_out.py +0 -29
  52. athena/types/semantic_query_out.py +0 -29
  53. athena/types/snippet.py +0 -35
  54. athena/types/sql_results.py +0 -29
  55. athena/types/status_enum.py +0 -29
  56. athena/types/structured_parse_result.py +0 -29
  57. athena/types/time_dimension_model.py +0 -33
  58. athena/types/tools.py +0 -57
  59. athena/types/upload_documents_out.py +0 -31
  60. athena/types/url_result.py +0 -29
  61. athena/types/workflow_status_out.py +0 -31
  62. athena/upload/__init__.py +0 -2
  63. athena/upload/client.py +0 -108
  64. athena/workflow/__init__.py +0 -2
  65. athena/workflow/client.py +0 -117
  66. athena_intelligence-0.1.93.dist-info/RECORD +0 -92
  67. {athena_intelligence-0.1.93.dist-info → athena_intelligence-0.1.95.dist-info}/WHEEL +0 -0
athena/types/report.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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class Report(pydantic_v1.BaseModel):
11
- id: str
12
- name: typing.Optional[str] = None
13
- workspace_access: bool
14
- created_at: str
15
-
16
- def json(self, **kwargs: typing.Any) -> str:
17
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18
- return super().json(**kwargs_with_defaults)
19
-
20
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
23
-
24
- return deep_union_pydantic_dicts(
25
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
26
- )
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,29 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class ResearcherOut(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_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
20
-
21
- return deep_union_pydantic_dicts(
22
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
23
- )
24
-
25
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,29 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class SemanticQueryOut(pydantic_v1.BaseModel):
11
- output: 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_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
20
-
21
- return deep_union_pydantic_dicts(
22
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
23
- )
24
-
25
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
athena/types/snippet.py DELETED
@@ -1,35 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class Snippet(pydantic_v1.BaseModel):
11
- id: str
12
- title: typing.Optional[str] = None
13
- description: typing.Optional[str] = None
14
- content: typing.Optional[str] = None
15
- language: typing.Optional[str] = None
16
- created_at: str
17
- dependencies: typing.Optional[typing.Dict[str, typing.List[str]]] = None
18
-
19
- def json(self, **kwargs: typing.Any) -> str:
20
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
- return super().json(**kwargs_with_defaults)
22
-
23
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
26
-
27
- return deep_union_pydantic_dicts(
28
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
29
- )
30
-
31
- class Config:
32
- frozen = True
33
- smart_union = True
34
- extra = pydantic_v1.Extra.allow
35
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,29 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class SqlResults(pydantic_v1.BaseModel):
11
- result: typing.Optional[typing.Any] = None
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_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
20
-
21
- return deep_union_pydantic_dicts(
22
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
23
- )
24
-
25
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,29 +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 StatusEnum(str, enum.Enum):
10
- """
11
- An enumeration.
12
- """
13
-
14
- PENDING = "pending"
15
- RESPONDED = "responded"
16
- ERROR = "error"
17
-
18
- def visit(
19
- self,
20
- pending: typing.Callable[[], T_Result],
21
- responded: typing.Callable[[], T_Result],
22
- error: typing.Callable[[], T_Result],
23
- ) -> T_Result:
24
- if self is StatusEnum.PENDING:
25
- return pending()
26
- if self is StatusEnum.RESPONDED:
27
- return responded()
28
- if self is StatusEnum.ERROR:
29
- return error()
@@ -1,29 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class StructuredParseResult(pydantic_v1.BaseModel):
11
- result: 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_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
20
-
21
- return deep_union_pydantic_dicts(
22
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
23
- )
24
-
25
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,33 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class TimeDimensionModel(pydantic_v1.BaseModel):
11
- dimension: str
12
- granularity: str
13
- date_range: typing.List[str] = pydantic_v1.Field(alias="dateRange")
14
-
15
- def json(self, **kwargs: typing.Any) -> str:
16
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17
- return super().json(**kwargs_with_defaults)
18
-
19
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
-
23
- return deep_union_pydantic_dicts(
24
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25
- )
26
-
27
- class Config:
28
- frozen = True
29
- smart_union = True
30
- allow_population_by_field_name = True
31
- populate_by_name = True
32
- extra = pydantic_v1.Extra.allow
33
- json_encoders = {dt.datetime: serialize_datetime}
athena/types/tools.py DELETED
@@ -1,57 +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 Tools(str, enum.Enum):
10
- """
11
- An enumeration.
12
- """
13
-
14
- SEARCH = "search"
15
- BROWSE = "browse"
16
- WIKIPEDIA = "wikipedia"
17
- DATABASE_METADATA = "database_metadata"
18
- QUERY = "query"
19
- CHART = "chart"
20
- ENRICH_PERSON = "enrich_person"
21
- ENRICH_COMPANY = "enrich_company"
22
- BROWSERBASE = "browserbase"
23
- CODE_EXECUTION = "code_execution"
24
-
25
- def visit(
26
- self,
27
- search: typing.Callable[[], T_Result],
28
- browse: typing.Callable[[], T_Result],
29
- wikipedia: typing.Callable[[], T_Result],
30
- database_metadata: typing.Callable[[], T_Result],
31
- query: typing.Callable[[], T_Result],
32
- chart: typing.Callable[[], T_Result],
33
- enrich_person: typing.Callable[[], T_Result],
34
- enrich_company: typing.Callable[[], T_Result],
35
- browserbase: typing.Callable[[], T_Result],
36
- code_execution: typing.Callable[[], T_Result],
37
- ) -> T_Result:
38
- if self is Tools.SEARCH:
39
- return search()
40
- if self is Tools.BROWSE:
41
- return browse()
42
- if self is Tools.WIKIPEDIA:
43
- return wikipedia()
44
- if self is Tools.DATABASE_METADATA:
45
- return database_metadata()
46
- if self is Tools.QUERY:
47
- return query()
48
- if self is Tools.CHART:
49
- return chart()
50
- if self is Tools.ENRICH_PERSON:
51
- return enrich_person()
52
- if self is Tools.ENRICH_COMPANY:
53
- return enrich_company()
54
- if self is Tools.BROWSERBASE:
55
- return browserbase()
56
- if self is Tools.CODE_EXECUTION:
57
- return code_execution()
@@ -1,31 +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 deep_union_pydantic_dicts, pydantic_v1
8
- from .file_data_response import FileDataResponse
9
-
10
-
11
- class UploadDocumentsOut(pydantic_v1.BaseModel):
12
- success: bool
13
- uploaded_documents: typing.Optional[typing.List[FileDataResponse]] = None
14
-
15
- def json(self, **kwargs: typing.Any) -> str:
16
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17
- return super().json(**kwargs_with_defaults)
18
-
19
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
-
23
- return deep_union_pydantic_dicts(
24
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25
- )
26
-
27
- class Config:
28
- frozen = True
29
- smart_union = True
30
- extra = pydantic_v1.Extra.allow
31
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,29 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class UrlResult(pydantic_v1.BaseModel):
11
- result: 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_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
20
-
21
- return deep_union_pydantic_dicts(
22
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
23
- )
24
-
25
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,31 +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 deep_union_pydantic_dicts, pydantic_v1
8
-
9
-
10
- class WorkflowStatusOut(pydantic_v1.BaseModel):
11
- status: str
12
- execution_info: typing.Dict[str, typing.Any]
13
- workflow_output: typing.Optional[typing.Dict[str, typing.Any]] = None
14
-
15
- def json(self, **kwargs: typing.Any) -> str:
16
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17
- return super().json(**kwargs_with_defaults)
18
-
19
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22
-
23
- return deep_union_pydantic_dicts(
24
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25
- )
26
-
27
- class Config:
28
- frozen = True
29
- smart_union = True
30
- extra = pydantic_v1.Extra.allow
31
- json_encoders = {dt.datetime: serialize_datetime}
athena/upload/__init__.py DELETED
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
athena/upload/client.py DELETED
@@ -1,108 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from json.decoder import JSONDecodeError
5
-
6
- from .. import core
7
- from ..core.api_error import ApiError
8
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
- from ..core.pydantic_utilities import pydantic_v1
10
- from ..core.request_options import RequestOptions
11
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
12
- from ..types.http_validation_error import HttpValidationError
13
- from ..types.upload_documents_out import UploadDocumentsOut
14
-
15
- # this is used as the default value for optional parameters
16
- OMIT = typing.cast(typing.Any, ...)
17
-
18
-
19
- class UploadClient:
20
- def __init__(self, *, client_wrapper: SyncClientWrapper):
21
- self._client_wrapper = client_wrapper
22
-
23
- def upload_documents(
24
- self, *, files: typing.List[core.File], request_options: typing.Optional[RequestOptions] = None
25
- ) -> UploadDocumentsOut:
26
- """
27
- Parameters
28
- ----------
29
- files : typing.List[core.File]
30
- See core.File for more documentation
31
-
32
- request_options : typing.Optional[RequestOptions]
33
- Request-specific configuration.
34
-
35
- Returns
36
- -------
37
- UploadDocumentsOut
38
- Successful Response
39
-
40
- Examples
41
- --------
42
- from athena.client import Athena
43
-
44
- client = Athena(
45
- api_key="YOUR_API_KEY",
46
- )
47
- client.upload.upload_documents()
48
- """
49
- _response = self._client_wrapper.httpx_client.request(
50
- "api/v0/upload", method="POST", data={}, files={"files": files}, request_options=request_options, omit=OMIT
51
- )
52
- if 200 <= _response.status_code < 300:
53
- return pydantic_v1.parse_obj_as(UploadDocumentsOut, _response.json()) # type: ignore
54
- if _response.status_code == 422:
55
- raise UnprocessableEntityError(
56
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
57
- )
58
- try:
59
- _response_json = _response.json()
60
- except JSONDecodeError:
61
- raise ApiError(status_code=_response.status_code, body=_response.text)
62
- raise ApiError(status_code=_response.status_code, body=_response_json)
63
-
64
-
65
- class AsyncUploadClient:
66
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
67
- self._client_wrapper = client_wrapper
68
-
69
- async def upload_documents(
70
- self, *, files: typing.List[core.File], request_options: typing.Optional[RequestOptions] = None
71
- ) -> UploadDocumentsOut:
72
- """
73
- Parameters
74
- ----------
75
- files : typing.List[core.File]
76
- See core.File for more documentation
77
-
78
- request_options : typing.Optional[RequestOptions]
79
- Request-specific configuration.
80
-
81
- Returns
82
- -------
83
- UploadDocumentsOut
84
- Successful Response
85
-
86
- Examples
87
- --------
88
- from athena.client import AsyncAthena
89
-
90
- client = AsyncAthena(
91
- api_key="YOUR_API_KEY",
92
- )
93
- await client.upload.upload_documents()
94
- """
95
- _response = await self._client_wrapper.httpx_client.request(
96
- "api/v0/upload", method="POST", data={}, files={"files": files}, request_options=request_options, omit=OMIT
97
- )
98
- if 200 <= _response.status_code < 300:
99
- return pydantic_v1.parse_obj_as(UploadDocumentsOut, _response.json()) # type: ignore
100
- if _response.status_code == 422:
101
- raise UnprocessableEntityError(
102
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
103
- )
104
- try:
105
- _response_json = _response.json()
106
- except JSONDecodeError:
107
- raise ApiError(status_code=_response.status_code, body=_response.text)
108
- 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
-
athena/workflow/client.py DELETED
@@ -1,117 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from json.decoder import JSONDecodeError
5
-
6
- from ..core.api_error import ApiError
7
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
- from ..core.pydantic_utilities import pydantic_v1
9
- from ..core.request_options import RequestOptions
10
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
11
- from ..types.http_validation_error import HttpValidationError
12
- from ..types.workflow_status_out import WorkflowStatusOut
13
-
14
- # this is used as the default value for optional parameters
15
- OMIT = typing.cast(typing.Any, ...)
16
-
17
-
18
- class WorkflowClient:
19
- def __init__(self, *, client_wrapper: SyncClientWrapper):
20
- self._client_wrapper = client_wrapper
21
-
22
- def get_workflow_status(
23
- self, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
24
- ) -> WorkflowStatusOut:
25
- """
26
- Parameters
27
- ----------
28
- workflow_id : str
29
-
30
- request_options : typing.Optional[RequestOptions]
31
- Request-specific configuration.
32
-
33
- Returns
34
- -------
35
- WorkflowStatusOut
36
- Successful Response
37
-
38
- Examples
39
- --------
40
- from athena.client import Athena
41
-
42
- client = Athena(
43
- api_key="YOUR_API_KEY",
44
- )
45
- client.workflow.get_workflow_status(
46
- workflow_id="workflow_5f6eeb00-86e5-41b2-8e1d-49415f34ccc4",
47
- )
48
- """
49
- _response = self._client_wrapper.httpx_client.request(
50
- "api/v0/workflow/status",
51
- method="POST",
52
- json={"workflow_id": workflow_id},
53
- request_options=request_options,
54
- omit=OMIT,
55
- )
56
- if 200 <= _response.status_code < 300:
57
- return pydantic_v1.parse_obj_as(WorkflowStatusOut, _response.json()) # type: ignore
58
- if _response.status_code == 422:
59
- raise UnprocessableEntityError(
60
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
61
- )
62
- try:
63
- _response_json = _response.json()
64
- except JSONDecodeError:
65
- raise ApiError(status_code=_response.status_code, body=_response.text)
66
- raise ApiError(status_code=_response.status_code, body=_response_json)
67
-
68
-
69
- class AsyncWorkflowClient:
70
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
71
- self._client_wrapper = client_wrapper
72
-
73
- async def get_workflow_status(
74
- self, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
75
- ) -> WorkflowStatusOut:
76
- """
77
- Parameters
78
- ----------
79
- workflow_id : str
80
-
81
- request_options : typing.Optional[RequestOptions]
82
- Request-specific configuration.
83
-
84
- Returns
85
- -------
86
- WorkflowStatusOut
87
- Successful Response
88
-
89
- Examples
90
- --------
91
- from athena.client import AsyncAthena
92
-
93
- client = AsyncAthena(
94
- api_key="YOUR_API_KEY",
95
- )
96
- await client.workflow.get_workflow_status(
97
- workflow_id="workflow_5f6eeb00-86e5-41b2-8e1d-49415f34ccc4",
98
- )
99
- """
100
- _response = await self._client_wrapper.httpx_client.request(
101
- "api/v0/workflow/status",
102
- method="POST",
103
- json={"workflow_id": workflow_id},
104
- request_options=request_options,
105
- omit=OMIT,
106
- )
107
- if 200 <= _response.status_code < 300:
108
- return pydantic_v1.parse_obj_as(WorkflowStatusOut, _response.json()) # type: ignore
109
- if _response.status_code == 422:
110
- raise UnprocessableEntityError(
111
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
112
- )
113
- try:
114
- _response_json = _response.json()
115
- except JSONDecodeError:
116
- raise ApiError(status_code=_response.status_code, body=_response.text)
117
- raise ApiError(status_code=_response.status_code, body=_response_json)