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.
Files changed (126) hide show
  1. qanswer_sdk/__init__.py +31 -24
  2. qanswer_sdk/api/__init__.py +0 -1
  3. qanswer_sdk/api/admin_api.py +914 -142
  4. qanswer_sdk/api/ai_assistant_access_rights_api.py +883 -280
  5. qanswer_sdk/api/ai_assistant_api.py +289 -61
  6. qanswer_sdk/api/branding_api.py +6 -6
  7. qanswer_sdk/api/connector_website_api.py +287 -0
  8. qanswer_sdk/api/connectors_api.py +863 -11
  9. qanswer_sdk/api/connectors_data_api.py +28 -27
  10. qanswer_sdk/api/mcp_api.py +1103 -469
  11. qanswer_sdk/api/payment_api.py +3 -3
  12. qanswer_sdk/api/socket_api.py +0 -245
  13. qanswer_sdk/api/task_ai_excel_api.py +288 -0
  14. qanswer_sdk/api/task_report_copilot_api.py +49 -122
  15. qanswer_sdk/api/tool_embedder_api.py +552 -1
  16. qanswer_sdk/api/tool_llm_api.py +1059 -10
  17. qanswer_sdk/api/unit_organizations_api.py +1240 -165
  18. qanswer_sdk/api/unit_user_api.py +506 -0
  19. qanswer_sdk/api_client.py +1 -1
  20. qanswer_sdk/configuration.py +1 -1
  21. qanswer_sdk/models/__init__.py +30 -22
  22. qanswer_sdk/models/access_pdf_payload_model.py +6 -4
  23. qanswer_sdk/models/add_qn_a_request.py +5 -3
  24. qanswer_sdk/models/{assistant_template.py → ai_assistant_clone_response.py} +9 -19
  25. qanswer_sdk/models/ai_assistant_dto.py +4 -2
  26. qanswer_sdk/models/ai_assistant_filter_dto.py +3 -1
  27. qanswer_sdk/models/{user_dataset_access_control_origin_header.py → ai_assistant_restricted_domain.py} +8 -8
  28. qanswer_sdk/models/ai_assistant_share_response.py +93 -0
  29. qanswer_sdk/models/api_key_mcp_authentication_config.py +2 -2
  30. qanswer_sdk/models/assistant_template_filter_dto.py +93 -0
  31. qanswer_sdk/models/{relation_extraction_schema.py → assistant_template_with_tools_selection_dto.py} +26 -24
  32. qanswer_sdk/models/audio_file_upload_payload.py +4 -2
  33. qanswer_sdk/models/auto_bot_description_request.py +5 -3
  34. qanswer_sdk/models/chatbot_chat_payload.py +6 -2
  35. qanswer_sdk/models/connector_type_dto.py +101 -0
  36. qanswer_sdk/models/{relation_extraction_data_input.py → connector_type_list_dto.py} +14 -14
  37. qanswer_sdk/models/conversation_message.py +37 -7
  38. qanswer_sdk/models/conversation_model.py +8 -2
  39. qanswer_sdk/models/credits_info_global_dto.py +95 -0
  40. qanswer_sdk/models/credits_info_organization_dto.py +93 -0
  41. qanswer_sdk/models/dataset_detail_kg.py +30 -10
  42. qanswer_sdk/models/dataset_schema.py +5 -1
  43. qanswer_sdk/models/dataset_update_object.py +8 -2
  44. qanswer_sdk/models/document_content_update_model.py +4 -2
  45. qanswer_sdk/models/econsilium_search_index_add_payload.py +3 -1
  46. qanswer_sdk/models/embedder_create_dto.py +9 -3
  47. qanswer_sdk/models/embedder_detailed_dto.py +9 -3
  48. qanswer_sdk/models/embedder_update_dto.py +9 -3
  49. qanswer_sdk/models/{relation_model.py → embedding_endpoint_import_failure.py} +8 -10
  50. qanswer_sdk/models/embedding_endpoint_import_response.py +99 -0
  51. qanswer_sdk/models/es_meta_data.py +98 -0
  52. qanswer_sdk/models/{get_file_es_meta_data_response.py → es_meta_data_value.py} +7 -11
  53. qanswer_sdk/models/feedback_update.py +4 -2
  54. qanswer_sdk/models/file_es_meta_data.py +31 -4
  55. qanswer_sdk/models/g_drive_download_request.py +3 -1
  56. qanswer_sdk/models/generate_ai_cells_payload.py +5 -3
  57. qanswer_sdk/models/highlight_audio_payload_model.py +6 -4
  58. qanswer_sdk/models/imap_add_payload.py +4 -2
  59. qanswer_sdk/models/list_socket_events.py +2 -2
  60. qanswer_sdk/models/llm_consumption.py +2 -2
  61. qanswer_sdk/models/llm_create_dto.py +25 -3
  62. qanswer_sdk/models/llm_detailed_dto.py +30 -4
  63. qanswer_sdk/models/llm_dto.py +18 -2
  64. qanswer_sdk/models/llm_endpoint.py +25 -3
  65. qanswer_sdk/models/llm_endpoint_import_failure.py +89 -0
  66. qanswer_sdk/models/{relation_extraction_data_output.py → llm_endpoint_import_response.py} +20 -16
  67. qanswer_sdk/models/llm_endpoint_read_input.py +25 -3
  68. qanswer_sdk/models/llm_endpoint_read_output.py +25 -3
  69. qanswer_sdk/models/llm_update_dto.py +25 -3
  70. qanswer_sdk/models/mcp_server.py +153 -0
  71. qanswer_sdk/models/mcp_server_create.py +4 -2
  72. qanswer_sdk/models/mcp_server_dto.py +6 -2
  73. qanswer_sdk/models/mcp_server_update.py +4 -2
  74. qanswer_sdk/models/mcp_tool.py +124 -0
  75. qanswer_sdk/models/mcp_tool_description_update.py +6 -4
  76. qanswer_sdk/models/mcp_tool_dto.py +3 -1
  77. qanswer_sdk/models/one_drive_download_request.py +3 -1
  78. qanswer_sdk/models/one_note_download_request.py +3 -1
  79. qanswer_sdk/models/organization_admin.py +4 -2
  80. qanswer_sdk/models/organization_filter_dto.py +4 -2
  81. qanswer_sdk/models/{relation_value_input.py → organization_mcp_server_setting.py} +29 -24
  82. qanswer_sdk/models/plan_dto.py +16 -4
  83. qanswer_sdk/models/publication_add_payload.py +4 -2
  84. qanswer_sdk/models/rag_payload.py +6 -2
  85. qanswer_sdk/models/report_copilot_generation_from_slots_payload.py +5 -3
  86. qanswer_sdk/models/report_copilot_refinement_payload.py +5 -3
  87. qanswer_sdk/models/report_copilot_slot_feedback_update.py +4 -2
  88. qanswer_sdk/models/report_template.py +3 -1
  89. qanswer_sdk/models/report_template_create_payload.py +4 -2
  90. qanswer_sdk/models/report_template_simplified.py +4 -2
  91. qanswer_sdk/models/report_template_update_payload.py +4 -2
  92. qanswer_sdk/models/report_templates_search_payload.py +104 -0
  93. qanswer_sdk/models/search_payload.py +6 -2
  94. qanswer_sdk/models/share_point_download_request.py +3 -1
  95. qanswer_sdk/models/socket_conversation_message.py +37 -7
  96. qanswer_sdk/models/template_toggle_request.py +5 -5
  97. qanswer_sdk/models/text2_sparql_payload.py +5 -1
  98. qanswer_sdk/models/thinking_block.py +91 -0
  99. qanswer_sdk/models/{subject_model.py → update_cells_payload.py} +10 -10
  100. qanswer_sdk/models/{relation_extraction_configuration.py → update_file_es_meta_data.py} +37 -26
  101. qanswer_sdk/models/{update_metadata_model.py → update_metadata_model_input.py} +7 -7
  102. qanswer_sdk/models/{relation_extraction_task_settings_update_payload.py → update_metadata_model_output.py} +14 -12
  103. qanswer_sdk/models/update_qn_a_pair_request.py +4 -2
  104. qanswer_sdk/models/{relation_extraction_template_payload.py → update_template_cells_payload.py} +19 -15
  105. qanswer_sdk/models/user.py +10 -5
  106. qanswer_sdk/models/user_credits_config_dto.py +95 -0
  107. qanswer_sdk/models/user_credits_dto.py +104 -0
  108. qanswer_sdk/models/user_dataset.py +31 -11
  109. qanswer_sdk/models/{relation_extraction_row_output.py → user_dataset_mcp_tool_selection.py} +33 -26
  110. qanswer_sdk/models/user_dataset_mcp_tool_selection_dto.py +3 -1
  111. qanswer_sdk/models/user_filter_dto.py +4 -2
  112. qanswer_sdk/models/{relation_extraction_row_input.py → user_mcp_tool_selection.py} +31 -26
  113. qanswer_sdk/models/user_mcp_tool_selection_dto.py +3 -1
  114. qanswer_sdk/models/user_profile_dto.py +16 -4
  115. qanswer_sdk/models/{value_model.py → websearch_scraping_site.py} +11 -17
  116. qanswer_sdk/models/website_add_payload.py +4 -2
  117. {qanswer_sdk-3.1508.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/METADATA +2 -2
  118. {qanswer_sdk-3.1508.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/RECORD +119 -112
  119. qanswer_sdk/api/task_relation_extraction_api.py +0 -3636
  120. qanswer_sdk/models/export_relation_extraction_table_request.py +0 -97
  121. qanswer_sdk/models/relation_extraction_payload.py +0 -117
  122. qanswer_sdk/models/relation_extraction_task_settings.py +0 -125
  123. qanswer_sdk/models/relation_extraction_task_update.py +0 -125
  124. qanswer_sdk/models/relation_value_output.py +0 -103
  125. qanswer_sdk/models/socket_data_extraction.py +0 -109
  126. {qanswer_sdk-3.1508.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/WHEEL +0 -0
@@ -1,97 +0,0 @@
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
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from qanswer_sdk.models.relation_extraction_data_input import RelationExtractionDataInput
23
- from qanswer_sdk.models.relation_extraction_template_payload import RelationExtractionTemplatePayload
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class ExportRelationExtractionTableRequest(BaseModel):
28
- """
29
- ExportRelationExtractionTableRequest
30
- """ # noqa: E501
31
- template_payload: Optional[RelationExtractionTemplatePayload] = Field(default=None, alias="templatePayload")
32
- extraction_data_input: Optional[RelationExtractionDataInput] = Field(default=None, alias="extractionDataInput")
33
- __properties: ClassVar[List[str]] = ["templatePayload", "extractionDataInput"]
34
-
35
- model_config = ConfigDict(
36
- populate_by_name=True,
37
- validate_assignment=True,
38
- protected_namespaces=(),
39
- )
40
-
41
-
42
- def to_str(self) -> str:
43
- """Returns the string representation of the model using alias"""
44
- return pprint.pformat(self.model_dump(by_alias=True))
45
-
46
- def to_json(self) -> str:
47
- """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
50
-
51
- @classmethod
52
- def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of ExportRelationExtractionTableRequest from a JSON string"""
54
- return cls.from_dict(json.loads(json_str))
55
-
56
- def to_dict(self) -> Dict[str, Any]:
57
- """Return the dictionary representation of the model using alias.
58
-
59
- This has the following differences from calling pydantic's
60
- `self.model_dump(by_alias=True)`:
61
-
62
- * `None` is only added to the output dict for nullable fields that
63
- were set at model initialization. Other fields with value `None`
64
- are ignored.
65
- """
66
- excluded_fields: Set[str] = set([
67
- ])
68
-
69
- _dict = self.model_dump(
70
- by_alias=True,
71
- exclude=excluded_fields,
72
- exclude_none=True,
73
- )
74
- # override the default output from pydantic by calling `to_dict()` of template_payload
75
- if self.template_payload:
76
- _dict['templatePayload'] = self.template_payload.to_dict()
77
- # override the default output from pydantic by calling `to_dict()` of extraction_data_input
78
- if self.extraction_data_input:
79
- _dict['extractionDataInput'] = self.extraction_data_input.to_dict()
80
- return _dict
81
-
82
- @classmethod
83
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of ExportRelationExtractionTableRequest from a dict"""
85
- if obj is None:
86
- return None
87
-
88
- if not isinstance(obj, dict):
89
- return cls.model_validate(obj)
90
-
91
- _obj = cls.model_validate({
92
- "templatePayload": RelationExtractionTemplatePayload.from_dict(obj["templatePayload"]) if obj.get("templatePayload") is not None else None,
93
- "extractionDataInput": RelationExtractionDataInput.from_dict(obj["extractionDataInput"]) if obj.get("extractionDataInput") is not None else None
94
- })
95
- return _obj
96
-
97
-
@@ -1,117 +0,0 @@
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, Optional
22
- from qanswer_sdk.models.relation_extraction_data_input import RelationExtractionDataInput
23
- from qanswer_sdk.models.relation_model import RelationModel
24
- from qanswer_sdk.models.subject_model import SubjectModel
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class RelationExtractionPayload(BaseModel):
29
- """
30
- RelationExtractionPayload
31
- """ # noqa: E501
32
- subject_entities: List[SubjectModel]
33
- relations: List[RelationModel]
34
- extracted_data: Optional[RelationExtractionDataInput] = None
35
- username: StrictStr
36
- dataset: StrictStr
37
- conversation_id: StrictStr
38
- __properties: ClassVar[List[str]] = ["subject_entities", "relations", "extracted_data", "username", "dataset", "conversation_id"]
39
-
40
- model_config = ConfigDict(
41
- populate_by_name=True,
42
- validate_assignment=True,
43
- protected_namespaces=(),
44
- )
45
-
46
-
47
- def to_str(self) -> str:
48
- """Returns the string representation of the model using alias"""
49
- return pprint.pformat(self.model_dump(by_alias=True))
50
-
51
- def to_json(self) -> str:
52
- """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
-
56
- @classmethod
57
- def from_json(cls, json_str: str) -> Optional[Self]:
58
- """Create an instance of RelationExtractionPayload from a JSON string"""
59
- return cls.from_dict(json.loads(json_str))
60
-
61
- def to_dict(self) -> Dict[str, Any]:
62
- """Return the dictionary representation of the model using alias.
63
-
64
- This has the following differences from calling pydantic's
65
- `self.model_dump(by_alias=True)`:
66
-
67
- * `None` is only added to the output dict for nullable fields that
68
- were set at model initialization. Other fields with value `None`
69
- are ignored.
70
- """
71
- excluded_fields: Set[str] = set([
72
- ])
73
-
74
- _dict = self.model_dump(
75
- by_alias=True,
76
- exclude=excluded_fields,
77
- exclude_none=True,
78
- )
79
- # override the default output from pydantic by calling `to_dict()` of each item in subject_entities (list)
80
- _items = []
81
- if self.subject_entities:
82
- for _item_subject_entities in self.subject_entities:
83
- if _item_subject_entities:
84
- _items.append(_item_subject_entities.to_dict())
85
- _dict['subject_entities'] = _items
86
- # override the default output from pydantic by calling `to_dict()` of each item in relations (list)
87
- _items = []
88
- if self.relations:
89
- for _item_relations in self.relations:
90
- if _item_relations:
91
- _items.append(_item_relations.to_dict())
92
- _dict['relations'] = _items
93
- # override the default output from pydantic by calling `to_dict()` of extracted_data
94
- if self.extracted_data:
95
- _dict['extracted_data'] = self.extracted_data.to_dict()
96
- return _dict
97
-
98
- @classmethod
99
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
100
- """Create an instance of RelationExtractionPayload from a dict"""
101
- if obj is None:
102
- return None
103
-
104
- if not isinstance(obj, dict):
105
- return cls.model_validate(obj)
106
-
107
- _obj = cls.model_validate({
108
- "subject_entities": [SubjectModel.from_dict(_item) for _item in obj["subject_entities"]] if obj.get("subject_entities") is not None else None,
109
- "relations": [RelationModel.from_dict(_item) for _item in obj["relations"]] if obj.get("relations") is not None else None,
110
- "extracted_data": RelationExtractionDataInput.from_dict(obj["extracted_data"]) if obj.get("extracted_data") is not None else None,
111
- "username": obj.get("username"),
112
- "dataset": obj.get("dataset"),
113
- "conversation_id": obj.get("conversation_id")
114
- })
115
- return _obj
116
-
117
-
@@ -1,125 +0,0 @@
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, StrictFloat, StrictInt, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from qanswer_sdk.models.llm_endpoint_read_output import LLMEndpointReadOutput
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class RelationExtractionTaskSettings(BaseModel):
27
- """
28
- RelationExtractionTaskSettings
29
- """ # noqa: E501
30
- prompt: Optional[StrictStr] = None
31
- bot_seed: Optional[StrictInt] = None
32
- bot_temperature: Optional[Union[StrictFloat, StrictInt]] = None
33
- bot_answer_length: Optional[StrictStr] = None
34
- number_of_references: Optional[StrictInt] = None
35
- stream_speed: Optional[Union[StrictFloat, StrictInt]] = None
36
- context_window: Optional[StrictInt] = None
37
- max_tokens: Optional[StrictInt] = None
38
- slots_values: Optional[Dict[str, StrictStr]] = None
39
- bot_name: Optional[StrictStr] = None
40
- bot_description: Optional[StrictStr] = None
41
- llm_id: Optional[StrictInt] = Field(default=None, description="The LLM ID. This field is populated based on the llm_choice.")
42
- llm_endpoint: Optional[LLMEndpointReadOutput] = None
43
- __properties: ClassVar[List[str]] = ["prompt", "bot_seed", "bot_temperature", "bot_answer_length", "number_of_references", "stream_speed", "context_window", "max_tokens", "slots_values", "bot_name", "bot_description", "llm_id", "llm_endpoint"]
44
-
45
- @field_validator('bot_answer_length')
46
- def bot_answer_length_validate_enum(cls, value):
47
- """Validates the enum"""
48
- if value is None:
49
- return value
50
-
51
- if value not in set(['short', 'brief', 'long']):
52
- raise ValueError("must be one of enum values ('short', 'brief', 'long')")
53
- return value
54
-
55
- model_config = ConfigDict(
56
- populate_by_name=True,
57
- validate_assignment=True,
58
- protected_namespaces=(),
59
- )
60
-
61
-
62
- def to_str(self) -> str:
63
- """Returns the string representation of the model using alias"""
64
- return pprint.pformat(self.model_dump(by_alias=True))
65
-
66
- def to_json(self) -> str:
67
- """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
-
71
- @classmethod
72
- def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of RelationExtractionTaskSettings from a JSON string"""
74
- return cls.from_dict(json.loads(json_str))
75
-
76
- def to_dict(self) -> Dict[str, Any]:
77
- """Return the dictionary representation of the model using alias.
78
-
79
- This has the following differences from calling pydantic's
80
- `self.model_dump(by_alias=True)`:
81
-
82
- * `None` is only added to the output dict for nullable fields that
83
- were set at model initialization. Other fields with value `None`
84
- are ignored.
85
- """
86
- excluded_fields: Set[str] = set([
87
- ])
88
-
89
- _dict = self.model_dump(
90
- by_alias=True,
91
- exclude=excluded_fields,
92
- exclude_none=True,
93
- )
94
- # override the default output from pydantic by calling `to_dict()` of llm_endpoint
95
- if self.llm_endpoint:
96
- _dict['llm_endpoint'] = self.llm_endpoint.to_dict()
97
- return _dict
98
-
99
- @classmethod
100
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
101
- """Create an instance of RelationExtractionTaskSettings from a dict"""
102
- if obj is None:
103
- return None
104
-
105
- if not isinstance(obj, dict):
106
- return cls.model_validate(obj)
107
-
108
- _obj = cls.model_validate({
109
- "prompt": obj.get("prompt"),
110
- "bot_seed": obj.get("bot_seed"),
111
- "bot_temperature": obj.get("bot_temperature"),
112
- "bot_answer_length": obj.get("bot_answer_length"),
113
- "number_of_references": obj.get("number_of_references"),
114
- "stream_speed": obj.get("stream_speed"),
115
- "context_window": obj.get("context_window"),
116
- "max_tokens": obj.get("max_tokens"),
117
- "slots_values": obj.get("slots_values"),
118
- "bot_name": obj.get("bot_name"),
119
- "bot_description": obj.get("bot_description"),
120
- "llm_id": obj.get("llm_id"),
121
- "llm_endpoint": LLMEndpointReadOutput.from_dict(obj["llm_endpoint"]) if obj.get("llm_endpoint") is not None else None
122
- })
123
- return _obj
124
-
125
-
@@ -1,125 +0,0 @@
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, StrictFloat, StrictInt, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from qanswer_sdk.models.llm_endpoint_read_input import LLMEndpointReadInput
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class RelationExtractionTaskUpdate(BaseModel):
27
- """
28
- RelationExtractionTaskUpdate
29
- """ # noqa: E501
30
- prompt: Optional[StrictStr] = None
31
- bot_seed: Optional[StrictInt] = None
32
- bot_temperature: Optional[Union[StrictFloat, StrictInt]] = None
33
- bot_answer_length: Optional[StrictStr] = None
34
- number_of_references: Optional[StrictInt] = None
35
- stream_speed: Optional[Union[StrictFloat, StrictInt]] = None
36
- context_window: Optional[StrictInt] = None
37
- max_tokens: Optional[StrictInt] = None
38
- slots_values: Optional[Dict[str, StrictStr]] = None
39
- bot_name: Optional[StrictStr] = None
40
- bot_description: Optional[StrictStr] = None
41
- llm_id: Optional[StrictInt] = Field(default=None, description="The LLM ID. This field is populated based on the llm_choice.")
42
- llm_endpoint: Optional[LLMEndpointReadInput] = None
43
- __properties: ClassVar[List[str]] = ["prompt", "bot_seed", "bot_temperature", "bot_answer_length", "number_of_references", "stream_speed", "context_window", "max_tokens", "slots_values", "bot_name", "bot_description", "llm_id", "llm_endpoint"]
44
-
45
- @field_validator('bot_answer_length')
46
- def bot_answer_length_validate_enum(cls, value):
47
- """Validates the enum"""
48
- if value is None:
49
- return value
50
-
51
- if value not in set(['short', 'brief', 'long']):
52
- raise ValueError("must be one of enum values ('short', 'brief', 'long')")
53
- return value
54
-
55
- model_config = ConfigDict(
56
- populate_by_name=True,
57
- validate_assignment=True,
58
- protected_namespaces=(),
59
- )
60
-
61
-
62
- def to_str(self) -> str:
63
- """Returns the string representation of the model using alias"""
64
- return pprint.pformat(self.model_dump(by_alias=True))
65
-
66
- def to_json(self) -> str:
67
- """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
-
71
- @classmethod
72
- def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of RelationExtractionTaskUpdate from a JSON string"""
74
- return cls.from_dict(json.loads(json_str))
75
-
76
- def to_dict(self) -> Dict[str, Any]:
77
- """Return the dictionary representation of the model using alias.
78
-
79
- This has the following differences from calling pydantic's
80
- `self.model_dump(by_alias=True)`:
81
-
82
- * `None` is only added to the output dict for nullable fields that
83
- were set at model initialization. Other fields with value `None`
84
- are ignored.
85
- """
86
- excluded_fields: Set[str] = set([
87
- ])
88
-
89
- _dict = self.model_dump(
90
- by_alias=True,
91
- exclude=excluded_fields,
92
- exclude_none=True,
93
- )
94
- # override the default output from pydantic by calling `to_dict()` of llm_endpoint
95
- if self.llm_endpoint:
96
- _dict['llm_endpoint'] = self.llm_endpoint.to_dict()
97
- return _dict
98
-
99
- @classmethod
100
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
101
- """Create an instance of RelationExtractionTaskUpdate from a dict"""
102
- if obj is None:
103
- return None
104
-
105
- if not isinstance(obj, dict):
106
- return cls.model_validate(obj)
107
-
108
- _obj = cls.model_validate({
109
- "prompt": obj.get("prompt"),
110
- "bot_seed": obj.get("bot_seed"),
111
- "bot_temperature": obj.get("bot_temperature"),
112
- "bot_answer_length": obj.get("bot_answer_length"),
113
- "number_of_references": obj.get("number_of_references"),
114
- "stream_speed": obj.get("stream_speed"),
115
- "context_window": obj.get("context_window"),
116
- "max_tokens": obj.get("max_tokens"),
117
- "slots_values": obj.get("slots_values"),
118
- "bot_name": obj.get("bot_name"),
119
- "bot_description": obj.get("bot_description"),
120
- "llm_id": obj.get("llm_id"),
121
- "llm_endpoint": LLMEndpointReadInput.from_dict(obj["llm_endpoint"]) if obj.get("llm_endpoint") is not None else None
122
- })
123
- return _obj
124
-
125
-
@@ -1,103 +0,0 @@
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
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from qanswer_sdk.models.relation_model import RelationModel
23
- from qanswer_sdk.models.value_model import ValueModel
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class RelationValueOutput(BaseModel):
28
- """
29
- RelationValueOutput
30
- """ # noqa: E501
31
- relation: RelationModel
32
- value: ValueModel
33
- mutable: Optional[StrictBool] = None
34
- index: Optional[StrictInt] = None
35
- cell_id: Optional[StrictInt] = None
36
- __properties: ClassVar[List[str]] = ["relation", "value", "mutable", "index", "cell_id"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of RelationValueOutput from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([
70
- ])
71
-
72
- _dict = self.model_dump(
73
- by_alias=True,
74
- exclude=excluded_fields,
75
- exclude_none=True,
76
- )
77
- # override the default output from pydantic by calling `to_dict()` of relation
78
- if self.relation:
79
- _dict['relation'] = self.relation.to_dict()
80
- # override the default output from pydantic by calling `to_dict()` of value
81
- if self.value:
82
- _dict['value'] = self.value.to_dict()
83
- return _dict
84
-
85
- @classmethod
86
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of RelationValueOutput from a dict"""
88
- if obj is None:
89
- return None
90
-
91
- if not isinstance(obj, dict):
92
- return cls.model_validate(obj)
93
-
94
- _obj = cls.model_validate({
95
- "relation": RelationModel.from_dict(obj["relation"]) if obj.get("relation") is not None else None,
96
- "value": ValueModel.from_dict(obj["value"]) if obj.get("value") is not None else None,
97
- "mutable": obj.get("mutable"),
98
- "index": obj.get("index"),
99
- "cell_id": obj.get("cell_id")
100
- })
101
- return _obj
102
-
103
-
@@ -1,109 +0,0 @@
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, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from qanswer_sdk.models.relation_value_output import RelationValueOutput
23
- from qanswer_sdk.models.subject_model import SubjectModel
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class SocketDataExtraction(BaseModel):
28
- """
29
- SocketDataExtraction
30
- """ # noqa: E501
31
- username: StrictStr = Field(description="Username of the dataset")
32
- dataset: StrictStr = Field(description="Name of the dataset")
33
- jwt: StrictStr = Field(description="JTW token for authentification to join the conversation.")
34
- api_key: Optional[StrictStr] = Field(default=None, description="Api ley for authentification to join the conversation.")
35
- subject: Optional[SubjectModel] = None
36
- subject_relations: List[RelationValueOutput]
37
- __properties: ClassVar[List[str]] = ["username", "dataset", "jwt", "api_key", "subject", "subject_relations"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
-
46
- def to_str(self) -> str:
47
- """Returns the string representation of the model using alias"""
48
- return pprint.pformat(self.model_dump(by_alias=True))
49
-
50
- def to_json(self) -> str:
51
- """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
-
55
- @classmethod
56
- def from_json(cls, json_str: str) -> Optional[Self]:
57
- """Create an instance of SocketDataExtraction from a JSON string"""
58
- return cls.from_dict(json.loads(json_str))
59
-
60
- def to_dict(self) -> Dict[str, Any]:
61
- """Return the dictionary representation of the model using alias.
62
-
63
- This has the following differences from calling pydantic's
64
- `self.model_dump(by_alias=True)`:
65
-
66
- * `None` is only added to the output dict for nullable fields that
67
- were set at model initialization. Other fields with value `None`
68
- are ignored.
69
- """
70
- excluded_fields: Set[str] = set([
71
- ])
72
-
73
- _dict = self.model_dump(
74
- by_alias=True,
75
- exclude=excluded_fields,
76
- exclude_none=True,
77
- )
78
- # override the default output from pydantic by calling `to_dict()` of subject
79
- if self.subject:
80
- _dict['subject'] = self.subject.to_dict()
81
- # override the default output from pydantic by calling `to_dict()` of each item in subject_relations (list)
82
- _items = []
83
- if self.subject_relations:
84
- for _item_subject_relations in self.subject_relations:
85
- if _item_subject_relations:
86
- _items.append(_item_subject_relations.to_dict())
87
- _dict['subject_relations'] = _items
88
- return _dict
89
-
90
- @classmethod
91
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
- """Create an instance of SocketDataExtraction from a dict"""
93
- if obj is None:
94
- return None
95
-
96
- if not isinstance(obj, dict):
97
- return cls.model_validate(obj)
98
-
99
- _obj = cls.model_validate({
100
- "username": obj.get("username"),
101
- "dataset": obj.get("dataset"),
102
- "jwt": obj.get("jwt"),
103
- "api_key": obj.get("api_key"),
104
- "subject": SubjectModel.from_dict(obj["subject"]) if obj.get("subject") is not None else None,
105
- "subject_relations": [RelationValueOutput.from_dict(_item) for _item in obj["subject_relations"]] if obj.get("subject_relations") is not None else None
106
- })
107
- return _obj
108
-
109
-