qanswer_sdk 3.1213.0__py3-none-any.whl → 3.1245.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 +66 -43
- qanswer_sdk/api/__init__.py +7 -4
- qanswer_sdk/api/admin_api.py +590 -7695
- qanswer_sdk/api/ai_assistant_access_rights_api.py +72 -73
- qanswer_sdk/api/ai_assistant_api.py +567 -46
- qanswer_sdk/api/branding_api.py +4578 -0
- qanswer_sdk/api/chatbot_api.py +72 -87
- qanswer_sdk/api/{tag_api.py → connector_imap_connector_api.py} +415 -997
- qanswer_sdk/api/connector_rdf_api.py +30 -31
- qanswer_sdk/api/connectors_api.py +183 -166
- qanswer_sdk/api/connectors_data_api.py +345 -1
- qanswer_sdk/api/dataset_config_api.py +0 -245
- qanswer_sdk/api/llm_api.py +30 -30
- qanswer_sdk/api/payment_api.py +17 -16
- qanswer_sdk/api/speech_to_text_api.py +2 -2
- qanswer_sdk/api/task_chat_api.py +8 -7
- qanswer_sdk/api/task_rdf_linker_api.py +35 -36
- qanswer_sdk/api/task_rdf_sparql_endpoint_api.py +16 -16
- qanswer_sdk/api/task_report_copilot_api.py +895 -281
- qanswer_sdk/api/task_search_api.py +8 -7
- qanswer_sdk/api/tool_embedder_api.py +4040 -0
- qanswer_sdk/api/{user_api.py → tool_llm_api.py} +735 -2749
- qanswer_sdk/api/unit_organizations_api.py +4547 -0
- qanswer_sdk/api/unit_teams_api.py +3906 -0
- qanswer_sdk/api/{organizations_teams_api.py → unit_user_api.py} +1345 -1394
- qanswer_sdk/api_client.py +1 -1
- qanswer_sdk/configuration.py +1 -1
- qanswer_sdk/models/__init__.py +58 -38
- qanswer_sdk/models/aggregation.py +2 -2
- qanswer_sdk/models/ai_assistant_filter_dto.py +105 -0
- qanswer_sdk/models/{user_profile_paginated.py → ai_assistant_list.py} +18 -18
- qanswer_sdk/models/{embedding_model.py → available_aggregation.py} +13 -11
- qanswer_sdk/models/available_connectors_response.py +2 -2
- qanswer_sdk/models/{branding_data.py → branding_app_title.py} +4 -4
- qanswer_sdk/models/{api_response.py → branding_system_message.py} +8 -8
- qanswer_sdk/models/chat_task_settings.py +12 -12
- qanswer_sdk/models/chat_task_update.py +13 -5
- qanswer_sdk/models/chatbot_chat_payload.py +19 -2
- qanswer_sdk/models/chatbot_conversation_model.py +10 -0
- qanswer_sdk/models/chatbot_response.py +22 -2
- qanswer_sdk/models/{user_chatbot_setting_payload.py → chatbot_setting_dto.py} +12 -13
- qanswer_sdk/models/chatbot_setting_request.py +96 -0
- qanswer_sdk/models/{question_completion.py → clip_connector_file_structure.py} +9 -9
- qanswer_sdk/models/clip_connector_structure.py +97 -0
- qanswer_sdk/models/connector_model.py +2 -2
- qanswer_sdk/models/conversation_message.py +4 -12
- qanswer_sdk/models/{cost_summary.py → cost_summary_dto.py} +4 -4
- qanswer_sdk/models/create_connector_request.py +4 -2
- qanswer_sdk/models/create_imap_connector_request.py +105 -0
- qanswer_sdk/models/create_pinecone_connector_request.py +3 -1
- qanswer_sdk/models/create_sharepoint_connector_from_certificate_request.py +3 -1
- qanswer_sdk/models/create_sharepoint_connector_request.py +3 -1
- qanswer_sdk/models/dataset_detail_kg.py +27 -1
- qanswer_sdk/models/dataset_schema.py +4 -2
- qanswer_sdk/models/dataset_update_object.py +3 -1
- qanswer_sdk/models/delete_connector_model.py +2 -2
- qanswer_sdk/models/delete_connectors_response.py +2 -4
- qanswer_sdk/models/{json_nullable_source_metadata.py → duplicate_report_template_response.py} +11 -9
- qanswer_sdk/models/{json_nullable_file_failure_reason.py → email_folder.py} +12 -8
- qanswer_sdk/models/{embedding_endpoint.py → embedder_detailed_dto.py} +16 -8
- qanswer_sdk/models/{tag_payload.py → embedder_dto.py} +11 -7
- qanswer_sdk/models/{pageable_object.py → embedder_list_dto.py} +20 -20
- qanswer_sdk/models/embedding_endpoint_create.py +3 -1
- qanswer_sdk/models/embedding_endpoint_update.py +4 -2
- qanswer_sdk/models/{sort_object.py → entity_description.py} +16 -12
- qanswer_sdk/models/{dataset_description.py → entity_description_dto.py} +9 -7
- qanswer_sdk/models/file_model.py +2 -2
- qanswer_sdk/models/imap_add_payload.py +103 -0
- qanswer_sdk/models/imap_additional_fields.py +101 -0
- qanswer_sdk/models/imap_file_metadata.py +114 -0
- qanswer_sdk/models/imap_search_response.py +113 -0
- qanswer_sdk/models/llm.py +129 -0
- qanswer_sdk/models/llm_consumption.py +118 -0
- qanswer_sdk/models/{pageable.py → llm_context_ranges.py} +14 -13
- qanswer_sdk/models/{llm_cost.py → llm_cost_filter.py} +11 -7
- qanswer_sdk/models/llm_cost_list.py +101 -0
- qanswer_sdk/models/llm_detailed_dto.py +179 -0
- qanswer_sdk/models/{llm_details.py → llm_dto.py} +14 -18
- qanswer_sdk/models/llm_endpoint.py +8 -2
- qanswer_sdk/models/llm_endpoint_read_input.py +173 -0
- qanswer_sdk/models/llm_endpoint_read_output.py +173 -0
- qanswer_sdk/models/llm_filter_dto.py +99 -0
- qanswer_sdk/models/llm_list_detailed_dto.py +101 -0
- qanswer_sdk/models/llm_list_dto.py +101 -0
- qanswer_sdk/models/modify_connector_request.py +5 -11
- qanswer_sdk/models/{o_auth_service.py → o_auth_service_dto.py} +4 -4
- qanswer_sdk/models/organization_admin.py +95 -0
- qanswer_sdk/models/organization_filter_dto.py +97 -0
- qanswer_sdk/models/organization_list_dto.py +101 -0
- qanswer_sdk/models/organization_llm.py +103 -0
- qanswer_sdk/models/{plan.py → plan_dto.py} +4 -4
- qanswer_sdk/models/prompt_token_count_details.py +3 -3
- qanswer_sdk/models/rag_payload.py +4 -4
- qanswer_sdk/models/rag_response.py +4 -2
- qanswer_sdk/models/relation_extraction_task_settings.py +12 -10
- qanswer_sdk/models/relation_extraction_task_update.py +14 -4
- qanswer_sdk/models/report_copilot_slot_task_settings.py +12 -10
- qanswer_sdk/models/report_copilot_slot_task_update.py +13 -3
- qanswer_sdk/models/report_copilot_task_settings.py +12 -10
- qanswer_sdk/models/report_copilot_task_update.py +14 -4
- qanswer_sdk/models/{report_copilot_template.py → report_template.py} +17 -7
- qanswer_sdk/models/{report_copilot_create_payload.py → report_template_create_payload.py} +4 -4
- qanswer_sdk/models/{report_copilot_template_simplified.py → report_template_simplified.py} +11 -7
- qanswer_sdk/models/{report_copilot_export_template_as_docx_payload_simplified.py → report_template_simplified_payload.py} +4 -4
- qanswer_sdk/models/{report_copilot_update_payload.py → report_template_update_payload.py} +15 -9
- qanswer_sdk/models/search_task_settings.py +12 -12
- qanswer_sdk/models/search_task_update.py +13 -3
- qanswer_sdk/models/{set_logo1_request.py → set_logo2_request.py} +4 -4
- qanswer_sdk/models/shared_organization_access.py +7 -3
- qanswer_sdk/models/shared_team_access.py +10 -4
- qanswer_sdk/models/slot.py +5 -1
- qanswer_sdk/models/slot_update.py +5 -1
- qanswer_sdk/models/socket_conversation_message.py +3 -11
- qanswer_sdk/models/socket_file_metadata.py +17 -11
- qanswer_sdk/models/source_metadata.py +109 -0
- qanswer_sdk/models/{tag_qa_list_payload.py → subscription_response.py} +22 -21
- qanswer_sdk/models/{team_with_count.py → team_admin.py} +8 -8
- qanswer_sdk/models/{team_filter.py → team_filter_dto.py} +16 -6
- qanswer_sdk/models/team_list_dto.py +101 -0
- qanswer_sdk/models/{available_endpoints_response.py → template_clip_structure_input.py} +14 -14
- qanswer_sdk/models/{available_embedding_models_response.py → template_clip_structure_output.py} +14 -14
- qanswer_sdk/models/test_imap_connection_payload.py +95 -0
- qanswer_sdk/models/text2_sparql_payload.py +4 -4
- qanswer_sdk/models/text2_sparql_task_settings.py +12 -10
- qanswer_sdk/models/text2_sparql_task_update.py +14 -4
- qanswer_sdk/models/{user_chatbot_setting_response.py → user_chatbot_setting.py} +24 -24
- qanswer_sdk/models/user_dataset.py +38 -2
- qanswer_sdk/models/{qa_metadata_payload.py → user_dataset_shared.py} +27 -37
- qanswer_sdk/models/{user_filter.py → user_filter_dto.py} +4 -4
- qanswer_sdk/models/{user_profile.py → user_profile_dto.py} +10 -10
- qanswer_sdk/models/user_profile_list_dto.py +3 -3
- qanswer_sdk/models/widget_configs.py +4 -2
- {qanswer_sdk-3.1213.0.dist-info → qanswer_sdk-3.1245.0.dist-info}/METADATA +2 -2
- {qanswer_sdk-3.1213.0.dist-info → qanswer_sdk-3.1245.0.dist-info}/RECORD +135 -112
- qanswer_sdk/api/llm_consumption_controller_api.py +0 -310
- qanswer_sdk/models/organization_filter.py +0 -87
- qanswer_sdk/models/page_organization.py +0 -123
- qanswer_sdk/models/page_team_with_count.py +0 -123
- qanswer_sdk/models/tag_qa_payload.py +0 -91
- {qanswer_sdk-3.1213.0.dist-info → qanswer_sdk-3.1245.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,179 @@
|
|
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, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
+
from qanswer_sdk.models.extra_body import ExtraBody
|
23
|
+
from qanswer_sdk.models.generation_params import GenerationParams
|
24
|
+
from qanswer_sdk.models.guardrail_endpoint import GuardrailEndpoint
|
25
|
+
from qanswer_sdk.models.llm_context_ranges import LLMContextRanges
|
26
|
+
from qanswer_sdk.models.rag_params import RAGParams
|
27
|
+
from qanswer_sdk.models.retry_params import RetryParams
|
28
|
+
from typing import Optional, Set
|
29
|
+
from typing_extensions import Self
|
30
|
+
|
31
|
+
class LlmDetailedDto(BaseModel):
|
32
|
+
"""
|
33
|
+
LlmDetailedDto
|
34
|
+
""" # noqa: E501
|
35
|
+
modality: Optional[StrictStr] = None
|
36
|
+
provider: Optional[StrictStr] = None
|
37
|
+
api_version: Optional[StrictStr] = None
|
38
|
+
aws_access_key_id: Optional[StrictStr] = None
|
39
|
+
aws_secret_access_key: Optional[StrictStr] = None
|
40
|
+
aws_region_name: Optional[StrictStr] = None
|
41
|
+
description: Optional[StrictStr] = None
|
42
|
+
onpremise: Optional[StrictBool] = None
|
43
|
+
sensitivity_label: Optional[StrictStr] = None
|
44
|
+
guardrail: Optional[GuardrailEndpoint] = None
|
45
|
+
retry_params: Optional[RetryParams] = None
|
46
|
+
extra_body: Optional[ExtraBody] = None
|
47
|
+
tags: Optional[List[StrictStr]] = None
|
48
|
+
display_name: StrictStr
|
49
|
+
engine: StrictStr
|
50
|
+
api_key: StrictStr
|
51
|
+
endpoint_url: StrictStr
|
52
|
+
rag_params: Optional[RAGParams] = None
|
53
|
+
generation_params: GenerationParams
|
54
|
+
name: StrictStr
|
55
|
+
id: Optional[StrictInt] = None
|
56
|
+
context_ranges: Optional[LLMContextRanges] = None
|
57
|
+
cost_input_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costInputToken")
|
58
|
+
cost_output_token: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="costOutputToken")
|
59
|
+
active: Optional[StrictBool] = None
|
60
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "tags", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges", "costInputToken", "costOutputToken", "active"]
|
61
|
+
|
62
|
+
@field_validator('modality')
|
63
|
+
def modality_validate_enum(cls, value):
|
64
|
+
"""Validates the enum"""
|
65
|
+
if value is None:
|
66
|
+
return value
|
67
|
+
|
68
|
+
if value not in set(['text', 'text-image']):
|
69
|
+
raise ValueError("must be one of enum values ('text', 'text-image')")
|
70
|
+
return value
|
71
|
+
|
72
|
+
@field_validator('provider')
|
73
|
+
def provider_validate_enum(cls, value):
|
74
|
+
"""Validates the enum"""
|
75
|
+
if value is None:
|
76
|
+
return value
|
77
|
+
|
78
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter']):
|
79
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter')")
|
80
|
+
return value
|
81
|
+
|
82
|
+
model_config = ConfigDict(
|
83
|
+
populate_by_name=True,
|
84
|
+
validate_assignment=True,
|
85
|
+
protected_namespaces=(),
|
86
|
+
)
|
87
|
+
|
88
|
+
|
89
|
+
def to_str(self) -> str:
|
90
|
+
"""Returns the string representation of the model using alias"""
|
91
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
92
|
+
|
93
|
+
def to_json(self) -> str:
|
94
|
+
"""Returns the JSON representation of the model using alias"""
|
95
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
96
|
+
return json.dumps(self.to_dict())
|
97
|
+
|
98
|
+
@classmethod
|
99
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
100
|
+
"""Create an instance of LlmDetailedDto from a JSON string"""
|
101
|
+
return cls.from_dict(json.loads(json_str))
|
102
|
+
|
103
|
+
def to_dict(self) -> Dict[str, Any]:
|
104
|
+
"""Return the dictionary representation of the model using alias.
|
105
|
+
|
106
|
+
This has the following differences from calling pydantic's
|
107
|
+
`self.model_dump(by_alias=True)`:
|
108
|
+
|
109
|
+
* `None` is only added to the output dict for nullable fields that
|
110
|
+
were set at model initialization. Other fields with value `None`
|
111
|
+
are ignored.
|
112
|
+
"""
|
113
|
+
excluded_fields: Set[str] = set([
|
114
|
+
])
|
115
|
+
|
116
|
+
_dict = self.model_dump(
|
117
|
+
by_alias=True,
|
118
|
+
exclude=excluded_fields,
|
119
|
+
exclude_none=True,
|
120
|
+
)
|
121
|
+
# override the default output from pydantic by calling `to_dict()` of guardrail
|
122
|
+
if self.guardrail:
|
123
|
+
_dict['guardrail'] = self.guardrail.to_dict()
|
124
|
+
# override the default output from pydantic by calling `to_dict()` of retry_params
|
125
|
+
if self.retry_params:
|
126
|
+
_dict['retry_params'] = self.retry_params.to_dict()
|
127
|
+
# override the default output from pydantic by calling `to_dict()` of extra_body
|
128
|
+
if self.extra_body:
|
129
|
+
_dict['extra_body'] = self.extra_body.to_dict()
|
130
|
+
# override the default output from pydantic by calling `to_dict()` of rag_params
|
131
|
+
if self.rag_params:
|
132
|
+
_dict['rag_params'] = self.rag_params.to_dict()
|
133
|
+
# override the default output from pydantic by calling `to_dict()` of generation_params
|
134
|
+
if self.generation_params:
|
135
|
+
_dict['generation_params'] = self.generation_params.to_dict()
|
136
|
+
# override the default output from pydantic by calling `to_dict()` of context_ranges
|
137
|
+
if self.context_ranges:
|
138
|
+
_dict['context_ranges'] = self.context_ranges.to_dict()
|
139
|
+
return _dict
|
140
|
+
|
141
|
+
@classmethod
|
142
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
143
|
+
"""Create an instance of LlmDetailedDto from a dict"""
|
144
|
+
if obj is None:
|
145
|
+
return None
|
146
|
+
|
147
|
+
if not isinstance(obj, dict):
|
148
|
+
return cls.model_validate(obj)
|
149
|
+
|
150
|
+
_obj = cls.model_validate({
|
151
|
+
"modality": obj.get("modality"),
|
152
|
+
"provider": obj.get("provider"),
|
153
|
+
"api_version": obj.get("api_version"),
|
154
|
+
"aws_access_key_id": obj.get("aws_access_key_id"),
|
155
|
+
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
156
|
+
"aws_region_name": obj.get("aws_region_name"),
|
157
|
+
"description": obj.get("description"),
|
158
|
+
"onpremise": obj.get("onpremise"),
|
159
|
+
"sensitivity_label": obj.get("sensitivity_label"),
|
160
|
+
"guardrail": GuardrailEndpoint.from_dict(obj["guardrail"]) if obj.get("guardrail") is not None else None,
|
161
|
+
"retry_params": RetryParams.from_dict(obj["retry_params"]) if obj.get("retry_params") is not None else None,
|
162
|
+
"extra_body": ExtraBody.from_dict(obj["extra_body"]) if obj.get("extra_body") is not None else None,
|
163
|
+
"tags": obj.get("tags"),
|
164
|
+
"display_name": obj.get("display_name"),
|
165
|
+
"engine": obj.get("engine"),
|
166
|
+
"api_key": obj.get("api_key"),
|
167
|
+
"endpoint_url": obj.get("endpoint_url"),
|
168
|
+
"rag_params": RAGParams.from_dict(obj["rag_params"]) if obj.get("rag_params") is not None else None,
|
169
|
+
"generation_params": GenerationParams.from_dict(obj["generation_params"]) if obj.get("generation_params") is not None else None,
|
170
|
+
"name": obj.get("name"),
|
171
|
+
"id": obj.get("id"),
|
172
|
+
"context_ranges": LLMContextRanges.from_dict(obj["context_ranges"]) if obj.get("context_ranges") is not None else None,
|
173
|
+
"costInputToken": obj.get("costInputToken"),
|
174
|
+
"costOutputToken": obj.get("costOutputToken"),
|
175
|
+
"active": obj.get("active")
|
176
|
+
})
|
177
|
+
return _obj
|
178
|
+
|
179
|
+
|
@@ -17,24 +17,22 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
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 LlmDto(BaseModel):
|
26
26
|
"""
|
27
|
-
|
27
|
+
LlmDto
|
28
28
|
""" # noqa: E501
|
29
|
-
|
30
|
-
description: Optional[StrictStr] = None
|
31
|
-
display_name: Optional[StrictStr] = None
|
29
|
+
id: Optional[StrictInt] = None
|
32
30
|
name: Optional[StrictStr] = None
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
description: Optional[StrictStr] = None
|
32
|
+
sensitivity_label: Optional[StrictStr] = Field(default=None, alias="sensitivityLabel")
|
33
|
+
onpremise: Optional[StrictBool] = None
|
36
34
|
modality: Optional[StrictStr] = None
|
37
|
-
__properties: ClassVar[List[str]] = ["
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "name", "description", "sensitivityLabel", "onpremise", "modality"]
|
38
36
|
|
39
37
|
@field_validator('modality')
|
40
38
|
def modality_validate_enum(cls, value):
|
@@ -64,7 +62,7 @@ class LLMDetails(BaseModel):
|
|
64
62
|
|
65
63
|
@classmethod
|
66
64
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
67
|
-
"""Create an instance of
|
65
|
+
"""Create an instance of LlmDto from a JSON string"""
|
68
66
|
return cls.from_dict(json.loads(json_str))
|
69
67
|
|
70
68
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -89,7 +87,7 @@ class LLMDetails(BaseModel):
|
|
89
87
|
|
90
88
|
@classmethod
|
91
89
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
92
|
-
"""Create an instance of
|
90
|
+
"""Create an instance of LlmDto from a dict"""
|
93
91
|
if obj is None:
|
94
92
|
return None
|
95
93
|
|
@@ -97,13 +95,11 @@ class LLMDetails(BaseModel):
|
|
97
95
|
return cls.model_validate(obj)
|
98
96
|
|
99
97
|
_obj = cls.model_validate({
|
100
|
-
"
|
101
|
-
"description": obj.get("description"),
|
102
|
-
"display_name": obj.get("display_name"),
|
98
|
+
"id": obj.get("id"),
|
103
99
|
"name": obj.get("name"),
|
104
|
-
"
|
105
|
-
"
|
106
|
-
"
|
100
|
+
"description": obj.get("description"),
|
101
|
+
"sensitivityLabel": obj.get("sensitivityLabel"),
|
102
|
+
"onpremise": obj.get("onpremise"),
|
107
103
|
"modality": obj.get("modality")
|
108
104
|
})
|
109
105
|
return _obj
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from qanswer_sdk.models.extra_body import ExtraBody
|
23
23
|
from qanswer_sdk.models.generation_params import GenerationParams
|
24
24
|
from qanswer_sdk.models.guardrail_endpoint import GuardrailEndpoint
|
25
|
+
from qanswer_sdk.models.llm_context_ranges import LLMContextRanges
|
25
26
|
from qanswer_sdk.models.rag_params import RAGParams
|
26
27
|
from qanswer_sdk.models.retry_params import RetryParams
|
27
28
|
from typing import Optional, Set
|
@@ -52,7 +53,8 @@ class LLMEndpoint(BaseModel):
|
|
52
53
|
generation_params: GenerationParams
|
53
54
|
name: StrictStr
|
54
55
|
id: Optional[StrictInt] = None
|
55
|
-
|
56
|
+
context_ranges: Optional[LLMContextRanges] = None
|
57
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "tags", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges"]
|
56
58
|
|
57
59
|
@field_validator('modality')
|
58
60
|
def modality_validate_enum(cls, value):
|
@@ -128,6 +130,9 @@ class LLMEndpoint(BaseModel):
|
|
128
130
|
# override the default output from pydantic by calling `to_dict()` of generation_params
|
129
131
|
if self.generation_params:
|
130
132
|
_dict['generation_params'] = self.generation_params.to_dict()
|
133
|
+
# override the default output from pydantic by calling `to_dict()` of context_ranges
|
134
|
+
if self.context_ranges:
|
135
|
+
_dict['context_ranges'] = self.context_ranges.to_dict()
|
131
136
|
return _dict
|
132
137
|
|
133
138
|
@classmethod
|
@@ -160,7 +165,8 @@ class LLMEndpoint(BaseModel):
|
|
160
165
|
"rag_params": RAGParams.from_dict(obj["rag_params"]) if obj.get("rag_params") is not None else None,
|
161
166
|
"generation_params": GenerationParams.from_dict(obj["generation_params"]) if obj.get("generation_params") is not None else None,
|
162
167
|
"name": obj.get("name"),
|
163
|
-
"id": obj.get("id")
|
168
|
+
"id": obj.get("id"),
|
169
|
+
"context_ranges": LLMContextRanges.from_dict(obj["context_ranges"]) if obj.get("context_ranges") is not None else None
|
164
170
|
})
|
165
171
|
return _obj
|
166
172
|
|
@@ -0,0 +1,173 @@
|
|
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, StrictInt, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from qanswer_sdk.models.extra_body import ExtraBody
|
23
|
+
from qanswer_sdk.models.generation_params import GenerationParams
|
24
|
+
from qanswer_sdk.models.guardrail_endpoint import GuardrailEndpoint
|
25
|
+
from qanswer_sdk.models.llm_context_ranges import LLMContextRanges
|
26
|
+
from qanswer_sdk.models.rag_params import RAGParams
|
27
|
+
from qanswer_sdk.models.retry_params import RetryParams
|
28
|
+
from typing import Optional, Set
|
29
|
+
from typing_extensions import Self
|
30
|
+
|
31
|
+
class LLMEndpointReadInput(BaseModel):
|
32
|
+
"""
|
33
|
+
The LLM endpoint details. This field is populated based on the llm_choice.
|
34
|
+
""" # noqa: E501
|
35
|
+
modality: Optional[StrictStr] = None
|
36
|
+
provider: Optional[StrictStr] = None
|
37
|
+
api_version: Optional[StrictStr] = None
|
38
|
+
aws_access_key_id: Optional[StrictStr] = None
|
39
|
+
aws_secret_access_key: Optional[StrictStr] = None
|
40
|
+
aws_region_name: Optional[StrictStr] = None
|
41
|
+
description: Optional[StrictStr] = None
|
42
|
+
onpremise: Optional[StrictBool] = None
|
43
|
+
sensitivity_label: Optional[StrictStr] = None
|
44
|
+
guardrail: Optional[GuardrailEndpoint] = None
|
45
|
+
retry_params: Optional[RetryParams] = None
|
46
|
+
extra_body: Optional[ExtraBody] = None
|
47
|
+
tags: Optional[List[StrictStr]] = None
|
48
|
+
display_name: StrictStr
|
49
|
+
engine: StrictStr
|
50
|
+
api_key: StrictStr
|
51
|
+
endpoint_url: StrictStr
|
52
|
+
rag_params: Optional[RAGParams] = None
|
53
|
+
generation_params: GenerationParams
|
54
|
+
name: StrictStr
|
55
|
+
id: Optional[StrictInt] = None
|
56
|
+
context_ranges: Optional[LLMContextRanges] = None
|
57
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "tags", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges"]
|
58
|
+
|
59
|
+
@field_validator('modality')
|
60
|
+
def modality_validate_enum(cls, value):
|
61
|
+
"""Validates the enum"""
|
62
|
+
if value is None:
|
63
|
+
return value
|
64
|
+
|
65
|
+
if value not in set(['text', 'text-image']):
|
66
|
+
raise ValueError("must be one of enum values ('text', 'text-image')")
|
67
|
+
return value
|
68
|
+
|
69
|
+
@field_validator('provider')
|
70
|
+
def provider_validate_enum(cls, value):
|
71
|
+
"""Validates the enum"""
|
72
|
+
if value is None:
|
73
|
+
return value
|
74
|
+
|
75
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter']):
|
76
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter')")
|
77
|
+
return value
|
78
|
+
|
79
|
+
model_config = ConfigDict(
|
80
|
+
populate_by_name=True,
|
81
|
+
validate_assignment=True,
|
82
|
+
protected_namespaces=(),
|
83
|
+
)
|
84
|
+
|
85
|
+
|
86
|
+
def to_str(self) -> str:
|
87
|
+
"""Returns the string representation of the model using alias"""
|
88
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
89
|
+
|
90
|
+
def to_json(self) -> str:
|
91
|
+
"""Returns the JSON representation of the model using alias"""
|
92
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
93
|
+
return json.dumps(self.to_dict())
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
97
|
+
"""Create an instance of LLMEndpointReadInput from a JSON string"""
|
98
|
+
return cls.from_dict(json.loads(json_str))
|
99
|
+
|
100
|
+
def to_dict(self) -> Dict[str, Any]:
|
101
|
+
"""Return the dictionary representation of the model using alias.
|
102
|
+
|
103
|
+
This has the following differences from calling pydantic's
|
104
|
+
`self.model_dump(by_alias=True)`:
|
105
|
+
|
106
|
+
* `None` is only added to the output dict for nullable fields that
|
107
|
+
were set at model initialization. Other fields with value `None`
|
108
|
+
are ignored.
|
109
|
+
"""
|
110
|
+
excluded_fields: Set[str] = set([
|
111
|
+
])
|
112
|
+
|
113
|
+
_dict = self.model_dump(
|
114
|
+
by_alias=True,
|
115
|
+
exclude=excluded_fields,
|
116
|
+
exclude_none=True,
|
117
|
+
)
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of guardrail
|
119
|
+
if self.guardrail:
|
120
|
+
_dict['guardrail'] = self.guardrail.to_dict()
|
121
|
+
# override the default output from pydantic by calling `to_dict()` of retry_params
|
122
|
+
if self.retry_params:
|
123
|
+
_dict['retry_params'] = self.retry_params.to_dict()
|
124
|
+
# override the default output from pydantic by calling `to_dict()` of extra_body
|
125
|
+
if self.extra_body:
|
126
|
+
_dict['extra_body'] = self.extra_body.to_dict()
|
127
|
+
# override the default output from pydantic by calling `to_dict()` of rag_params
|
128
|
+
if self.rag_params:
|
129
|
+
_dict['rag_params'] = self.rag_params.to_dict()
|
130
|
+
# override the default output from pydantic by calling `to_dict()` of generation_params
|
131
|
+
if self.generation_params:
|
132
|
+
_dict['generation_params'] = self.generation_params.to_dict()
|
133
|
+
# override the default output from pydantic by calling `to_dict()` of context_ranges
|
134
|
+
if self.context_ranges:
|
135
|
+
_dict['context_ranges'] = self.context_ranges.to_dict()
|
136
|
+
return _dict
|
137
|
+
|
138
|
+
@classmethod
|
139
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
140
|
+
"""Create an instance of LLMEndpointReadInput from a dict"""
|
141
|
+
if obj is None:
|
142
|
+
return None
|
143
|
+
|
144
|
+
if not isinstance(obj, dict):
|
145
|
+
return cls.model_validate(obj)
|
146
|
+
|
147
|
+
_obj = cls.model_validate({
|
148
|
+
"modality": obj.get("modality"),
|
149
|
+
"provider": obj.get("provider"),
|
150
|
+
"api_version": obj.get("api_version"),
|
151
|
+
"aws_access_key_id": obj.get("aws_access_key_id"),
|
152
|
+
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
153
|
+
"aws_region_name": obj.get("aws_region_name"),
|
154
|
+
"description": obj.get("description"),
|
155
|
+
"onpremise": obj.get("onpremise"),
|
156
|
+
"sensitivity_label": obj.get("sensitivity_label"),
|
157
|
+
"guardrail": GuardrailEndpoint.from_dict(obj["guardrail"]) if obj.get("guardrail") is not None else None,
|
158
|
+
"retry_params": RetryParams.from_dict(obj["retry_params"]) if obj.get("retry_params") is not None else None,
|
159
|
+
"extra_body": ExtraBody.from_dict(obj["extra_body"]) if obj.get("extra_body") is not None else None,
|
160
|
+
"tags": obj.get("tags"),
|
161
|
+
"display_name": obj.get("display_name"),
|
162
|
+
"engine": obj.get("engine"),
|
163
|
+
"api_key": obj.get("api_key"),
|
164
|
+
"endpoint_url": obj.get("endpoint_url"),
|
165
|
+
"rag_params": RAGParams.from_dict(obj["rag_params"]) if obj.get("rag_params") is not None else None,
|
166
|
+
"generation_params": GenerationParams.from_dict(obj["generation_params"]) if obj.get("generation_params") is not None else None,
|
167
|
+
"name": obj.get("name"),
|
168
|
+
"id": obj.get("id"),
|
169
|
+
"context_ranges": LLMContextRanges.from_dict(obj["context_ranges"]) if obj.get("context_ranges") is not None else None
|
170
|
+
})
|
171
|
+
return _obj
|
172
|
+
|
173
|
+
|
@@ -0,0 +1,173 @@
|
|
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, StrictInt, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from qanswer_sdk.models.extra_body import ExtraBody
|
23
|
+
from qanswer_sdk.models.generation_params import GenerationParams
|
24
|
+
from qanswer_sdk.models.guardrail_endpoint import GuardrailEndpoint
|
25
|
+
from qanswer_sdk.models.llm_context_ranges import LLMContextRanges
|
26
|
+
from qanswer_sdk.models.rag_params import RAGParams
|
27
|
+
from qanswer_sdk.models.retry_params import RetryParams
|
28
|
+
from typing import Optional, Set
|
29
|
+
from typing_extensions import Self
|
30
|
+
|
31
|
+
class LLMEndpointReadOutput(BaseModel):
|
32
|
+
"""
|
33
|
+
The LLM endpoint details. This field is populated based on the llm_choice.
|
34
|
+
""" # noqa: E501
|
35
|
+
modality: Optional[StrictStr] = None
|
36
|
+
provider: Optional[StrictStr] = None
|
37
|
+
api_version: Optional[StrictStr] = None
|
38
|
+
aws_access_key_id: Optional[StrictStr] = None
|
39
|
+
aws_secret_access_key: Optional[StrictStr] = None
|
40
|
+
aws_region_name: Optional[StrictStr] = None
|
41
|
+
description: Optional[StrictStr] = None
|
42
|
+
onpremise: Optional[StrictBool] = None
|
43
|
+
sensitivity_label: Optional[StrictStr] = None
|
44
|
+
guardrail: Optional[GuardrailEndpoint] = None
|
45
|
+
retry_params: Optional[RetryParams] = None
|
46
|
+
extra_body: Optional[ExtraBody] = None
|
47
|
+
tags: Optional[List[StrictStr]] = None
|
48
|
+
display_name: StrictStr
|
49
|
+
engine: StrictStr
|
50
|
+
api_key: StrictStr
|
51
|
+
endpoint_url: StrictStr
|
52
|
+
rag_params: Optional[RAGParams] = None
|
53
|
+
generation_params: GenerationParams
|
54
|
+
name: StrictStr
|
55
|
+
id: Optional[StrictInt] = None
|
56
|
+
context_ranges: Optional[LLMContextRanges] = None
|
57
|
+
__properties: ClassVar[List[str]] = ["modality", "provider", "api_version", "aws_access_key_id", "aws_secret_access_key", "aws_region_name", "description", "onpremise", "sensitivity_label", "guardrail", "retry_params", "extra_body", "tags", "display_name", "engine", "api_key", "endpoint_url", "rag_params", "generation_params", "name", "id", "context_ranges"]
|
58
|
+
|
59
|
+
@field_validator('modality')
|
60
|
+
def modality_validate_enum(cls, value):
|
61
|
+
"""Validates the enum"""
|
62
|
+
if value is None:
|
63
|
+
return value
|
64
|
+
|
65
|
+
if value not in set(['text', 'text-image']):
|
66
|
+
raise ValueError("must be one of enum values ('text', 'text-image')")
|
67
|
+
return value
|
68
|
+
|
69
|
+
@field_validator('provider')
|
70
|
+
def provider_validate_enum(cls, value):
|
71
|
+
"""Validates the enum"""
|
72
|
+
if value is None:
|
73
|
+
return value
|
74
|
+
|
75
|
+
if value not in set(['openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter']):
|
76
|
+
raise ValueError("must be one of enum values ('openai', 'azure', 'bedrock', 'mistral', 'anthropic', 'openrouter')")
|
77
|
+
return value
|
78
|
+
|
79
|
+
model_config = ConfigDict(
|
80
|
+
populate_by_name=True,
|
81
|
+
validate_assignment=True,
|
82
|
+
protected_namespaces=(),
|
83
|
+
)
|
84
|
+
|
85
|
+
|
86
|
+
def to_str(self) -> str:
|
87
|
+
"""Returns the string representation of the model using alias"""
|
88
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
89
|
+
|
90
|
+
def to_json(self) -> str:
|
91
|
+
"""Returns the JSON representation of the model using alias"""
|
92
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
93
|
+
return json.dumps(self.to_dict())
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
97
|
+
"""Create an instance of LLMEndpointReadOutput from a JSON string"""
|
98
|
+
return cls.from_dict(json.loads(json_str))
|
99
|
+
|
100
|
+
def to_dict(self) -> Dict[str, Any]:
|
101
|
+
"""Return the dictionary representation of the model using alias.
|
102
|
+
|
103
|
+
This has the following differences from calling pydantic's
|
104
|
+
`self.model_dump(by_alias=True)`:
|
105
|
+
|
106
|
+
* `None` is only added to the output dict for nullable fields that
|
107
|
+
were set at model initialization. Other fields with value `None`
|
108
|
+
are ignored.
|
109
|
+
"""
|
110
|
+
excluded_fields: Set[str] = set([
|
111
|
+
])
|
112
|
+
|
113
|
+
_dict = self.model_dump(
|
114
|
+
by_alias=True,
|
115
|
+
exclude=excluded_fields,
|
116
|
+
exclude_none=True,
|
117
|
+
)
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of guardrail
|
119
|
+
if self.guardrail:
|
120
|
+
_dict['guardrail'] = self.guardrail.to_dict()
|
121
|
+
# override the default output from pydantic by calling `to_dict()` of retry_params
|
122
|
+
if self.retry_params:
|
123
|
+
_dict['retry_params'] = self.retry_params.to_dict()
|
124
|
+
# override the default output from pydantic by calling `to_dict()` of extra_body
|
125
|
+
if self.extra_body:
|
126
|
+
_dict['extra_body'] = self.extra_body.to_dict()
|
127
|
+
# override the default output from pydantic by calling `to_dict()` of rag_params
|
128
|
+
if self.rag_params:
|
129
|
+
_dict['rag_params'] = self.rag_params.to_dict()
|
130
|
+
# override the default output from pydantic by calling `to_dict()` of generation_params
|
131
|
+
if self.generation_params:
|
132
|
+
_dict['generation_params'] = self.generation_params.to_dict()
|
133
|
+
# override the default output from pydantic by calling `to_dict()` of context_ranges
|
134
|
+
if self.context_ranges:
|
135
|
+
_dict['context_ranges'] = self.context_ranges.to_dict()
|
136
|
+
return _dict
|
137
|
+
|
138
|
+
@classmethod
|
139
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
140
|
+
"""Create an instance of LLMEndpointReadOutput from a dict"""
|
141
|
+
if obj is None:
|
142
|
+
return None
|
143
|
+
|
144
|
+
if not isinstance(obj, dict):
|
145
|
+
return cls.model_validate(obj)
|
146
|
+
|
147
|
+
_obj = cls.model_validate({
|
148
|
+
"modality": obj.get("modality"),
|
149
|
+
"provider": obj.get("provider"),
|
150
|
+
"api_version": obj.get("api_version"),
|
151
|
+
"aws_access_key_id": obj.get("aws_access_key_id"),
|
152
|
+
"aws_secret_access_key": obj.get("aws_secret_access_key"),
|
153
|
+
"aws_region_name": obj.get("aws_region_name"),
|
154
|
+
"description": obj.get("description"),
|
155
|
+
"onpremise": obj.get("onpremise"),
|
156
|
+
"sensitivity_label": obj.get("sensitivity_label"),
|
157
|
+
"guardrail": GuardrailEndpoint.from_dict(obj["guardrail"]) if obj.get("guardrail") is not None else None,
|
158
|
+
"retry_params": RetryParams.from_dict(obj["retry_params"]) if obj.get("retry_params") is not None else None,
|
159
|
+
"extra_body": ExtraBody.from_dict(obj["extra_body"]) if obj.get("extra_body") is not None else None,
|
160
|
+
"tags": obj.get("tags"),
|
161
|
+
"display_name": obj.get("display_name"),
|
162
|
+
"engine": obj.get("engine"),
|
163
|
+
"api_key": obj.get("api_key"),
|
164
|
+
"endpoint_url": obj.get("endpoint_url"),
|
165
|
+
"rag_params": RAGParams.from_dict(obj["rag_params"]) if obj.get("rag_params") is not None else None,
|
166
|
+
"generation_params": GenerationParams.from_dict(obj["generation_params"]) if obj.get("generation_params") is not None else None,
|
167
|
+
"name": obj.get("name"),
|
168
|
+
"id": obj.get("id"),
|
169
|
+
"context_ranges": LLMContextRanges.from_dict(obj["context_ranges"]) if obj.get("context_ranges") is not None else None
|
170
|
+
})
|
171
|
+
return _obj
|
172
|
+
|
173
|
+
|