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
athena/types/__init__.py CHANGED
@@ -1,11 +1,16 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ # isort: skip_file
4
+
5
+ from .asset_content_request_out import AssetContentRequestOut
3
6
  from .asset_node import AssetNode
4
7
  from .asset_not_found_error import AssetNotFoundError
8
+ from .asset_screenshot_response_out import AssetScreenshotResponseOut
5
9
  from .chunk import Chunk
6
10
  from .chunk_content_item import ChunkContentItem, ChunkContentItem_ImageUrl, ChunkContentItem_Text
7
11
  from .chunk_result import ChunkResult
8
12
  from .chunk_result_chunk_id import ChunkResultChunkId
13
+ from .content import Content
9
14
  from .custom_agent_response import CustomAgentResponse
10
15
  from .data_frame_request_out import DataFrameRequestOut
11
16
  from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
@@ -21,26 +26,39 @@ from .general_agent_config import GeneralAgentConfig
21
26
  from .general_agent_config_enabled_tools_item import GeneralAgentConfigEnabledToolsItem
22
27
  from .general_agent_request import GeneralAgentRequest
23
28
  from .general_agent_response import GeneralAgentResponse
29
+ from .general_agent_response_message import GeneralAgentResponseMessage
30
+ from .general_agent_response_message_kwargs import GeneralAgentResponseMessageKwargs
31
+ from .id import Id
24
32
  from .image_url_content import ImageUrlContent
33
+ from .input_message import InputMessage
34
+ from .input_message_content_item import (
35
+ InputMessageContentItem,
36
+ InputMessageContentItem_ImageUrl,
37
+ InputMessageContentItem_Text,
38
+ )
39
+ from .paginated_assets_out import PaginatedAssetsOut
25
40
  from .parent_folder_error import ParentFolderError
26
41
  from .prompt_message import PromptMessage
42
+ from .public_asset_out import PublicAssetOut
27
43
  from .research_agent_response import ResearchAgentResponse
28
44
  from .save_asset_request_out import SaveAssetRequestOut
29
45
  from .sql_agent_response import SqlAgentResponse
30
46
  from .structured_data_extractor_response import StructuredDataExtractorResponse
31
47
  from .text_content import TextContent
32
- from .tool import Tool
33
48
  from .type import Type
34
49
 
35
50
  __all__ = [
51
+ "AssetContentRequestOut",
36
52
  "AssetNode",
37
53
  "AssetNotFoundError",
54
+ "AssetScreenshotResponseOut",
38
55
  "Chunk",
39
56
  "ChunkContentItem",
40
57
  "ChunkContentItem_ImageUrl",
41
58
  "ChunkContentItem_Text",
42
59
  "ChunkResult",
43
60
  "ChunkResultChunkId",
61
+ "Content",
44
62
  "CustomAgentResponse",
45
63
  "DataFrameRequestOut",
46
64
  "DataFrameRequestOutColumnsItem",
@@ -56,14 +74,22 @@ __all__ = [
56
74
  "GeneralAgentConfigEnabledToolsItem",
57
75
  "GeneralAgentRequest",
58
76
  "GeneralAgentResponse",
77
+ "GeneralAgentResponseMessage",
78
+ "GeneralAgentResponseMessageKwargs",
79
+ "Id",
59
80
  "ImageUrlContent",
81
+ "InputMessage",
82
+ "InputMessageContentItem",
83
+ "InputMessageContentItem_ImageUrl",
84
+ "InputMessageContentItem_Text",
85
+ "PaginatedAssetsOut",
60
86
  "ParentFolderError",
61
87
  "PromptMessage",
88
+ "PublicAssetOut",
62
89
  "ResearchAgentResponse",
63
90
  "SaveAssetRequestOut",
64
91
  "SqlAgentResponse",
65
92
  "StructuredDataExtractorResponse",
66
93
  "TextContent",
67
- "Tool",
68
94
  "Type",
69
95
  ]
@@ -0,0 +1,26 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
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
@@ -1,11 +1,11 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from __future__ import annotations
4
- from ..core.pydantic_utilities import UniversalBaseModel
4
+
5
5
  import typing
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+
7
7
  import pydantic
8
- from ..core.pydantic_utilities import update_forward_refs
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
9
9
 
10
10
 
11
11
  class AssetNode(UniversalBaseModel):
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
5
3
  import typing
4
+
6
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class AssetNotFoundError(UniversalBaseModel):
@@ -0,0 +1,43 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
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,10 +1,10 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
5
- from .chunk_content_item import ChunkContentItem
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
7
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .chunk_content_item import ChunkContentItem
8
8
 
9
9
 
10
10
  class Chunk(UniversalBaseModel):
@@ -1,10 +1,11 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from __future__ import annotations
4
- from ..core.pydantic_utilities import UniversalBaseModel
4
+
5
5
  import typing
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+
7
7
  import pydantic
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
9
 
9
10
 
10
11
  class ChunkContentItem_Text(UniversalBaseModel):
@@ -1,10 +1,10 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
- from .chunk_result_chunk_id import ChunkResultChunkId
5
3
  import typing
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
7
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .chunk_result_chunk_id import ChunkResultChunkId
8
8
 
9
9
 
10
10
  class ChunkResult(UniversalBaseModel):
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .input_message_content_item import InputMessageContentItem
6
+
7
+ Content = typing.Union[str, typing.List[InputMessageContentItem]]
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
4
+
5
5
  import pydantic
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class CustomAgentResponse(UniversalBaseModel):
@@ -1,12 +1,12 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
5
7
  from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
6
8
  from .data_frame_request_out_data_item_item import DataFrameRequestOutDataItemItem
7
9
  from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
8
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
- import pydantic
10
10
 
11
11
 
12
12
  class DataFrameRequestOut(UniversalBaseModel):
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
5
3
  import typing
4
+
6
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class DataFrameUnknownFormatError(UniversalBaseModel):
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
5
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
6
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class DocumentChunk(UniversalBaseModel):
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
4
+
5
5
  import pydantic
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class DriveAgentResponse(UniversalBaseModel):
@@ -1,10 +1,10 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
5
- from .document_chunk import DocumentChunk
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
7
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .document_chunk import DocumentChunk
8
8
 
9
9
 
10
10
  class FileChunkRequestOut(UniversalBaseModel):
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
5
3
  import typing
4
+
6
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class FileTooLargeError(UniversalBaseModel):
@@ -1,10 +1,11 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
3
+ from __future__ import annotations
4
+
4
5
  import typing
5
- from .asset_node import AssetNode
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+
7
7
  import pydantic
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
8
9
 
9
10
 
10
11
  class FolderResponse(UniversalBaseModel):
@@ -13,7 +14,7 @@ class FolderResponse(UniversalBaseModel):
13
14
  """
14
15
 
15
16
  structure_tree_ascii: str
16
- tree_data: typing.Dict[str, AssetNode]
17
+ tree_data: typing.Dict[str, "AssetNode"]
17
18
 
18
19
  if IS_PYDANTIC_V2:
19
20
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -23,3 +24,8 @@ class FolderResponse(UniversalBaseModel):
23
24
  frozen = True
24
25
  smart_union = True
25
26
  extra = pydantic.Extra.allow
27
+
28
+
29
+ from .asset_node import AssetNode # noqa: E402, F401, I001
30
+
31
+ update_forward_refs(FolderResponse)
@@ -1,10 +1,10 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
5
- from .general_agent_config_enabled_tools_item import GeneralAgentConfigEnabledToolsItem
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
7
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .general_agent_config_enabled_tools_item import GeneralAgentConfigEnabledToolsItem
8
8
 
9
9
 
10
10
  class GeneralAgentConfig(UniversalBaseModel):
@@ -14,6 +14,7 @@ class GeneralAgentConfig(UniversalBaseModel):
14
14
 
15
15
  enabled_tools: typing.Optional[typing.List[GeneralAgentConfigEnabledToolsItem]] = None
16
16
  knowledge_base_asset_ids: typing.Optional[typing.List[str]] = None
17
+ model: typing.Optional[str] = None
17
18
  system_prompt: typing.Optional[str] = None
18
19
 
19
20
  if IS_PYDANTIC_V2:
@@ -1,6 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- from .tool import Tool
5
4
 
6
- GeneralAgentConfigEnabledToolsItem = typing.Union[Tool, str]
5
+ GeneralAgentConfigEnabledToolsItem = typing.Union[typing.Literal["search"], typing.Literal["browse"], str]
@@ -1,10 +1,11 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
- from .general_agent_config import GeneralAgentConfig
5
3
  import typing
4
+
6
5
  import pydantic
7
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .general_agent_config import GeneralAgentConfig
8
+ from .input_message import InputMessage
8
9
 
9
10
 
10
11
  class GeneralAgentRequest(UniversalBaseModel):
@@ -12,12 +13,22 @@ class GeneralAgentRequest(UniversalBaseModel):
12
13
  A chat request for the Athena SDK.
13
14
  """
14
15
 
16
+ channel: typing.Optional[str] = pydantic.Field(default=None)
17
+ """
18
+ The channel through which the request is being made.
19
+ """
20
+
15
21
  config: GeneralAgentConfig
16
- messages: typing.List[typing.Optional[typing.Any]] = pydantic.Field()
22
+ messages: typing.List[InputMessage] = pydantic.Field()
17
23
  """
18
24
  The messages to send to the agent. Each message should be a string (for text inputs) or a list of multimodal content parts.
19
25
  """
20
26
 
27
+ thread_id: typing.Optional[str] = pydantic.Field(default=None)
28
+ """
29
+ Optional thread ID for conversation persistence. If not provided, a new thread will be created.
30
+ """
31
+
21
32
  if IS_PYDANTIC_V2:
22
33
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
23
34
  else:
@@ -1,9 +1,10 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
5
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
6
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .general_agent_response_message import GeneralAgentResponseMessage
7
8
 
8
9
 
9
10
  class GeneralAgentResponse(UniversalBaseModel):
@@ -11,7 +12,7 @@ class GeneralAgentResponse(UniversalBaseModel):
11
12
  The response from the agent.
12
13
  """
13
14
 
14
- messages: typing.List[typing.Dict[str, typing.Optional[typing.Any]]]
15
+ messages: typing.List[GeneralAgentResponseMessage]
15
16
 
16
17
  if IS_PYDANTIC_V2:
17
18
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,100 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .content import Content
10
+ from .general_agent_response_message_kwargs import GeneralAgentResponseMessageKwargs
11
+ from .id import Id
12
+
13
+
14
+ class GeneralAgentResponseMessage(UniversalBaseModel):
15
+ """
16
+ A response message from the agent.
17
+ """
18
+
19
+ additional_kwargs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
20
+ """
21
+ Additional keyword arguments for the message.
22
+ """
23
+
24
+ content: typing.Optional[Content] = pydantic.Field(default=None)
25
+ """
26
+ The content of the message, can be string or list of content parts.
27
+ """
28
+
29
+ id: typing.Optional[Id] = pydantic.Field(default=None)
30
+ """
31
+ Unique identifier for the message or LangChain class identifier.
32
+ """
33
+
34
+ kwargs_: typing_extensions.Annotated[
35
+ typing.Optional[GeneralAgentResponseMessageKwargs], FieldMetadata(alias="kwargs")
36
+ ] = pydantic.Field(default=None)
37
+ """
38
+ Structured kwargs field containing known message data.
39
+ """
40
+
41
+ langchain_id: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
42
+ """
43
+ LangChain class identifier
44
+ """
45
+
46
+ lc: typing.Optional[int] = pydantic.Field(default=None)
47
+ """
48
+ LangChain version marker
49
+ """
50
+
51
+ message_id: typing.Optional[str] = pydantic.Field(default=None)
52
+ """
53
+ The actual message identifier (when id contains LangChain class path).
54
+ """
55
+
56
+ name: typing.Optional[str] = pydantic.Field(default=None)
57
+ """
58
+ Name associated with the message.
59
+ """
60
+
61
+ response_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
62
+ """
63
+ Metadata about the response generation.
64
+ """
65
+
66
+ role: typing.Optional[str] = pydantic.Field(default=None)
67
+ """
68
+ Role of the message sender (e.g., 'ai', 'human', 'system', 'tool'). Automatically populated from kwargs.type for convenience.
69
+ """
70
+
71
+ tool_call_id: typing.Optional[str] = pydantic.Field(default=None)
72
+ """
73
+ ID of the tool call this message responds to (for tool messages).
74
+ """
75
+
76
+ tool_calls: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
77
+ default=None
78
+ )
79
+ """
80
+ Tool calls made by the message (for AI messages).
81
+ """
82
+
83
+ type: str = pydantic.Field()
84
+ """
85
+ The type of the message (e.g., 'human', 'ai', 'system', 'tool').
86
+ """
87
+
88
+ usage_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
89
+ """
90
+ Usage metadata including token counts.
91
+ """
92
+
93
+ if IS_PYDANTIC_V2:
94
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
95
+ else:
96
+
97
+ class Config:
98
+ frozen = True
99
+ smart_union = True
100
+ extra = pydantic.Extra.allow
@@ -0,0 +1,74 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .content import Content
8
+
9
+
10
+ class GeneralAgentResponseMessageKwargs(UniversalBaseModel):
11
+ """
12
+ Structured kwargs data for response messages with basic required fields.
13
+ """
14
+
15
+ additional_kwargs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
16
+ """
17
+ Additional keyword arguments for the message.
18
+ """
19
+
20
+ content: typing.Optional[Content] = pydantic.Field(default=None)
21
+ """
22
+ The content of the response message, matches main response content.
23
+ """
24
+
25
+ id: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ Unique identifier for the message.
28
+ """
29
+
30
+ name: typing.Optional[str] = pydantic.Field(default=None)
31
+ """
32
+ Name associated with the message.
33
+ """
34
+
35
+ response_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
36
+ """
37
+ Metadata about the response generation.
38
+ """
39
+
40
+ role: typing.Optional[str] = pydantic.Field(default=None)
41
+ """
42
+ Role of the message sender.
43
+ """
44
+
45
+ tool_call_id: typing.Optional[str] = pydantic.Field(default=None)
46
+ """
47
+ ID of the tool call this message responds to (for tool messages).
48
+ """
49
+
50
+ tool_calls: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(
51
+ default=None
52
+ )
53
+ """
54
+ Tool calls made by the message (for AI messages).
55
+ """
56
+
57
+ type: str = pydantic.Field()
58
+ """
59
+ The type of the message (e.g., 'human', 'ai', 'system', 'tool').
60
+ """
61
+
62
+ usage_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
63
+ """
64
+ Usage metadata including token counts.
65
+ """
66
+
67
+ if IS_PYDANTIC_V2:
68
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
69
+ else:
70
+
71
+ class Config:
72
+ frozen = True
73
+ smart_union = True
74
+ extra = pydantic.Extra.allow
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- Tool = typing.Union[typing.Literal["search", "browse"], typing.Any]
5
+ Id = typing.Union[str, typing.List[str]]
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
4
3
  import typing
5
- from ..core.pydantic_utilities import IS_PYDANTIC_V2
4
+
6
5
  import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class ImageUrlContent(UniversalBaseModel):