qanswer_sdk 3.1508.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.1508.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/METADATA +2 -2
- {qanswer_sdk-3.1508.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.1508.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/WHEEL +0 -0
|
@@ -22,6 +22,9 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from qanswer_sdk.models.aggregations_group import AggregationsGroup
|
|
23
23
|
from qanswer_sdk.models.content_item import ContentItem
|
|
24
24
|
from qanswer_sdk.models.source import Source
|
|
25
|
+
from qanswer_sdk.models.thinking_block import ThinkingBlock
|
|
26
|
+
from qanswer_sdk.models.tool_selection import ToolSelection
|
|
27
|
+
from qanswer_sdk.models.websearch_scraping_site import WebsearchScrapingSite
|
|
25
28
|
from typing import Optional, Set
|
|
26
29
|
from typing_extensions import Self
|
|
27
30
|
|
|
@@ -56,12 +59,15 @@ class SocketConversationMessage(BaseModel):
|
|
|
56
59
|
expanded_question: Optional[StrictStr] = None
|
|
57
60
|
prompt_type: Optional[StrictStr] = None
|
|
58
61
|
tagged_assistant_name: Optional[StrictStr] = None
|
|
59
|
-
synonyms_used: Optional[List[
|
|
60
|
-
tool_calls: Optional[List[Dict[str, Any]]] = None
|
|
62
|
+
synonyms_used: Optional[List[StrictStr]] = None
|
|
63
|
+
tool_calls: Optional[List[Dict[str, Dict[str, Any]]]] = None
|
|
61
64
|
tool_call_id: Optional[StrictStr] = None
|
|
62
|
-
tool_selections: Optional[List[
|
|
65
|
+
tool_selections: Optional[List[ToolSelection]] = None
|
|
66
|
+
server_uids: Optional[List[StrictStr]] = None
|
|
67
|
+
thinking_blocks: Optional[List[ThinkingBlock]] = None
|
|
68
|
+
websearch_sites: Optional[List[WebsearchScrapingSite]] = None
|
|
63
69
|
status: StrictStr
|
|
64
|
-
__properties: ClassVar[List[str]] = ["username", "dataset", "jwt", "api_key", "conversation_id", "user", "role", "contents", "message_id", "parent_message_id", "timestamp", "feedback", "origin", "sources", "all_sources", "task_category", "interface_origin", "comment", "llm_choice", "error_key", "prompt_used", "mode", "is_input_data_cropped", "aggs", "expanded_question", "prompt_type", "tagged_assistant_name", "synonyms_used", "tool_calls", "tool_call_id", "tool_selections", "status"]
|
|
70
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "jwt", "api_key", "conversation_id", "user", "role", "contents", "message_id", "parent_message_id", "timestamp", "feedback", "origin", "sources", "all_sources", "task_category", "interface_origin", "comment", "llm_choice", "error_key", "prompt_used", "mode", "is_input_data_cropped", "aggs", "expanded_question", "prompt_type", "tagged_assistant_name", "synonyms_used", "tool_calls", "tool_call_id", "tool_selections", "server_uids", "thinking_blocks", "websearch_sites", "status"]
|
|
65
71
|
|
|
66
72
|
@field_validator('role')
|
|
67
73
|
def role_validate_enum(cls, value):
|
|
@@ -73,8 +79,8 @@ class SocketConversationMessage(BaseModel):
|
|
|
73
79
|
@field_validator('task_category')
|
|
74
80
|
def task_category_validate_enum(cls, value):
|
|
75
81
|
"""Validates the enum"""
|
|
76
|
-
if value not in set(['text', 'sparql', 'sql', 'sparql2text', 'sparqlvisualize', 'undefined', 'typing', 'user_joined', 'user_left', 'human_takeover_proposed', 'human_takeover_accepted', 'human_takeover_rejected', 'thinking', 'something_went_wrong', 'mcp_tool_calls', 'mcp_tool_choice_accept', 'mcp_tool_choice_reject', 'mcp_ask_for_connection', 'mcp_tool_choice_ask_confirmation', 'mcp_tool_call_response']):
|
|
77
|
-
raise ValueError("must be one of enum values ('text', 'sparql', 'sql', 'sparql2text', 'sparqlvisualize', 'undefined', 'typing', 'user_joined', 'user_left', 'human_takeover_proposed', 'human_takeover_accepted', 'human_takeover_rejected', 'thinking', 'something_went_wrong', 'mcp_tool_calls', 'mcp_tool_choice_accept', 'mcp_tool_choice_reject', 'mcp_ask_for_connection', 'mcp_tool_choice_ask_confirmation', 'mcp_tool_call_response')")
|
|
82
|
+
if value not in set(['text', 'sparql', 'sql', 'sparql2text', 'sparqlvisualize', 'undefined', 'typing', 'user_joined', 'user_left', 'human_takeover_proposed', 'human_takeover_accepted', 'human_takeover_rejected', 'websearch', 'thinking', 'something_went_wrong', 'mcp_tool_calls', 'mcp_tool_choice_accept', 'mcp_tool_choice_reject', 'mcp_ask_for_connection', 'mcp_tool_choice_ask_confirmation', 'mcp_tool_call_response']):
|
|
83
|
+
raise ValueError("must be one of enum values ('text', 'sparql', 'sql', 'sparql2text', 'sparqlvisualize', 'undefined', 'typing', 'user_joined', 'user_left', 'human_takeover_proposed', 'human_takeover_accepted', 'human_takeover_rejected', 'websearch', 'thinking', 'something_went_wrong', 'mcp_tool_calls', 'mcp_tool_choice_accept', 'mcp_tool_choice_reject', 'mcp_ask_for_connection', 'mcp_tool_choice_ask_confirmation', 'mcp_tool_call_response')")
|
|
78
84
|
return value
|
|
79
85
|
|
|
80
86
|
@field_validator('error_key')
|
|
@@ -171,6 +177,27 @@ class SocketConversationMessage(BaseModel):
|
|
|
171
177
|
if _item_aggs:
|
|
172
178
|
_items.append(_item_aggs.to_dict())
|
|
173
179
|
_dict['aggs'] = _items
|
|
180
|
+
# override the default output from pydantic by calling `to_dict()` of each item in tool_selections (list)
|
|
181
|
+
_items = []
|
|
182
|
+
if self.tool_selections:
|
|
183
|
+
for _item_tool_selections in self.tool_selections:
|
|
184
|
+
if _item_tool_selections:
|
|
185
|
+
_items.append(_item_tool_selections.to_dict())
|
|
186
|
+
_dict['tool_selections'] = _items
|
|
187
|
+
# override the default output from pydantic by calling `to_dict()` of each item in thinking_blocks (list)
|
|
188
|
+
_items = []
|
|
189
|
+
if self.thinking_blocks:
|
|
190
|
+
for _item_thinking_blocks in self.thinking_blocks:
|
|
191
|
+
if _item_thinking_blocks:
|
|
192
|
+
_items.append(_item_thinking_blocks.to_dict())
|
|
193
|
+
_dict['thinking_blocks'] = _items
|
|
194
|
+
# override the default output from pydantic by calling `to_dict()` of each item in websearch_sites (list)
|
|
195
|
+
_items = []
|
|
196
|
+
if self.websearch_sites:
|
|
197
|
+
for _item_websearch_sites in self.websearch_sites:
|
|
198
|
+
if _item_websearch_sites:
|
|
199
|
+
_items.append(_item_websearch_sites.to_dict())
|
|
200
|
+
_dict['websearch_sites'] = _items
|
|
174
201
|
return _dict
|
|
175
202
|
|
|
176
203
|
@classmethod
|
|
@@ -213,7 +240,10 @@ class SocketConversationMessage(BaseModel):
|
|
|
213
240
|
"synonyms_used": obj.get("synonyms_used"),
|
|
214
241
|
"tool_calls": obj.get("tool_calls"),
|
|
215
242
|
"tool_call_id": obj.get("tool_call_id"),
|
|
216
|
-
"tool_selections": obj.get("tool_selections"),
|
|
243
|
+
"tool_selections": [ToolSelection.from_dict(_item) for _item in obj["tool_selections"]] if obj.get("tool_selections") is not None else None,
|
|
244
|
+
"server_uids": obj.get("server_uids"),
|
|
245
|
+
"thinking_blocks": [ThinkingBlock.from_dict(_item) for _item in obj["thinking_blocks"]] if obj.get("thinking_blocks") is not None else None,
|
|
246
|
+
"websearch_sites": [WebsearchScrapingSite.from_dict(_item) for _item in obj["websearch_sites"]] if obj.get("websearch_sites") is not None else None,
|
|
217
247
|
"status": obj.get("status")
|
|
218
248
|
})
|
|
219
249
|
return _obj
|
|
@@ -26,11 +26,11 @@ class TemplateToggleRequest(BaseModel):
|
|
|
26
26
|
"""
|
|
27
27
|
TemplateToggleRequest
|
|
28
28
|
""" # noqa: E501
|
|
29
|
-
username: StrictStr = Field(description="Username associated with the dataset")
|
|
30
|
-
dataset: StrictStr = Field(description="Dataset identifier")
|
|
31
|
-
|
|
29
|
+
username: Optional[StrictStr] = Field(default=None, description="Username associated with the dataset")
|
|
30
|
+
dataset: Optional[StrictStr] = Field(default=None, description="Dataset identifier")
|
|
31
|
+
assistant_id: StrictInt = Field(description="Dataset ID (optional, for additional verification)")
|
|
32
32
|
publish: StrictBool = Field(description="Whether the assistant should be published as a template")
|
|
33
|
-
__properties: ClassVar[List[str]] = ["username", "dataset", "
|
|
33
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "assistant_id", "publish"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
36
36
|
populate_by_name=True,
|
|
@@ -85,7 +85,7 @@ class TemplateToggleRequest(BaseModel):
|
|
|
85
85
|
_obj = cls.model_validate({
|
|
86
86
|
"username": obj.get("username"),
|
|
87
87
|
"dataset": obj.get("dataset"),
|
|
88
|
-
"
|
|
88
|
+
"assistant_id": obj.get("assistant_id"),
|
|
89
89
|
"publish": obj.get("publish")
|
|
90
90
|
})
|
|
91
91
|
return _obj
|
|
@@ -52,10 +52,12 @@ class Text2SparqlPayload(BaseModel):
|
|
|
52
52
|
index_hashes: Optional[List[Dict[str, Any]]] = Field(default=None, description="The hashes of the indexes to be used for the response.")
|
|
53
53
|
apply_map_reduce: Optional[StrictBool] = Field(default=None, description="Determines whether to apply map-reduce strategy for the response.")
|
|
54
54
|
conversation_has_clip: Optional[StrictBool] = Field(default=None, description="Indicates whether the conversation has a clip associated with it.")
|
|
55
|
+
incognito: Optional[StrictBool] = Field(default=None, description="When true, the conversation is stored only in Redis with a TTL, is not retrievable via list/get, and will be purged automatically.")
|
|
55
56
|
current_time: Optional[StrictStr] = Field(default=None, description="The current time to be used in the prompt, if applicable.")
|
|
56
57
|
tool_selections: Optional[List[ToolSelection]] = Field(default=None, description="The selections of the MCP tools to be used.")
|
|
58
|
+
expanded_question: Optional[StrictStr] = Field(default=None, description="The expanded version of the original question, if applicable.")
|
|
57
59
|
validate_sparql: Optional[StrictBool] = None
|
|
58
|
-
__properties: ClassVar[List[str]] = ["question", "username", "dataset", "organizationId", "image_urls", "parent_message_id", "conversation_id", "is_regenerate", "origin", "text_fragmentation", "interface_origin", "system_prompt", "prompt", "additional_fields", "bypass_guardrail", "talk_to_web", "original_question", "oauth_token", "auto_filters", "filters", "exclude_filters", "index_hashes", "apply_map_reduce", "conversation_has_clip", "current_time", "tool_selections", "validate_sparql"]
|
|
60
|
+
__properties: ClassVar[List[str]] = ["question", "username", "dataset", "organizationId", "image_urls", "parent_message_id", "conversation_id", "is_regenerate", "origin", "text_fragmentation", "interface_origin", "system_prompt", "prompt", "additional_fields", "bypass_guardrail", "talk_to_web", "original_question", "oauth_token", "auto_filters", "filters", "exclude_filters", "index_hashes", "apply_map_reduce", "conversation_has_clip", "incognito", "current_time", "tool_selections", "expanded_question", "validate_sparql"]
|
|
59
61
|
|
|
60
62
|
@field_validator('interface_origin')
|
|
61
63
|
def interface_origin_validate_enum(cls, value):
|
|
@@ -173,8 +175,10 @@ class Text2SparqlPayload(BaseModel):
|
|
|
173
175
|
"index_hashes": obj.get("index_hashes"),
|
|
174
176
|
"apply_map_reduce": obj.get("apply_map_reduce"),
|
|
175
177
|
"conversation_has_clip": obj.get("conversation_has_clip"),
|
|
178
|
+
"incognito": obj.get("incognito"),
|
|
176
179
|
"current_time": obj.get("current_time"),
|
|
177
180
|
"tool_selections": [ToolSelection.from_dict(_item) for _item in obj["tool_selections"]] if obj.get("tool_selections") is not None else None,
|
|
181
|
+
"expanded_question": obj.get("expanded_question"),
|
|
178
182
|
"validate_sparql": obj.get("validate_sparql")
|
|
179
183
|
})
|
|
180
184
|
return _obj
|
|
@@ -0,0 +1,91 @@
|
|
|
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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ThinkingBlock(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ThinkingBlock
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
type: StrictStr
|
|
30
|
+
thinking: StrictStr
|
|
31
|
+
signature: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["type", "thinking", "signature"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of ThinkingBlock from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of ThinkingBlock from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"type": obj.get("type"),
|
|
86
|
+
"thinking": obj.get("thinking"),
|
|
87
|
+
"signature": obj.get("signature")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -17,19 +17,19 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class UpdateCellsPayload(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
UpdateCellsPayload
|
|
28
28
|
""" # noqa: E501
|
|
29
|
-
|
|
29
|
+
id: Optional[StrictInt] = None
|
|
30
30
|
value: Optional[StrictStr] = None
|
|
31
|
-
|
|
32
|
-
__properties: ClassVar[List[str]] = ["
|
|
31
|
+
prompt: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["id", "value", "prompt"]
|
|
33
33
|
|
|
34
34
|
model_config = ConfigDict(
|
|
35
35
|
populate_by_name=True,
|
|
@@ -49,7 +49,7 @@ class SubjectModel(BaseModel):
|
|
|
49
49
|
|
|
50
50
|
@classmethod
|
|
51
51
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of
|
|
52
|
+
"""Create an instance of UpdateCellsPayload from a JSON string"""
|
|
53
53
|
return cls.from_dict(json.loads(json_str))
|
|
54
54
|
|
|
55
55
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -74,7 +74,7 @@ class SubjectModel(BaseModel):
|
|
|
74
74
|
|
|
75
75
|
@classmethod
|
|
76
76
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of
|
|
77
|
+
"""Create an instance of UpdateCellsPayload from a dict"""
|
|
78
78
|
if obj is None:
|
|
79
79
|
return None
|
|
80
80
|
|
|
@@ -82,9 +82,9 @@ class SubjectModel(BaseModel):
|
|
|
82
82
|
return cls.model_validate(obj)
|
|
83
83
|
|
|
84
84
|
_obj = cls.model_validate({
|
|
85
|
-
"
|
|
85
|
+
"id": obj.get("id"),
|
|
86
86
|
"value": obj.get("value"),
|
|
87
|
-
"
|
|
87
|
+
"prompt": obj.get("prompt")
|
|
88
88
|
})
|
|
89
89
|
return _obj
|
|
90
90
|
|
|
@@ -17,20 +17,20 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from qanswer_sdk.models.
|
|
23
|
-
from qanswer_sdk.models.subject_model import SubjectModel
|
|
22
|
+
from qanswer_sdk.models.es_meta_data_value import ESMetaDataValue
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
27
|
-
class
|
|
26
|
+
class UpdateFileESMetaData(BaseModel):
|
|
28
27
|
"""
|
|
29
|
-
|
|
28
|
+
UpdateFileESMetaData
|
|
30
29
|
""" # noqa: E501
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
additional_fields: Dict[str, ESMetaDataValue]
|
|
31
|
+
metadata: Dict[str, ESMetaDataValue]
|
|
32
|
+
file_id: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["additional_fields", "metadata", "file_id"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
36
36
|
populate_by_name=True,
|
|
@@ -50,7 +50,7 @@ class RelationExtractionConfiguration(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
@classmethod
|
|
52
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of UpdateFileESMetaData from a JSON string"""
|
|
54
54
|
return cls.from_dict(json.loads(json_str))
|
|
55
55
|
|
|
56
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,25 +71,25 @@ class RelationExtractionConfiguration(BaseModel):
|
|
|
71
71
|
exclude=excluded_fields,
|
|
72
72
|
exclude_none=True,
|
|
73
73
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of each
|
|
75
|
-
|
|
76
|
-
if self.
|
|
77
|
-
for
|
|
78
|
-
if
|
|
79
|
-
|
|
80
|
-
_dict['
|
|
81
|
-
# override the default output from pydantic by calling `to_dict()` of each
|
|
82
|
-
|
|
83
|
-
if self.
|
|
84
|
-
for
|
|
85
|
-
if
|
|
86
|
-
|
|
87
|
-
_dict['
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each value in additional_fields (dict)
|
|
75
|
+
_field_dict = {}
|
|
76
|
+
if self.additional_fields:
|
|
77
|
+
for _key_additional_fields in self.additional_fields:
|
|
78
|
+
if self.additional_fields[_key_additional_fields]:
|
|
79
|
+
_field_dict[_key_additional_fields] = self.additional_fields[_key_additional_fields].to_dict()
|
|
80
|
+
_dict['additional_fields'] = _field_dict
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
|
|
82
|
+
_field_dict = {}
|
|
83
|
+
if self.metadata:
|
|
84
|
+
for _key_metadata in self.metadata:
|
|
85
|
+
if self.metadata[_key_metadata]:
|
|
86
|
+
_field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
|
|
87
|
+
_dict['metadata'] = _field_dict
|
|
88
88
|
return _dict
|
|
89
89
|
|
|
90
90
|
@classmethod
|
|
91
91
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
-
"""Create an instance of
|
|
92
|
+
"""Create an instance of UpdateFileESMetaData from a dict"""
|
|
93
93
|
if obj is None:
|
|
94
94
|
return None
|
|
95
95
|
|
|
@@ -97,8 +97,19 @@ class RelationExtractionConfiguration(BaseModel):
|
|
|
97
97
|
return cls.model_validate(obj)
|
|
98
98
|
|
|
99
99
|
_obj = cls.model_validate({
|
|
100
|
-
"
|
|
101
|
-
|
|
100
|
+
"additional_fields": dict(
|
|
101
|
+
(_k, ESMetaDataValue.from_dict(_v))
|
|
102
|
+
for _k, _v in obj["additional_fields"].items()
|
|
103
|
+
)
|
|
104
|
+
if obj.get("additional_fields") is not None
|
|
105
|
+
else None,
|
|
106
|
+
"metadata": dict(
|
|
107
|
+
(_k, ESMetaDataValue.from_dict(_v))
|
|
108
|
+
for _k, _v in obj["metadata"].items()
|
|
109
|
+
)
|
|
110
|
+
if obj.get("metadata") is not None
|
|
111
|
+
else None,
|
|
112
|
+
"file_id": obj.get("file_id")
|
|
102
113
|
})
|
|
103
114
|
return _obj
|
|
104
115
|
|
|
@@ -19,17 +19,17 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from qanswer_sdk.models.
|
|
22
|
+
from qanswer_sdk.models.update_file_es_meta_data import UpdateFileESMetaData
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class UpdateMetadataModelInput(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
UpdateMetadataModelInput
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
username: StrictStr
|
|
31
31
|
dataset: StrictStr
|
|
32
|
-
data:
|
|
32
|
+
data: UpdateFileESMetaData
|
|
33
33
|
conversation_id: Optional[StrictStr] = None
|
|
34
34
|
__properties: ClassVar[List[str]] = ["username", "dataset", "data", "conversation_id"]
|
|
35
35
|
|
|
@@ -51,7 +51,7 @@ class UpdateMetadataModel(BaseModel):
|
|
|
51
51
|
|
|
52
52
|
@classmethod
|
|
53
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of
|
|
54
|
+
"""Create an instance of UpdateMetadataModelInput from a JSON string"""
|
|
55
55
|
return cls.from_dict(json.loads(json_str))
|
|
56
56
|
|
|
57
57
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -79,7 +79,7 @@ class UpdateMetadataModel(BaseModel):
|
|
|
79
79
|
|
|
80
80
|
@classmethod
|
|
81
81
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
-
"""Create an instance of
|
|
82
|
+
"""Create an instance of UpdateMetadataModelInput from a dict"""
|
|
83
83
|
if obj is None:
|
|
84
84
|
return None
|
|
85
85
|
|
|
@@ -89,7 +89,7 @@ class UpdateMetadataModel(BaseModel):
|
|
|
89
89
|
_obj = cls.model_validate({
|
|
90
90
|
"username": obj.get("username"),
|
|
91
91
|
"dataset": obj.get("dataset"),
|
|
92
|
-
"data":
|
|
92
|
+
"data": UpdateFileESMetaData.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
|
93
93
|
"conversation_id": obj.get("conversation_id")
|
|
94
94
|
})
|
|
95
95
|
return _obj
|
|
@@ -18,19 +18,20 @@ 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
|
|
22
|
-
from qanswer_sdk.models.
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from qanswer_sdk.models.update_file_es_meta_data import UpdateFileESMetaData
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class UpdateMetadataModelOutput(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
UpdateMetadataModelOutput
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
username: StrictStr
|
|
31
31
|
dataset: StrictStr
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
data: UpdateFileESMetaData
|
|
33
|
+
conversation_id: Optional[StrictStr] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "data", "conversation_id"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
37
|
populate_by_name=True,
|
|
@@ -50,7 +51,7 @@ class RelationExtractionTaskSettingsUpdatePayload(BaseModel):
|
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
54
|
+
"""Create an instance of UpdateMetadataModelOutput from a JSON string"""
|
|
54
55
|
return cls.from_dict(json.loads(json_str))
|
|
55
56
|
|
|
56
57
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,14 +72,14 @@ class RelationExtractionTaskSettingsUpdatePayload(BaseModel):
|
|
|
71
72
|
exclude=excluded_fields,
|
|
72
73
|
exclude_none=True,
|
|
73
74
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
75
|
-
if self.
|
|
76
|
-
_dict['
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
76
|
+
if self.data:
|
|
77
|
+
_dict['data'] = self.data.to_dict()
|
|
77
78
|
return _dict
|
|
78
79
|
|
|
79
80
|
@classmethod
|
|
80
81
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of
|
|
82
|
+
"""Create an instance of UpdateMetadataModelOutput from a dict"""
|
|
82
83
|
if obj is None:
|
|
83
84
|
return None
|
|
84
85
|
|
|
@@ -88,7 +89,8 @@ class RelationExtractionTaskSettingsUpdatePayload(BaseModel):
|
|
|
88
89
|
_obj = cls.model_validate({
|
|
89
90
|
"username": obj.get("username"),
|
|
90
91
|
"dataset": obj.get("dataset"),
|
|
91
|
-
"
|
|
92
|
+
"data": UpdateFileESMetaData.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
|
93
|
+
"conversation_id": obj.get("conversation_id")
|
|
92
94
|
})
|
|
93
95
|
return _obj
|
|
94
96
|
|
|
@@ -34,7 +34,8 @@ class UpdateQnAPairRequest(BaseModel):
|
|
|
34
34
|
answer: StrictStr
|
|
35
35
|
source: Optional[StrictStr] = None
|
|
36
36
|
source_type: Optional[StrictStr] = None
|
|
37
|
-
|
|
37
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "connector_id", "file_id", "question", "answer", "source", "source_type", "additional_fields"]
|
|
38
39
|
|
|
39
40
|
model_config = ConfigDict(
|
|
40
41
|
populate_by_name=True,
|
|
@@ -94,7 +95,8 @@ class UpdateQnAPairRequest(BaseModel):
|
|
|
94
95
|
"question": obj.get("question"),
|
|
95
96
|
"answer": obj.get("answer"),
|
|
96
97
|
"source": obj.get("source"),
|
|
97
|
-
"source_type": obj.get("source_type")
|
|
98
|
+
"source_type": obj.get("source_type"),
|
|
99
|
+
"additional_fields": obj.get("additional_fields")
|
|
98
100
|
})
|
|
99
101
|
return _obj
|
|
100
102
|
|
qanswer_sdk/models/{relation_extraction_template_payload.py → update_template_cells_payload.py}
RENAMED
|
@@ -17,21 +17,21 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from qanswer_sdk.models.
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from qanswer_sdk.models.update_cells_payload import UpdateCellsPayload
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class UpdateTemplateCellsPayload(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
UpdateTemplateCellsPayload
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
username: StrictStr
|
|
31
31
|
dataset: StrictStr
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["username", "dataset", "
|
|
32
|
+
template_id: StrictInt
|
|
33
|
+
cells: List[UpdateCellsPayload]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "template_id", "cells"]
|
|
35
35
|
|
|
36
36
|
model_config = ConfigDict(
|
|
37
37
|
populate_by_name=True,
|
|
@@ -51,7 +51,7 @@ class RelationExtractionTemplatePayload(BaseModel):
|
|
|
51
51
|
|
|
52
52
|
@classmethod
|
|
53
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of
|
|
54
|
+
"""Create an instance of UpdateTemplateCellsPayload from a JSON string"""
|
|
55
55
|
return cls.from_dict(json.loads(json_str))
|
|
56
56
|
|
|
57
57
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -72,14 +72,18 @@ class RelationExtractionTemplatePayload(BaseModel):
|
|
|
72
72
|
exclude=excluded_fields,
|
|
73
73
|
exclude_none=True,
|
|
74
74
|
)
|
|
75
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in cells (list)
|
|
76
|
+
_items = []
|
|
77
|
+
if self.cells:
|
|
78
|
+
for _item_cells in self.cells:
|
|
79
|
+
if _item_cells:
|
|
80
|
+
_items.append(_item_cells.to_dict())
|
|
81
|
+
_dict['cells'] = _items
|
|
78
82
|
return _dict
|
|
79
83
|
|
|
80
84
|
@classmethod
|
|
81
85
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
-
"""Create an instance of
|
|
86
|
+
"""Create an instance of UpdateTemplateCellsPayload from a dict"""
|
|
83
87
|
if obj is None:
|
|
84
88
|
return None
|
|
85
89
|
|
|
@@ -89,8 +93,8 @@ class RelationExtractionTemplatePayload(BaseModel):
|
|
|
89
93
|
_obj = cls.model_validate({
|
|
90
94
|
"username": obj.get("username"),
|
|
91
95
|
"dataset": obj.get("dataset"),
|
|
92
|
-
"
|
|
93
|
-
"
|
|
96
|
+
"template_id": obj.get("template_id"),
|
|
97
|
+
"cells": [UpdateCellsPayload.from_dict(_item) for _item in obj["cells"]] if obj.get("cells") is not None else None
|
|
94
98
|
})
|
|
95
99
|
return _obj
|
|
96
100
|
|