athena-intelligence 0.1.126__py3-none-any.whl → 0.1.184__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 (99) hide show
  1. athena/__init__.py +28 -3
  2. athena/agents/__init__.py +2 -0
  3. athena/agents/client.py +51 -95
  4. athena/agents/drive/__init__.py +2 -0
  5. athena/agents/drive/client.py +31 -80
  6. athena/agents/drive/raw_client.py +155 -0
  7. athena/agents/general/__init__.py +2 -0
  8. athena/agents/general/client.py +91 -238
  9. athena/agents/general/raw_client.py +369 -0
  10. athena/agents/raw_client.py +176 -0
  11. athena/agents/research/__init__.py +2 -0
  12. athena/agents/research/client.py +31 -80
  13. athena/agents/research/raw_client.py +155 -0
  14. athena/agents/sql/__init__.py +2 -0
  15. athena/agents/sql/client.py +31 -80
  16. athena/agents/sql/raw_client.py +155 -0
  17. athena/assets/__init__.py +4 -0
  18. athena/assets/client.py +144 -0
  19. athena/assets/raw_client.py +164 -0
  20. athena/base_client.py +25 -11
  21. athena/client.py +1 -1
  22. athena/core/__init__.py +5 -0
  23. athena/core/api_error.py +13 -5
  24. athena/core/client_wrapper.py +33 -8
  25. athena/core/force_multipart.py +16 -0
  26. athena/core/http_client.py +70 -26
  27. athena/core/http_response.py +55 -0
  28. athena/core/jsonable_encoder.py +0 -1
  29. athena/core/pydantic_utilities.py +70 -111
  30. athena/core/serialization.py +7 -3
  31. athena/errors/__init__.py +2 -0
  32. athena/errors/bad_request_error.py +4 -2
  33. athena/errors/content_too_large_error.py +4 -2
  34. athena/errors/internal_server_error.py +4 -3
  35. athena/errors/not_found_error.py +4 -2
  36. athena/errors/unauthorized_error.py +4 -3
  37. athena/errors/unprocessable_entity_error.py +4 -3
  38. athena/errors/unsupported_media_type_error.py +4 -2
  39. athena/query/__init__.py +2 -0
  40. athena/query/client.py +39 -219
  41. athena/query/raw_client.py +344 -0
  42. athena/query/types/__init__.py +2 -0
  43. athena/tools/__init__.py +2 -0
  44. athena/tools/calendar/__init__.py +2 -0
  45. athena/tools/calendar/client.py +35 -79
  46. athena/tools/calendar/raw_client.py +172 -0
  47. athena/tools/client.py +267 -653
  48. athena/tools/email/__init__.py +2 -0
  49. athena/tools/email/client.py +39 -115
  50. athena/tools/email/raw_client.py +248 -0
  51. athena/tools/raw_client.py +1328 -0
  52. athena/tools/structured_data_extractor/__init__.py +2 -0
  53. athena/tools/structured_data_extractor/client.py +42 -96
  54. athena/tools/structured_data_extractor/raw_client.py +240 -0
  55. athena/tools/tasks/__init__.py +2 -0
  56. athena/tools/tasks/client.py +31 -43
  57. athena/tools/tasks/raw_client.py +96 -0
  58. athena/tools/types/__init__.py +2 -0
  59. athena/types/__init__.py +28 -2
  60. athena/types/asset_content_request_out.py +26 -0
  61. athena/types/asset_node.py +3 -3
  62. athena/types/asset_not_found_error.py +2 -2
  63. athena/types/asset_screenshot_response_out.py +43 -0
  64. athena/types/chunk.py +3 -3
  65. athena/types/chunk_content_item.py +3 -2
  66. athena/types/chunk_result.py +3 -3
  67. athena/types/content.py +7 -0
  68. athena/types/custom_agent_response.py +2 -2
  69. athena/types/data_frame_request_out.py +3 -3
  70. athena/types/data_frame_unknown_format_error.py +2 -2
  71. athena/types/document_chunk.py +2 -2
  72. athena/types/drive_agent_response.py +2 -2
  73. athena/types/file_chunk_request_out.py +3 -3
  74. athena/types/file_too_large_error.py +2 -2
  75. athena/types/folder_response.py +10 -4
  76. athena/types/general_agent_config.py +4 -3
  77. athena/types/general_agent_config_enabled_tools_item.py +1 -2
  78. athena/types/general_agent_request.py +15 -4
  79. athena/types/general_agent_response.py +4 -3
  80. athena/types/general_agent_response_message.py +100 -0
  81. athena/types/general_agent_response_message_kwargs.py +74 -0
  82. athena/types/{tool.py → id.py} +1 -1
  83. athena/types/image_url_content.py +2 -2
  84. athena/types/input_message.py +29 -0
  85. athena/types/input_message_content_item.py +39 -0
  86. athena/types/paginated_assets_out.py +52 -0
  87. athena/types/parent_folder_error.py +2 -2
  88. athena/types/prompt_message.py +3 -3
  89. athena/types/public_asset_out.py +97 -0
  90. athena/types/research_agent_response.py +2 -2
  91. athena/types/save_asset_request_out.py +2 -2
  92. athena/types/sql_agent_response.py +2 -2
  93. athena/types/structured_data_extractor_response.py +3 -3
  94. athena/types/text_content.py +2 -2
  95. athena/types/type.py +1 -1
  96. {athena_intelligence-0.1.126.dist-info → athena_intelligence-0.1.184.dist-info}/METADATA +3 -7
  97. athena_intelligence-0.1.184.dist-info/RECORD +112 -0
  98. {athena_intelligence-0.1.126.dist-info → athena_intelligence-0.1.184.dist-info}/WHEEL +1 -1
  99. athena_intelligence-0.1.126.dist-info/RECORD +0 -87
@@ -1,17 +1,26 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ...core.client_wrapper import SyncClientWrapper
4
3
  import typing
4
+
5
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
5
6
  from ...core.request_options import RequestOptions
6
- from ...core.pydantic_utilities import parse_obj_as
7
- from json.decoder import JSONDecodeError
8
- from ...core.api_error import ApiError
9
- from ...core.client_wrapper import AsyncClientWrapper
7
+ from .raw_client import AsyncRawCalendarClient, RawCalendarClient
10
8
 
11
9
 
12
10
  class CalendarClient:
13
11
  def __init__(self, *, client_wrapper: SyncClientWrapper):
14
- self._client_wrapper = client_wrapper
12
+ self._raw_client = RawCalendarClient(client_wrapper=client_wrapper)
13
+
14
+ @property
15
+ def with_raw_response(self) -> RawCalendarClient:
16
+ """
17
+ Retrieves a raw implementation of this client that returns raw responses.
18
+
19
+ Returns
20
+ -------
21
+ RawCalendarClient
22
+ """
23
+ return self._raw_client
15
24
 
16
25
  def list_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
17
26
  """
@@ -36,24 +45,8 @@ class CalendarClient:
36
45
  )
37
46
  client.tools.calendar.list_events()
38
47
  """
39
- _response = self._client_wrapper.httpx_client.request(
40
- "api/v0/tools/calendar/events",
41
- method="GET",
42
- request_options=request_options,
43
- )
44
- try:
45
- if 200 <= _response.status_code < 300:
46
- return typing.cast(
47
- typing.Optional[typing.Any],
48
- parse_obj_as(
49
- type_=typing.Optional[typing.Any], # type: ignore
50
- object_=_response.json(),
51
- ),
52
- )
53
- _response_json = _response.json()
54
- except JSONDecodeError:
55
- raise ApiError(status_code=_response.status_code, body=_response.text)
56
- raise ApiError(status_code=_response.status_code, body=_response_json)
48
+ _response = self._raw_client.list_events(request_options=request_options)
49
+ return _response.data
57
50
 
58
51
  def create_event(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
59
52
  """
@@ -78,29 +71,24 @@ class CalendarClient:
78
71
  )
79
72
  client.tools.calendar.create_event()
80
73
  """
81
- _response = self._client_wrapper.httpx_client.request(
82
- "api/v0/tools/calendar/events",
83
- method="POST",
84
- request_options=request_options,
85
- )
86
- try:
87
- if 200 <= _response.status_code < 300:
88
- return typing.cast(
89
- typing.Optional[typing.Any],
90
- parse_obj_as(
91
- type_=typing.Optional[typing.Any], # type: ignore
92
- object_=_response.json(),
93
- ),
94
- )
95
- _response_json = _response.json()
96
- except JSONDecodeError:
97
- raise ApiError(status_code=_response.status_code, body=_response.text)
98
- raise ApiError(status_code=_response.status_code, body=_response_json)
74
+ _response = self._raw_client.create_event(request_options=request_options)
75
+ return _response.data
99
76
 
100
77
 
101
78
  class AsyncCalendarClient:
102
79
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
103
- self._client_wrapper = client_wrapper
80
+ self._raw_client = AsyncRawCalendarClient(client_wrapper=client_wrapper)
81
+
82
+ @property
83
+ def with_raw_response(self) -> AsyncRawCalendarClient:
84
+ """
85
+ Retrieves a raw implementation of this client that returns raw responses.
86
+
87
+ Returns
88
+ -------
89
+ AsyncRawCalendarClient
90
+ """
91
+ return self._raw_client
104
92
 
105
93
  async def list_events(
106
94
  self, *, request_options: typing.Optional[RequestOptions] = None
@@ -135,24 +123,8 @@ class AsyncCalendarClient:
135
123
 
136
124
  asyncio.run(main())
137
125
  """
138
- _response = await self._client_wrapper.httpx_client.request(
139
- "api/v0/tools/calendar/events",
140
- method="GET",
141
- request_options=request_options,
142
- )
143
- try:
144
- if 200 <= _response.status_code < 300:
145
- return typing.cast(
146
- typing.Optional[typing.Any],
147
- parse_obj_as(
148
- type_=typing.Optional[typing.Any], # type: ignore
149
- object_=_response.json(),
150
- ),
151
- )
152
- _response_json = _response.json()
153
- except JSONDecodeError:
154
- raise ApiError(status_code=_response.status_code, body=_response.text)
155
- raise ApiError(status_code=_response.status_code, body=_response_json)
126
+ _response = await self._raw_client.list_events(request_options=request_options)
127
+ return _response.data
156
128
 
157
129
  async def create_event(
158
130
  self, *, request_options: typing.Optional[RequestOptions] = None
@@ -187,21 +159,5 @@ class AsyncCalendarClient:
187
159
 
188
160
  asyncio.run(main())
189
161
  """
190
- _response = await self._client_wrapper.httpx_client.request(
191
- "api/v0/tools/calendar/events",
192
- method="POST",
193
- request_options=request_options,
194
- )
195
- try:
196
- if 200 <= _response.status_code < 300:
197
- return typing.cast(
198
- typing.Optional[typing.Any],
199
- parse_obj_as(
200
- type_=typing.Optional[typing.Any], # type: ignore
201
- object_=_response.json(),
202
- ),
203
- )
204
- _response_json = _response.json()
205
- except JSONDecodeError:
206
- raise ApiError(status_code=_response.status_code, body=_response.text)
207
- raise ApiError(status_code=_response.status_code, body=_response_json)
162
+ _response = await self._raw_client.create_event(request_options=request_options)
163
+ return _response.data
@@ -0,0 +1,172 @@
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.http_response import AsyncHttpResponse, HttpResponse
9
+ from ...core.pydantic_utilities import parse_obj_as
10
+ from ...core.request_options import RequestOptions
11
+
12
+
13
+ class RawCalendarClient:
14
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
15
+ self._client_wrapper = client_wrapper
16
+
17
+ def list_events(
18
+ self, *, request_options: typing.Optional[RequestOptions] = None
19
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
20
+ """
21
+ Coming soon! List calendar events with optional filtering.
22
+
23
+ Parameters
24
+ ----------
25
+ request_options : typing.Optional[RequestOptions]
26
+ Request-specific configuration.
27
+
28
+ Returns
29
+ -------
30
+ HttpResponse[typing.Optional[typing.Any]]
31
+ Successful Response
32
+ """
33
+ _response = self._client_wrapper.httpx_client.request(
34
+ "api/v0/tools/calendar/events",
35
+ method="GET",
36
+ request_options=request_options,
37
+ )
38
+ try:
39
+ if _response is None or not _response.text.strip():
40
+ return HttpResponse(response=_response, data=None)
41
+ if 200 <= _response.status_code < 300:
42
+ _data = typing.cast(
43
+ typing.Optional[typing.Any],
44
+ parse_obj_as(
45
+ type_=typing.Optional[typing.Any], # type: ignore
46
+ object_=_response.json(),
47
+ ),
48
+ )
49
+ return HttpResponse(response=_response, data=_data)
50
+ _response_json = _response.json()
51
+ except JSONDecodeError:
52
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
53
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
54
+
55
+ def create_event(
56
+ self, *, request_options: typing.Optional[RequestOptions] = None
57
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
58
+ """
59
+ Coming soon! Create new calendar events.
60
+
61
+ Parameters
62
+ ----------
63
+ request_options : typing.Optional[RequestOptions]
64
+ Request-specific configuration.
65
+
66
+ Returns
67
+ -------
68
+ HttpResponse[typing.Optional[typing.Any]]
69
+ Successful Response
70
+ """
71
+ _response = self._client_wrapper.httpx_client.request(
72
+ "api/v0/tools/calendar/events",
73
+ method="POST",
74
+ request_options=request_options,
75
+ )
76
+ try:
77
+ if _response is None or not _response.text.strip():
78
+ return HttpResponse(response=_response, data=None)
79
+ if 200 <= _response.status_code < 300:
80
+ _data = typing.cast(
81
+ typing.Optional[typing.Any],
82
+ parse_obj_as(
83
+ type_=typing.Optional[typing.Any], # type: ignore
84
+ object_=_response.json(),
85
+ ),
86
+ )
87
+ return HttpResponse(response=_response, data=_data)
88
+ _response_json = _response.json()
89
+ except JSONDecodeError:
90
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
91
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
92
+
93
+
94
+ class AsyncRawCalendarClient:
95
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
96
+ self._client_wrapper = client_wrapper
97
+
98
+ async def list_events(
99
+ self, *, request_options: typing.Optional[RequestOptions] = None
100
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
101
+ """
102
+ Coming soon! List calendar events with optional filtering.
103
+
104
+ Parameters
105
+ ----------
106
+ request_options : typing.Optional[RequestOptions]
107
+ Request-specific configuration.
108
+
109
+ Returns
110
+ -------
111
+ AsyncHttpResponse[typing.Optional[typing.Any]]
112
+ Successful Response
113
+ """
114
+ _response = await self._client_wrapper.httpx_client.request(
115
+ "api/v0/tools/calendar/events",
116
+ method="GET",
117
+ request_options=request_options,
118
+ )
119
+ try:
120
+ if _response is None or not _response.text.strip():
121
+ return AsyncHttpResponse(response=_response, data=None)
122
+ if 200 <= _response.status_code < 300:
123
+ _data = typing.cast(
124
+ typing.Optional[typing.Any],
125
+ parse_obj_as(
126
+ type_=typing.Optional[typing.Any], # type: ignore
127
+ object_=_response.json(),
128
+ ),
129
+ )
130
+ return AsyncHttpResponse(response=_response, data=_data)
131
+ _response_json = _response.json()
132
+ except JSONDecodeError:
133
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
134
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
135
+
136
+ async def create_event(
137
+ self, *, request_options: typing.Optional[RequestOptions] = None
138
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
139
+ """
140
+ Coming soon! Create new calendar events.
141
+
142
+ Parameters
143
+ ----------
144
+ request_options : typing.Optional[RequestOptions]
145
+ Request-specific configuration.
146
+
147
+ Returns
148
+ -------
149
+ AsyncHttpResponse[typing.Optional[typing.Any]]
150
+ Successful Response
151
+ """
152
+ _response = await self._client_wrapper.httpx_client.request(
153
+ "api/v0/tools/calendar/events",
154
+ method="POST",
155
+ request_options=request_options,
156
+ )
157
+ try:
158
+ if _response is None or not _response.text.strip():
159
+ return AsyncHttpResponse(response=_response, data=None)
160
+ if 200 <= _response.status_code < 300:
161
+ _data = typing.cast(
162
+ typing.Optional[typing.Any],
163
+ parse_obj_as(
164
+ type_=typing.Optional[typing.Any], # type: ignore
165
+ object_=_response.json(),
166
+ ),
167
+ )
168
+ return AsyncHttpResponse(response=_response, data=_data)
169
+ _response_json = _response.json()
170
+ except JSONDecodeError:
171
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
172
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)