qanswer_sdk 3.1509.0__py3-none-any.whl → 3.1510.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.
- qanswer_sdk/__init__.py +31 -24
- qanswer_sdk/api/__init__.py +0 -1
- qanswer_sdk/api/admin_api.py +914 -142
- qanswer_sdk/api/ai_assistant_access_rights_api.py +883 -280
- qanswer_sdk/api/ai_assistant_api.py +289 -61
- qanswer_sdk/api/branding_api.py +6 -6
- qanswer_sdk/api/connector_website_api.py +287 -0
- qanswer_sdk/api/connectors_api.py +863 -11
- qanswer_sdk/api/connectors_data_api.py +28 -27
- qanswer_sdk/api/mcp_api.py +1103 -469
- qanswer_sdk/api/payment_api.py +3 -3
- qanswer_sdk/api/socket_api.py +0 -245
- qanswer_sdk/api/task_ai_excel_api.py +288 -0
- qanswer_sdk/api/task_report_copilot_api.py +49 -122
- qanswer_sdk/api/tool_embedder_api.py +552 -1
- qanswer_sdk/api/tool_llm_api.py +1059 -10
- qanswer_sdk/api/unit_organizations_api.py +1240 -165
- qanswer_sdk/api/unit_user_api.py +506 -0
- qanswer_sdk/api_client.py +1 -1
- qanswer_sdk/configuration.py +1 -1
- qanswer_sdk/models/__init__.py +30 -22
- qanswer_sdk/models/access_pdf_payload_model.py +6 -4
- qanswer_sdk/models/add_qn_a_request.py +5 -3
- qanswer_sdk/models/{assistant_template.py → ai_assistant_clone_response.py} +9 -19
- qanswer_sdk/models/ai_assistant_dto.py +4 -2
- qanswer_sdk/models/ai_assistant_filter_dto.py +3 -1
- qanswer_sdk/models/{user_dataset_access_control_origin_header.py → ai_assistant_restricted_domain.py} +8 -8
- qanswer_sdk/models/ai_assistant_share_response.py +93 -0
- qanswer_sdk/models/api_key_mcp_authentication_config.py +2 -2
- qanswer_sdk/models/assistant_template_filter_dto.py +93 -0
- qanswer_sdk/models/{relation_extraction_schema.py → assistant_template_with_tools_selection_dto.py} +26 -24
- qanswer_sdk/models/audio_file_upload_payload.py +4 -2
- qanswer_sdk/models/auto_bot_description_request.py +5 -3
- qanswer_sdk/models/chatbot_chat_payload.py +6 -2
- qanswer_sdk/models/connector_type_dto.py +101 -0
- qanswer_sdk/models/{relation_extraction_data_input.py → connector_type_list_dto.py} +14 -14
- qanswer_sdk/models/conversation_message.py +37 -7
- qanswer_sdk/models/conversation_model.py +8 -2
- qanswer_sdk/models/credits_info_global_dto.py +95 -0
- qanswer_sdk/models/credits_info_organization_dto.py +93 -0
- qanswer_sdk/models/dataset_detail_kg.py +30 -10
- qanswer_sdk/models/dataset_schema.py +5 -1
- qanswer_sdk/models/dataset_update_object.py +8 -2
- qanswer_sdk/models/document_content_update_model.py +4 -2
- qanswer_sdk/models/econsilium_search_index_add_payload.py +3 -1
- qanswer_sdk/models/embedder_create_dto.py +9 -3
- qanswer_sdk/models/embedder_detailed_dto.py +9 -3
- qanswer_sdk/models/embedder_update_dto.py +9 -3
- qanswer_sdk/models/{relation_model.py → embedding_endpoint_import_failure.py} +8 -10
- qanswer_sdk/models/embedding_endpoint_import_response.py +99 -0
- qanswer_sdk/models/es_meta_data.py +98 -0
- qanswer_sdk/models/{get_file_es_meta_data_response.py → es_meta_data_value.py} +7 -11
- qanswer_sdk/models/feedback_update.py +4 -2
- qanswer_sdk/models/file_es_meta_data.py +31 -4
- qanswer_sdk/models/g_drive_download_request.py +3 -1
- qanswer_sdk/models/generate_ai_cells_payload.py +5 -3
- qanswer_sdk/models/highlight_audio_payload_model.py +6 -4
- qanswer_sdk/models/imap_add_payload.py +4 -2
- qanswer_sdk/models/list_socket_events.py +2 -2
- qanswer_sdk/models/llm_consumption.py +2 -2
- qanswer_sdk/models/llm_create_dto.py +25 -3
- qanswer_sdk/models/llm_detailed_dto.py +30 -4
- qanswer_sdk/models/llm_dto.py +18 -2
- qanswer_sdk/models/llm_endpoint.py +25 -3
- qanswer_sdk/models/llm_endpoint_import_failure.py +89 -0
- qanswer_sdk/models/{relation_extraction_data_output.py → llm_endpoint_import_response.py} +20 -16
- qanswer_sdk/models/llm_endpoint_read_input.py +25 -3
- qanswer_sdk/models/llm_endpoint_read_output.py +25 -3
- qanswer_sdk/models/llm_update_dto.py +25 -3
- qanswer_sdk/models/mcp_server.py +153 -0
- qanswer_sdk/models/mcp_server_create.py +4 -2
- qanswer_sdk/models/mcp_server_dto.py +6 -2
- qanswer_sdk/models/mcp_server_update.py +4 -2
- qanswer_sdk/models/mcp_tool.py +124 -0
- qanswer_sdk/models/mcp_tool_description_update.py +6 -4
- qanswer_sdk/models/mcp_tool_dto.py +3 -1
- qanswer_sdk/models/one_drive_download_request.py +3 -1
- qanswer_sdk/models/one_note_download_request.py +3 -1
- qanswer_sdk/models/organization_admin.py +4 -2
- qanswer_sdk/models/organization_filter_dto.py +4 -2
- qanswer_sdk/models/{relation_value_input.py → organization_mcp_server_setting.py} +29 -24
- qanswer_sdk/models/plan_dto.py +16 -4
- qanswer_sdk/models/publication_add_payload.py +4 -2
- qanswer_sdk/models/rag_payload.py +6 -2
- qanswer_sdk/models/report_copilot_generation_from_slots_payload.py +5 -3
- qanswer_sdk/models/report_copilot_refinement_payload.py +5 -3
- qanswer_sdk/models/report_copilot_slot_feedback_update.py +4 -2
- qanswer_sdk/models/report_template.py +3 -1
- qanswer_sdk/models/report_template_create_payload.py +4 -2
- qanswer_sdk/models/report_template_simplified.py +4 -2
- qanswer_sdk/models/report_template_update_payload.py +4 -2
- qanswer_sdk/models/report_templates_search_payload.py +104 -0
- qanswer_sdk/models/search_payload.py +6 -2
- qanswer_sdk/models/share_point_download_request.py +3 -1
- qanswer_sdk/models/socket_conversation_message.py +37 -7
- qanswer_sdk/models/template_toggle_request.py +5 -5
- qanswer_sdk/models/text2_sparql_payload.py +5 -1
- qanswer_sdk/models/thinking_block.py +91 -0
- qanswer_sdk/models/{subject_model.py → update_cells_payload.py} +10 -10
- qanswer_sdk/models/{relation_extraction_configuration.py → update_file_es_meta_data.py} +37 -26
- qanswer_sdk/models/{update_metadata_model.py → update_metadata_model_input.py} +7 -7
- qanswer_sdk/models/{relation_extraction_task_settings_update_payload.py → update_metadata_model_output.py} +14 -12
- qanswer_sdk/models/update_qn_a_pair_request.py +4 -2
- qanswer_sdk/models/{relation_extraction_template_payload.py → update_template_cells_payload.py} +19 -15
- qanswer_sdk/models/user.py +10 -5
- qanswer_sdk/models/user_credits_config_dto.py +95 -0
- qanswer_sdk/models/user_credits_dto.py +104 -0
- qanswer_sdk/models/user_dataset.py +31 -11
- qanswer_sdk/models/{relation_extraction_row_output.py → user_dataset_mcp_tool_selection.py} +33 -26
- qanswer_sdk/models/user_dataset_mcp_tool_selection_dto.py +3 -1
- qanswer_sdk/models/user_filter_dto.py +4 -2
- qanswer_sdk/models/{relation_extraction_row_input.py → user_mcp_tool_selection.py} +31 -26
- qanswer_sdk/models/user_mcp_tool_selection_dto.py +3 -1
- qanswer_sdk/models/user_profile_dto.py +16 -4
- qanswer_sdk/models/{value_model.py → websearch_scraping_site.py} +11 -17
- qanswer_sdk/models/website_add_payload.py +4 -2
- {qanswer_sdk-3.1509.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/METADATA +2 -2
- {qanswer_sdk-3.1509.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/RECORD +119 -112
- qanswer_sdk/api/task_relation_extraction_api.py +0 -3636
- qanswer_sdk/models/export_relation_extraction_table_request.py +0 -97
- qanswer_sdk/models/relation_extraction_payload.py +0 -117
- qanswer_sdk/models/relation_extraction_task_settings.py +0 -125
- qanswer_sdk/models/relation_extraction_task_update.py +0 -125
- qanswer_sdk/models/relation_value_output.py +0 -103
- qanswer_sdk/models/socket_data_extraction.py +0 -109
- {qanswer_sdk-3.1509.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/WHEEL +0 -0
|
@@ -20,14 +20,16 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from qanswer_sdk.models.ai_assistant_restricted_domain import AiAssistantRestrictedDomain
|
|
23
24
|
from qanswer_sdk.models.dataset_config_request import DatasetConfigRequest
|
|
25
|
+
from qanswer_sdk.models.embedder_consumption import EmbedderConsumption
|
|
24
26
|
from qanswer_sdk.models.entity_description import EntityDescription
|
|
25
27
|
from qanswer_sdk.models.llm_consumption import LlmConsumption
|
|
26
28
|
from qanswer_sdk.models.logo import Logo
|
|
27
29
|
from qanswer_sdk.models.shared_organization_access import SharedOrganizationAccess
|
|
28
30
|
from qanswer_sdk.models.shared_team_access import SharedTeamAccess
|
|
29
31
|
from qanswer_sdk.models.user import User
|
|
30
|
-
from qanswer_sdk.models.
|
|
32
|
+
from qanswer_sdk.models.user_dataset_mcp_tool_selection import UserDatasetMcpToolSelection
|
|
31
33
|
from qanswer_sdk.models.user_dataset_shared import UserDatasetShared
|
|
32
34
|
from typing import Optional, Set
|
|
33
35
|
from typing_extensions import Self
|
|
@@ -53,12 +55,14 @@ class DatasetDetailKg(BaseModel):
|
|
|
53
55
|
shared_users: Optional[List[UserDatasetShared]] = Field(default=None, alias="sharedUsers")
|
|
54
56
|
shared_team_accesses: Optional[List[SharedTeamAccess]] = Field(default=None, alias="sharedTeamAccesses")
|
|
55
57
|
shared_organization_accesses: Optional[List[SharedOrganizationAccess]] = Field(default=None, alias="sharedOrganizationAccesses")
|
|
56
|
-
|
|
58
|
+
mcp_tool_selections: Optional[List[UserDatasetMcpToolSelection]] = Field(default=None, alias="mcpToolSelections")
|
|
59
|
+
ai_assistant_restricted_domains: Optional[List[AiAssistantRestrictedDomain]] = Field(default=None, alias="aiAssistantRestrictedDomains")
|
|
57
60
|
entity_description: Optional[EntityDescription] = Field(default=None, alias="entityDescription")
|
|
58
61
|
logo: Optional[Logo] = None
|
|
59
62
|
llm_consumptions: Optional[List[LlmConsumption]] = Field(default=None, alias="llmConsumptions")
|
|
63
|
+
embedder_consumptions: Optional[List[EmbedderConsumption]] = Field(default=None, alias="embedderConsumptions")
|
|
60
64
|
config: Optional[DatasetConfigRequest] = None
|
|
61
|
-
__properties: ClassVar[List[str]] = ["id", "dataset", "name", "description", "user", "uploaded", "indexed", "access", "accessType", "size", "created", "indexType", "languages", "assistantTemplatePublished", "sharedUsers", "sharedTeamAccesses", "sharedOrganizationAccesses", "
|
|
65
|
+
__properties: ClassVar[List[str]] = ["id", "dataset", "name", "description", "user", "uploaded", "indexed", "access", "accessType", "size", "created", "indexType", "languages", "assistantTemplatePublished", "sharedUsers", "sharedTeamAccesses", "sharedOrganizationAccesses", "mcpToolSelections", "aiAssistantRestrictedDomains", "entityDescription", "logo", "llmConsumptions", "embedderConsumptions", "config"]
|
|
62
66
|
|
|
63
67
|
@field_validator('access_type')
|
|
64
68
|
def access_type_validate_enum(cls, value):
|
|
@@ -133,13 +137,20 @@ class DatasetDetailKg(BaseModel):
|
|
|
133
137
|
if _item_shared_organization_accesses:
|
|
134
138
|
_items.append(_item_shared_organization_accesses.to_dict())
|
|
135
139
|
_dict['sharedOrganizationAccesses'] = _items
|
|
136
|
-
# override the default output from pydantic by calling `to_dict()` of each item in
|
|
140
|
+
# override the default output from pydantic by calling `to_dict()` of each item in mcp_tool_selections (list)
|
|
137
141
|
_items = []
|
|
138
|
-
if self.
|
|
139
|
-
for
|
|
140
|
-
if
|
|
141
|
-
_items.append(
|
|
142
|
-
_dict['
|
|
142
|
+
if self.mcp_tool_selections:
|
|
143
|
+
for _item_mcp_tool_selections in self.mcp_tool_selections:
|
|
144
|
+
if _item_mcp_tool_selections:
|
|
145
|
+
_items.append(_item_mcp_tool_selections.to_dict())
|
|
146
|
+
_dict['mcpToolSelections'] = _items
|
|
147
|
+
# override the default output from pydantic by calling `to_dict()` of each item in ai_assistant_restricted_domains (list)
|
|
148
|
+
_items = []
|
|
149
|
+
if self.ai_assistant_restricted_domains:
|
|
150
|
+
for _item_ai_assistant_restricted_domains in self.ai_assistant_restricted_domains:
|
|
151
|
+
if _item_ai_assistant_restricted_domains:
|
|
152
|
+
_items.append(_item_ai_assistant_restricted_domains.to_dict())
|
|
153
|
+
_dict['aiAssistantRestrictedDomains'] = _items
|
|
143
154
|
# override the default output from pydantic by calling `to_dict()` of entity_description
|
|
144
155
|
if self.entity_description:
|
|
145
156
|
_dict['entityDescription'] = self.entity_description.to_dict()
|
|
@@ -153,6 +164,13 @@ class DatasetDetailKg(BaseModel):
|
|
|
153
164
|
if _item_llm_consumptions:
|
|
154
165
|
_items.append(_item_llm_consumptions.to_dict())
|
|
155
166
|
_dict['llmConsumptions'] = _items
|
|
167
|
+
# override the default output from pydantic by calling `to_dict()` of each item in embedder_consumptions (list)
|
|
168
|
+
_items = []
|
|
169
|
+
if self.embedder_consumptions:
|
|
170
|
+
for _item_embedder_consumptions in self.embedder_consumptions:
|
|
171
|
+
if _item_embedder_consumptions:
|
|
172
|
+
_items.append(_item_embedder_consumptions.to_dict())
|
|
173
|
+
_dict['embedderConsumptions'] = _items
|
|
156
174
|
# override the default output from pydantic by calling `to_dict()` of config
|
|
157
175
|
if self.config:
|
|
158
176
|
_dict['config'] = self.config.to_dict()
|
|
@@ -185,10 +203,12 @@ class DatasetDetailKg(BaseModel):
|
|
|
185
203
|
"sharedUsers": [UserDatasetShared.from_dict(_item) for _item in obj["sharedUsers"]] if obj.get("sharedUsers") is not None else None,
|
|
186
204
|
"sharedTeamAccesses": [SharedTeamAccess.from_dict(_item) for _item in obj["sharedTeamAccesses"]] if obj.get("sharedTeamAccesses") is not None else None,
|
|
187
205
|
"sharedOrganizationAccesses": [SharedOrganizationAccess.from_dict(_item) for _item in obj["sharedOrganizationAccesses"]] if obj.get("sharedOrganizationAccesses") is not None else None,
|
|
188
|
-
"
|
|
206
|
+
"mcpToolSelections": [UserDatasetMcpToolSelection.from_dict(_item) for _item in obj["mcpToolSelections"]] if obj.get("mcpToolSelections") is not None else None,
|
|
207
|
+
"aiAssistantRestrictedDomains": [AiAssistantRestrictedDomain.from_dict(_item) for _item in obj["aiAssistantRestrictedDomains"]] if obj.get("aiAssistantRestrictedDomains") is not None else None,
|
|
189
208
|
"entityDescription": EntityDescription.from_dict(obj["entityDescription"]) if obj.get("entityDescription") is not None else None,
|
|
190
209
|
"logo": Logo.from_dict(obj["logo"]) if obj.get("logo") is not None else None,
|
|
191
210
|
"llmConsumptions": [LlmConsumption.from_dict(_item) for _item in obj["llmConsumptions"]] if obj.get("llmConsumptions") is not None else None,
|
|
211
|
+
"embedderConsumptions": [EmbedderConsumption.from_dict(_item) for _item in obj["embedderConsumptions"]] if obj.get("embedderConsumptions") is not None else None,
|
|
192
212
|
"config": DatasetConfigRequest.from_dict(obj["config"]) if obj.get("config") is not None else None
|
|
193
213
|
})
|
|
194
214
|
return _obj
|
|
@@ -64,15 +64,17 @@ class DatasetSchema(BaseModel):
|
|
|
64
64
|
creation_date: Optional[StrictStr] = None
|
|
65
65
|
use_training: Optional[StrictBool] = None
|
|
66
66
|
embedding_model: Optional[StrictStr] = None
|
|
67
|
+
reindexing_failed: Optional[StrictBool] = None
|
|
67
68
|
data_storage_preference: Optional[StrictStr] = None
|
|
68
69
|
logs_visibility_policy: Optional[StrictStr] = None
|
|
69
70
|
dataset_type: Optional[StrictStr] = None
|
|
70
71
|
categories: Optional[List[StrictStr]] = None
|
|
71
72
|
is_template: Optional[StrictBool] = None
|
|
73
|
+
incognito: Optional[StrictBool] = None
|
|
72
74
|
widget_configs: WidgetConfigs
|
|
73
75
|
n_tokens: Optional[StrictInt] = None
|
|
74
76
|
embedding_model_id: Optional[StrictInt] = None
|
|
75
|
-
__properties: ClassVar[List[str]] = ["id", "dataset", "username", "index_hash", "language", "is_updating", "use_reader", "use_ranker", "use_fallback", "top_k_retriever", "top_k_reader", "top_k_ranker", "return_no_ans", "no_ans_boost", "max_seq_len", "doc_stride", "max_ans_len", "weight_title", "weight_text", "split_by", "split_len", "split_overlap", "bot_name", "bot_description", "bot_mode", "bot_knowledge", "bot_answer_length", "bot_seed", "bot_temperature", "prompt", "number_of_references", "stream_speed", "initial_message", "track_geo", "creation_date", "use_training", "embedding_model", "data_storage_preference", "logs_visibility_policy", "dataset_type", "categories", "is_template", "widget_configs", "n_tokens", "embedding_model_id"]
|
|
77
|
+
__properties: ClassVar[List[str]] = ["id", "dataset", "username", "index_hash", "language", "is_updating", "use_reader", "use_ranker", "use_fallback", "top_k_retriever", "top_k_reader", "top_k_ranker", "return_no_ans", "no_ans_boost", "max_seq_len", "doc_stride", "max_ans_len", "weight_title", "weight_text", "split_by", "split_len", "split_overlap", "bot_name", "bot_description", "bot_mode", "bot_knowledge", "bot_answer_length", "bot_seed", "bot_temperature", "prompt", "number_of_references", "stream_speed", "initial_message", "track_geo", "creation_date", "use_training", "embedding_model", "reindexing_failed", "data_storage_preference", "logs_visibility_policy", "dataset_type", "categories", "is_template", "incognito", "widget_configs", "n_tokens", "embedding_model_id"]
|
|
76
78
|
|
|
77
79
|
@field_validator('data_storage_preference')
|
|
78
80
|
def data_storage_preference_validate_enum(cls, value):
|
|
@@ -195,11 +197,13 @@ class DatasetSchema(BaseModel):
|
|
|
195
197
|
"creation_date": obj.get("creation_date"),
|
|
196
198
|
"use_training": obj.get("use_training"),
|
|
197
199
|
"embedding_model": obj.get("embedding_model"),
|
|
200
|
+
"reindexing_failed": obj.get("reindexing_failed"),
|
|
198
201
|
"data_storage_preference": obj.get("data_storage_preference"),
|
|
199
202
|
"logs_visibility_policy": obj.get("logs_visibility_policy"),
|
|
200
203
|
"dataset_type": obj.get("dataset_type"),
|
|
201
204
|
"categories": obj.get("categories"),
|
|
202
205
|
"is_template": obj.get("is_template"),
|
|
206
|
+
"incognito": obj.get("incognito"),
|
|
203
207
|
"widget_configs": WidgetConfigs.from_dict(obj["widget_configs"]) if obj.get("widget_configs") is not None else None,
|
|
204
208
|
"n_tokens": obj.get("n_tokens"),
|
|
205
209
|
"embedding_model_id": obj.get("embedding_model_id")
|
|
@@ -70,7 +70,10 @@ class DatasetUpdateObject(BaseModel):
|
|
|
70
70
|
split_by: Optional[StrictStr] = Field(default=None, description="Split method")
|
|
71
71
|
split_len: Optional[StrictInt] = Field(default=None, description="Split length")
|
|
72
72
|
split_overlap: Optional[StrictInt] = Field(default=None, description="Split overlap")
|
|
73
|
-
|
|
73
|
+
embedding_model_id: Optional[StrictInt] = Field(default=None, description="Embedding model id in case of changing the embedder, otherwise None")
|
|
74
|
+
reindexing_failed: Optional[StrictBool] = None
|
|
75
|
+
additional_fields: Optional[Dict[str, Any]] = Field(default=None, description="Additional fields for future extensions")
|
|
76
|
+
__properties: ClassVar[List[str]] = ["dataset", "username", "is_updating", "use_reader", "use_ranker", "use_fallback", "top_k_retriever", "top_k_reader", "return_no_ans", "no_ans_boost", "max_seq_len", "doc_stride", "max_ans_len", "weight_title", "weight_text", "bot_name", "bot_description", "bot_mode", "bot_knowledge", "bot_answer_length", "bot_seed", "bot_temperature", "prompt", "number_of_references", "data_storage_preference", "stream_speed", "categories", "initial_message", "widget_init_msg", "widget_theme", "widget_open_default", "widget_font", "widget_colorPrimary", "widget_colorSecondary", "widget_align", "widget_offsetX", "widget_offsetY", "widget_show_powered_by", "widget_show_export_conversation", "track_geo", "use_training", "split_by", "split_len", "split_overlap", "embedding_model_id", "reindexing_failed", "additional_fields"]
|
|
74
77
|
|
|
75
78
|
@field_validator('data_storage_preference')
|
|
76
79
|
def data_storage_preference_validate_enum(cls, value):
|
|
@@ -176,7 +179,10 @@ class DatasetUpdateObject(BaseModel):
|
|
|
176
179
|
"use_training": obj.get("use_training"),
|
|
177
180
|
"split_by": obj.get("split_by"),
|
|
178
181
|
"split_len": obj.get("split_len"),
|
|
179
|
-
"split_overlap": obj.get("split_overlap")
|
|
182
|
+
"split_overlap": obj.get("split_overlap"),
|
|
183
|
+
"embedding_model_id": obj.get("embedding_model_id"),
|
|
184
|
+
"reindexing_failed": obj.get("reindexing_failed"),
|
|
185
|
+
"additional_fields": obj.get("additional_fields")
|
|
180
186
|
})
|
|
181
187
|
return _obj
|
|
182
188
|
|
|
@@ -32,7 +32,8 @@ class DocumentContentUpdateModel(BaseModel):
|
|
|
32
32
|
connector_id: StrictInt
|
|
33
33
|
content: StrictStr
|
|
34
34
|
conversation_id: Optional[StrictStr] = None
|
|
35
|
-
|
|
35
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "filename", "connector_id", "content", "conversation_id", "additional_fields"]
|
|
36
37
|
|
|
37
38
|
model_config = ConfigDict(
|
|
38
39
|
populate_by_name=True,
|
|
@@ -90,7 +91,8 @@ class DocumentContentUpdateModel(BaseModel):
|
|
|
90
91
|
"filename": obj.get("filename"),
|
|
91
92
|
"connector_id": obj.get("connector_id"),
|
|
92
93
|
"content": obj.get("content"),
|
|
93
|
-
"conversation_id": obj.get("conversation_id")
|
|
94
|
+
"conversation_id": obj.get("conversation_id"),
|
|
95
|
+
"additional_fields": obj.get("additional_fields")
|
|
94
96
|
})
|
|
95
97
|
return _obj
|
|
96
98
|
|
|
@@ -31,9 +31,10 @@ class EconsiliumSearchIndexAddPayload(BaseModel):
|
|
|
31
31
|
dataset: StrictStr
|
|
32
32
|
connector_id: StrictInt
|
|
33
33
|
quota: StrictInt
|
|
34
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
34
35
|
oauth_token: Optional[StrictStr] = None
|
|
35
36
|
files: List[EconsiliumFileMetadata]
|
|
36
|
-
__properties: ClassVar[List[str]] = ["username", "dataset", "connector_id", "quota", "oauth_token", "files"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "connector_id", "quota", "additional_fields", "oauth_token", "files"]
|
|
37
38
|
|
|
38
39
|
model_config = ConfigDict(
|
|
39
40
|
populate_by_name=True,
|
|
@@ -97,6 +98,7 @@ class EconsiliumSearchIndexAddPayload(BaseModel):
|
|
|
97
98
|
"dataset": obj.get("dataset"),
|
|
98
99
|
"connector_id": obj.get("connector_id"),
|
|
99
100
|
"quota": obj.get("quota"),
|
|
101
|
+
"additional_fields": obj.get("additional_fields"),
|
|
100
102
|
"oauth_token": obj.get("oauth_token"),
|
|
101
103
|
"files": [EconsiliumFileMetadata.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None
|
|
102
104
|
})
|
|
@@ -37,7 +37,10 @@ class EmbedderCreateDto(BaseModel):
|
|
|
37
37
|
aws_secret_access_key: Optional[StrictStr] = None
|
|
38
38
|
aws_region_name: Optional[StrictStr] = None
|
|
39
39
|
aws_inference_profile: Optional[StrictStr] = None
|
|
40
|
+
vertex_location: Optional[StrictStr] = None
|
|
41
|
+
vertex_credentials: Optional[StrictStr] = None
|
|
40
42
|
batch_size: Optional[StrictInt] = None
|
|
43
|
+
skip_ssl_verification: Optional[StrictBool] = None
|
|
41
44
|
display_name: StrictStr
|
|
42
45
|
engine: StrictStr
|
|
43
46
|
api_key: Optional[StrictStr] = None
|
|
@@ -45,7 +48,7 @@ class EmbedderCreateDto(BaseModel):
|
|
|
45
48
|
embedding_size: StrictInt
|
|
46
49
|
context_window: StrictInt
|
|
47
50
|
cost_input_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costInputPerMillionToken")
|
|
48
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "batch_size", "display_name", "engine", "api_key", "name", "embedding_size", "context_window", "costInputPerMillionToken"]
|
|
51
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "vertex_location", "vertex_credentials", "batch_size", "skip_ssl_verification", "display_name", "engine", "api_key", "name", "embedding_size", "context_window", "costInputPerMillionToken"]
|
|
49
52
|
|
|
50
53
|
@field_validator('modality')
|
|
51
54
|
def modality_validate_enum(cls, value):
|
|
@@ -63,8 +66,8 @@ class EmbedderCreateDto(BaseModel):
|
|
|
63
66
|
if value is None:
|
|
64
67
|
return value
|
|
65
68
|
|
|
66
|
-
if value not in set(['openai', 'azure', 'bedrock', 'ollama']):
|
|
67
|
-
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'ollama')")
|
|
69
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai']):
|
|
70
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai')")
|
|
68
71
|
return value
|
|
69
72
|
|
|
70
73
|
model_config = ConfigDict(
|
|
@@ -129,7 +132,10 @@ class EmbedderCreateDto(BaseModel):
|
|
|
129
132
|
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
|
130
133
|
"aws_region_name": obj.get("aws_region_name"),
|
|
131
134
|
"aws_inference_profile": obj.get("aws_inference_profile"),
|
|
135
|
+
"vertex_location": obj.get("vertex_location"),
|
|
136
|
+
"vertex_credentials": obj.get("vertex_credentials"),
|
|
132
137
|
"batch_size": obj.get("batch_size"),
|
|
138
|
+
"skip_ssl_verification": obj.get("skip_ssl_verification"),
|
|
133
139
|
"display_name": obj.get("display_name"),
|
|
134
140
|
"engine": obj.get("engine"),
|
|
135
141
|
"api_key": obj.get("api_key"),
|
|
@@ -37,7 +37,10 @@ class EmbedderDetailedDto(BaseModel):
|
|
|
37
37
|
aws_secret_access_key: Optional[StrictStr] = None
|
|
38
38
|
aws_region_name: Optional[StrictStr] = None
|
|
39
39
|
aws_inference_profile: Optional[StrictStr] = None
|
|
40
|
+
vertex_location: Optional[StrictStr] = None
|
|
41
|
+
vertex_credentials: Optional[StrictStr] = None
|
|
40
42
|
batch_size: Optional[StrictInt] = None
|
|
43
|
+
skip_ssl_verification: Optional[StrictBool] = None
|
|
41
44
|
display_name: StrictStr
|
|
42
45
|
engine: StrictStr
|
|
43
46
|
api_key: Optional[StrictStr] = None
|
|
@@ -47,7 +50,7 @@ class EmbedderDetailedDto(BaseModel):
|
|
|
47
50
|
id: Optional[StrictInt] = None
|
|
48
51
|
cost_input_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costInputPerMillionToken")
|
|
49
52
|
active: Optional[StrictBool] = None
|
|
50
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "batch_size", "display_name", "engine", "api_key", "name", "embedding_size", "context_window", "id", "costInputPerMillionToken", "active"]
|
|
53
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "vertex_location", "vertex_credentials", "batch_size", "skip_ssl_verification", "display_name", "engine", "api_key", "name", "embedding_size", "context_window", "id", "costInputPerMillionToken", "active"]
|
|
51
54
|
|
|
52
55
|
@field_validator('modality')
|
|
53
56
|
def modality_validate_enum(cls, value):
|
|
@@ -65,8 +68,8 @@ class EmbedderDetailedDto(BaseModel):
|
|
|
65
68
|
if value is None:
|
|
66
69
|
return value
|
|
67
70
|
|
|
68
|
-
if value not in set(['openai', 'azure', 'bedrock', 'ollama']):
|
|
69
|
-
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'ollama')")
|
|
71
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai']):
|
|
72
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai')")
|
|
70
73
|
return value
|
|
71
74
|
|
|
72
75
|
model_config = ConfigDict(
|
|
@@ -131,7 +134,10 @@ class EmbedderDetailedDto(BaseModel):
|
|
|
131
134
|
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
|
132
135
|
"aws_region_name": obj.get("aws_region_name"),
|
|
133
136
|
"aws_inference_profile": obj.get("aws_inference_profile"),
|
|
137
|
+
"vertex_location": obj.get("vertex_location"),
|
|
138
|
+
"vertex_credentials": obj.get("vertex_credentials"),
|
|
134
139
|
"batch_size": obj.get("batch_size"),
|
|
140
|
+
"skip_ssl_verification": obj.get("skip_ssl_verification"),
|
|
135
141
|
"display_name": obj.get("display_name"),
|
|
136
142
|
"engine": obj.get("engine"),
|
|
137
143
|
"api_key": obj.get("api_key"),
|
|
@@ -37,12 +37,15 @@ class EmbedderUpdateDto(BaseModel):
|
|
|
37
37
|
aws_secret_access_key: Optional[StrictStr] = None
|
|
38
38
|
aws_region_name: Optional[StrictStr] = None
|
|
39
39
|
aws_inference_profile: Optional[StrictStr] = None
|
|
40
|
+
vertex_location: Optional[StrictStr] = None
|
|
41
|
+
vertex_credentials: Optional[StrictStr] = None
|
|
40
42
|
batch_size: Optional[StrictInt] = None
|
|
43
|
+
skip_ssl_verification: Optional[StrictBool] = None
|
|
41
44
|
display_name: Optional[StrictStr] = None
|
|
42
45
|
engine: Optional[StrictStr] = None
|
|
43
46
|
api_key: Optional[StrictStr] = None
|
|
44
47
|
cost_input_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costInputPerMillionToken")
|
|
45
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "batch_size", "display_name", "engine", "api_key", "costInputPerMillionToken"]
|
|
48
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "endpoint_url", "description", "onpremise", "sensitivity_label", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "vertex_location", "vertex_credentials", "batch_size", "skip_ssl_verification", "display_name", "engine", "api_key", "costInputPerMillionToken"]
|
|
46
49
|
|
|
47
50
|
@field_validator('modality')
|
|
48
51
|
def modality_validate_enum(cls, value):
|
|
@@ -60,8 +63,8 @@ class EmbedderUpdateDto(BaseModel):
|
|
|
60
63
|
if value is None:
|
|
61
64
|
return value
|
|
62
65
|
|
|
63
|
-
if value not in set(['openai', 'azure', 'bedrock', 'ollama']):
|
|
64
|
-
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'ollama')")
|
|
66
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai']):
|
|
67
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai')")
|
|
65
68
|
return value
|
|
66
69
|
|
|
67
70
|
model_config = ConfigDict(
|
|
@@ -126,7 +129,10 @@ class EmbedderUpdateDto(BaseModel):
|
|
|
126
129
|
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
|
127
130
|
"aws_region_name": obj.get("aws_region_name"),
|
|
128
131
|
"aws_inference_profile": obj.get("aws_inference_profile"),
|
|
132
|
+
"vertex_location": obj.get("vertex_location"),
|
|
133
|
+
"vertex_credentials": obj.get("vertex_credentials"),
|
|
129
134
|
"batch_size": obj.get("batch_size"),
|
|
135
|
+
"skip_ssl_verification": obj.get("skip_ssl_verification"),
|
|
130
136
|
"display_name": obj.get("display_name"),
|
|
131
137
|
"engine": obj.get("engine"),
|
|
132
138
|
"api_key": obj.get("api_key"),
|
|
@@ -18,18 +18,17 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class EmbeddingEndpointImportFailure(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
EmbeddingEndpointImportFailure
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
name: StrictStr
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
__properties: ClassVar[List[str]] = ["name", "task_description", "prompt"]
|
|
30
|
+
reason: StrictStr
|
|
31
|
+
__properties: ClassVar[List[str]] = ["name", "reason"]
|
|
33
32
|
|
|
34
33
|
model_config = ConfigDict(
|
|
35
34
|
populate_by_name=True,
|
|
@@ -49,7 +48,7 @@ class RelationModel(BaseModel):
|
|
|
49
48
|
|
|
50
49
|
@classmethod
|
|
51
50
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of
|
|
51
|
+
"""Create an instance of EmbeddingEndpointImportFailure from a JSON string"""
|
|
53
52
|
return cls.from_dict(json.loads(json_str))
|
|
54
53
|
|
|
55
54
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -74,7 +73,7 @@ class RelationModel(BaseModel):
|
|
|
74
73
|
|
|
75
74
|
@classmethod
|
|
76
75
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of
|
|
76
|
+
"""Create an instance of EmbeddingEndpointImportFailure from a dict"""
|
|
78
77
|
if obj is None:
|
|
79
78
|
return None
|
|
80
79
|
|
|
@@ -83,8 +82,7 @@ class RelationModel(BaseModel):
|
|
|
83
82
|
|
|
84
83
|
_obj = cls.model_validate({
|
|
85
84
|
"name": obj.get("name"),
|
|
86
|
-
"
|
|
87
|
-
"prompt": obj.get("prompt")
|
|
85
|
+
"reason": obj.get("reason")
|
|
88
86
|
})
|
|
89
87
|
return _obj
|
|
90
88
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QAnswer: Api Documentation
|
|
5
|
+
|
|
6
|
+
APIs provided by QAnswer
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from qanswer_sdk.models.embedding_endpoint_import_failure import EmbeddingEndpointImportFailure
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class EmbeddingEndpointImportResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
EmbeddingEndpointImportResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
success: StrictInt
|
|
31
|
+
failed: StrictInt
|
|
32
|
+
fail_list: List[EmbeddingEndpointImportFailure]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["success", "failed", "fail_list"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of EmbeddingEndpointImportResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in fail_list (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.fail_list:
|
|
77
|
+
for _item_fail_list in self.fail_list:
|
|
78
|
+
if _item_fail_list:
|
|
79
|
+
_items.append(_item_fail_list.to_dict())
|
|
80
|
+
_dict['fail_list'] = _items
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of EmbeddingEndpointImportResponse from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"success": obj.get("success"),
|
|
94
|
+
"failed": obj.get("failed"),
|
|
95
|
+
"fail_list": [EmbeddingEndpointImportFailure.from_dict(_item) for _item in obj["fail_list"]] if obj.get("fail_list") is not None else None
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QAnswer: Api Documentation
|
|
5
|
+
|
|
6
|
+
APIs provided by QAnswer
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ESMetaData(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ESMetaData
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
value: StrictStr
|
|
30
|
+
type: StrictStr
|
|
31
|
+
editable: StrictBool
|
|
32
|
+
__properties: ClassVar[List[str]] = ["value", "type", "editable"]
|
|
33
|
+
|
|
34
|
+
@field_validator('type')
|
|
35
|
+
def type_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['keyword', 'text', 'long', 'date', 'freetext', 'boolean']):
|
|
38
|
+
raise ValueError("must be one of enum values ('keyword', 'text', 'long', 'date', 'freetext', 'boolean')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of ESMetaData from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ESMetaData from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"value": obj.get("value"),
|
|
93
|
+
"type": obj.get("type"),
|
|
94
|
+
"editable": obj.get("editable")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -22,14 +22,12 @@ from typing import Any, ClassVar, Dict, List
|
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class ESMetaDataValue(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
ESMetaDataValue
|
|
28
28
|
""" # noqa: E501
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
metadata: Dict[str, Dict[str, Any]]
|
|
32
|
-
__properties: ClassVar[List[str]] = ["additional_fields", "file_id", "metadata"]
|
|
29
|
+
value: StrictStr
|
|
30
|
+
__properties: ClassVar[List[str]] = ["value"]
|
|
33
31
|
|
|
34
32
|
model_config = ConfigDict(
|
|
35
33
|
populate_by_name=True,
|
|
@@ -49,7 +47,7 @@ class GetFileESMetaDataResponse(BaseModel):
|
|
|
49
47
|
|
|
50
48
|
@classmethod
|
|
51
49
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of
|
|
50
|
+
"""Create an instance of ESMetaDataValue from a JSON string"""
|
|
53
51
|
return cls.from_dict(json.loads(json_str))
|
|
54
52
|
|
|
55
53
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -74,7 +72,7 @@ class GetFileESMetaDataResponse(BaseModel):
|
|
|
74
72
|
|
|
75
73
|
@classmethod
|
|
76
74
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of
|
|
75
|
+
"""Create an instance of ESMetaDataValue from a dict"""
|
|
78
76
|
if obj is None:
|
|
79
77
|
return None
|
|
80
78
|
|
|
@@ -82,9 +80,7 @@ class GetFileESMetaDataResponse(BaseModel):
|
|
|
82
80
|
return cls.model_validate(obj)
|
|
83
81
|
|
|
84
82
|
_obj = cls.model_validate({
|
|
85
|
-
"
|
|
86
|
-
"file_id": obj.get("file_id"),
|
|
87
|
-
"metadata": obj.get("metadata")
|
|
83
|
+
"value": obj.get("value")
|
|
88
84
|
})
|
|
89
85
|
return _obj
|
|
90
86
|
|
|
@@ -35,7 +35,8 @@ class FeedbackUpdate(BaseModel):
|
|
|
35
35
|
modified_response: Optional[StrictStr] = None
|
|
36
36
|
comment: Optional[StrictStr] = None
|
|
37
37
|
approved: Optional[StrictBool] = None
|
|
38
|
-
|
|
38
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "message_id", "conversation_id", "rate", "modified_question", "modified_response", "comment", "approved", "additional_fields"]
|
|
39
40
|
|
|
40
41
|
model_config = ConfigDict(
|
|
41
42
|
populate_by_name=True,
|
|
@@ -96,7 +97,8 @@ class FeedbackUpdate(BaseModel):
|
|
|
96
97
|
"modified_question": obj.get("modified_question"),
|
|
97
98
|
"modified_response": obj.get("modified_response"),
|
|
98
99
|
"comment": obj.get("comment"),
|
|
99
|
-
"approved": obj.get("approved")
|
|
100
|
+
"approved": obj.get("approved"),
|
|
101
|
+
"additional_fields": obj.get("additional_fields")
|
|
100
102
|
})
|
|
101
103
|
return _obj
|
|
102
104
|
|