athena-intelligence 0.1.125__py3-none-any.whl → 0.1.127__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 +7 -0
- athena/agents/client.py +88 -36
- athena/agents/drive/client.py +80 -32
- athena/agents/general/client.py +222 -91
- athena/agents/research/client.py +80 -32
- athena/agents/sql/client.py +80 -32
- athena/base_client.py +13 -11
- athena/client.py +161 -61
- athena/core/__init__.py +21 -4
- athena/core/client_wrapper.py +9 -10
- athena/core/file.py +37 -8
- athena/core/http_client.py +97 -41
- athena/core/jsonable_encoder.py +33 -31
- athena/core/pydantic_utilities.py +272 -4
- athena/core/query_encoder.py +38 -13
- athena/core/request_options.py +5 -2
- athena/core/serialization.py +272 -0
- athena/errors/internal_server_error.py +2 -3
- athena/errors/unauthorized_error.py +2 -3
- athena/errors/unprocessable_entity_error.py +2 -3
- athena/query/client.py +208 -58
- athena/tools/calendar/client.py +82 -30
- athena/tools/client.py +956 -188
- athena/tools/email/client.py +117 -43
- athena/tools/structured_data_extractor/client.py +118 -67
- athena/tools/tasks/client.py +41 -17
- athena/types/__init__.py +4 -0
- athena/types/asset_content_request_out.py +26 -0
- athena/types/asset_node.py +14 -24
- athena/types/asset_not_found_error.py +11 -21
- athena/types/asset_screenshot_response_out.py +43 -0
- athena/types/chunk.py +11 -21
- athena/types/chunk_content_item.py +21 -41
- athena/types/chunk_result.py +13 -23
- athena/types/custom_agent_response.py +12 -22
- athena/types/data_frame_request_out.py +11 -21
- athena/types/data_frame_unknown_format_error.py +11 -21
- athena/types/document_chunk.py +12 -22
- athena/types/drive_agent_response.py +12 -22
- athena/types/file_chunk_request_out.py +11 -21
- athena/types/file_too_large_error.py +11 -21
- athena/types/folder_response.py +11 -21
- athena/types/general_agent_config.py +12 -21
- athena/types/general_agent_config_enabled_tools_item.py +0 -1
- athena/types/general_agent_request.py +13 -23
- athena/types/general_agent_response.py +12 -22
- athena/types/image_url_content.py +11 -21
- athena/types/parent_folder_error.py +11 -21
- athena/types/prompt_message.py +12 -22
- athena/types/research_agent_response.py +12 -22
- athena/types/save_asset_request_out.py +11 -21
- athena/types/sql_agent_response.py +13 -23
- athena/types/structured_data_extractor_response.py +15 -25
- athena/types/text_content.py +11 -21
- athena/types/tool.py +1 -13
- athena/types/type.py +1 -21
- athena/version.py +0 -1
- {athena_intelligence-0.1.125.dist-info → athena_intelligence-0.1.127.dist-info}/METADATA +12 -4
- athena_intelligence-0.1.127.dist-info/RECORD +89 -0
- {athena_intelligence-0.1.125.dist-info → athena_intelligence-0.1.127.dist-info}/WHEEL +1 -1
- athena_intelligence-0.1.125.dist-info/RECORD +0 -86
athena/tools/tasks/client.py
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
from ...core.client_wrapper import SyncClientWrapper
|
3
4
|
import typing
|
5
|
+
from ...core.request_options import RequestOptions
|
6
|
+
from ...core.pydantic_utilities import parse_obj_as
|
4
7
|
from json.decoder import JSONDecodeError
|
5
|
-
|
6
8
|
from ...core.api_error import ApiError
|
7
|
-
from ...core.client_wrapper import AsyncClientWrapper
|
8
|
-
from ...core.pydantic_utilities import pydantic_v1
|
9
|
-
from ...core.request_options import RequestOptions
|
9
|
+
from ...core.client_wrapper import AsyncClientWrapper
|
10
10
|
|
11
11
|
|
12
12
|
class TasksClient:
|
13
13
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
14
14
|
self._client_wrapper = client_wrapper
|
15
15
|
|
16
|
-
def run_task(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
|
16
|
+
def run_task(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
17
17
|
"""
|
18
18
|
Coming soon! Run a [task](https://resources.athenaintel.com/docs/task-studio/home).
|
19
19
|
|
@@ -24,12 +24,12 @@ class TasksClient:
|
|
24
24
|
|
25
25
|
Returns
|
26
26
|
-------
|
27
|
-
typing.Any
|
27
|
+
typing.Optional[typing.Any]
|
28
28
|
Successful Response
|
29
29
|
|
30
30
|
Examples
|
31
31
|
--------
|
32
|
-
from athena
|
32
|
+
from athena import Athena
|
33
33
|
|
34
34
|
client = Athena(
|
35
35
|
api_key="YOUR_API_KEY",
|
@@ -37,11 +37,19 @@ class TasksClient:
|
|
37
37
|
client.tools.tasks.run_task()
|
38
38
|
"""
|
39
39
|
_response = self._client_wrapper.httpx_client.request(
|
40
|
-
"api/v0/tools/tasks/run",
|
40
|
+
"api/v0/tools/tasks/run",
|
41
|
+
method="POST",
|
42
|
+
request_options=request_options,
|
41
43
|
)
|
42
|
-
if 200 <= _response.status_code < 300:
|
43
|
-
return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
44
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
|
+
)
|
45
53
|
_response_json = _response.json()
|
46
54
|
except JSONDecodeError:
|
47
55
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
@@ -52,7 +60,7 @@ class AsyncTasksClient:
|
|
52
60
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
53
61
|
self._client_wrapper = client_wrapper
|
54
62
|
|
55
|
-
async def run_task(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
|
63
|
+
async def run_task(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
56
64
|
"""
|
57
65
|
Coming soon! Run a [task](https://resources.athenaintel.com/docs/task-studio/home).
|
58
66
|
|
@@ -63,24 +71,40 @@ class AsyncTasksClient:
|
|
63
71
|
|
64
72
|
Returns
|
65
73
|
-------
|
66
|
-
typing.Any
|
74
|
+
typing.Optional[typing.Any]
|
67
75
|
Successful Response
|
68
76
|
|
69
77
|
Examples
|
70
78
|
--------
|
71
|
-
|
79
|
+
import asyncio
|
80
|
+
|
81
|
+
from athena import AsyncAthena
|
72
82
|
|
73
83
|
client = AsyncAthena(
|
74
84
|
api_key="YOUR_API_KEY",
|
75
85
|
)
|
76
|
-
|
86
|
+
|
87
|
+
|
88
|
+
async def main() -> None:
|
89
|
+
await client.tools.tasks.run_task()
|
90
|
+
|
91
|
+
|
92
|
+
asyncio.run(main())
|
77
93
|
"""
|
78
94
|
_response = await self._client_wrapper.httpx_client.request(
|
79
|
-
"api/v0/tools/tasks/run",
|
95
|
+
"api/v0/tools/tasks/run",
|
96
|
+
method="POST",
|
97
|
+
request_options=request_options,
|
80
98
|
)
|
81
|
-
if 200 <= _response.status_code < 300:
|
82
|
-
return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
83
99
|
try:
|
100
|
+
if 200 <= _response.status_code < 300:
|
101
|
+
return typing.cast(
|
102
|
+
typing.Optional[typing.Any],
|
103
|
+
parse_obj_as(
|
104
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
105
|
+
object_=_response.json(),
|
106
|
+
),
|
107
|
+
)
|
84
108
|
_response_json = _response.json()
|
85
109
|
except JSONDecodeError:
|
86
110
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
athena/types/__init__.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
from .asset_content_request_out import AssetContentRequestOut
|
3
4
|
from .asset_node import AssetNode
|
4
5
|
from .asset_not_found_error import AssetNotFoundError
|
6
|
+
from .asset_screenshot_response_out import AssetScreenshotResponseOut
|
5
7
|
from .chunk import Chunk
|
6
8
|
from .chunk_content_item import ChunkContentItem, ChunkContentItem_ImageUrl, ChunkContentItem_Text
|
7
9
|
from .chunk_result import ChunkResult
|
@@ -33,8 +35,10 @@ from .tool import Tool
|
|
33
35
|
from .type import Type
|
34
36
|
|
35
37
|
__all__ = [
|
38
|
+
"AssetContentRequestOut",
|
36
39
|
"AssetNode",
|
37
40
|
"AssetNotFoundError",
|
41
|
+
"AssetScreenshotResponseOut",
|
38
42
|
"Chunk",
|
39
43
|
"ChunkContentItem",
|
40
44
|
"ChunkContentItem_ImageUrl",
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
|
+
import pydantic
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
6
|
+
import typing
|
7
|
+
|
8
|
+
|
9
|
+
class AssetContentRequestOut(UniversalBaseModel):
|
10
|
+
"""
|
11
|
+
Response model with asset content.
|
12
|
+
"""
|
13
|
+
|
14
|
+
content: str = pydantic.Field()
|
15
|
+
"""
|
16
|
+
The content of the asset
|
17
|
+
"""
|
18
|
+
|
19
|
+
if IS_PYDANTIC_V2:
|
20
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
21
|
+
else:
|
22
|
+
|
23
|
+
class Config:
|
24
|
+
frozen = True
|
25
|
+
smart_union = True
|
26
|
+
extra = pydantic.Extra.allow
|
athena/types/asset_node.py
CHANGED
@@ -1,42 +1,32 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
|
-
|
5
|
-
import datetime as dt
|
4
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
6
5
|
import typing
|
7
|
-
|
8
|
-
|
9
|
-
from ..core.pydantic_utilities import
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
|
+
import pydantic
|
8
|
+
from ..core.pydantic_utilities import update_forward_refs
|
10
9
|
|
11
10
|
|
12
|
-
class AssetNode(
|
11
|
+
class AssetNode(UniversalBaseModel):
|
13
12
|
"""
|
14
13
|
Model representing a node in the folder tree.
|
15
14
|
"""
|
16
15
|
|
17
|
-
children: typing.Optional[typing.Dict[str, typing.Optional[AssetNode]]] = None
|
16
|
+
children: typing.Optional[typing.Dict[str, typing.Optional["AssetNode"]]] = None
|
18
17
|
id: str
|
19
18
|
media_type: str
|
20
19
|
name: str
|
21
20
|
type: str
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
28
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
29
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
30
|
-
|
31
|
-
return deep_union_pydantic_dicts(
|
32
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
33
|
-
)
|
22
|
+
if IS_PYDANTIC_V2:
|
23
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
24
|
+
else:
|
34
25
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
26
|
+
class Config:
|
27
|
+
frozen = True
|
28
|
+
smart_union = True
|
29
|
+
extra = pydantic.Extra.allow
|
40
30
|
|
41
31
|
|
42
|
-
|
32
|
+
update_forward_refs(AssetNode)
|
@@ -1,29 +1,19 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
4
5
|
import typing
|
6
|
+
import pydantic
|
5
7
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
|
-
|
10
|
-
class AssetNotFoundError(pydantic_v1.BaseModel):
|
9
|
+
class AssetNotFoundError(UniversalBaseModel):
|
11
10
|
message: str
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
)
|
12
|
+
if IS_PYDANTIC_V2:
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
14
|
+
else:
|
24
15
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
16
|
+
class Config:
|
17
|
+
frozen = True
|
18
|
+
smart_union = True
|
19
|
+
extra = pydantic.Extra.allow
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
|
+
import typing_extensions
|
5
|
+
from ..core.serialization import FieldMetadata
|
6
|
+
import pydantic
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
8
|
+
import typing
|
9
|
+
|
10
|
+
|
11
|
+
class AssetScreenshotResponseOut(UniversalBaseModel):
|
12
|
+
"""
|
13
|
+
Response model with screenshot data.
|
14
|
+
"""
|
15
|
+
|
16
|
+
base_64_image: typing_extensions.Annotated[str, FieldMetadata(alias="base64_image")] = pydantic.Field()
|
17
|
+
"""
|
18
|
+
Base64-encoded image data
|
19
|
+
"""
|
20
|
+
|
21
|
+
message: str = pydantic.Field()
|
22
|
+
"""
|
23
|
+
Status message
|
24
|
+
"""
|
25
|
+
|
26
|
+
page_number: int = pydantic.Field()
|
27
|
+
"""
|
28
|
+
The page number that was captured
|
29
|
+
"""
|
30
|
+
|
31
|
+
total_pages: int = pydantic.Field()
|
32
|
+
"""
|
33
|
+
Total number of pages in the document
|
34
|
+
"""
|
35
|
+
|
36
|
+
if IS_PYDANTIC_V2:
|
37
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
38
|
+
else:
|
39
|
+
|
40
|
+
class Config:
|
41
|
+
frozen = True
|
42
|
+
smart_union = True
|
43
|
+
extra = pydantic.Extra.allow
|
athena/types/chunk.py
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
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
5
|
from .chunk_content_item import ChunkContentItem
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
|
+
import pydantic
|
9
8
|
|
10
9
|
|
11
|
-
class Chunk(
|
10
|
+
class Chunk(UniversalBaseModel):
|
12
11
|
"""
|
13
12
|
A chunk of content to extract data from.
|
14
13
|
"""
|
@@ -17,20 +16,11 @@ class Chunk(pydantic_v1.BaseModel):
|
|
17
16
|
content: typing.List[ChunkContentItem]
|
18
17
|
metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
27
|
-
|
28
|
-
return deep_union_pydantic_dicts(
|
29
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
30
|
-
)
|
19
|
+
if IS_PYDANTIC_V2:
|
20
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
21
|
+
else:
|
31
22
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
23
|
+
class Config:
|
24
|
+
frozen = True
|
25
|
+
smart_union = True
|
26
|
+
extra = pydantic.Extra.allow
|
@@ -1,58 +1,38 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
|
-
|
5
|
-
import datetime as dt
|
4
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
6
5
|
import typing
|
7
|
-
|
8
|
-
|
9
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
|
+
import pydantic
|
10
8
|
|
11
9
|
|
12
|
-
class ChunkContentItem_Text(
|
13
|
-
text: str
|
10
|
+
class ChunkContentItem_Text(UniversalBaseModel):
|
14
11
|
type: typing.Literal["text"] = "text"
|
12
|
+
text: str
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
)
|
14
|
+
if IS_PYDANTIC_V2:
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
16
|
+
else:
|
27
17
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
18
|
+
class Config:
|
19
|
+
frozen = True
|
20
|
+
smart_union = True
|
21
|
+
extra = pydantic.Extra.allow
|
33
22
|
|
34
23
|
|
35
|
-
class ChunkContentItem_ImageUrl(
|
36
|
-
image_url: typing.Dict[str, str]
|
24
|
+
class ChunkContentItem_ImageUrl(UniversalBaseModel):
|
37
25
|
type: typing.Literal["image_url"] = "image_url"
|
26
|
+
image_url: typing.Dict[str, str]
|
38
27
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
44
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
45
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
46
|
-
|
47
|
-
return deep_union_pydantic_dicts(
|
48
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
49
|
-
)
|
28
|
+
if IS_PYDANTIC_V2:
|
29
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
30
|
+
else:
|
50
31
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
32
|
+
class Config:
|
33
|
+
frozen = True
|
34
|
+
smart_union = True
|
35
|
+
extra = pydantic.Extra.allow
|
56
36
|
|
57
37
|
|
58
38
|
ChunkContentItem = typing.Union[ChunkContentItem_Text, ChunkContentItem_ImageUrl]
|
athena/types/chunk_result.py
CHANGED
@@ -1,35 +1,25 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
8
4
|
from .chunk_result_chunk_id import ChunkResultChunkId
|
5
|
+
import typing
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
|
+
import pydantic
|
9
8
|
|
10
9
|
|
11
|
-
class ChunkResult(
|
10
|
+
class ChunkResult(UniversalBaseModel):
|
12
11
|
"""
|
13
12
|
The result of a chunk extraction.
|
14
13
|
"""
|
15
14
|
|
16
15
|
chunk_id: ChunkResultChunkId
|
17
|
-
chunk_result: typing.Optional[typing.Dict[str, typing.Any]] = 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}
|
16
|
+
chunk_result: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
26
17
|
|
27
|
-
|
28
|
-
|
29
|
-
|
18
|
+
if IS_PYDANTIC_V2:
|
19
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
20
|
+
else:
|
30
21
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
22
|
+
class Config:
|
23
|
+
frozen = True
|
24
|
+
smart_union = True
|
25
|
+
extra = pydantic.Extra.allow
|
@@ -1,32 +1,22 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import typing
|
5
|
+
import pydantic
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
5
7
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
result: typing.Dict[str, typing.Any] = pydantic_v1.Field()
|
9
|
+
class CustomAgentResponse(UniversalBaseModel):
|
10
|
+
result: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
|
12
11
|
"""
|
13
12
|
The agent's response. Format depends on the specific agent implementation.
|
14
13
|
"""
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
)
|
15
|
+
if IS_PYDANTIC_V2:
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
17
|
+
else:
|
27
18
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
19
|
+
class Config:
|
20
|
+
frozen = True
|
21
|
+
smart_union = True
|
22
|
+
extra = pydantic.Extra.allow
|
@@ -1,16 +1,15 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
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
5
|
from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
|
9
6
|
from .data_frame_request_out_data_item_item import DataFrameRequestOutDataItemItem
|
10
7
|
from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
|
8
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
|
+
import pydantic
|
11
10
|
|
12
11
|
|
13
|
-
class DataFrameRequestOut(
|
12
|
+
class DataFrameRequestOut(UniversalBaseModel):
|
14
13
|
"""
|
15
14
|
Response model with JSON dataframe representation.
|
16
15
|
"""
|
@@ -19,20 +18,11 @@ class DataFrameRequestOut(pydantic_v1.BaseModel):
|
|
19
18
|
data: typing.List[typing.List[typing.Optional[DataFrameRequestOutDataItemItem]]]
|
20
19
|
index: typing.Optional[typing.List[typing.Optional[DataFrameRequestOutIndexItem]]] = None
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
27
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
28
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
29
|
-
|
30
|
-
return deep_union_pydantic_dicts(
|
31
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
32
|
-
)
|
21
|
+
if IS_PYDANTIC_V2:
|
22
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
23
|
+
else:
|
33
24
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
25
|
+
class Config:
|
26
|
+
frozen = True
|
27
|
+
smart_union = True
|
28
|
+
extra = pydantic.Extra.allow
|
@@ -1,31 +1,21 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
4
5
|
import typing
|
6
|
+
import pydantic
|
5
7
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
|
-
|
10
|
-
class DataFrameUnknownFormatError(pydantic_v1.BaseModel):
|
9
|
+
class DataFrameUnknownFormatError(UniversalBaseModel):
|
11
10
|
asset_id: str
|
12
11
|
media_type: str
|
13
12
|
message: str
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
)
|
14
|
+
if IS_PYDANTIC_V2:
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
16
|
+
else:
|
26
17
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
18
|
+
class Config:
|
19
|
+
frozen = True
|
20
|
+
smart_union = True
|
21
|
+
extra = pydantic.Extra.allow
|