h2ogpte 1.6.42__py3-none-any.whl → 1.6.43rc1__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 (98) hide show
  1. h2ogpte/__init__.py +1 -1
  2. h2ogpte/cli/__init__.py +0 -0
  3. h2ogpte/cli/commands/__init__.py +0 -0
  4. h2ogpte/cli/commands/command_handlers/__init__.py +0 -0
  5. h2ogpte/cli/commands/command_handlers/agent.py +41 -0
  6. h2ogpte/cli/commands/command_handlers/chat.py +37 -0
  7. h2ogpte/cli/commands/command_handlers/clear.py +8 -0
  8. h2ogpte/cli/commands/command_handlers/collection.py +67 -0
  9. h2ogpte/cli/commands/command_handlers/config.py +113 -0
  10. h2ogpte/cli/commands/command_handlers/disconnect.py +36 -0
  11. h2ogpte/cli/commands/command_handlers/exit.py +37 -0
  12. h2ogpte/cli/commands/command_handlers/help.py +8 -0
  13. h2ogpte/cli/commands/command_handlers/history.py +29 -0
  14. h2ogpte/cli/commands/command_handlers/rag.py +146 -0
  15. h2ogpte/cli/commands/command_handlers/research_agent.py +45 -0
  16. h2ogpte/cli/commands/command_handlers/session.py +77 -0
  17. h2ogpte/cli/commands/command_handlers/status.py +33 -0
  18. h2ogpte/cli/commands/dispatcher.py +79 -0
  19. h2ogpte/cli/core/__init__.py +0 -0
  20. h2ogpte/cli/core/app.py +105 -0
  21. h2ogpte/cli/core/config.py +199 -0
  22. h2ogpte/cli/core/encryption.py +104 -0
  23. h2ogpte/cli/core/session.py +171 -0
  24. h2ogpte/cli/integrations/__init__.py +0 -0
  25. h2ogpte/cli/integrations/agent.py +338 -0
  26. h2ogpte/cli/integrations/rag.py +442 -0
  27. h2ogpte/cli/main.py +90 -0
  28. h2ogpte/cli/ui/__init__.py +0 -0
  29. h2ogpte/cli/ui/hbot_prompt.py +435 -0
  30. h2ogpte/cli/ui/prompts.py +129 -0
  31. h2ogpte/cli/ui/status_bar.py +133 -0
  32. h2ogpte/cli/utils/__init__.py +0 -0
  33. h2ogpte/cli/utils/file_manager.py +411 -0
  34. h2ogpte/h2ogpte.py +471 -67
  35. h2ogpte/h2ogpte_async.py +482 -68
  36. h2ogpte/h2ogpte_sync_base.py +8 -1
  37. h2ogpte/rest_async/__init__.py +6 -3
  38. h2ogpte/rest_async/api/chat_api.py +29 -0
  39. h2ogpte/rest_async/api/collections_api.py +293 -0
  40. h2ogpte/rest_async/api/extractors_api.py +2874 -70
  41. h2ogpte/rest_async/api/prompt_templates_api.py +32 -32
  42. h2ogpte/rest_async/api_client.py +1 -1
  43. h2ogpte/rest_async/configuration.py +1 -1
  44. h2ogpte/rest_async/models/__init__.py +5 -2
  45. h2ogpte/rest_async/models/chat_completion.py +4 -2
  46. h2ogpte/rest_async/models/chat_completion_delta.py +5 -3
  47. h2ogpte/rest_async/models/chat_completion_request.py +1 -1
  48. h2ogpte/rest_async/models/chat_session.py +4 -2
  49. h2ogpte/rest_async/models/chat_settings.py +1 -1
  50. h2ogpte/rest_async/models/collection.py +4 -2
  51. h2ogpte/rest_async/models/collection_create_request.py +4 -2
  52. h2ogpte/rest_async/models/create_chat_session_request.py +87 -0
  53. h2ogpte/rest_async/models/extraction_request.py +1 -1
  54. h2ogpte/rest_async/models/extractor.py +4 -2
  55. h2ogpte/rest_async/models/guardrails_settings.py +8 -4
  56. h2ogpte/rest_async/models/guardrails_settings_create_request.py +1 -1
  57. h2ogpte/rest_async/models/process_document_job_request.py +1 -1
  58. h2ogpte/rest_async/models/question_request.py +1 -1
  59. h2ogpte/rest_async/models/{reset_and_share_prompt_template_request.py → reset_and_share_request.py} +6 -6
  60. h2ogpte/{rest_sync/models/reset_and_share_prompt_template_with_groups_request.py → rest_async/models/reset_and_share_with_groups_request.py} +6 -6
  61. h2ogpte/rest_async/models/summarize_request.py +1 -1
  62. h2ogpte/rest_async/models/update_collection_workspace_request.py +87 -0
  63. h2ogpte/rest_async/models/update_extractor_privacy_request.py +87 -0
  64. h2ogpte/rest_sync/__init__.py +6 -3
  65. h2ogpte/rest_sync/api/chat_api.py +29 -0
  66. h2ogpte/rest_sync/api/collections_api.py +293 -0
  67. h2ogpte/rest_sync/api/extractors_api.py +2874 -70
  68. h2ogpte/rest_sync/api/prompt_templates_api.py +32 -32
  69. h2ogpte/rest_sync/api_client.py +1 -1
  70. h2ogpte/rest_sync/configuration.py +1 -1
  71. h2ogpte/rest_sync/models/__init__.py +5 -2
  72. h2ogpte/rest_sync/models/chat_completion.py +4 -2
  73. h2ogpte/rest_sync/models/chat_completion_delta.py +5 -3
  74. h2ogpte/rest_sync/models/chat_completion_request.py +1 -1
  75. h2ogpte/rest_sync/models/chat_session.py +4 -2
  76. h2ogpte/rest_sync/models/chat_settings.py +1 -1
  77. h2ogpte/rest_sync/models/collection.py +4 -2
  78. h2ogpte/rest_sync/models/collection_create_request.py +4 -2
  79. h2ogpte/rest_sync/models/create_chat_session_request.py +87 -0
  80. h2ogpte/rest_sync/models/extraction_request.py +1 -1
  81. h2ogpte/rest_sync/models/extractor.py +4 -2
  82. h2ogpte/rest_sync/models/guardrails_settings.py +8 -4
  83. h2ogpte/rest_sync/models/guardrails_settings_create_request.py +1 -1
  84. h2ogpte/rest_sync/models/process_document_job_request.py +1 -1
  85. h2ogpte/rest_sync/models/question_request.py +1 -1
  86. h2ogpte/rest_sync/models/{reset_and_share_prompt_template_request.py → reset_and_share_request.py} +6 -6
  87. h2ogpte/{rest_async/models/reset_and_share_prompt_template_with_groups_request.py → rest_sync/models/reset_and_share_with_groups_request.py} +6 -6
  88. h2ogpte/rest_sync/models/summarize_request.py +1 -1
  89. h2ogpte/rest_sync/models/update_collection_workspace_request.py +87 -0
  90. h2ogpte/rest_sync/models/update_extractor_privacy_request.py +87 -0
  91. h2ogpte/session.py +3 -2
  92. h2ogpte/session_async.py +22 -6
  93. h2ogpte/types.py +6 -0
  94. {h2ogpte-1.6.42.dist-info → h2ogpte-1.6.43rc1.dist-info}/METADATA +5 -1
  95. {h2ogpte-1.6.42.dist-info → h2ogpte-1.6.43rc1.dist-info}/RECORD +98 -59
  96. h2ogpte-1.6.43rc1.dist-info/entry_points.txt +2 -0
  97. {h2ogpte-1.6.42.dist-info → h2ogpte-1.6.43rc1.dist-info}/WHEEL +0 -0
  98. {h2ogpte-1.6.42.dist-info → h2ogpte-1.6.43rc1.dist-info}/top_level.txt +0 -0
@@ -288,13 +288,20 @@ class H2OGPTESyncBase:
288
288
  response = self._post("/rpc/crawl/func", marshal([name, kwargs]))
289
289
  return response
290
290
 
291
- def _wait_for_completion(self, job_id: str, timeout: Optional[float] = None) -> Job:
291
+ def _wait_for_completion(
292
+ self,
293
+ job_id: str,
294
+ timeout: Optional[float] = None,
295
+ callback: Optional[Callable[[Job], None]] = None,
296
+ ) -> Job:
292
297
  if timeout is None:
293
298
  timeout = 86400
294
299
  dt = H2OGPTEAsync.INITIAL_WAIT_INTERVAL
295
300
  last_job: Optional[Job] = None
296
301
  while True:
297
302
  job = self.get_job(job_id)
303
+ if callback:
304
+ callback(job)
298
305
  if job.completed or job.canceled:
299
306
  break
300
307
  if last_job is not None and last_job.progress == job.progress:
@@ -14,7 +14,7 @@
14
14
  """ # noqa: E501
15
15
 
16
16
 
17
- __version__ = "1.6.42"
17
+ __version__ = "1.6.43-dev1"
18
18
 
19
19
  # import apis into sdk package
20
20
  from h2ogpte.rest_async.api.api_keys_api import APIKeysApi
@@ -82,6 +82,7 @@ from h2ogpte.rest_async.models.count_with_queue_details import CountWithQueueDet
82
82
  from h2ogpte.rest_async.models.create_agent_key_request import CreateAgentKeyRequest
83
83
  from h2ogpte.rest_async.models.create_agent_tool_key_associations_request import CreateAgentToolKeyAssociationsRequest
84
84
  from h2ogpte.rest_async.models.create_agent_tool_request import CreateAgentToolRequest
85
+ from h2ogpte.rest_async.models.create_chat_session_request import CreateChatSessionRequest
85
86
  from h2ogpte.rest_async.models.create_import_collection_to_collection_job_request import CreateImportCollectionToCollectionJobRequest
86
87
  from h2ogpte.rest_async.models.create_insert_document_to_collection_job_request import CreateInsertDocumentToCollectionJobRequest
87
88
  from h2ogpte.rest_async.models.create_secret201_response import CreateSecret201Response
@@ -137,8 +138,8 @@ from h2ogpte.rest_async.models.prompt_template_create_request import PromptTempl
137
138
  from h2ogpte.rest_async.models.qa_feedback import QAFeedback
138
139
  from h2ogpte.rest_async.models.question_request import QuestionRequest
139
140
  from h2ogpte.rest_async.models.queue_details import QueueDetails
140
- from h2ogpte.rest_async.models.reset_and_share_prompt_template_request import ResetAndSharePromptTemplateRequest
141
- from h2ogpte.rest_async.models.reset_and_share_prompt_template_with_groups_request import ResetAndSharePromptTemplateWithGroupsRequest
141
+ from h2ogpte.rest_async.models.reset_and_share_request import ResetAndShareRequest
142
+ from h2ogpte.rest_async.models.reset_and_share_with_groups_request import ResetAndShareWithGroupsRequest
142
143
  from h2ogpte.rest_async.models.role_create_request import RoleCreateRequest
143
144
  from h2ogpte.rest_async.models.role_info import RoleInfo
144
145
  from h2ogpte.rest_async.models.roles_reset_request import RolesResetRequest
@@ -161,9 +162,11 @@ from h2ogpte.rest_async.models.update_agent_tool_preference_request import Updat
161
162
  from h2ogpte.rest_async.models.update_collection_expiry_date_request import UpdateCollectionExpiryDateRequest
162
163
  from h2ogpte.rest_async.models.update_collection_inactivity_interval_request import UpdateCollectionInactivityIntervalRequest
163
164
  from h2ogpte.rest_async.models.update_collection_privacy_request import UpdateCollectionPrivacyRequest
165
+ from h2ogpte.rest_async.models.update_collection_workspace_request import UpdateCollectionWorkspaceRequest
164
166
  from h2ogpte.rest_async.models.update_custom_agent_tool200_response import UpdateCustomAgentTool200Response
165
167
  from h2ogpte.rest_async.models.update_custom_agent_tool_request import UpdateCustomAgentToolRequest
166
168
  from h2ogpte.rest_async.models.update_default_prompt_template_visibility_request import UpdateDefaultPromptTemplateVisibilityRequest
169
+ from h2ogpte.rest_async.models.update_extractor_privacy_request import UpdateExtractorPrivacyRequest
167
170
  from h2ogpte.rest_async.models.update_prompt_template_privacy_request import UpdatePromptTemplatePrivacyRequest
168
171
  from h2ogpte.rest_async.models.update_qa_feedback_request import UpdateQAFeedbackRequest
169
172
  from h2ogpte.rest_async.models.update_secret_request import UpdateSecretRequest
@@ -30,6 +30,7 @@ from h2ogpte.rest_async.models.chat_session import ChatSession
30
30
  from h2ogpte.rest_async.models.chat_session_update_request import ChatSessionUpdateRequest
31
31
  from h2ogpte.rest_async.models.collection_change_request import CollectionChangeRequest
32
32
  from h2ogpte.rest_async.models.count import Count
33
+ from h2ogpte.rest_async.models.create_chat_session_request import CreateChatSessionRequest
33
34
  from h2ogpte.rest_async.models.delete_chat_sessions_job_request import DeleteChatSessionsJobRequest
34
35
  from h2ogpte.rest_async.models.job_details import JobDetails
35
36
  from h2ogpte.rest_async.models.message_vote_update_request import MessageVoteUpdateRequest
@@ -60,6 +61,7 @@ class ChatApi:
60
61
  async def create_chat_session(
61
62
  self,
62
63
  collection_id: Annotated[Optional[StrictStr], Field(description="Id of collection")] = None,
64
+ create_chat_session_request: Optional[CreateChatSessionRequest] = None,
63
65
  _request_timeout: Union[
64
66
  None,
65
67
  Annotated[StrictFloat, Field(gt=0)],
@@ -79,6 +81,8 @@ class ChatApi:
79
81
 
80
82
  :param collection_id: Id of collection
81
83
  :type collection_id: str
84
+ :param create_chat_session_request:
85
+ :type create_chat_session_request: CreateChatSessionRequest
82
86
  :param _request_timeout: timeout setting for this request. If one
83
87
  number provided, it will be total request
84
88
  timeout. It can also be a pair (tuple) of
@@ -103,6 +107,7 @@ class ChatApi:
103
107
 
104
108
  _param = self._create_chat_session_serialize(
105
109
  collection_id=collection_id,
110
+ create_chat_session_request=create_chat_session_request,
106
111
  _request_auth=_request_auth,
107
112
  _content_type=_content_type,
108
113
  _headers=_headers,
@@ -128,6 +133,7 @@ class ChatApi:
128
133
  async def create_chat_session_with_http_info(
129
134
  self,
130
135
  collection_id: Annotated[Optional[StrictStr], Field(description="Id of collection")] = None,
136
+ create_chat_session_request: Optional[CreateChatSessionRequest] = None,
131
137
  _request_timeout: Union[
132
138
  None,
133
139
  Annotated[StrictFloat, Field(gt=0)],
@@ -147,6 +153,8 @@ class ChatApi:
147
153
 
148
154
  :param collection_id: Id of collection
149
155
  :type collection_id: str
156
+ :param create_chat_session_request:
157
+ :type create_chat_session_request: CreateChatSessionRequest
150
158
  :param _request_timeout: timeout setting for this request. If one
151
159
  number provided, it will be total request
152
160
  timeout. It can also be a pair (tuple) of
@@ -171,6 +179,7 @@ class ChatApi:
171
179
 
172
180
  _param = self._create_chat_session_serialize(
173
181
  collection_id=collection_id,
182
+ create_chat_session_request=create_chat_session_request,
174
183
  _request_auth=_request_auth,
175
184
  _content_type=_content_type,
176
185
  _headers=_headers,
@@ -196,6 +205,7 @@ class ChatApi:
196
205
  async def create_chat_session_without_preload_content(
197
206
  self,
198
207
  collection_id: Annotated[Optional[StrictStr], Field(description="Id of collection")] = None,
208
+ create_chat_session_request: Optional[CreateChatSessionRequest] = None,
199
209
  _request_timeout: Union[
200
210
  None,
201
211
  Annotated[StrictFloat, Field(gt=0)],
@@ -215,6 +225,8 @@ class ChatApi:
215
225
 
216
226
  :param collection_id: Id of collection
217
227
  :type collection_id: str
228
+ :param create_chat_session_request:
229
+ :type create_chat_session_request: CreateChatSessionRequest
218
230
  :param _request_timeout: timeout setting for this request. If one
219
231
  number provided, it will be total request
220
232
  timeout. It can also be a pair (tuple) of
@@ -239,6 +251,7 @@ class ChatApi:
239
251
 
240
252
  _param = self._create_chat_session_serialize(
241
253
  collection_id=collection_id,
254
+ create_chat_session_request=create_chat_session_request,
242
255
  _request_auth=_request_auth,
243
256
  _content_type=_content_type,
244
257
  _headers=_headers,
@@ -259,6 +272,7 @@ class ChatApi:
259
272
  def _create_chat_session_serialize(
260
273
  self,
261
274
  collection_id,
275
+ create_chat_session_request,
262
276
  _request_auth,
263
277
  _content_type,
264
278
  _headers,
@@ -288,6 +302,8 @@ class ChatApi:
288
302
  # process the header parameters
289
303
  # process the form parameters
290
304
  # process the body parameter
305
+ if create_chat_session_request is not None:
306
+ _body_params = create_chat_session_request
291
307
 
292
308
 
293
309
  # set the HTTP header `Accept`
@@ -298,6 +314,19 @@ class ChatApi:
298
314
  ]
299
315
  )
300
316
 
317
+ # set the HTTP header `Content-Type`
318
+ if _content_type:
319
+ _header_params['Content-Type'] = _content_type
320
+ else:
321
+ _default_content_type = (
322
+ self.api_client.select_header_content_type(
323
+ [
324
+ 'application/json'
325
+ ]
326
+ )
327
+ )
328
+ if _default_content_type is not None:
329
+ _header_params['Content-Type'] = _default_content_type
301
330
 
302
331
  # authentication setting
303
332
  _auth_settings: List[str] = [
@@ -45,6 +45,7 @@ from h2ogpte.rest_async.models.suggested_question import SuggestedQuestion
45
45
  from h2ogpte.rest_async.models.update_collection_expiry_date_request import UpdateCollectionExpiryDateRequest
46
46
  from h2ogpte.rest_async.models.update_collection_inactivity_interval_request import UpdateCollectionInactivityIntervalRequest
47
47
  from h2ogpte.rest_async.models.update_collection_privacy_request import UpdateCollectionPrivacyRequest
48
+ from h2ogpte.rest_async.models.update_collection_workspace_request import UpdateCollectionWorkspaceRequest
48
49
 
49
50
  from h2ogpte.rest_async.api_client import ApiClient, RequestSerialized
50
51
  from h2ogpte.rest_async.api_response import ApiResponse
@@ -14773,3 +14774,295 @@ class CollectionsApi:
14773
14774
  )
14774
14775
 
14775
14776
 
14777
+
14778
+
14779
+ @validate_call
14780
+ async def update_collection_workspace(
14781
+ self,
14782
+ collection_id: Annotated[StrictStr, Field(description="Id of the collection")],
14783
+ update_collection_workspace_request: UpdateCollectionWorkspaceRequest,
14784
+ _request_timeout: Union[
14785
+ None,
14786
+ Annotated[StrictFloat, Field(gt=0)],
14787
+ Tuple[
14788
+ Annotated[StrictFloat, Field(gt=0)],
14789
+ Annotated[StrictFloat, Field(gt=0)]
14790
+ ]
14791
+ ] = None,
14792
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
14793
+ _content_type: Optional[StrictStr] = None,
14794
+ _headers: Optional[Dict[StrictStr, Any]] = None,
14795
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
14796
+ ) -> None:
14797
+ """Updates the workspace associated with a collection.
14798
+
14799
+ Updates the workspace associated with a collection as well as the chats belonging to the collection.
14800
+
14801
+ :param collection_id: Id of the collection (required)
14802
+ :type collection_id: str
14803
+ :param update_collection_workspace_request: (required)
14804
+ :type update_collection_workspace_request: UpdateCollectionWorkspaceRequest
14805
+ :param _request_timeout: timeout setting for this request. If one
14806
+ number provided, it will be total request
14807
+ timeout. It can also be a pair (tuple) of
14808
+ (connection, read) timeouts.
14809
+ :type _request_timeout: int, tuple(int, int), optional
14810
+ :param _request_auth: set to override the auth_settings for an a single
14811
+ request; this effectively ignores the
14812
+ authentication in the spec for a single request.
14813
+ :type _request_auth: dict, optional
14814
+ :param _content_type: force content-type for the request.
14815
+ :type _content_type: str, Optional
14816
+ :param _headers: set to override the headers for a single
14817
+ request; this effectively ignores the headers
14818
+ in the spec for a single request.
14819
+ :type _headers: dict, optional
14820
+ :param _host_index: set to override the host_index for a single
14821
+ request; this effectively ignores the host_index
14822
+ in the spec for a single request.
14823
+ :type _host_index: int, optional
14824
+ :return: Returns the result object.
14825
+ """ # noqa: E501
14826
+
14827
+ _param = self._update_collection_workspace_serialize(
14828
+ collection_id=collection_id,
14829
+ update_collection_workspace_request=update_collection_workspace_request,
14830
+ _request_auth=_request_auth,
14831
+ _content_type=_content_type,
14832
+ _headers=_headers,
14833
+ _host_index=_host_index
14834
+ )
14835
+
14836
+ _response_types_map: Dict[str, Optional[str]] = {
14837
+ '204': None,
14838
+ '401': "EndpointError",
14839
+ }
14840
+ response_data = await self.api_client.call_api(
14841
+ *_param,
14842
+ _request_timeout=_request_timeout
14843
+ )
14844
+ await response_data.read()
14845
+ return self.api_client.response_deserialize(
14846
+ response_data=response_data,
14847
+ response_types_map=_response_types_map,
14848
+ ).data
14849
+
14850
+
14851
+ @validate_call
14852
+ async def update_collection_workspace_with_http_info(
14853
+ self,
14854
+ collection_id: Annotated[StrictStr, Field(description="Id of the collection")],
14855
+ update_collection_workspace_request: UpdateCollectionWorkspaceRequest,
14856
+ _request_timeout: Union[
14857
+ None,
14858
+ Annotated[StrictFloat, Field(gt=0)],
14859
+ Tuple[
14860
+ Annotated[StrictFloat, Field(gt=0)],
14861
+ Annotated[StrictFloat, Field(gt=0)]
14862
+ ]
14863
+ ] = None,
14864
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
14865
+ _content_type: Optional[StrictStr] = None,
14866
+ _headers: Optional[Dict[StrictStr, Any]] = None,
14867
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
14868
+ ) -> ApiResponse[None]:
14869
+ """Updates the workspace associated with a collection.
14870
+
14871
+ Updates the workspace associated with a collection as well as the chats belonging to the collection.
14872
+
14873
+ :param collection_id: Id of the collection (required)
14874
+ :type collection_id: str
14875
+ :param update_collection_workspace_request: (required)
14876
+ :type update_collection_workspace_request: UpdateCollectionWorkspaceRequest
14877
+ :param _request_timeout: timeout setting for this request. If one
14878
+ number provided, it will be total request
14879
+ timeout. It can also be a pair (tuple) of
14880
+ (connection, read) timeouts.
14881
+ :type _request_timeout: int, tuple(int, int), optional
14882
+ :param _request_auth: set to override the auth_settings for an a single
14883
+ request; this effectively ignores the
14884
+ authentication in the spec for a single request.
14885
+ :type _request_auth: dict, optional
14886
+ :param _content_type: force content-type for the request.
14887
+ :type _content_type: str, Optional
14888
+ :param _headers: set to override the headers for a single
14889
+ request; this effectively ignores the headers
14890
+ in the spec for a single request.
14891
+ :type _headers: dict, optional
14892
+ :param _host_index: set to override the host_index for a single
14893
+ request; this effectively ignores the host_index
14894
+ in the spec for a single request.
14895
+ :type _host_index: int, optional
14896
+ :return: Returns the result object.
14897
+ """ # noqa: E501
14898
+
14899
+ _param = self._update_collection_workspace_serialize(
14900
+ collection_id=collection_id,
14901
+ update_collection_workspace_request=update_collection_workspace_request,
14902
+ _request_auth=_request_auth,
14903
+ _content_type=_content_type,
14904
+ _headers=_headers,
14905
+ _host_index=_host_index
14906
+ )
14907
+
14908
+ _response_types_map: Dict[str, Optional[str]] = {
14909
+ '204': None,
14910
+ '401': "EndpointError",
14911
+ }
14912
+ response_data = await self.api_client.call_api(
14913
+ *_param,
14914
+ _request_timeout=_request_timeout
14915
+ )
14916
+ await response_data.read()
14917
+ return self.api_client.response_deserialize(
14918
+ response_data=response_data,
14919
+ response_types_map=_response_types_map,
14920
+ )
14921
+
14922
+
14923
+ @validate_call
14924
+ async def update_collection_workspace_without_preload_content(
14925
+ self,
14926
+ collection_id: Annotated[StrictStr, Field(description="Id of the collection")],
14927
+ update_collection_workspace_request: UpdateCollectionWorkspaceRequest,
14928
+ _request_timeout: Union[
14929
+ None,
14930
+ Annotated[StrictFloat, Field(gt=0)],
14931
+ Tuple[
14932
+ Annotated[StrictFloat, Field(gt=0)],
14933
+ Annotated[StrictFloat, Field(gt=0)]
14934
+ ]
14935
+ ] = None,
14936
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
14937
+ _content_type: Optional[StrictStr] = None,
14938
+ _headers: Optional[Dict[StrictStr, Any]] = None,
14939
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
14940
+ ) -> RESTResponseType:
14941
+ """Updates the workspace associated with a collection.
14942
+
14943
+ Updates the workspace associated with a collection as well as the chats belonging to the collection.
14944
+
14945
+ :param collection_id: Id of the collection (required)
14946
+ :type collection_id: str
14947
+ :param update_collection_workspace_request: (required)
14948
+ :type update_collection_workspace_request: UpdateCollectionWorkspaceRequest
14949
+ :param _request_timeout: timeout setting for this request. If one
14950
+ number provided, it will be total request
14951
+ timeout. It can also be a pair (tuple) of
14952
+ (connection, read) timeouts.
14953
+ :type _request_timeout: int, tuple(int, int), optional
14954
+ :param _request_auth: set to override the auth_settings for an a single
14955
+ request; this effectively ignores the
14956
+ authentication in the spec for a single request.
14957
+ :type _request_auth: dict, optional
14958
+ :param _content_type: force content-type for the request.
14959
+ :type _content_type: str, Optional
14960
+ :param _headers: set to override the headers for a single
14961
+ request; this effectively ignores the headers
14962
+ in the spec for a single request.
14963
+ :type _headers: dict, optional
14964
+ :param _host_index: set to override the host_index for a single
14965
+ request; this effectively ignores the host_index
14966
+ in the spec for a single request.
14967
+ :type _host_index: int, optional
14968
+ :return: Returns the result object.
14969
+ """ # noqa: E501
14970
+
14971
+ _param = self._update_collection_workspace_serialize(
14972
+ collection_id=collection_id,
14973
+ update_collection_workspace_request=update_collection_workspace_request,
14974
+ _request_auth=_request_auth,
14975
+ _content_type=_content_type,
14976
+ _headers=_headers,
14977
+ _host_index=_host_index
14978
+ )
14979
+
14980
+ _response_types_map: Dict[str, Optional[str]] = {
14981
+ '204': None,
14982
+ '401': "EndpointError",
14983
+ }
14984
+ response_data = await self.api_client.call_api(
14985
+ *_param,
14986
+ _request_timeout=_request_timeout
14987
+ )
14988
+ return response_data.response
14989
+
14990
+
14991
+ def _update_collection_workspace_serialize(
14992
+ self,
14993
+ collection_id,
14994
+ update_collection_workspace_request,
14995
+ _request_auth,
14996
+ _content_type,
14997
+ _headers,
14998
+ _host_index,
14999
+ ) -> RequestSerialized:
15000
+
15001
+ _host = None
15002
+
15003
+ _collection_formats: Dict[str, str] = {
15004
+ }
15005
+
15006
+ _path_params: Dict[str, str] = {}
15007
+ _query_params: List[Tuple[str, str]] = []
15008
+ _header_params: Dict[str, Optional[str]] = _headers or {}
15009
+ _form_params: List[Tuple[str, str]] = []
15010
+ _files: Dict[
15011
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
15012
+ ] = {}
15013
+ _body_params: Optional[bytes] = None
15014
+
15015
+ # process the path parameters
15016
+ if collection_id is not None:
15017
+ _path_params['collection_id'] = collection_id
15018
+ # process the query parameters
15019
+ # process the header parameters
15020
+ # process the form parameters
15021
+ # process the body parameter
15022
+ if update_collection_workspace_request is not None:
15023
+ _body_params = update_collection_workspace_request
15024
+
15025
+
15026
+ # set the HTTP header `Accept`
15027
+ if 'Accept' not in _header_params:
15028
+ _header_params['Accept'] = self.api_client.select_header_accept(
15029
+ [
15030
+ 'application/json'
15031
+ ]
15032
+ )
15033
+
15034
+ # set the HTTP header `Content-Type`
15035
+ if _content_type:
15036
+ _header_params['Content-Type'] = _content_type
15037
+ else:
15038
+ _default_content_type = (
15039
+ self.api_client.select_header_content_type(
15040
+ [
15041
+ 'application/json'
15042
+ ]
15043
+ )
15044
+ )
15045
+ if _default_content_type is not None:
15046
+ _header_params['Content-Type'] = _default_content_type
15047
+
15048
+ # authentication setting
15049
+ _auth_settings: List[str] = [
15050
+ 'bearerAuth'
15051
+ ]
15052
+
15053
+ return self.api_client.param_serialize(
15054
+ method='PUT',
15055
+ resource_path='/collections/{collection_id}/workspace',
15056
+ path_params=_path_params,
15057
+ query_params=_query_params,
15058
+ header_params=_header_params,
15059
+ body=_body_params,
15060
+ post_params=_form_params,
15061
+ files=_files,
15062
+ auth_settings=_auth_settings,
15063
+ collection_formats=_collection_formats,
15064
+ _host=_host,
15065
+ _request_auth=_request_auth
15066
+ )
15067
+
15068
+