arbi 0.18.0__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.
- arbi/__init__.py +92 -0
- arbi/_base_client.py +2124 -0
- arbi/_client.py +442 -0
- arbi/_compat.py +219 -0
- arbi/_constants.py +14 -0
- arbi/_exceptions.py +108 -0
- arbi/_files.py +123 -0
- arbi/_models.py +872 -0
- arbi/_qs.py +150 -0
- arbi/_resource.py +43 -0
- arbi/_response.py +830 -0
- arbi/_streaming.py +333 -0
- arbi/_types.py +270 -0
- arbi/_utils/__init__.py +64 -0
- arbi/_utils/_compat.py +45 -0
- arbi/_utils/_datetime_parse.py +136 -0
- arbi/_utils/_logs.py +25 -0
- arbi/_utils/_proxy.py +65 -0
- arbi/_utils/_reflection.py +42 -0
- arbi/_utils/_resources_proxy.py +24 -0
- arbi/_utils/_streams.py +12 -0
- arbi/_utils/_sync.py +58 -0
- arbi/_utils/_transform.py +457 -0
- arbi/_utils/_typing.py +156 -0
- arbi/_utils/_utils.py +421 -0
- arbi/_version.py +4 -0
- arbi/lib/.keep +4 -0
- arbi/py.typed +0 -0
- arbi/resources/__init__.py +19 -0
- arbi/resources/api/__init__.py +145 -0
- arbi/resources/api/api.py +422 -0
- arbi/resources/api/assistant.py +312 -0
- arbi/resources/api/configs.py +533 -0
- arbi/resources/api/conversation/__init__.py +33 -0
- arbi/resources/api/conversation/conversation.py +648 -0
- arbi/resources/api/conversation/user.py +270 -0
- arbi/resources/api/document/__init__.py +33 -0
- arbi/resources/api/document/doctag.py +516 -0
- arbi/resources/api/document/document.py +929 -0
- arbi/resources/api/health.py +253 -0
- arbi/resources/api/notifications.py +478 -0
- arbi/resources/api/tag.py +409 -0
- arbi/resources/api/user/__init__.py +61 -0
- arbi/resources/api/user/contacts.py +322 -0
- arbi/resources/api/user/settings.py +283 -0
- arbi/resources/api/user/subscription.py +230 -0
- arbi/resources/api/user/user.py +943 -0
- arbi/resources/api/workspace.py +1198 -0
- arbi/types/__init__.py +8 -0
- arbi/types/api/__init__.py +94 -0
- arbi/types/api/assistant_query_params.py +95 -0
- arbi/types/api/assistant_retrieve_params.py +95 -0
- arbi/types/api/chunker_config_param.py +9 -0
- arbi/types/api/config_create_params.py +227 -0
- arbi/types/api/config_create_response.py +17 -0
- arbi/types/api/config_delete_response.py +11 -0
- arbi/types/api/config_get_versions_response.py +19 -0
- arbi/types/api/config_retrieve_response.py +234 -0
- arbi/types/api/conversation/__init__.py +8 -0
- arbi/types/api/conversation/user_add_params.py +11 -0
- arbi/types/api/conversation/user_add_response.py +11 -0
- arbi/types/api/conversation/user_remove_params.py +11 -0
- arbi/types/api/conversation/user_remove_response.py +11 -0
- arbi/types/api/conversation_delete_message_response.py +11 -0
- arbi/types/api/conversation_delete_response.py +11 -0
- arbi/types/api/conversation_retrieve_message_response.py +105 -0
- arbi/types/api/conversation_retrieve_threads_response.py +124 -0
- arbi/types/api/conversation_share_response.py +11 -0
- arbi/types/api/conversation_update_title_params.py +16 -0
- arbi/types/api/conversation_update_title_response.py +13 -0
- arbi/types/api/doc_response.py +66 -0
- arbi/types/api/document/__init__.py +11 -0
- arbi/types/api/document/doc_tag_response.py +40 -0
- arbi/types/api/document/doctag_create_params.py +35 -0
- arbi/types/api/document/doctag_create_response.py +10 -0
- arbi/types/api/document/doctag_delete_params.py +15 -0
- arbi/types/api/document/doctag_generate_params.py +22 -0
- arbi/types/api/document/doctag_generate_response.py +20 -0
- arbi/types/api/document/doctag_update_params.py +35 -0
- arbi/types/api/document_date_extractor_llm_config.py +29 -0
- arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
- arbi/types/api/document_delete_params.py +13 -0
- arbi/types/api/document_get_parsed_response.py +26 -0
- arbi/types/api/document_retrieve_params.py +16 -0
- arbi/types/api/document_retrieve_response.py +10 -0
- arbi/types/api/document_update_params.py +42 -0
- arbi/types/api/document_update_response.py +10 -0
- arbi/types/api/document_upload_from_url_params.py +26 -0
- arbi/types/api/document_upload_from_url_response.py +16 -0
- arbi/types/api/document_upload_params.py +26 -0
- arbi/types/api/document_upload_response.py +16 -0
- arbi/types/api/embedder_config.py +30 -0
- arbi/types/api/embedder_config_param.py +29 -0
- arbi/types/api/health_check_models_response.py +21 -0
- arbi/types/api/health_get_models_response.py +19 -0
- arbi/types/api/health_retrieve_status_response.py +49 -0
- arbi/types/api/model_citation_config.py +20 -0
- arbi/types/api/model_citation_config_param.py +20 -0
- arbi/types/api/notification_create_params.py +20 -0
- arbi/types/api/notification_create_response.py +47 -0
- arbi/types/api/notification_delete_params.py +13 -0
- arbi/types/api/notification_get_schemas_response.py +197 -0
- arbi/types/api/notification_list_response.py +47 -0
- arbi/types/api/notification_update_params.py +27 -0
- arbi/types/api/notification_update_response.py +47 -0
- arbi/types/api/parser_config_param.py +9 -0
- arbi/types/api/query_llm_config.py +30 -0
- arbi/types/api/query_llm_config_param.py +29 -0
- arbi/types/api/reranker_config.py +21 -0
- arbi/types/api/reranker_config_param.py +20 -0
- arbi/types/api/retriever_config.py +39 -0
- arbi/types/api/retriever_config_param.py +38 -0
- arbi/types/api/tag_create_params.py +49 -0
- arbi/types/api/tag_create_response.py +57 -0
- arbi/types/api/tag_delete_response.py +9 -0
- arbi/types/api/tag_update_params.py +22 -0
- arbi/types/api/tag_update_response.py +57 -0
- arbi/types/api/title_llm_config.py +29 -0
- arbi/types/api/title_llm_config_param.py +28 -0
- arbi/types/api/user/__init__.py +13 -0
- arbi/types/api/user/contact_create_params.py +13 -0
- arbi/types/api/user/contact_create_response.py +30 -0
- arbi/types/api/user/contact_delete_params.py +13 -0
- arbi/types/api/user/contact_list_response.py +30 -0
- arbi/types/api/user/setting_retrieve_response.py +89 -0
- arbi/types/api/user/setting_update_params.py +60 -0
- arbi/types/api/user/subscription_create_params.py +13 -0
- arbi/types/api/user/subscription_create_response.py +11 -0
- arbi/types/api/user/subscription_retrieve_response.py +48 -0
- arbi/types/api/user_change_password_params.py +18 -0
- arbi/types/api/user_change_password_response.py +11 -0
- arbi/types/api/user_check_sso_status_params.py +20 -0
- arbi/types/api/user_check_sso_status_response.py +25 -0
- arbi/types/api/user_list_products_response.py +37 -0
- arbi/types/api/user_list_workspaces_response.py +10 -0
- arbi/types/api/user_login_params.py +18 -0
- arbi/types/api/user_login_response.py +23 -0
- arbi/types/api/user_logout_response.py +9 -0
- arbi/types/api/user_register_params.py +22 -0
- arbi/types/api/user_response.py +26 -0
- arbi/types/api/user_verify_email_params.py +11 -0
- arbi/types/api/user_verify_email_response.py +9 -0
- arbi/types/api/workspace_copy_params.py +21 -0
- arbi/types/api/workspace_copy_response.py +25 -0
- arbi/types/api/workspace_create_protected_params.py +16 -0
- arbi/types/api/workspace_delete_response.py +9 -0
- arbi/types/api/workspace_get_conversations_response.py +30 -0
- arbi/types/api/workspace_get_documents_response.py +10 -0
- arbi/types/api/workspace_get_stats_response.py +17 -0
- arbi/types/api/workspace_get_tags_response.py +60 -0
- arbi/types/api/workspace_get_users_response.py +10 -0
- arbi/types/api/workspace_remove_user_params.py +11 -0
- arbi/types/api/workspace_remove_user_response.py +11 -0
- arbi/types/api/workspace_response.py +41 -0
- arbi/types/api/workspace_share_params.py +15 -0
- arbi/types/api/workspace_share_response.py +13 -0
- arbi/types/api/workspace_update_params.py +20 -0
- arbi/types/chunk.py +12 -0
- arbi/types/chunk_metadata.py +31 -0
- arbi/types/chunk_metadata_param.py +32 -0
- arbi/types/chunk_param.py +15 -0
- arbi-0.18.0.dist-info/METADATA +410 -0
- arbi-0.18.0.dist-info/RECORD +165 -0
- arbi-0.18.0.dist-info/WHEEL +4 -0
- arbi-0.18.0.dist-info/licenses/LICENSE +201 -0
arbi/types/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .chunk import Chunk as Chunk
|
|
6
|
+
from .chunk_param import ChunkParam as ChunkParam
|
|
7
|
+
from .chunk_metadata import ChunkMetadata as ChunkMetadata
|
|
8
|
+
from .chunk_metadata_param import ChunkMetadataParam as ChunkMetadataParam
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .doc_response import DocResponse as DocResponse
|
|
6
|
+
from .user_response import UserResponse as UserResponse
|
|
7
|
+
from .embedder_config import EmbedderConfig as EmbedderConfig
|
|
8
|
+
from .reranker_config import RerankerConfig as RerankerConfig
|
|
9
|
+
from .query_llm_config import QueryLlmConfig as QueryLlmConfig
|
|
10
|
+
from .retriever_config import RetrieverConfig as RetrieverConfig
|
|
11
|
+
from .title_llm_config import TitleLlmConfig as TitleLlmConfig
|
|
12
|
+
from .tag_create_params import TagCreateParams as TagCreateParams
|
|
13
|
+
from .tag_update_params import TagUpdateParams as TagUpdateParams
|
|
14
|
+
from .user_login_params import UserLoginParams as UserLoginParams
|
|
15
|
+
from .workspace_response import WorkspaceResponse as WorkspaceResponse
|
|
16
|
+
from .parser_config_param import ParserConfigParam as ParserConfigParam
|
|
17
|
+
from .tag_create_response import TagCreateResponse as TagCreateResponse
|
|
18
|
+
from .tag_delete_response import TagDeleteResponse as TagDeleteResponse
|
|
19
|
+
from .tag_update_response import TagUpdateResponse as TagUpdateResponse
|
|
20
|
+
from .user_login_response import UserLoginResponse as UserLoginResponse
|
|
21
|
+
from .chunker_config_param import ChunkerConfigParam as ChunkerConfigParam
|
|
22
|
+
from .config_create_params import ConfigCreateParams as ConfigCreateParams
|
|
23
|
+
from .user_logout_response import UserLogoutResponse as UserLogoutResponse
|
|
24
|
+
from .user_register_params import UserRegisterParams as UserRegisterParams
|
|
25
|
+
from .embedder_config_param import EmbedderConfigParam as EmbedderConfigParam
|
|
26
|
+
from .model_citation_config import ModelCitationConfig as ModelCitationConfig
|
|
27
|
+
from .reranker_config_param import RerankerConfigParam as RerankerConfigParam
|
|
28
|
+
from .workspace_copy_params import WorkspaceCopyParams as WorkspaceCopyParams
|
|
29
|
+
from .assistant_query_params import AssistantQueryParams as AssistantQueryParams
|
|
30
|
+
from .config_create_response import ConfigCreateResponse as ConfigCreateResponse
|
|
31
|
+
from .config_delete_response import ConfigDeleteResponse as ConfigDeleteResponse
|
|
32
|
+
from .document_delete_params import DocumentDeleteParams as DocumentDeleteParams
|
|
33
|
+
from .document_update_params import DocumentUpdateParams as DocumentUpdateParams
|
|
34
|
+
from .document_upload_params import DocumentUploadParams as DocumentUploadParams
|
|
35
|
+
from .query_llm_config_param import QueryLlmConfigParam as QueryLlmConfigParam
|
|
36
|
+
from .retriever_config_param import RetrieverConfigParam as RetrieverConfigParam
|
|
37
|
+
from .title_llm_config_param import TitleLlmConfigParam as TitleLlmConfigParam
|
|
38
|
+
from .workspace_share_params import WorkspaceShareParams as WorkspaceShareParams
|
|
39
|
+
from .workspace_copy_response import WorkspaceCopyResponse as WorkspaceCopyResponse
|
|
40
|
+
from .workspace_update_params import WorkspaceUpdateParams as WorkspaceUpdateParams
|
|
41
|
+
from .config_retrieve_response import ConfigRetrieveResponse as ConfigRetrieveResponse
|
|
42
|
+
from .document_retrieve_params import DocumentRetrieveParams as DocumentRetrieveParams
|
|
43
|
+
from .document_update_response import DocumentUpdateResponse as DocumentUpdateResponse
|
|
44
|
+
from .document_upload_response import DocumentUploadResponse as DocumentUploadResponse
|
|
45
|
+
from .user_verify_email_params import UserVerifyEmailParams as UserVerifyEmailParams
|
|
46
|
+
from .workspace_share_response import WorkspaceShareResponse as WorkspaceShareResponse
|
|
47
|
+
from .assistant_retrieve_params import AssistantRetrieveParams as AssistantRetrieveParams
|
|
48
|
+
from .workspace_delete_response import WorkspaceDeleteResponse as WorkspaceDeleteResponse
|
|
49
|
+
from .document_retrieve_response import DocumentRetrieveResponse as DocumentRetrieveResponse
|
|
50
|
+
from .health_get_models_response import HealthGetModelsResponse as HealthGetModelsResponse
|
|
51
|
+
from .notification_create_params import NotificationCreateParams as NotificationCreateParams
|
|
52
|
+
from .notification_delete_params import NotificationDeleteParams as NotificationDeleteParams
|
|
53
|
+
from .notification_list_response import NotificationListResponse as NotificationListResponse
|
|
54
|
+
from .notification_update_params import NotificationUpdateParams as NotificationUpdateParams
|
|
55
|
+
from .user_verify_email_response import UserVerifyEmailResponse as UserVerifyEmailResponse
|
|
56
|
+
from .conversation_share_response import ConversationShareResponse as ConversationShareResponse
|
|
57
|
+
from .model_citation_config_param import ModelCitationConfigParam as ModelCitationConfigParam
|
|
58
|
+
from .user_change_password_params import UserChangePasswordParams as UserChangePasswordParams
|
|
59
|
+
from .user_list_products_response import UserListProductsResponse as UserListProductsResponse
|
|
60
|
+
from .workspace_get_tags_response import WorkspaceGetTagsResponse as WorkspaceGetTagsResponse
|
|
61
|
+
from .config_get_versions_response import ConfigGetVersionsResponse as ConfigGetVersionsResponse
|
|
62
|
+
from .conversation_delete_response import ConversationDeleteResponse as ConversationDeleteResponse
|
|
63
|
+
from .document_get_parsed_response import DocumentGetParsedResponse as DocumentGetParsedResponse
|
|
64
|
+
from .health_check_models_response import HealthCheckModelsResponse as HealthCheckModelsResponse
|
|
65
|
+
from .notification_create_response import NotificationCreateResponse as NotificationCreateResponse
|
|
66
|
+
from .notification_update_response import NotificationUpdateResponse as NotificationUpdateResponse
|
|
67
|
+
from .user_check_sso_status_params import UserCheckSSOStatusParams as UserCheckSSOStatusParams
|
|
68
|
+
from .workspace_get_stats_response import WorkspaceGetStatsResponse as WorkspaceGetStatsResponse
|
|
69
|
+
from .workspace_get_users_response import WorkspaceGetUsersResponse as WorkspaceGetUsersResponse
|
|
70
|
+
from .workspace_remove_user_params import WorkspaceRemoveUserParams as WorkspaceRemoveUserParams
|
|
71
|
+
from .user_change_password_response import UserChangePasswordResponse as UserChangePasswordResponse
|
|
72
|
+
from .user_list_workspaces_response import UserListWorkspacesResponse as UserListWorkspacesResponse
|
|
73
|
+
from .user_check_sso_status_response import UserCheckSSOStatusResponse as UserCheckSSOStatusResponse
|
|
74
|
+
from .workspace_remove_user_response import WorkspaceRemoveUserResponse as WorkspaceRemoveUserResponse
|
|
75
|
+
from .document_upload_from_url_params import DocumentUploadFromURLParams as DocumentUploadFromURLParams
|
|
76
|
+
from .health_retrieve_status_response import HealthRetrieveStatusResponse as HealthRetrieveStatusResponse
|
|
77
|
+
from .conversation_update_title_params import ConversationUpdateTitleParams as ConversationUpdateTitleParams
|
|
78
|
+
from .workspace_get_documents_response import WorkspaceGetDocumentsResponse as WorkspaceGetDocumentsResponse
|
|
79
|
+
from .document_upload_from_url_response import DocumentUploadFromURLResponse as DocumentUploadFromURLResponse
|
|
80
|
+
from .notification_get_schemas_response import NotificationGetSchemasResponse as NotificationGetSchemasResponse
|
|
81
|
+
from .workspace_create_protected_params import WorkspaceCreateProtectedParams as WorkspaceCreateProtectedParams
|
|
82
|
+
from .conversation_update_title_response import ConversationUpdateTitleResponse as ConversationUpdateTitleResponse
|
|
83
|
+
from .document_date_extractor_llm_config import DocumentDateExtractorLlmConfig as DocumentDateExtractorLlmConfig
|
|
84
|
+
from .conversation_delete_message_response import ConversationDeleteMessageResponse as ConversationDeleteMessageResponse
|
|
85
|
+
from .workspace_get_conversations_response import WorkspaceGetConversationsResponse as WorkspaceGetConversationsResponse
|
|
86
|
+
from .conversation_retrieve_message_response import (
|
|
87
|
+
ConversationRetrieveMessageResponse as ConversationRetrieveMessageResponse,
|
|
88
|
+
)
|
|
89
|
+
from .conversation_retrieve_threads_response import (
|
|
90
|
+
ConversationRetrieveThreadsResponse as ConversationRetrieveThreadsResponse,
|
|
91
|
+
)
|
|
92
|
+
from .document_date_extractor_llm_config_param import (
|
|
93
|
+
DocumentDateExtractorLlmConfigParam as DocumentDateExtractorLlmConfigParam,
|
|
94
|
+
)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
|
+
from ..._utils import PropertyInfo
|
|
10
|
+
from ..chunk_param import ChunkParam
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"AssistantQueryParams",
|
|
14
|
+
"Tools",
|
|
15
|
+
"ToolsModelCitationTool",
|
|
16
|
+
"ToolsModelCitationToolToolResponses",
|
|
17
|
+
"ToolsRetrievalChunkToolInput",
|
|
18
|
+
"ToolsRetrievalFullContextToolInput",
|
|
19
|
+
"ToolsTraceTool",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class AssistantQueryParams(TypedDict, total=False):
|
|
24
|
+
content: Required[str]
|
|
25
|
+
|
|
26
|
+
workspace_ext_id: Required[str]
|
|
27
|
+
|
|
28
|
+
config_ext_id: Optional[str]
|
|
29
|
+
|
|
30
|
+
parent_message_ext_id: Optional[str]
|
|
31
|
+
|
|
32
|
+
tools: Dict[str, Tools]
|
|
33
|
+
|
|
34
|
+
workspace_key: Annotated[str, PropertyInfo(alias="workspace-key")]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ToolsModelCitationToolToolResponses(TypedDict, total=False):
|
|
38
|
+
"""Data for a single citation - shared by DocTags and ModelCitationTool."""
|
|
39
|
+
|
|
40
|
+
chunk_ids: Required[SequenceNotStr[str]]
|
|
41
|
+
|
|
42
|
+
offset_end: Required[int]
|
|
43
|
+
|
|
44
|
+
offset_start: Required[int]
|
|
45
|
+
|
|
46
|
+
statement: Required[str]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ToolsModelCitationTool(TypedDict, total=False):
|
|
50
|
+
description: str
|
|
51
|
+
|
|
52
|
+
name: Literal["model_citation"]
|
|
53
|
+
|
|
54
|
+
tool_responses: Dict[str, ToolsModelCitationToolToolResponses]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class ToolsRetrievalChunkToolInput(TypedDict, total=False):
|
|
58
|
+
description: str
|
|
59
|
+
|
|
60
|
+
name: Literal["retrieval_chunk"]
|
|
61
|
+
|
|
62
|
+
tool_args: Dict[str, SequenceNotStr[str]]
|
|
63
|
+
|
|
64
|
+
tool_responses: Dict[str, Iterable[ChunkParam]]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ToolsRetrievalFullContextToolInput(TypedDict, total=False):
|
|
68
|
+
description: str
|
|
69
|
+
|
|
70
|
+
name: Literal["retrieval_full_context"]
|
|
71
|
+
|
|
72
|
+
tool_args: Dict[str, object]
|
|
73
|
+
|
|
74
|
+
tool_responses: Dict[str, Iterable[ChunkParam]]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class ToolsTraceTool(TypedDict, total=False):
|
|
78
|
+
"""Execution trace tool that captures the full execution history of a request."""
|
|
79
|
+
|
|
80
|
+
description: str
|
|
81
|
+
|
|
82
|
+
duration_seconds: Optional[float]
|
|
83
|
+
|
|
84
|
+
name: Literal["trace"]
|
|
85
|
+
|
|
86
|
+
start_time: Optional[float]
|
|
87
|
+
|
|
88
|
+
steps: Iterable[Dict[str, object]]
|
|
89
|
+
|
|
90
|
+
trace_id: Optional[str]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
Tools: TypeAlias = Union[
|
|
94
|
+
ToolsModelCitationTool, ToolsRetrievalChunkToolInput, ToolsRetrievalFullContextToolInput, ToolsTraceTool
|
|
95
|
+
]
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
|
+
from ..._utils import PropertyInfo
|
|
10
|
+
from ..chunk_param import ChunkParam
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"AssistantRetrieveParams",
|
|
14
|
+
"Tools",
|
|
15
|
+
"ToolsModelCitationTool",
|
|
16
|
+
"ToolsModelCitationToolToolResponses",
|
|
17
|
+
"ToolsRetrievalChunkToolInput",
|
|
18
|
+
"ToolsRetrievalFullContextToolInput",
|
|
19
|
+
"ToolsTraceTool",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class AssistantRetrieveParams(TypedDict, total=False):
|
|
24
|
+
content: Required[str]
|
|
25
|
+
|
|
26
|
+
workspace_ext_id: Required[str]
|
|
27
|
+
|
|
28
|
+
config_ext_id: Optional[str]
|
|
29
|
+
|
|
30
|
+
parent_message_ext_id: Optional[str]
|
|
31
|
+
|
|
32
|
+
tools: Dict[str, Tools]
|
|
33
|
+
|
|
34
|
+
workspace_key: Annotated[str, PropertyInfo(alias="workspace-key")]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ToolsModelCitationToolToolResponses(TypedDict, total=False):
|
|
38
|
+
"""Data for a single citation - shared by DocTags and ModelCitationTool."""
|
|
39
|
+
|
|
40
|
+
chunk_ids: Required[SequenceNotStr[str]]
|
|
41
|
+
|
|
42
|
+
offset_end: Required[int]
|
|
43
|
+
|
|
44
|
+
offset_start: Required[int]
|
|
45
|
+
|
|
46
|
+
statement: Required[str]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ToolsModelCitationTool(TypedDict, total=False):
|
|
50
|
+
description: str
|
|
51
|
+
|
|
52
|
+
name: Literal["model_citation"]
|
|
53
|
+
|
|
54
|
+
tool_responses: Dict[str, ToolsModelCitationToolToolResponses]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class ToolsRetrievalChunkToolInput(TypedDict, total=False):
|
|
58
|
+
description: str
|
|
59
|
+
|
|
60
|
+
name: Literal["retrieval_chunk"]
|
|
61
|
+
|
|
62
|
+
tool_args: Dict[str, SequenceNotStr[str]]
|
|
63
|
+
|
|
64
|
+
tool_responses: Dict[str, Iterable[ChunkParam]]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ToolsRetrievalFullContextToolInput(TypedDict, total=False):
|
|
68
|
+
description: str
|
|
69
|
+
|
|
70
|
+
name: Literal["retrieval_full_context"]
|
|
71
|
+
|
|
72
|
+
tool_args: Dict[str, object]
|
|
73
|
+
|
|
74
|
+
tool_responses: Dict[str, Iterable[ChunkParam]]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class ToolsTraceTool(TypedDict, total=False):
|
|
78
|
+
"""Execution trace tool that captures the full execution history of a request."""
|
|
79
|
+
|
|
80
|
+
description: str
|
|
81
|
+
|
|
82
|
+
duration_seconds: Optional[float]
|
|
83
|
+
|
|
84
|
+
name: Literal["trace"]
|
|
85
|
+
|
|
86
|
+
start_time: Optional[float]
|
|
87
|
+
|
|
88
|
+
steps: Iterable[Dict[str, object]]
|
|
89
|
+
|
|
90
|
+
trace_id: Optional[str]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
Tools: TypeAlias = Union[
|
|
94
|
+
ToolsModelCitationTool, ToolsRetrievalChunkToolInput, ToolsRetrievalFullContextToolInput, ToolsTraceTool
|
|
95
|
+
]
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import Literal, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from ..._utils import PropertyInfo
|
|
9
|
+
from .parser_config_param import ParserConfigParam
|
|
10
|
+
from .chunker_config_param import ChunkerConfigParam
|
|
11
|
+
from .embedder_config_param import EmbedderConfigParam
|
|
12
|
+
from .reranker_config_param import RerankerConfigParam
|
|
13
|
+
from .query_llm_config_param import QueryLlmConfigParam
|
|
14
|
+
from .retriever_config_param import RetrieverConfigParam
|
|
15
|
+
from .title_llm_config_param import TitleLlmConfigParam
|
|
16
|
+
from .model_citation_config_param import ModelCitationConfigParam
|
|
17
|
+
from .document_date_extractor_llm_config_param import DocumentDateExtractorLlmConfigParam
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"ConfigCreateParams",
|
|
21
|
+
"AgentLlm",
|
|
22
|
+
"Agents",
|
|
23
|
+
"DoctagLlm",
|
|
24
|
+
"DocumentSummaryExtractorLlm",
|
|
25
|
+
"EvaluatorLlm",
|
|
26
|
+
"KeywordEmbedder",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ConfigCreateParams(TypedDict, total=False):
|
|
31
|
+
agent_llm: Annotated[Optional[AgentLlm], PropertyInfo(alias="AgentLLM")]
|
|
32
|
+
|
|
33
|
+
agents: Annotated[Optional[Agents], PropertyInfo(alias="Agents")]
|
|
34
|
+
|
|
35
|
+
chunker: Annotated[Optional[ChunkerConfigParam], PropertyInfo(alias="Chunker")]
|
|
36
|
+
|
|
37
|
+
doctag_llm: Annotated[Optional[DoctagLlm], PropertyInfo(alias="DoctagLLM")]
|
|
38
|
+
"""
|
|
39
|
+
Configuration for DoctagLLM - extracts information from documents based on tag
|
|
40
|
+
instructions.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
document_date_extractor_llm: Annotated[
|
|
44
|
+
Optional[DocumentDateExtractorLlmConfigParam], PropertyInfo(alias="DocumentDateExtractorLLM")
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
document_summary_extractor_llm: Annotated[
|
|
48
|
+
Optional[DocumentSummaryExtractorLlm], PropertyInfo(alias="DocumentSummaryExtractorLLM")
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
embedder: Annotated[Optional[EmbedderConfigParam], PropertyInfo(alias="Embedder")]
|
|
52
|
+
|
|
53
|
+
evaluator_llm: Annotated[Optional[EvaluatorLlm], PropertyInfo(alias="EvaluatorLLM")]
|
|
54
|
+
|
|
55
|
+
keyword_embedder: Annotated[Optional[KeywordEmbedder], PropertyInfo(alias="KeywordEmbedder")]
|
|
56
|
+
"""Configuration for keyword embedder with BM25 scoring."""
|
|
57
|
+
|
|
58
|
+
model_citation: Annotated[Optional[ModelCitationConfigParam], PropertyInfo(alias="ModelCitation")]
|
|
59
|
+
|
|
60
|
+
parent_message_ext_id: Optional[str]
|
|
61
|
+
|
|
62
|
+
parser: Annotated[Optional[ParserConfigParam], PropertyInfo(alias="Parser")]
|
|
63
|
+
|
|
64
|
+
query_llm: Annotated[Optional[QueryLlmConfigParam], PropertyInfo(alias="QueryLLM")]
|
|
65
|
+
|
|
66
|
+
reranker: Annotated[Optional[RerankerConfigParam], PropertyInfo(alias="Reranker")]
|
|
67
|
+
|
|
68
|
+
retriever: Annotated[Optional[RetrieverConfigParam], PropertyInfo(alias="Retriever")]
|
|
69
|
+
|
|
70
|
+
title: str
|
|
71
|
+
|
|
72
|
+
title_llm: Annotated[Optional[TitleLlmConfigParam], PropertyInfo(alias="TitleLLM")]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class AgentLlm(TypedDict, total=False):
|
|
76
|
+
api_type: Annotated[Literal["local", "remote"], PropertyInfo(alias="API_TYPE")]
|
|
77
|
+
"""The inference type (local or remote)."""
|
|
78
|
+
|
|
79
|
+
enabled: Annotated[bool, PropertyInfo(alias="ENABLED")]
|
|
80
|
+
"""Whether to use agent mode for queries."""
|
|
81
|
+
|
|
82
|
+
max_char_size_to_answer: Annotated[int, PropertyInfo(alias="MAX_CHAR_SIZE_TO_ANSWER")]
|
|
83
|
+
"""Maximum character size for history."""
|
|
84
|
+
|
|
85
|
+
max_context_tokens: Annotated[int, PropertyInfo(alias="MAX_CONTEXT_TOKENS")]
|
|
86
|
+
"""
|
|
87
|
+
Maximum tokens for gathered context (applies to evidence buffer and final
|
|
88
|
+
query).
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
max_iterations: Annotated[int, PropertyInfo(alias="MAX_ITERATIONS")]
|
|
92
|
+
"""Maximum agent loop iterations."""
|
|
93
|
+
|
|
94
|
+
max_tokens: Annotated[int, PropertyInfo(alias="MAX_TOKENS")]
|
|
95
|
+
"""Maximum tokens for planning decisions."""
|
|
96
|
+
|
|
97
|
+
model_name: Annotated[str, PropertyInfo(alias="MODEL_NAME")]
|
|
98
|
+
"""The name of the model to be used."""
|
|
99
|
+
|
|
100
|
+
show_interim_steps: Annotated[bool, PropertyInfo(alias="SHOW_INTERIM_STEPS")]
|
|
101
|
+
"""Whether to show agent's intermediate steps."""
|
|
102
|
+
|
|
103
|
+
system_instruction: Annotated[str, PropertyInfo(alias="SYSTEM_INSTRUCTION")]
|
|
104
|
+
"""The system instruction for agent planning."""
|
|
105
|
+
|
|
106
|
+
temperature: Annotated[float, PropertyInfo(alias="TEMPERATURE")]
|
|
107
|
+
"""Temperature for agent decisions."""
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class Agents(TypedDict, total=False):
|
|
111
|
+
agent_model_name: Annotated[str, PropertyInfo(alias="AGENT_MODEL_NAME")]
|
|
112
|
+
"""The name of the model to be used for the agent."""
|
|
113
|
+
|
|
114
|
+
agent_prompt: Annotated[str, PropertyInfo(alias="AGENT_PROMPT")]
|
|
115
|
+
|
|
116
|
+
enabled: Annotated[bool, PropertyInfo(alias="ENABLED")]
|
|
117
|
+
"""Whether to use agents mode for queries."""
|
|
118
|
+
|
|
119
|
+
llm_agent_temperature: Annotated[float, PropertyInfo(alias="LLM_AGENT_TEMPERATURE")]
|
|
120
|
+
"""Temperature value for randomness."""
|
|
121
|
+
|
|
122
|
+
llm_page_filter_model_name: Annotated[str, PropertyInfo(alias="LLM_PAGE_FILTER_MODEL_NAME")]
|
|
123
|
+
"""The name of the model to be used for the llm page filter model."""
|
|
124
|
+
|
|
125
|
+
llm_page_filter_prompt: Annotated[str, PropertyInfo(alias="LLM_PAGE_FILTER_PROMPT")]
|
|
126
|
+
|
|
127
|
+
llm_page_filter_temperature: Annotated[float, PropertyInfo(alias="LLM_PAGE_FILTER_TEMPERATURE")]
|
|
128
|
+
"""Temperature value for randomness."""
|
|
129
|
+
|
|
130
|
+
llm_summarise_model_name: Annotated[str, PropertyInfo(alias="LLM_SUMMARISE_MODEL_NAME")]
|
|
131
|
+
"""The name of the model to be used for the llm summarise model."""
|
|
132
|
+
|
|
133
|
+
llm_summarise_prompt: Annotated[str, PropertyInfo(alias="LLM_SUMMARISE_PROMPT")]
|
|
134
|
+
|
|
135
|
+
llm_summarise_temperature: Annotated[float, PropertyInfo(alias="LLM_SUMMARISE_TEMPERATURE")]
|
|
136
|
+
"""Temperature value for randomness."""
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class DoctagLlm(TypedDict, total=False):
|
|
140
|
+
"""
|
|
141
|
+
Configuration for DoctagLLM - extracts information from documents based on tag instructions.
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
api_type: Annotated[Literal["local", "remote"], PropertyInfo(alias="API_TYPE")]
|
|
145
|
+
"""The inference type (local or remote)."""
|
|
146
|
+
|
|
147
|
+
max_char_context_to_answer: Annotated[int, PropertyInfo(alias="MAX_CHAR_CONTEXT_TO_ANSWER")]
|
|
148
|
+
"""Maximum characters in document for context."""
|
|
149
|
+
|
|
150
|
+
max_tokens: Annotated[int, PropertyInfo(alias="MAX_TOKENS")]
|
|
151
|
+
"""Maximum number of tokens allowed for all answers."""
|
|
152
|
+
|
|
153
|
+
model_name: Annotated[str, PropertyInfo(alias="MODEL_NAME")]
|
|
154
|
+
"""The name of the non-reasoning model to be used."""
|
|
155
|
+
|
|
156
|
+
system_instruction: Annotated[str, PropertyInfo(alias="SYSTEM_INSTRUCTION")]
|
|
157
|
+
|
|
158
|
+
temperature: Annotated[float, PropertyInfo(alias="TEMPERATURE")]
|
|
159
|
+
"""Temperature for factual answers."""
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class DocumentSummaryExtractorLlm(TypedDict, total=False):
|
|
163
|
+
api_type: Annotated[Literal["local", "remote"], PropertyInfo(alias="API_TYPE")]
|
|
164
|
+
"""The inference type (local or remote)."""
|
|
165
|
+
|
|
166
|
+
max_char_context_to_answer: Annotated[int, PropertyInfo(alias="MAX_CHAR_CONTEXT_TO_ANSWER")]
|
|
167
|
+
"""Maximum characters in document for context."""
|
|
168
|
+
|
|
169
|
+
max_tokens: Annotated[int, PropertyInfo(alias="MAX_TOKENS")]
|
|
170
|
+
"""Maximum number of tokens allowed."""
|
|
171
|
+
|
|
172
|
+
model_name: Annotated[str, PropertyInfo(alias="MODEL_NAME")]
|
|
173
|
+
"""The name of the non-reasoning model to be used."""
|
|
174
|
+
|
|
175
|
+
system_instruction: Annotated[str, PropertyInfo(alias="SYSTEM_INSTRUCTION")]
|
|
176
|
+
|
|
177
|
+
temperature: Annotated[float, PropertyInfo(alias="TEMPERATURE")]
|
|
178
|
+
"""Temperature value for randomness."""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class EvaluatorLlm(TypedDict, total=False):
|
|
182
|
+
api_type: Annotated[Literal["local", "remote"], PropertyInfo(alias="API_TYPE")]
|
|
183
|
+
"""The inference type (local or remote)."""
|
|
184
|
+
|
|
185
|
+
max_char_size_to_answer: Annotated[int, PropertyInfo(alias="MAX_CHAR_SIZE_TO_ANSWER")]
|
|
186
|
+
"""Maximum character size for evaluation context."""
|
|
187
|
+
|
|
188
|
+
max_tokens: Annotated[int, PropertyInfo(alias="MAX_TOKENS")]
|
|
189
|
+
"""Maximum tokens for evaluation response."""
|
|
190
|
+
|
|
191
|
+
model_name: Annotated[str, PropertyInfo(alias="MODEL_NAME")]
|
|
192
|
+
"""The name of the non-reasoning model to be used."""
|
|
193
|
+
|
|
194
|
+
system_instruction: Annotated[str, PropertyInfo(alias="SYSTEM_INSTRUCTION")]
|
|
195
|
+
"""The system instruction for chunk evaluation."""
|
|
196
|
+
|
|
197
|
+
temperature: Annotated[float, PropertyInfo(alias="TEMPERATURE")]
|
|
198
|
+
"""Low temperature for consistent evaluation."""
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
class KeywordEmbedder(TypedDict, total=False):
|
|
202
|
+
"""Configuration for keyword embedder with BM25 scoring."""
|
|
203
|
+
|
|
204
|
+
bm25_avgdl: Annotated[float, PropertyInfo(alias="BM25_AVGDL")]
|
|
205
|
+
"""Average document length in tokens.
|
|
206
|
+
|
|
207
|
+
Adjust based on your documents: chat messages ~20-50, articles ~100-300, papers
|
|
208
|
+
~1000+
|
|
209
|
+
"""
|
|
210
|
+
|
|
211
|
+
bm25_b: Annotated[float, PropertyInfo(alias="BM25_B")]
|
|
212
|
+
"""BM25 document length normalization (0.0-1.0).
|
|
213
|
+
|
|
214
|
+
0=ignore length, 1=full penalty for long docs. Default 0.75 is standard.
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
bm25_k1: Annotated[float, PropertyInfo(alias="BM25_K1")]
|
|
218
|
+
"""BM25 term frequency saturation (1.2-2.0).
|
|
219
|
+
|
|
220
|
+
Higher = more weight on term repetition. Default 1.5 works for most cases.
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
dimension_space: Annotated[int, PropertyInfo(alias="DIMENSION_SPACE")]
|
|
224
|
+
"""Total dimension space for hash trick (1,048,576 dimensions)"""
|
|
225
|
+
|
|
226
|
+
filter_stopwords: Annotated[bool, PropertyInfo(alias="FILTER_STOPWORDS")]
|
|
227
|
+
"""Remove common stopwords to reduce noise"""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ConfigCreateResponse"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ConfigCreateResponse(BaseModel):
|
|
11
|
+
"""Response model for configuration save endpoint"""
|
|
12
|
+
|
|
13
|
+
created_at: str
|
|
14
|
+
|
|
15
|
+
external_id: str
|
|
16
|
+
|
|
17
|
+
title: Optional[str] = None
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ConfigDeleteResponse"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ConfigDeleteResponse(BaseModel):
|
|
11
|
+
detail: Optional[str] = None
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ConfigGetVersionsResponse", "Version"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Version(BaseModel):
|
|
11
|
+
created_at: str
|
|
12
|
+
|
|
13
|
+
external_id: str
|
|
14
|
+
|
|
15
|
+
title: Optional[str] = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ConfigGetVersionsResponse(BaseModel):
|
|
19
|
+
versions: List[Version]
|