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
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from qanswer_sdk.models.es_meta_data import ESMetaData
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -26,9 +27,10 @@ class FileESMetaData(BaseModel):
|
|
|
26
27
|
"""
|
|
27
28
|
FileESMetaData
|
|
28
29
|
""" # noqa: E501
|
|
29
|
-
additional_fields: Dict[str,
|
|
30
|
+
additional_fields: Dict[str, ESMetaData]
|
|
30
31
|
file_id: StrictStr
|
|
31
|
-
|
|
32
|
+
metadata: Dict[str, ESMetaData]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["additional_fields", "file_id", "metadata"]
|
|
32
34
|
|
|
33
35
|
model_config = ConfigDict(
|
|
34
36
|
populate_by_name=True,
|
|
@@ -69,6 +71,20 @@ class FileESMetaData(BaseModel):
|
|
|
69
71
|
exclude=excluded_fields,
|
|
70
72
|
exclude_none=True,
|
|
71
73
|
)
|
|
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
|
|
72
88
|
return _dict
|
|
73
89
|
|
|
74
90
|
@classmethod
|
|
@@ -81,8 +97,19 @@ class FileESMetaData(BaseModel):
|
|
|
81
97
|
return cls.model_validate(obj)
|
|
82
98
|
|
|
83
99
|
_obj = cls.model_validate({
|
|
84
|
-
"additional_fields":
|
|
85
|
-
|
|
100
|
+
"additional_fields": dict(
|
|
101
|
+
(_k, ESMetaData.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
|
+
"file_id": obj.get("file_id"),
|
|
107
|
+
"metadata": dict(
|
|
108
|
+
(_k, ESMetaData.from_dict(_v))
|
|
109
|
+
for _k, _v in obj["metadata"].items()
|
|
110
|
+
)
|
|
111
|
+
if obj.get("metadata") is not None
|
|
112
|
+
else None
|
|
86
113
|
})
|
|
87
114
|
return _obj
|
|
88
115
|
|
|
@@ -32,8 +32,9 @@ class GDriveDownloadRequest(BaseModel):
|
|
|
32
32
|
account_id: Optional[StrictStr] = None
|
|
33
33
|
connector_id: StrictInt
|
|
34
34
|
quota: Optional[StrictInt] = Field(default=None, description="Quota of the user")
|
|
35
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
35
36
|
ids: GDriveDownloadByIds
|
|
36
|
-
__properties: ClassVar[List[str]] = ["username", "dataset", "account_id", "connector_id", "quota", "ids"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "account_id", "connector_id", "quota", "additional_fields", "ids"]
|
|
37
38
|
|
|
38
39
|
model_config = ConfigDict(
|
|
39
40
|
populate_by_name=True,
|
|
@@ -94,6 +95,7 @@ class GDriveDownloadRequest(BaseModel):
|
|
|
94
95
|
"account_id": obj.get("account_id"),
|
|
95
96
|
"connector_id": obj.get("connector_id"),
|
|
96
97
|
"quota": obj.get("quota"),
|
|
98
|
+
"additional_fields": obj.get("additional_fields"),
|
|
97
99
|
"ids": GDriveDownloadByIds.from_dict(obj["ids"]) if obj.get("ids") is not None else None
|
|
98
100
|
})
|
|
99
101
|
return _obj
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
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
|
|
|
@@ -30,7 +30,8 @@ class GenerateAICellsPayload(BaseModel):
|
|
|
30
30
|
dataset: StrictStr
|
|
31
31
|
template_id: StrictInt
|
|
32
32
|
cells: List[StrictInt]
|
|
33
|
-
|
|
33
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "template_id", "cells", "additional_fields"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
37
|
populate_by_name=True,
|
|
@@ -86,7 +87,8 @@ class GenerateAICellsPayload(BaseModel):
|
|
|
86
87
|
"username": obj.get("username"),
|
|
87
88
|
"dataset": obj.get("dataset"),
|
|
88
89
|
"template_id": obj.get("template_id"),
|
|
89
|
-
"cells": obj.get("cells")
|
|
90
|
+
"cells": obj.get("cells"),
|
|
91
|
+
"additional_fields": obj.get("additional_fields")
|
|
90
92
|
})
|
|
91
93
|
return _obj
|
|
92
94
|
|
|
@@ -32,7 +32,8 @@ class HighlightAudioPayloadModel(BaseModel):
|
|
|
32
32
|
file_id: StrictStr
|
|
33
33
|
references: Optional[ReferenceModel] = None
|
|
34
34
|
task_name: Optional[StrictStr] = None
|
|
35
|
-
|
|
35
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "file_id", "references", "task_name", "additional_fields"]
|
|
36
37
|
|
|
37
38
|
@field_validator('task_name')
|
|
38
39
|
def task_name_validate_enum(cls, value):
|
|
@@ -40,8 +41,8 @@ class HighlightAudioPayloadModel(BaseModel):
|
|
|
40
41
|
if value is None:
|
|
41
42
|
return value
|
|
42
43
|
|
|
43
|
-
if value not in set(['search', 'chat', '
|
|
44
|
-
raise ValueError("must be one of enum values ('search', 'chat', '
|
|
44
|
+
if value not in set(['search', 'chat', 'ai_excel', 'report_copilot', 'text2sparql', 'sparql2text', 'chatbot']):
|
|
45
|
+
raise ValueError("must be one of enum values ('search', 'chat', 'ai_excel', 'report_copilot', 'text2sparql', 'sparql2text', 'chatbot')")
|
|
45
46
|
return value
|
|
46
47
|
|
|
47
48
|
model_config = ConfigDict(
|
|
@@ -102,7 +103,8 @@ class HighlightAudioPayloadModel(BaseModel):
|
|
|
102
103
|
"dataset": obj.get("dataset"),
|
|
103
104
|
"file_id": obj.get("file_id"),
|
|
104
105
|
"references": ReferenceModel.from_dict(obj["references"]) if obj.get("references") is not None else None,
|
|
105
|
-
"task_name": obj.get("task_name")
|
|
106
|
+
"task_name": obj.get("task_name"),
|
|
107
|
+
"additional_fields": obj.get("additional_fields")
|
|
106
108
|
})
|
|
107
109
|
return _obj
|
|
108
110
|
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from qanswer_sdk.models.imap_file_metadata import ImapFileMetadata
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
@@ -31,8 +31,9 @@ class ImapAddPayload(BaseModel):
|
|
|
31
31
|
dataset: StrictStr
|
|
32
32
|
connector_id: StrictInt
|
|
33
33
|
quota: StrictInt
|
|
34
|
+
additional_fields: Optional[Dict[str, Any]] = None
|
|
34
35
|
files: List[ImapFileMetadata]
|
|
35
|
-
__properties: ClassVar[List[str]] = ["username", "dataset", "connector_id", "quota", "files"]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["username", "dataset", "connector_id", "quota", "additional_fields", "files"]
|
|
36
37
|
|
|
37
38
|
model_config = ConfigDict(
|
|
38
39
|
populate_by_name=True,
|
|
@@ -96,6 +97,7 @@ class ImapAddPayload(BaseModel):
|
|
|
96
97
|
"dataset": obj.get("dataset"),
|
|
97
98
|
"connector_id": obj.get("connector_id"),
|
|
98
99
|
"quota": obj.get("quota"),
|
|
100
|
+
"additional_fields": obj.get("additional_fields"),
|
|
99
101
|
"files": [ImapFileMetadata.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None
|
|
100
102
|
})
|
|
101
103
|
return _obj
|
|
@@ -33,8 +33,8 @@ class ListSocketEvents(BaseModel):
|
|
|
33
33
|
def connectors_validate_enum(cls, value):
|
|
34
34
|
"""Validates the enum"""
|
|
35
35
|
for i in value:
|
|
36
|
-
if i not in set(['join_dataset', 'join_conversation', 'stop_conversation', 'chat', 'transcribe', 'connector_indexing', 'data_extraction', 'ai_cell_generation', 'report_copilot_continuation', 'report_copilot_generation_from_slots', 'report_copilot_generation_from_template', 'report_copilot_refinement']):
|
|
37
|
-
raise ValueError("each list item must be one of ('join_dataset', 'join_conversation', 'stop_conversation', 'chat', 'transcribe', 'connector_indexing', 'data_extraction', 'ai_cell_generation', 'report_copilot_continuation', 'report_copilot_generation_from_slots', 'report_copilot_generation_from_template', 'report_copilot_refinement')")
|
|
36
|
+
if i not in set(['join_dataset', 'join_conversation', 'stop_conversation', 'chat', 'transcribe', 'connector_indexing', 'websearch_scraping', 'data_extraction', 'ai_cell_generation', 'report_copilot_continuation', 'report_copilot_generation_from_slots', 'report_copilot_generation_from_template', 'report_copilot_refinement']):
|
|
37
|
+
raise ValueError("each list item must be one of ('join_dataset', 'join_conversation', 'stop_conversation', 'chat', 'transcribe', 'connector_indexing', 'websearch_scraping', 'data_extraction', 'ai_cell_generation', 'report_copilot_continuation', 'report_copilot_generation_from_slots', 'report_copilot_generation_from_template', 'report_copilot_refinement')")
|
|
38
38
|
return value
|
|
39
39
|
|
|
40
40
|
model_config = ConfigDict(
|
|
@@ -45,8 +45,8 @@ class LlmConsumption(BaseModel):
|
|
|
45
45
|
if value is None:
|
|
46
46
|
return value
|
|
47
47
|
|
|
48
|
-
if value not in set(['query-expansion', 'response-audit', 'title-generation', 'chat', 'sparql2text', 'guardrail', 'jailbreak', 'human-take-over', 'auto-es-filters-generation', 'question-suggestion', 'language-detection', 'advanced-classification', 'advanced-classification-v2', 'highlight', 'tool-choice', 'pdf-vision-conversion', 'map-reduce-map', 'map-reduce-reduce', 'shorten-instruction', 'auto-bot-description', 'openai-chat-completion', 'mcp-assistant-router', 'mcp-multi-turn-execution', 'mcp-progress-message-generation', 'mcp-progress-tool-bullet-point-generation', 'unknown']):
|
|
49
|
-
raise ValueError("must be one of enum values ('query-expansion', 'response-audit', 'title-generation', 'chat', 'sparql2text', 'guardrail', 'jailbreak', 'human-take-over', 'auto-es-filters-generation', 'question-suggestion', 'language-detection', 'advanced-classification', 'advanced-classification-v2', 'highlight', 'tool-choice', 'pdf-vision-conversion', 'map-reduce-map', 'map-reduce-reduce', 'shorten-instruction', 'auto-bot-description', 'openai-chat-completion', 'mcp-assistant-router', 'mcp-multi-turn-execution', 'mcp-progress-message-generation', 'mcp-progress-tool-bullet-point-generation', 'unknown')")
|
|
48
|
+
if value not in set(['query-expansion', 'response-audit', 'title-generation', 'chat', 'sparql2text', 'guardrail', 'jailbreak', 'human-take-over', 'auto-es-filters-generation', 'question-suggestion', 'language-detection', 'advanced-classification', 'advanced-classification-v2', 'highlight', 'tool-choice', 'pdf-vision-conversion', 'map-reduce-map', 'map-reduce-reduce', 'shorten-instruction', 'websearch-selection', 'auto-bot-description', 'openai-chat-completion', 'mcp-assistant-router', 'mcp-multi-turn-execution', 'mcp-progress-message-generation', 'mcp-progress-tool-bullet-point-generation', 'unknown']):
|
|
49
|
+
raise ValueError("must be one of enum values ('query-expansion', 'response-audit', 'title-generation', 'chat', 'sparql2text', 'guardrail', 'jailbreak', 'human-take-over', 'auto-es-filters-generation', 'question-suggestion', 'language-detection', 'advanced-classification', 'advanced-classification-v2', 'highlight', 'tool-choice', 'pdf-vision-conversion', 'map-reduce-map', 'map-reduce-reduce', 'shorten-instruction', 'websearch-selection', 'auto-bot-description', 'openai-chat-completion', 'mcp-assistant-router', 'mcp-multi-turn-execution', 'mcp-progress-message-generation', 'mcp-progress-tool-bullet-point-generation', 'unknown')")
|
|
50
50
|
return value
|
|
51
51
|
|
|
52
52
|
model_config = ConfigDict(
|
|
@@ -44,10 +44,16 @@ class LlmCreateDto(BaseModel):
|
|
|
44
44
|
guardrail: Optional[GuardrailEndpoint] = None
|
|
45
45
|
retry_params: Optional[RetryParams] = None
|
|
46
46
|
extra_body: Optional[ExtraBody] = None
|
|
47
|
+
vertex_location: Optional[StrictStr] = None
|
|
48
|
+
vertex_credentials: Optional[StrictStr] = None
|
|
47
49
|
tags: Optional[List[StrictStr]] = None
|
|
48
50
|
tool_call_support: Optional[StrictBool] = None
|
|
49
51
|
temperature_support: Optional[StrictBool] = None
|
|
50
52
|
stream_options_support: Optional[StrictBool] = None
|
|
53
|
+
content_items_support: Optional[StrictBool] = None
|
|
54
|
+
reasoning_effort: Optional[StrictStr] = None
|
|
55
|
+
websearch_support: Optional[StrictBool] = None
|
|
56
|
+
skip_ssl_verification: Optional[StrictBool] = None
|
|
51
57
|
display_name: StrictStr
|
|
52
58
|
engine: StrictStr
|
|
53
59
|
api_key: StrictStr
|
|
@@ -57,7 +63,7 @@ class LlmCreateDto(BaseModel):
|
|
|
57
63
|
name: StrictStr
|
|
58
64
|
cost_input_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costInputPerMillionToken")
|
|
59
65
|
cost_output_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costOutputPerMillionToken")
|
|
60
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "tags", "tool_call_support", "temperature_support", "stream_options_support", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "costInputPerMillionToken", "costOutputPerMillionToken"]
|
|
66
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "vertex_location", "vertex_credentials", "tags", "tool_call_support", "temperature_support", "stream_options_support", "content_items_support", "reasoning_effort", "websearch_support", "skip_ssl_verification", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "costInputPerMillionToken", "costOutputPerMillionToken"]
|
|
61
67
|
|
|
62
68
|
@field_validator('modality')
|
|
63
69
|
def modality_validate_enum(cls, value):
|
|
@@ -75,8 +81,18 @@ class LlmCreateDto(BaseModel):
|
|
|
75
81
|
if value is None:
|
|
76
82
|
return value
|
|
77
83
|
|
|
78
|
-
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'ollama']):
|
|
79
|
-
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'ollama')")
|
|
84
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai']):
|
|
85
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai')")
|
|
86
|
+
return value
|
|
87
|
+
|
|
88
|
+
@field_validator('reasoning_effort')
|
|
89
|
+
def reasoning_effort_validate_enum(cls, value):
|
|
90
|
+
"""Validates the enum"""
|
|
91
|
+
if value is None:
|
|
92
|
+
return value
|
|
93
|
+
|
|
94
|
+
if value not in set(['none', 'low', 'medium', 'high']):
|
|
95
|
+
raise ValueError("must be one of enum values ('none', 'low', 'medium', 'high')")
|
|
80
96
|
return value
|
|
81
97
|
|
|
82
98
|
model_config = ConfigDict(
|
|
@@ -158,10 +174,16 @@ class LlmCreateDto(BaseModel):
|
|
|
158
174
|
"guardrail": GuardrailEndpoint.from_dict(obj["guardrail"]) if obj.get("guardrail") is not None else None,
|
|
159
175
|
"retry_params": RetryParams.from_dict(obj["retry_params"]) if obj.get("retry_params") is not None else None,
|
|
160
176
|
"extra_body": ExtraBody.from_dict(obj["extra_body"]) if obj.get("extra_body") is not None else None,
|
|
177
|
+
"vertex_location": obj.get("vertex_location"),
|
|
178
|
+
"vertex_credentials": obj.get("vertex_credentials"),
|
|
161
179
|
"tags": obj.get("tags"),
|
|
162
180
|
"tool_call_support": obj.get("tool_call_support"),
|
|
163
181
|
"temperature_support": obj.get("temperature_support"),
|
|
164
182
|
"stream_options_support": obj.get("stream_options_support"),
|
|
183
|
+
"content_items_support": obj.get("content_items_support"),
|
|
184
|
+
"reasoning_effort": obj.get("reasoning_effort"),
|
|
185
|
+
"websearch_support": obj.get("websearch_support"),
|
|
186
|
+
"skip_ssl_verification": obj.get("skip_ssl_verification"),
|
|
165
187
|
"display_name": obj.get("display_name"),
|
|
166
188
|
"engine": obj.get("engine"),
|
|
167
189
|
"api_key": obj.get("api_key"),
|
|
@@ -45,10 +45,16 @@ class LlmDetailedDto(BaseModel):
|
|
|
45
45
|
guardrail: Optional[GuardrailEndpoint] = None
|
|
46
46
|
retry_params: Optional[RetryParams] = None
|
|
47
47
|
extra_body: Optional[ExtraBody] = None
|
|
48
|
+
vertex_location: Optional[StrictStr] = None
|
|
49
|
+
vertex_credentials: Optional[StrictStr] = None
|
|
48
50
|
tags: Optional[List[StrictStr]] = None
|
|
49
51
|
tool_call_support: Optional[StrictBool] = None
|
|
50
52
|
temperature_support: Optional[StrictBool] = None
|
|
51
53
|
stream_options_support: Optional[StrictBool] = None
|
|
54
|
+
content_items_support: Optional[StrictBool] = None
|
|
55
|
+
reasoning_effort: Optional[StrictStr] = None
|
|
56
|
+
websearch_support: Optional[StrictBool] = None
|
|
57
|
+
skip_ssl_verification: Optional[StrictBool] = None
|
|
52
58
|
display_name: StrictStr
|
|
53
59
|
engine: StrictStr
|
|
54
60
|
api_key: StrictStr
|
|
@@ -61,7 +67,9 @@ class LlmDetailedDto(BaseModel):
|
|
|
61
67
|
cost_input_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costInputPerMillionToken")
|
|
62
68
|
cost_output_per_million_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costOutputPerMillionToken")
|
|
63
69
|
active: Optional[StrictBool] = None
|
|
64
|
-
|
|
70
|
+
is_system_default: Optional[StrictBool] = Field(default=None, alias="isSystemDefault")
|
|
71
|
+
is_organization_default: Optional[StrictBool] = Field(default=None, alias="isOrganizationDefault")
|
|
72
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "vertex_location", "vertex_credentials", "tags", "tool_call_support", "temperature_support", "stream_options_support", "content_items_support", "reasoning_effort", "websearch_support", "skip_ssl_verification", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges", "costInputPerMillionToken", "costOutputPerMillionToken", "active", "isSystemDefault", "isOrganizationDefault"]
|
|
65
73
|
|
|
66
74
|
@field_validator('modality')
|
|
67
75
|
def modality_validate_enum(cls, value):
|
|
@@ -79,8 +87,18 @@ class LlmDetailedDto(BaseModel):
|
|
|
79
87
|
if value is None:
|
|
80
88
|
return value
|
|
81
89
|
|
|
82
|
-
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'ollama']):
|
|
83
|
-
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'ollama')")
|
|
90
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai']):
|
|
91
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai')")
|
|
92
|
+
return value
|
|
93
|
+
|
|
94
|
+
@field_validator('reasoning_effort')
|
|
95
|
+
def reasoning_effort_validate_enum(cls, value):
|
|
96
|
+
"""Validates the enum"""
|
|
97
|
+
if value is None:
|
|
98
|
+
return value
|
|
99
|
+
|
|
100
|
+
if value not in set(['none', 'low', 'medium', 'high']):
|
|
101
|
+
raise ValueError("must be one of enum values ('none', 'low', 'medium', 'high')")
|
|
84
102
|
return value
|
|
85
103
|
|
|
86
104
|
model_config = ConfigDict(
|
|
@@ -165,10 +183,16 @@ class LlmDetailedDto(BaseModel):
|
|
|
165
183
|
"guardrail": GuardrailEndpoint.from_dict(obj["guardrail"]) if obj.get("guardrail") is not None else None,
|
|
166
184
|
"retry_params": RetryParams.from_dict(obj["retry_params"]) if obj.get("retry_params") is not None else None,
|
|
167
185
|
"extra_body": ExtraBody.from_dict(obj["extra_body"]) if obj.get("extra_body") is not None else None,
|
|
186
|
+
"vertex_location": obj.get("vertex_location"),
|
|
187
|
+
"vertex_credentials": obj.get("vertex_credentials"),
|
|
168
188
|
"tags": obj.get("tags"),
|
|
169
189
|
"tool_call_support": obj.get("tool_call_support"),
|
|
170
190
|
"temperature_support": obj.get("temperature_support"),
|
|
171
191
|
"stream_options_support": obj.get("stream_options_support"),
|
|
192
|
+
"content_items_support": obj.get("content_items_support"),
|
|
193
|
+
"reasoning_effort": obj.get("reasoning_effort"),
|
|
194
|
+
"websearch_support": obj.get("websearch_support"),
|
|
195
|
+
"skip_ssl_verification": obj.get("skip_ssl_verification"),
|
|
172
196
|
"display_name": obj.get("display_name"),
|
|
173
197
|
"engine": obj.get("engine"),
|
|
174
198
|
"api_key": obj.get("api_key"),
|
|
@@ -180,7 +204,9 @@ class LlmDetailedDto(BaseModel):
|
|
|
180
204
|
"context_ranges": LLMContextRanges.from_dict(obj["context_ranges"]) if obj.get("context_ranges") is not None else None,
|
|
181
205
|
"costInputPerMillionToken": obj.get("costInputPerMillionToken"),
|
|
182
206
|
"costOutputPerMillionToken": obj.get("costOutputPerMillionToken"),
|
|
183
|
-
"active": obj.get("active")
|
|
207
|
+
"active": obj.get("active"),
|
|
208
|
+
"isSystemDefault": obj.get("isSystemDefault"),
|
|
209
|
+
"isOrganizationDefault": obj.get("isOrganizationDefault")
|
|
184
210
|
})
|
|
185
211
|
return _obj
|
|
186
212
|
|
qanswer_sdk/models/llm_dto.py
CHANGED
|
@@ -32,7 +32,10 @@ class LlmDto(BaseModel):
|
|
|
32
32
|
sensitivity_label: Optional[StrictStr] = Field(default=None, alias="sensitivityLabel")
|
|
33
33
|
onpremise: Optional[StrictBool] = None
|
|
34
34
|
modality: Optional[StrictStr] = None
|
|
35
|
-
|
|
35
|
+
tool_call_support: Optional[StrictBool] = Field(default=None, alias="toolCallSupport")
|
|
36
|
+
reasoning_effort: Optional[StrictStr] = Field(default=None, alias="reasoningEffort")
|
|
37
|
+
web_search_support: Optional[StrictBool] = Field(default=None, alias="webSearchSupport")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "name", "description", "sensitivityLabel", "onpremise", "modality", "toolCallSupport", "reasoningEffort", "webSearchSupport"]
|
|
36
39
|
|
|
37
40
|
@field_validator('modality')
|
|
38
41
|
def modality_validate_enum(cls, value):
|
|
@@ -44,6 +47,16 @@ class LlmDto(BaseModel):
|
|
|
44
47
|
raise ValueError("must be one of enum values ('text', 'text-image')")
|
|
45
48
|
return value
|
|
46
49
|
|
|
50
|
+
@field_validator('reasoning_effort')
|
|
51
|
+
def reasoning_effort_validate_enum(cls, value):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if value not in set(['none', 'low', 'medium', 'high']):
|
|
57
|
+
raise ValueError("must be one of enum values ('none', 'low', 'medium', 'high')")
|
|
58
|
+
return value
|
|
59
|
+
|
|
47
60
|
model_config = ConfigDict(
|
|
48
61
|
populate_by_name=True,
|
|
49
62
|
validate_assignment=True,
|
|
@@ -100,7 +113,10 @@ class LlmDto(BaseModel):
|
|
|
100
113
|
"description": obj.get("description"),
|
|
101
114
|
"sensitivityLabel": obj.get("sensitivityLabel"),
|
|
102
115
|
"onpremise": obj.get("onpremise"),
|
|
103
|
-
"modality": obj.get("modality")
|
|
116
|
+
"modality": obj.get("modality"),
|
|
117
|
+
"toolCallSupport": obj.get("toolCallSupport"),
|
|
118
|
+
"reasoningEffort": obj.get("reasoningEffort"),
|
|
119
|
+
"webSearchSupport": obj.get("webSearchSupport")
|
|
104
120
|
})
|
|
105
121
|
return _obj
|
|
106
122
|
|
|
@@ -45,10 +45,16 @@ class LLMEndpoint(BaseModel):
|
|
|
45
45
|
guardrail: Optional[GuardrailEndpoint] = None
|
|
46
46
|
retry_params: Optional[RetryParams] = None
|
|
47
47
|
extra_body: Optional[ExtraBody] = None
|
|
48
|
+
vertex_location: Optional[StrictStr] = None
|
|
49
|
+
vertex_credentials: Optional[StrictStr] = None
|
|
48
50
|
tags: Optional[List[StrictStr]] = None
|
|
49
51
|
tool_call_support: Optional[StrictBool] = None
|
|
50
52
|
temperature_support: Optional[StrictBool] = None
|
|
51
53
|
stream_options_support: Optional[StrictBool] = None
|
|
54
|
+
content_items_support: Optional[StrictBool] = None
|
|
55
|
+
reasoning_effort: Optional[StrictStr] = None
|
|
56
|
+
websearch_support: Optional[StrictBool] = None
|
|
57
|
+
skip_ssl_verification: Optional[StrictBool] = None
|
|
52
58
|
display_name: StrictStr
|
|
53
59
|
engine: StrictStr
|
|
54
60
|
api_key: StrictStr
|
|
@@ -58,7 +64,7 @@ class LLMEndpoint(BaseModel):
|
|
|
58
64
|
name: StrictStr
|
|
59
65
|
id: Optional[StrictInt] = None
|
|
60
66
|
context_ranges: Optional[LLMContextRanges] = None
|
|
61
|
-
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "tags", "tool_call_support", "temperature_support", "stream_options_support", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges"]
|
|
67
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "aws_inference_profile", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "vertex_location", "vertex_credentials", "tags", "tool_call_support", "temperature_support", "stream_options_support", "content_items_support", "reasoning_effort", "websearch_support", "skip_ssl_verification", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges"]
|
|
62
68
|
|
|
63
69
|
@field_validator('modality')
|
|
64
70
|
def modality_validate_enum(cls, value):
|
|
@@ -76,8 +82,18 @@ class LLMEndpoint(BaseModel):
|
|
|
76
82
|
if value is None:
|
|
77
83
|
return value
|
|
78
84
|
|
|
79
|
-
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'ollama']):
|
|
80
|
-
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'ollama')")
|
|
85
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai']):
|
|
86
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter', 'gemini', 'ollama', 'vertex_ai')")
|
|
87
|
+
return value
|
|
88
|
+
|
|
89
|
+
@field_validator('reasoning_effort')
|
|
90
|
+
def reasoning_effort_validate_enum(cls, value):
|
|
91
|
+
"""Validates the enum"""
|
|
92
|
+
if value is None:
|
|
93
|
+
return value
|
|
94
|
+
|
|
95
|
+
if value not in set(['none', 'low', 'medium', 'high']):
|
|
96
|
+
raise ValueError("must be one of enum values ('none', 'low', 'medium', 'high')")
|
|
81
97
|
return value
|
|
82
98
|
|
|
83
99
|
model_config = ConfigDict(
|
|
@@ -162,10 +178,16 @@ class LLMEndpoint(BaseModel):
|
|
|
162
178
|
"guardrail": GuardrailEndpoint.from_dict(obj["guardrail"]) if obj.get("guardrail") is not None else None,
|
|
163
179
|
"retry_params": RetryParams.from_dict(obj["retry_params"]) if obj.get("retry_params") is not None else None,
|
|
164
180
|
"extra_body": ExtraBody.from_dict(obj["extra_body"]) if obj.get("extra_body") is not None else None,
|
|
181
|
+
"vertex_location": obj.get("vertex_location"),
|
|
182
|
+
"vertex_credentials": obj.get("vertex_credentials"),
|
|
165
183
|
"tags": obj.get("tags"),
|
|
166
184
|
"tool_call_support": obj.get("tool_call_support"),
|
|
167
185
|
"temperature_support": obj.get("temperature_support"),
|
|
168
186
|
"stream_options_support": obj.get("stream_options_support"),
|
|
187
|
+
"content_items_support": obj.get("content_items_support"),
|
|
188
|
+
"reasoning_effort": obj.get("reasoning_effort"),
|
|
189
|
+
"websearch_support": obj.get("websearch_support"),
|
|
190
|
+
"skip_ssl_verification": obj.get("skip_ssl_verification"),
|
|
169
191
|
"display_name": obj.get("display_name"),
|
|
170
192
|
"engine": obj.get("engine"),
|
|
171
193
|
"api_key": obj.get("api_key"),
|
|
@@ -0,0 +1,89 @@
|
|
|
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 LLMEndpointImportFailure(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
LLMEndpointImportFailure
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: StrictStr
|
|
30
|
+
reason: StrictStr
|
|
31
|
+
__properties: ClassVar[List[str]] = ["name", "reason"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of LLMEndpointImportFailure from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of LLMEndpointImportFailure from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"name": obj.get("name"),
|
|
85
|
+
"reason": obj.get("reason")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -17,18 +17,20 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from qanswer_sdk.models.
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from qanswer_sdk.models.llm_endpoint_import_failure import LLMEndpointImportFailure
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class LLMEndpointImportResponse(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
LLMEndpointImportResponse
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
success: StrictInt
|
|
31
|
+
failed: StrictInt
|
|
32
|
+
fail_list: List[LLMEndpointImportFailure]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["success", "failed", "fail_list"]
|
|
32
34
|
|
|
33
35
|
model_config = ConfigDict(
|
|
34
36
|
populate_by_name=True,
|
|
@@ -48,7 +50,7 @@ class RelationExtractionDataOutput(BaseModel):
|
|
|
48
50
|
|
|
49
51
|
@classmethod
|
|
50
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of LLMEndpointImportResponse from a JSON string"""
|
|
52
54
|
return cls.from_dict(json.loads(json_str))
|
|
53
55
|
|
|
54
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -69,18 +71,18 @@ class RelationExtractionDataOutput(BaseModel):
|
|
|
69
71
|
exclude=excluded_fields,
|
|
70
72
|
exclude_none=True,
|
|
71
73
|
)
|
|
72
|
-
# override the default output from pydantic by calling `to_dict()` of each item in
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in fail_list (list)
|
|
73
75
|
_items = []
|
|
74
|
-
if self.
|
|
75
|
-
for
|
|
76
|
-
if
|
|
77
|
-
_items.append(
|
|
78
|
-
_dict['
|
|
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
|
|
79
81
|
return _dict
|
|
80
82
|
|
|
81
83
|
@classmethod
|
|
82
84
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
-
"""Create an instance of
|
|
85
|
+
"""Create an instance of LLMEndpointImportResponse from a dict"""
|
|
84
86
|
if obj is None:
|
|
85
87
|
return None
|
|
86
88
|
|
|
@@ -88,7 +90,9 @@ class RelationExtractionDataOutput(BaseModel):
|
|
|
88
90
|
return cls.model_validate(obj)
|
|
89
91
|
|
|
90
92
|
_obj = cls.model_validate({
|
|
91
|
-
"
|
|
93
|
+
"success": obj.get("success"),
|
|
94
|
+
"failed": obj.get("failed"),
|
|
95
|
+
"fail_list": [LLMEndpointImportFailure.from_dict(_item) for _item in obj["fail_list"]] if obj.get("fail_list") is not None else None
|
|
92
96
|
})
|
|
93
97
|
return _obj
|
|
94
98
|
|