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