athena-intelligence 0.1.124__py3-none-any.whl → 0.1.126__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 (58) hide show
  1. athena/__init__.py +3 -0
  2. athena/agents/client.py +88 -36
  3. athena/agents/drive/client.py +80 -32
  4. athena/agents/general/client.py +222 -91
  5. athena/agents/research/client.py +80 -32
  6. athena/agents/sql/client.py +80 -32
  7. athena/base_client.py +13 -11
  8. athena/client.py +191 -80
  9. athena/core/__init__.py +21 -4
  10. athena/core/client_wrapper.py +9 -10
  11. athena/core/file.py +37 -8
  12. athena/core/http_client.py +97 -41
  13. athena/core/jsonable_encoder.py +33 -31
  14. athena/core/pydantic_utilities.py +272 -4
  15. athena/core/query_encoder.py +38 -13
  16. athena/core/request_options.py +5 -2
  17. athena/core/serialization.py +272 -0
  18. athena/errors/internal_server_error.py +2 -3
  19. athena/errors/unauthorized_error.py +2 -3
  20. athena/errors/unprocessable_entity_error.py +2 -3
  21. athena/query/client.py +208 -58
  22. athena/tools/calendar/client.py +82 -30
  23. athena/tools/client.py +576 -184
  24. athena/tools/email/client.py +117 -43
  25. athena/tools/structured_data_extractor/client.py +118 -67
  26. athena/tools/tasks/client.py +41 -17
  27. athena/types/asset_node.py +14 -24
  28. athena/types/asset_not_found_error.py +11 -21
  29. athena/types/chunk.py +11 -21
  30. athena/types/chunk_content_item.py +21 -41
  31. athena/types/chunk_result.py +13 -23
  32. athena/types/custom_agent_response.py +12 -22
  33. athena/types/data_frame_request_out.py +11 -21
  34. athena/types/data_frame_unknown_format_error.py +11 -21
  35. athena/types/document_chunk.py +12 -22
  36. athena/types/drive_agent_response.py +12 -22
  37. athena/types/file_chunk_request_out.py +11 -21
  38. athena/types/file_too_large_error.py +11 -21
  39. athena/types/folder_response.py +11 -21
  40. athena/types/general_agent_config.py +11 -21
  41. athena/types/general_agent_config_enabled_tools_item.py +0 -1
  42. athena/types/general_agent_request.py +13 -23
  43. athena/types/general_agent_response.py +12 -22
  44. athena/types/image_url_content.py +11 -21
  45. athena/types/parent_folder_error.py +11 -21
  46. athena/types/prompt_message.py +12 -22
  47. athena/types/research_agent_response.py +12 -22
  48. athena/types/save_asset_request_out.py +11 -21
  49. athena/types/sql_agent_response.py +13 -23
  50. athena/types/structured_data_extractor_response.py +15 -25
  51. athena/types/text_content.py +11 -21
  52. athena/types/tool.py +1 -13
  53. athena/types/type.py +1 -21
  54. athena/version.py +0 -1
  55. {athena_intelligence-0.1.124.dist-info → athena_intelligence-0.1.126.dist-info}/METADATA +12 -4
  56. athena_intelligence-0.1.126.dist-info/RECORD +87 -0
  57. {athena_intelligence-0.1.124.dist-info → athena_intelligence-0.1.126.dist-info}/WHEEL +1 -1
  58. athena_intelligence-0.1.124.dist-info/RECORD +0 -86
@@ -1,34 +1,24 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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 .document_chunk import DocumentChunk
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
9
8
 
10
9
 
11
- class FileChunkRequestOut(pydantic_v1.BaseModel):
10
+ class FileChunkRequestOut(UniversalBaseModel):
12
11
  """
13
12
  Response model for a file chunk.
14
13
  """
15
14
 
16
15
  chunks: typing.Dict[str, typing.List[DocumentChunk]]
17
16
 
18
- def json(self, **kwargs: typing.Any) -> str:
19
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20
- return super().json(**kwargs_with_defaults)
21
-
22
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
25
-
26
- return deep_union_pydantic_dicts(
27
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
28
- )
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
+ else:
29
20
 
30
- class Config:
31
- frozen = True
32
- smart_union = True
33
- extra = pydantic_v1.Extra.allow
34
- json_encoders = {dt.datetime: serialize_datetime}
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -1,29 +1,19 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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 FileTooLargeError(pydantic_v1.BaseModel):
9
+ class FileTooLargeError(UniversalBaseModel):
11
10
  message: str
12
11
 
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
- )
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
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
16
+ class Config:
17
+ frozen = True
18
+ smart_union = True
19
+ extra = pydantic.Extra.allow
@@ -1,14 +1,13 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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 .asset_node import AssetNode
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
9
8
 
10
9
 
11
- class FolderResponse(pydantic_v1.BaseModel):
10
+ class FolderResponse(UniversalBaseModel):
12
11
  """
13
12
  Combined response with tree data and visualization.
14
13
  """
@@ -16,20 +15,11 @@ class FolderResponse(pydantic_v1.BaseModel):
16
15
  structure_tree_ascii: str
17
16
  tree_data: typing.Dict[str, AssetNode]
18
17
 
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
- )
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
- class Config:
32
- frozen = True
33
- smart_union = True
34
- extra = pydantic_v1.Extra.allow
35
- json_encoders = {dt.datetime: serialize_datetime}
22
+ class Config:
23
+ frozen = True
24
+ smart_union = True
25
+ extra = pydantic.Extra.allow
@@ -1,14 +1,13 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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 .general_agent_config_enabled_tools_item import GeneralAgentConfigEnabledToolsItem
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
9
8
 
10
9
 
11
- class GeneralAgentConfig(pydantic_v1.BaseModel):
10
+ class GeneralAgentConfig(UniversalBaseModel):
12
11
  """
13
12
  Configurable fields for the agent.
14
13
  """
@@ -17,20 +16,11 @@ class GeneralAgentConfig(pydantic_v1.BaseModel):
17
16
  knowledge_base_asset_ids: typing.Optional[typing.List[str]] = None
18
17
  system_prompt: typing.Optional[str] = None
19
18
 
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_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
- class Config:
33
- frozen = True
34
- smart_union = True
35
- extra = pydantic_v1.Extra.allow
36
- json_encoders = {dt.datetime: serialize_datetime}
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -1,7 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
-
5
4
  from .tool import Tool
6
5
 
7
6
  GeneralAgentConfigEnabledToolsItem = typing.Union[Tool, str]
@@ -1,38 +1,28 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
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
3
+ from ..core.pydantic_utilities import UniversalBaseModel
8
4
  from .general_agent_config import GeneralAgentConfig
5
+ import typing
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
8
 
10
9
 
11
- class GeneralAgentRequest(pydantic_v1.BaseModel):
10
+ class GeneralAgentRequest(UniversalBaseModel):
12
11
  """
13
12
  A chat request for the Athena SDK.
14
13
  """
15
14
 
16
15
  config: GeneralAgentConfig
17
- messages: typing.List[typing.Any] = pydantic_v1.Field()
16
+ messages: typing.List[typing.Optional[typing.Any]] = pydantic.Field()
18
17
  """
19
18
  The messages to send to the agent. Each message should be a string (for text inputs) or a list of multimodal content parts.
20
19
  """
21
20
 
22
- def json(self, **kwargs: typing.Any) -> str:
23
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
- return super().json(**kwargs_with_defaults)
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
- class Config:
35
- frozen = True
36
- smart_union = True
37
- extra = pydantic_v1.Extra.allow
38
- json_encoders = {dt.datetime: serialize_datetime}
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
@@ -1,33 +1,23 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
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 GeneralAgentResponse(pydantic_v1.BaseModel):
9
+ class GeneralAgentResponse(UniversalBaseModel):
11
10
  """
12
11
  The response from the agent.
13
12
  """
14
13
 
15
- messages: typing.List[typing.Dict[str, typing.Any]]
16
-
17
- def json(self, **kwargs: typing.Any) -> str:
18
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- return super().json(**kwargs_with_defaults)
20
-
21
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
14
+ messages: typing.List[typing.Dict[str, typing.Optional[typing.Any]]]
24
15
 
25
- return deep_union_pydantic_dicts(
26
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27
- )
16
+ if IS_PYDANTIC_V2:
17
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
18
+ else:
28
19
 
29
- class Config:
30
- frozen = True
31
- smart_union = True
32
- extra = pydantic_v1.Extra.allow
33
- json_encoders = {dt.datetime: serialize_datetime}
20
+ class Config:
21
+ frozen = True
22
+ smart_union = True
23
+ extra = pydantic.Extra.allow
@@ -1,33 +1,23 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
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 ImageUrlContent(pydantic_v1.BaseModel):
9
+ class ImageUrlContent(UniversalBaseModel):
11
10
  """
12
11
  An image content item.
13
12
  """
14
13
 
15
14
  image_url: typing.Dict[str, str]
16
15
 
17
- def json(self, **kwargs: typing.Any) -> str:
18
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- return super().json(**kwargs_with_defaults)
20
-
21
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
-
25
- return deep_union_pydantic_dicts(
26
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27
- )
16
+ if IS_PYDANTIC_V2:
17
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
18
+ else:
28
19
 
29
- class Config:
30
- frozen = True
31
- smart_union = True
32
- extra = pydantic_v1.Extra.allow
33
- json_encoders = {dt.datetime: serialize_datetime}
20
+ class Config:
21
+ frozen = True
22
+ smart_union = True
23
+ extra = pydantic.Extra.allow
@@ -1,29 +1,19 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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 ParentFolderError(pydantic_v1.BaseModel):
9
+ class ParentFolderError(UniversalBaseModel):
11
10
  message: str
12
11
 
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
- )
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
- class Config:
26
- frozen = True
27
- smart_union = True
28
- extra = pydantic_v1.Extra.allow
29
- json_encoders = {dt.datetime: serialize_datetime}
16
+ class Config:
17
+ frozen = True
18
+ smart_union = True
19
+ extra = pydantic.Extra.allow
@@ -1,14 +1,13 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
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
3
+ from ..core.pydantic_utilities import UniversalBaseModel
8
4
  from .type import Type
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import typing
7
+ import pydantic
9
8
 
10
9
 
11
- class PromptMessage(pydantic_v1.BaseModel):
10
+ class PromptMessage(UniversalBaseModel):
12
11
  """
13
12
  A message to use for the structured data extractor.
14
13
  """
@@ -16,20 +15,11 @@ class PromptMessage(pydantic_v1.BaseModel):
16
15
  content: str
17
16
  type: Type
18
17
 
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
- )
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
- class Config:
32
- frozen = True
33
- smart_union = True
34
- extra = pydantic_v1.Extra.allow
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
- import datetime as dt
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
- class ResearchAgentResponse(pydantic_v1.BaseModel):
11
- findings: typing.Dict[str, typing.Any] = pydantic_v1.Field()
9
+ class ResearchAgentResponse(UniversalBaseModel):
10
+ findings: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
12
11
  """
13
12
  Research findings and compiled information
14
13
  """
15
14
 
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
- )
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
- class Config:
29
- frozen = True
30
- smart_union = True
31
- extra = pydantic_v1.Extra.allow
32
- json_encoders = {dt.datetime: serialize_datetime}
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -1,33 +1,23 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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 SaveAssetRequestOut(pydantic_v1.BaseModel):
9
+ class SaveAssetRequestOut(UniversalBaseModel):
11
10
  """
12
11
  Response model asset information representation.
13
12
  """
14
13
 
15
14
  asset_id: str
16
15
 
17
- def json(self, **kwargs: typing.Any) -> str:
18
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- return super().json(**kwargs_with_defaults)
20
-
21
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
24
-
25
- return deep_union_pydantic_dicts(
26
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
27
- )
16
+ if IS_PYDANTIC_V2:
17
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
18
+ else:
28
19
 
29
- class Config:
30
- frozen = True
31
- smart_union = True
32
- extra = pydantic_v1.Extra.allow
33
- json_encoders = {dt.datetime: serialize_datetime}
20
+ class Config:
21
+ frozen = True
22
+ smart_union = True
23
+ extra = pydantic.Extra.allow
@@ -1,37 +1,27 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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
- class SqlAgentResponse(pydantic_v1.BaseModel):
11
- metadata: typing.Dict[str, typing.Any] = pydantic_v1.Field()
9
+ class SqlAgentResponse(UniversalBaseModel):
10
+ metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
12
11
  """
13
12
  Additional metadata about the generated query
14
13
  """
15
14
 
16
- query_asset_id: str = pydantic_v1.Field()
15
+ query_asset_id: str = pydantic.Field()
17
16
  """
18
17
  The asset ID of the generated SQL query object
19
18
  """
20
19
 
21
- def json(self, **kwargs: typing.Any) -> str:
22
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
- return super().json(**kwargs_with_defaults)
24
-
25
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
-
29
- return deep_union_pydantic_dicts(
30
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31
- )
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
32
23
 
33
- class Config:
34
- frozen = True
35
- smart_union = True
36
- extra = pydantic_v1.Extra.allow
37
- json_encoders = {dt.datetime: serialize_datetime}
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -1,42 +1,32 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
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_result import ChunkResult
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
8
 
10
9
 
11
- class StructuredDataExtractorResponse(pydantic_v1.BaseModel):
10
+ class StructuredDataExtractorResponse(UniversalBaseModel):
12
11
  """
13
12
  The agent's response.
14
13
  """
15
14
 
16
- chunk_by_chunk_data: typing.Optional[typing.List[ChunkResult]] = pydantic_v1.Field(default=None)
15
+ chunk_by_chunk_data: typing.Optional[typing.List[ChunkResult]] = pydantic.Field(default=None)
17
16
  """
18
- The extracted structured data for each chunk. A list where each element is guaranteed to match `json_schema`.
17
+ The extracted structured data for each chunk. A list where each element is guaranteed to match `json_schema`.
19
18
  """
20
19
 
21
- reduced_data: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
20
+ reduced_data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
22
21
  """
23
- If reduce is True, the reduced structured data, otherwise null. Guaranteed to match `json_schema`.
22
+ If reduce is True, the reduced structured data, otherwise null. Guaranteed to match `json_schema`.
24
23
  """
25
24
 
26
- def json(self, **kwargs: typing.Any) -> str:
27
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28
- return super().json(**kwargs_with_defaults)
29
-
30
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
31
- kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
32
- kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
33
-
34
- return deep_union_pydantic_dicts(
35
- super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
36
- )
25
+ if IS_PYDANTIC_V2:
26
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27
+ else:
37
28
 
38
- class Config:
39
- frozen = True
40
- smart_union = True
41
- extra = pydantic_v1.Extra.allow
42
- json_encoders = {dt.datetime: serialize_datetime}
29
+ class Config:
30
+ frozen = True
31
+ smart_union = True
32
+ extra = pydantic.Extra.allow