qanswer_sdk 3.1212.0__py3-none-any.whl → 3.1244.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 (140) hide show
  1. qanswer_sdk/__init__.py +66 -43
  2. qanswer_sdk/api/__init__.py +7 -4
  3. qanswer_sdk/api/admin_api.py +590 -7695
  4. qanswer_sdk/api/ai_assistant_access_rights_api.py +72 -73
  5. qanswer_sdk/api/ai_assistant_api.py +567 -46
  6. qanswer_sdk/api/branding_api.py +4578 -0
  7. qanswer_sdk/api/chatbot_api.py +72 -87
  8. qanswer_sdk/api/{tag_api.py → connector_imap_connector_api.py} +415 -997
  9. qanswer_sdk/api/connector_rdf_api.py +30 -31
  10. qanswer_sdk/api/connectors_api.py +183 -166
  11. qanswer_sdk/api/connectors_data_api.py +345 -1
  12. qanswer_sdk/api/dataset_config_api.py +0 -245
  13. qanswer_sdk/api/llm_api.py +30 -30
  14. qanswer_sdk/api/payment_api.py +17 -16
  15. qanswer_sdk/api/speech_to_text_api.py +2 -2
  16. qanswer_sdk/api/task_chat_api.py +8 -7
  17. qanswer_sdk/api/task_rdf_linker_api.py +35 -36
  18. qanswer_sdk/api/task_rdf_sparql_endpoint_api.py +16 -16
  19. qanswer_sdk/api/task_report_copilot_api.py +895 -281
  20. qanswer_sdk/api/task_search_api.py +8 -7
  21. qanswer_sdk/api/tool_embedder_api.py +4040 -0
  22. qanswer_sdk/api/{user_api.py → tool_llm_api.py} +735 -2749
  23. qanswer_sdk/api/unit_organizations_api.py +4547 -0
  24. qanswer_sdk/api/unit_teams_api.py +3906 -0
  25. qanswer_sdk/api/{organizations_teams_api.py → unit_user_api.py} +1345 -1394
  26. qanswer_sdk/api_client.py +1 -1
  27. qanswer_sdk/configuration.py +1 -1
  28. qanswer_sdk/models/__init__.py +58 -38
  29. qanswer_sdk/models/aggregation.py +2 -2
  30. qanswer_sdk/models/ai_assistant_filter_dto.py +105 -0
  31. qanswer_sdk/models/{user_profile_paginated.py → ai_assistant_list.py} +18 -18
  32. qanswer_sdk/models/{embedding_model.py → available_aggregation.py} +13 -11
  33. qanswer_sdk/models/available_connectors_response.py +2 -2
  34. qanswer_sdk/models/{branding_data.py → branding_app_title.py} +4 -4
  35. qanswer_sdk/models/{api_response.py → branding_system_message.py} +8 -8
  36. qanswer_sdk/models/chat_task_settings.py +12 -12
  37. qanswer_sdk/models/chat_task_update.py +13 -5
  38. qanswer_sdk/models/chatbot_chat_payload.py +19 -2
  39. qanswer_sdk/models/chatbot_conversation_model.py +10 -0
  40. qanswer_sdk/models/chatbot_response.py +22 -2
  41. qanswer_sdk/models/{user_chatbot_setting_payload.py → chatbot_setting_dto.py} +12 -13
  42. qanswer_sdk/models/chatbot_setting_request.py +96 -0
  43. qanswer_sdk/models/{question_completion.py → clip_connector_file_structure.py} +9 -9
  44. qanswer_sdk/models/clip_connector_structure.py +97 -0
  45. qanswer_sdk/models/connector_model.py +2 -2
  46. qanswer_sdk/models/conversation_message.py +4 -12
  47. qanswer_sdk/models/{cost_summary.py → cost_summary_dto.py} +4 -4
  48. qanswer_sdk/models/create_connector_request.py +4 -2
  49. qanswer_sdk/models/create_imap_connector_request.py +105 -0
  50. qanswer_sdk/models/create_pinecone_connector_request.py +3 -1
  51. qanswer_sdk/models/create_sharepoint_connector_from_certificate_request.py +3 -1
  52. qanswer_sdk/models/create_sharepoint_connector_request.py +3 -1
  53. qanswer_sdk/models/dataset_detail_kg.py +27 -1
  54. qanswer_sdk/models/dataset_schema.py +4 -2
  55. qanswer_sdk/models/dataset_update_object.py +3 -1
  56. qanswer_sdk/models/delete_connector_model.py +2 -2
  57. qanswer_sdk/models/delete_connectors_response.py +2 -4
  58. qanswer_sdk/models/{json_nullable_source_metadata.py → duplicate_report_template_response.py} +11 -9
  59. qanswer_sdk/models/{json_nullable_file_failure_reason.py → email_folder.py} +12 -8
  60. qanswer_sdk/models/{embedding_endpoint.py → embedder_detailed_dto.py} +16 -8
  61. qanswer_sdk/models/{tag_payload.py → embedder_dto.py} +11 -7
  62. qanswer_sdk/models/{pageable_object.py → embedder_list_dto.py} +20 -20
  63. qanswer_sdk/models/embedding_endpoint_create.py +3 -1
  64. qanswer_sdk/models/embedding_endpoint_update.py +4 -2
  65. qanswer_sdk/models/{sort_object.py → entity_description.py} +16 -12
  66. qanswer_sdk/models/{dataset_description.py → entity_description_dto.py} +9 -7
  67. qanswer_sdk/models/file_model.py +2 -2
  68. qanswer_sdk/models/imap_add_payload.py +103 -0
  69. qanswer_sdk/models/imap_additional_fields.py +101 -0
  70. qanswer_sdk/models/imap_file_metadata.py +114 -0
  71. qanswer_sdk/models/imap_search_response.py +113 -0
  72. qanswer_sdk/models/llm.py +129 -0
  73. qanswer_sdk/models/llm_consumption.py +118 -0
  74. qanswer_sdk/models/{pageable.py → llm_context_ranges.py} +14 -13
  75. qanswer_sdk/models/{llm_cost.py → llm_cost_filter.py} +11 -7
  76. qanswer_sdk/models/llm_cost_list.py +101 -0
  77. qanswer_sdk/models/llm_detailed_dto.py +179 -0
  78. qanswer_sdk/models/{llm_details.py → llm_dto.py} +14 -18
  79. qanswer_sdk/models/llm_endpoint.py +8 -2
  80. qanswer_sdk/models/llm_endpoint_read_input.py +173 -0
  81. qanswer_sdk/models/llm_endpoint_read_output.py +173 -0
  82. qanswer_sdk/models/llm_filter_dto.py +99 -0
  83. qanswer_sdk/models/llm_list_detailed_dto.py +101 -0
  84. qanswer_sdk/models/llm_list_dto.py +101 -0
  85. qanswer_sdk/models/modify_connector_request.py +5 -11
  86. qanswer_sdk/models/{o_auth_service.py → o_auth_service_dto.py} +4 -4
  87. qanswer_sdk/models/organization_admin.py +95 -0
  88. qanswer_sdk/models/organization_filter_dto.py +97 -0
  89. qanswer_sdk/models/organization_list_dto.py +101 -0
  90. qanswer_sdk/models/organization_llm.py +103 -0
  91. qanswer_sdk/models/{plan.py → plan_dto.py} +4 -4
  92. qanswer_sdk/models/prompt_token_count_details.py +3 -3
  93. qanswer_sdk/models/rag_payload.py +4 -4
  94. qanswer_sdk/models/rag_response.py +4 -2
  95. qanswer_sdk/models/relation_extraction_task_settings.py +12 -10
  96. qanswer_sdk/models/relation_extraction_task_update.py +14 -4
  97. qanswer_sdk/models/report_copilot_slot_task_settings.py +12 -10
  98. qanswer_sdk/models/report_copilot_slot_task_update.py +13 -3
  99. qanswer_sdk/models/report_copilot_task_settings.py +12 -10
  100. qanswer_sdk/models/report_copilot_task_update.py +14 -4
  101. qanswer_sdk/models/{report_copilot_template.py → report_template.py} +17 -7
  102. qanswer_sdk/models/{report_copilot_create_payload.py → report_template_create_payload.py} +4 -4
  103. qanswer_sdk/models/{report_copilot_template_simplified.py → report_template_simplified.py} +11 -7
  104. qanswer_sdk/models/{report_copilot_export_template_as_docx_payload_simplified.py → report_template_simplified_payload.py} +4 -4
  105. qanswer_sdk/models/{report_copilot_update_payload.py → report_template_update_payload.py} +15 -9
  106. qanswer_sdk/models/search_task_settings.py +12 -12
  107. qanswer_sdk/models/search_task_update.py +13 -3
  108. qanswer_sdk/models/{set_logo1_request.py → set_logo2_request.py} +4 -4
  109. qanswer_sdk/models/shared_organization_access.py +7 -3
  110. qanswer_sdk/models/shared_team_access.py +10 -4
  111. qanswer_sdk/models/slot.py +5 -1
  112. qanswer_sdk/models/slot_update.py +5 -1
  113. qanswer_sdk/models/socket_conversation_message.py +3 -11
  114. qanswer_sdk/models/socket_file_metadata.py +17 -11
  115. qanswer_sdk/models/source_metadata.py +109 -0
  116. qanswer_sdk/models/{tag_qa_list_payload.py → subscription_response.py} +22 -21
  117. qanswer_sdk/models/{team_with_count.py → team_admin.py} +8 -8
  118. qanswer_sdk/models/{team_filter.py → team_filter_dto.py} +16 -6
  119. qanswer_sdk/models/team_list_dto.py +101 -0
  120. qanswer_sdk/models/{available_endpoints_response.py → template_clip_structure_input.py} +14 -14
  121. qanswer_sdk/models/{available_embedding_models_response.py → template_clip_structure_output.py} +14 -14
  122. qanswer_sdk/models/test_imap_connection_payload.py +95 -0
  123. qanswer_sdk/models/text2_sparql_payload.py +4 -4
  124. qanswer_sdk/models/text2_sparql_task_settings.py +12 -10
  125. qanswer_sdk/models/text2_sparql_task_update.py +14 -4
  126. qanswer_sdk/models/{user_chatbot_setting_response.py → user_chatbot_setting.py} +24 -24
  127. qanswer_sdk/models/user_dataset.py +38 -2
  128. qanswer_sdk/models/{qa_metadata_payload.py → user_dataset_shared.py} +27 -37
  129. qanswer_sdk/models/{user_filter.py → user_filter_dto.py} +4 -4
  130. qanswer_sdk/models/{user_profile.py → user_profile_dto.py} +10 -10
  131. qanswer_sdk/models/user_profile_list_dto.py +3 -3
  132. qanswer_sdk/models/widget_configs.py +4 -2
  133. {qanswer_sdk-3.1212.0.dist-info → qanswer_sdk-3.1244.0.dist-info}/METADATA +2 -2
  134. {qanswer_sdk-3.1212.0.dist-info → qanswer_sdk-3.1244.0.dist-info}/RECORD +135 -112
  135. qanswer_sdk/api/llm_consumption_controller_api.py +0 -310
  136. qanswer_sdk/models/organization_filter.py +0 -87
  137. qanswer_sdk/models/page_organization.py +0 -123
  138. qanswer_sdk/models/page_team_with_count.py +0 -123
  139. qanswer_sdk/models/tag_qa_payload.py +0 -91
  140. {qanswer_sdk-3.1212.0.dist-info → qanswer_sdk-3.1244.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,95 @@
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class TestImapConnectionPayload(BaseModel):
26
+ """
27
+ TestImapConnectionPayload
28
+ """ # noqa: E501
29
+ imap_server: StrictStr
30
+ email: StrictStr
31
+ password: StrictStr
32
+ port: Optional[StrictInt] = None
33
+ use_ssl: Optional[StrictBool] = None
34
+ __properties: ClassVar[List[str]] = ["imap_server", "email", "password", "port", "use_ssl"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of TestImapConnectionPayload from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of TestImapConnectionPayload from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "imap_server": obj.get("imap_server"),
88
+ "email": obj.get("email"),
89
+ "password": obj.get("password"),
90
+ "port": obj.get("port"),
91
+ "use_ssl": obj.get("use_ssl")
92
+ })
93
+ return _obj
94
+
95
+
@@ -32,9 +32,8 @@ class Text2SparqlPayload(BaseModel):
32
32
  dataset: StrictStr = Field(description="The dataset to be queried for information.")
33
33
  image_urls: Optional[List[StrictStr]] = Field(default=None, description="List of image URLs to be processed if provided.")
34
34
  parent_message_id: Optional[StrictStr] = Field(default=None, description="ID of the parent generation (message_id of parent response or question) if applicable; used for tracking multi-turn conversations.")
35
- conversation_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the conversation.")
35
+ conversation_id: StrictStr = Field(description="Unique identifier for the conversation.")
36
36
  is_regenerate: Optional[StrictBool] = Field(default=None, description="Indicates if the user is asking for a regenerated response.")
37
- auto_filters: Optional[StrictBool] = Field(default=None, description="Determines whether the auto filters should be used for the response.")
38
37
  origin: Optional[StrictStr] = Field(default=None, description="The username or IP address of the user making the request.")
39
38
  text_fragmentation: Optional[StrictBool] = Field(default=None, description="Detemines wether links for website sources should have text fragments.")
40
39
  interface_origin: Optional[StrictStr] = Field(default=None, description="The interface from which the request originated (search, chat, microsoft_teams, etc.).")
@@ -45,13 +44,14 @@ class Text2SparqlPayload(BaseModel):
45
44
  talk_to_web: Optional[StrictBool] = Field(default=None, description="Determines whether the response should be sent to the web interface.")
46
45
  original_question: Optional[StrictStr] = Field(default=None, description="The original question submitted to the model.")
47
46
  oauth_token: Optional[StrictStr] = Field(default=None, description="The oauth token")
47
+ auto_filters: Optional[StrictBool] = Field(default=None, description="Determines whether the auto filters should be used for the response.")
48
48
  filters: Optional[List[List[SearchMetadataFilter]]] = None
49
49
  index_hashes: Optional[List[Dict[str, Any]]] = Field(default=None, description="The hashes of the indexes to be used for the response.")
50
50
  agentic_chatbot_enabled: Optional[StrictBool] = Field(default=None, description="Whether the agentic chatbot is enabled.")
51
51
  conversation_has_clip: Optional[StrictBool] = Field(default=None, description="Indicates whether the conversation has a clip associated with it.")
52
52
  current_time: Optional[StrictStr] = Field(default=None, description="The current time to be used in the prompt, if applicable.")
53
53
  validate_sparql: Optional[StrictBool] = None
54
- __properties: ClassVar[List[str]] = ["question", "username", "dataset", "image_urls", "parent_message_id", "conversation_id", "is_regenerate", "auto_filters", "origin", "text_fragmentation", "interface_origin", "system_prompt", "prompt", "additional_fields", "bypass_guardrail", "talk_to_web", "original_question", "oauth_token", "filters", "index_hashes", "agentic_chatbot_enabled", "conversation_has_clip", "current_time", "validate_sparql"]
54
+ __properties: ClassVar[List[str]] = ["question", "username", "dataset", "image_urls", "parent_message_id", "conversation_id", "is_regenerate", "origin", "text_fragmentation", "interface_origin", "system_prompt", "prompt", "additional_fields", "bypass_guardrail", "talk_to_web", "original_question", "oauth_token", "auto_filters", "filters", "index_hashes", "agentic_chatbot_enabled", "conversation_has_clip", "current_time", "validate_sparql"]
55
55
 
56
56
  @field_validator('interface_origin')
57
57
  def interface_origin_validate_enum(cls, value):
@@ -130,7 +130,6 @@ class Text2SparqlPayload(BaseModel):
130
130
  "parent_message_id": obj.get("parent_message_id"),
131
131
  "conversation_id": obj.get("conversation_id"),
132
132
  "is_regenerate": obj.get("is_regenerate"),
133
- "auto_filters": obj.get("auto_filters"),
134
133
  "origin": obj.get("origin"),
135
134
  "text_fragmentation": obj.get("text_fragmentation"),
136
135
  "interface_origin": obj.get("interface_origin"),
@@ -141,6 +140,7 @@ class Text2SparqlPayload(BaseModel):
141
140
  "talk_to_web": obj.get("talk_to_web"),
142
141
  "original_question": obj.get("original_question"),
143
142
  "oauth_token": obj.get("oauth_token"),
143
+ "auto_filters": obj.get("auto_filters"),
144
144
  "filters": [
145
145
  [SearchMetadataFilter.from_dict(_inner_item) for _inner_item in _item]
146
146
  for _item in obj["filters"]
@@ -17,9 +17,9 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from qanswer_sdk.models.llm_details import LLMDetails
22
+ from qanswer_sdk.models.llm_endpoint_read_output import LLMEndpointReadOutput
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
@@ -28,7 +28,6 @@ class Text2SparqlTaskSettings(BaseModel):
28
28
  Text2SparqlTaskSettings
29
29
  """ # noqa: E501
30
30
  prompt: Optional[StrictStr] = None
31
- llm_choice: Optional[StrictStr] = None
32
31
  bot_seed: Optional[StrictInt] = None
33
32
  bot_temperature: Optional[Union[StrictFloat, StrictInt]] = None
34
33
  bot_answer_length: Optional[StrictStr] = None
@@ -36,10 +35,12 @@ class Text2SparqlTaskSettings(BaseModel):
36
35
  stream_speed: Optional[Union[StrictFloat, StrictInt]] = None
37
36
  context_window: Optional[StrictInt] = None
38
37
  max_tokens: Optional[StrictInt] = None
38
+ slots_values: Optional[Dict[str, StrictStr]] = None
39
39
  bot_name: Optional[StrictStr] = None
40
40
  bot_description: Optional[StrictStr] = None
41
- llm_details: LLMDetails
42
- __properties: ClassVar[List[str]] = ["prompt", "llm_choice", "bot_seed", "bot_temperature", "bot_answer_length", "number_of_references", "stream_speed", "context_window", "max_tokens", "bot_name", "bot_description", "llm_details"]
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"]
43
44
 
44
45
  @field_validator('bot_answer_length')
45
46
  def bot_answer_length_validate_enum(cls, value):
@@ -90,9 +91,9 @@ class Text2SparqlTaskSettings(BaseModel):
90
91
  exclude=excluded_fields,
91
92
  exclude_none=True,
92
93
  )
93
- # override the default output from pydantic by calling `to_dict()` of llm_details
94
- if self.llm_details:
95
- _dict['llm_details'] = self.llm_details.to_dict()
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()
96
97
  return _dict
97
98
 
98
99
  @classmethod
@@ -106,7 +107,6 @@ class Text2SparqlTaskSettings(BaseModel):
106
107
 
107
108
  _obj = cls.model_validate({
108
109
  "prompt": obj.get("prompt"),
109
- "llm_choice": obj.get("llm_choice"),
110
110
  "bot_seed": obj.get("bot_seed"),
111
111
  "bot_temperature": obj.get("bot_temperature"),
112
112
  "bot_answer_length": obj.get("bot_answer_length"),
@@ -114,9 +114,11 @@ class Text2SparqlTaskSettings(BaseModel):
114
114
  "stream_speed": obj.get("stream_speed"),
115
115
  "context_window": obj.get("context_window"),
116
116
  "max_tokens": obj.get("max_tokens"),
117
+ "slots_values": obj.get("slots_values"),
117
118
  "bot_name": obj.get("bot_name"),
118
119
  "bot_description": obj.get("bot_description"),
119
- "llm_details": LLMDetails.from_dict(obj["llm_details"]) if obj.get("llm_details") is not None else None
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
120
122
  })
121
123
  return _obj
122
124
 
@@ -17,8 +17,9 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from qanswer_sdk.models.llm_endpoint_read_input import LLMEndpointReadInput
22
23
  from typing import Optional, Set
23
24
  from typing_extensions import Self
24
25
 
@@ -27,7 +28,7 @@ class Text2SparqlTaskUpdate(BaseModel):
27
28
  Text2SparqlTaskUpdate
28
29
  """ # noqa: E501
29
30
  prompt: Optional[StrictStr] = None
30
- llm_choice: Optional[StrictStr] = None
31
+ llm_choice: Optional[StrictStr] = Field(default=None, description="The LLM choice. If not provided, the system default will be used.")
31
32
  bot_seed: Optional[StrictInt] = None
32
33
  bot_temperature: Optional[Union[StrictFloat, StrictInt]] = None
33
34
  bot_answer_length: Optional[StrictStr] = None
@@ -35,9 +36,12 @@ class Text2SparqlTaskUpdate(BaseModel):
35
36
  stream_speed: Optional[Union[StrictFloat, StrictInt]] = None
36
37
  context_window: Optional[StrictInt] = None
37
38
  max_tokens: Optional[StrictInt] = None
39
+ slots_values: Optional[Dict[str, StrictStr]] = None
38
40
  bot_name: Optional[StrictStr] = None
39
41
  bot_description: Optional[StrictStr] = None
40
- __properties: ClassVar[List[str]] = ["prompt", "llm_choice", "bot_seed", "bot_temperature", "bot_answer_length", "number_of_references", "stream_speed", "context_window", "max_tokens", "bot_name", "bot_description"]
42
+ llm_id: Optional[StrictInt] = Field(default=None, description="The LLM ID. This field is populated based on the llm_choice.")
43
+ llm_endpoint: Optional[LLMEndpointReadInput] = None
44
+ __properties: ClassVar[List[str]] = ["prompt", "llm_choice", "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"]
41
45
 
42
46
  @field_validator('bot_answer_length')
43
47
  def bot_answer_length_validate_enum(cls, value):
@@ -88,6 +92,9 @@ class Text2SparqlTaskUpdate(BaseModel):
88
92
  exclude=excluded_fields,
89
93
  exclude_none=True,
90
94
  )
95
+ # override the default output from pydantic by calling `to_dict()` of llm_endpoint
96
+ if self.llm_endpoint:
97
+ _dict['llm_endpoint'] = self.llm_endpoint.to_dict()
91
98
  return _dict
92
99
 
93
100
  @classmethod
@@ -109,8 +116,11 @@ class Text2SparqlTaskUpdate(BaseModel):
109
116
  "stream_speed": obj.get("stream_speed"),
110
117
  "context_window": obj.get("context_window"),
111
118
  "max_tokens": obj.get("max_tokens"),
119
+ "slots_values": obj.get("slots_values"),
112
120
  "bot_name": obj.get("bot_name"),
113
- "bot_description": obj.get("bot_description")
121
+ "bot_description": obj.get("bot_description"),
122
+ "llm_id": obj.get("llm_id"),
123
+ "llm_endpoint": LLMEndpointReadInput.from_dict(obj["llm_endpoint"]) if obj.get("llm_endpoint") is not None else None
114
124
  })
115
125
  return _obj
116
126
 
@@ -17,20 +17,22 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from qanswer_sdk.models.llm_details import LLMDetails
22
+ from qanswer_sdk.models.user import User
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class UserChatbotSettingResponse(BaseModel):
26
+ class UserChatbotSetting(BaseModel):
27
27
  """
28
- UserChatbotSettingResponse
28
+ UserChatbotSetting
29
29
  """ # noqa: E501
30
- llm_choice: Optional[StrictStr] = Field(default=None, alias="llmChoice")
30
+ id: Optional[StrictInt] = None
31
+ system_message: Optional[StrictStr] = Field(default=None, alias="systemMessage")
32
+ llm: Optional[Llm] = None
31
33
  agentic_chatbot_enabled: Optional[StrictBool] = Field(default=None, alias="agenticChatbotEnabled")
32
- llm_details: Optional[LLMDetails] = Field(default=None, alias="llmDetails")
33
- __properties: ClassVar[List[str]] = ["llmChoice", "agenticChatbotEnabled", "llmDetails"]
34
+ user: Optional[User] = None
35
+ __properties: ClassVar[List[str]] = ["id", "systemMessage", "llm", "agenticChatbotEnabled", "user"]
34
36
 
35
37
  model_config = ConfigDict(
36
38
  populate_by_name=True,
@@ -50,7 +52,7 @@ class UserChatbotSettingResponse(BaseModel):
50
52
 
51
53
  @classmethod
52
54
  def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of UserChatbotSettingResponse from a JSON string"""
55
+ """Create an instance of UserChatbotSetting from a JSON string"""
54
56
  return cls.from_dict(json.loads(json_str))
55
57
 
56
58
  def to_dict(self) -> Dict[str, Any]:
@@ -71,24 +73,17 @@ class UserChatbotSettingResponse(BaseModel):
71
73
  exclude=excluded_fields,
72
74
  exclude_none=True,
73
75
  )
74
- # override the default output from pydantic by calling `to_dict()` of llm_details
75
- if self.llm_details:
76
- _dict['llmDetails'] = self.llm_details.to_dict()
77
- # set to None if llm_choice (nullable) is None
78
- # and model_fields_set contains the field
79
- if self.llm_choice is None and "llm_choice" in self.model_fields_set:
80
- _dict['llmChoice'] = None
81
-
82
- # set to None if agentic_chatbot_enabled (nullable) is None
83
- # and model_fields_set contains the field
84
- if self.agentic_chatbot_enabled is None and "agentic_chatbot_enabled" in self.model_fields_set:
85
- _dict['agenticChatbotEnabled'] = None
86
-
76
+ # override the default output from pydantic by calling `to_dict()` of llm
77
+ if self.llm:
78
+ _dict['llm'] = self.llm.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of user
80
+ if self.user:
81
+ _dict['user'] = self.user.to_dict()
87
82
  return _dict
88
83
 
89
84
  @classmethod
90
85
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
- """Create an instance of UserChatbotSettingResponse from a dict"""
86
+ """Create an instance of UserChatbotSetting from a dict"""
92
87
  if obj is None:
93
88
  return None
94
89
 
@@ -96,10 +91,15 @@ class UserChatbotSettingResponse(BaseModel):
96
91
  return cls.model_validate(obj)
97
92
 
98
93
  _obj = cls.model_validate({
99
- "llmChoice": obj.get("llmChoice"),
94
+ "id": obj.get("id"),
95
+ "systemMessage": obj.get("systemMessage"),
96
+ "llm": Llm.from_dict(obj["llm"]) if obj.get("llm") is not None else None,
100
97
  "agenticChatbotEnabled": obj.get("agenticChatbotEnabled"),
101
- "llmDetails": LLMDetails.from_dict(obj["llmDetails"]) if obj.get("llmDetails") is not None else None
98
+ "user": User.from_dict(obj["user"]) if obj.get("user") is not None else None
102
99
  })
103
100
  return _obj
104
101
 
102
+ from qanswer_sdk.models.llm import Llm
103
+ # TODO: Rewrite to not use raise_errors
104
+ UserChatbotSetting.model_rebuild(raise_errors=False)
105
105
 
@@ -20,6 +20,7 @@ import json
20
20
  from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from qanswer_sdk.models.entity_description import EntityDescription
23
24
  from qanswer_sdk.models.logo import Logo
24
25
  from qanswer_sdk.models.user import User
25
26
  from typing import Optional, Set
@@ -42,9 +43,13 @@ class UserDataset(BaseModel):
42
43
  created: Optional[datetime] = None
43
44
  index_type: Optional[StrictStr] = Field(default=None, alias="indexType")
44
45
  languages: Optional[List[StrictStr]] = None
46
+ shared_users: Optional[List[UserDatasetShared]] = Field(default=None, alias="sharedUsers")
47
+ shared_teams: Optional[List[SharedTeamAccess]] = Field(default=None, alias="sharedTeams")
45
48
  shared_organizations: Optional[List[SharedOrganizationAccess]] = Field(default=None, alias="sharedOrganizations")
49
+ entity_description: Optional[EntityDescription] = Field(default=None, alias="entityDescription")
46
50
  logo: Optional[Logo] = None
47
- __properties: ClassVar[List[str]] = ["id", "dataset", "name", "description", "user", "uploaded", "indexed", "access", "accessType", "size", "created", "indexType", "languages", "sharedOrganizations", "logo"]
51
+ llm_consumptions: Optional[List[LlmConsumption]] = Field(default=None, alias="llmConsumptions")
52
+ __properties: ClassVar[List[str]] = ["id", "dataset", "name", "description", "user", "uploaded", "indexed", "access", "accessType", "size", "created", "indexType", "languages", "sharedUsers", "sharedTeams", "sharedOrganizations", "entityDescription", "logo", "llmConsumptions"]
48
53
 
49
54
  @field_validator('access_type')
50
55
  def access_type_validate_enum(cls, value):
@@ -98,6 +103,20 @@ class UserDataset(BaseModel):
98
103
  # override the default output from pydantic by calling `to_dict()` of user
99
104
  if self.user:
100
105
  _dict['user'] = self.user.to_dict()
106
+ # override the default output from pydantic by calling `to_dict()` of each item in shared_users (list)
107
+ _items = []
108
+ if self.shared_users:
109
+ for _item_shared_users in self.shared_users:
110
+ if _item_shared_users:
111
+ _items.append(_item_shared_users.to_dict())
112
+ _dict['sharedUsers'] = _items
113
+ # override the default output from pydantic by calling `to_dict()` of each item in shared_teams (list)
114
+ _items = []
115
+ if self.shared_teams:
116
+ for _item_shared_teams in self.shared_teams:
117
+ if _item_shared_teams:
118
+ _items.append(_item_shared_teams.to_dict())
119
+ _dict['sharedTeams'] = _items
101
120
  # override the default output from pydantic by calling `to_dict()` of each item in shared_organizations (list)
102
121
  _items = []
103
122
  if self.shared_organizations:
@@ -105,9 +124,19 @@ class UserDataset(BaseModel):
105
124
  if _item_shared_organizations:
106
125
  _items.append(_item_shared_organizations.to_dict())
107
126
  _dict['sharedOrganizations'] = _items
127
+ # override the default output from pydantic by calling `to_dict()` of entity_description
128
+ if self.entity_description:
129
+ _dict['entityDescription'] = self.entity_description.to_dict()
108
130
  # override the default output from pydantic by calling `to_dict()` of logo
109
131
  if self.logo:
110
132
  _dict['logo'] = self.logo.to_dict()
133
+ # override the default output from pydantic by calling `to_dict()` of each item in llm_consumptions (list)
134
+ _items = []
135
+ if self.llm_consumptions:
136
+ for _item_llm_consumptions in self.llm_consumptions:
137
+ if _item_llm_consumptions:
138
+ _items.append(_item_llm_consumptions.to_dict())
139
+ _dict['llmConsumptions'] = _items
111
140
  return _dict
112
141
 
113
142
  @classmethod
@@ -133,12 +162,19 @@ class UserDataset(BaseModel):
133
162
  "created": obj.get("created"),
134
163
  "indexType": obj.get("indexType"),
135
164
  "languages": obj.get("languages"),
165
+ "sharedUsers": [UserDatasetShared.from_dict(_item) for _item in obj["sharedUsers"]] if obj.get("sharedUsers") is not None else None,
166
+ "sharedTeams": [SharedTeamAccess.from_dict(_item) for _item in obj["sharedTeams"]] if obj.get("sharedTeams") is not None else None,
136
167
  "sharedOrganizations": [SharedOrganizationAccess.from_dict(_item) for _item in obj["sharedOrganizations"]] if obj.get("sharedOrganizations") is not None else None,
137
- "logo": Logo.from_dict(obj["logo"]) if obj.get("logo") is not None else None
168
+ "entityDescription": EntityDescription.from_dict(obj["entityDescription"]) if obj.get("entityDescription") is not None else None,
169
+ "logo": Logo.from_dict(obj["logo"]) if obj.get("logo") is not None else None,
170
+ "llmConsumptions": [LlmConsumption.from_dict(_item) for _item in obj["llmConsumptions"]] if obj.get("llmConsumptions") is not None else None
138
171
  })
139
172
  return _obj
140
173
 
174
+ from qanswer_sdk.models.llm_consumption import LlmConsumption
141
175
  from qanswer_sdk.models.shared_organization_access import SharedOrganizationAccess
176
+ from qanswer_sdk.models.shared_team_access import SharedTeamAccess
177
+ from qanswer_sdk.models.user_dataset_shared import UserDatasetShared
142
178
  # TODO: Rewrite to not use raise_errors
143
179
  UserDataset.model_rebuild(raise_errors=False)
144
180
 
@@ -17,35 +17,24 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from qanswer_sdk.models.tag_payload import TagPayload
22
+ from qanswer_sdk.models.user import User
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class QaMetadataPayload(BaseModel):
26
+ class UserDatasetShared(BaseModel):
27
27
  """
28
- QaMetadataPayload
28
+ UserDatasetShared
29
29
  """ # noqa: E501
30
- dataset: Optional[StrictStr] = None
31
- owner: Optional[StrictStr] = None
32
- access_type_open: Optional[StrictStr] = Field(default=None, alias="accessTypeOpen")
33
- access_type_shared: Optional[StrictStr] = Field(default=None, alias="accessTypeShared")
34
- tags: Optional[List[TagPayload]] = None
35
- __properties: ClassVar[List[str]] = ["dataset", "owner", "accessTypeOpen", "accessTypeShared", "tags"]
36
-
37
- @field_validator('access_type_open')
38
- def access_type_open_validate_enum(cls, value):
39
- """Validates the enum"""
40
- if value is None:
41
- return value
42
-
43
- if value not in set(['LoggedIn', 'Open', 'None']):
44
- raise ValueError("must be one of enum values ('LoggedIn', 'Open', 'None')")
45
- return value
46
-
47
- @field_validator('access_type_shared')
48
- def access_type_shared_validate_enum(cls, value):
30
+ id: Optional[StrictInt] = None
31
+ ai_assistant: Optional[UserDataset] = Field(default=None, alias="aiAssistant")
32
+ user: Optional[User] = None
33
+ access_type: Optional[StrictStr] = Field(default=None, alias="accessType")
34
+ __properties: ClassVar[List[str]] = ["id", "aiAssistant", "user", "accessType"]
35
+
36
+ @field_validator('access_type')
37
+ def access_type_validate_enum(cls, value):
49
38
  """Validates the enum"""
50
39
  if value is None:
51
40
  return value
@@ -72,7 +61,7 @@ class QaMetadataPayload(BaseModel):
72
61
 
73
62
  @classmethod
74
63
  def from_json(cls, json_str: str) -> Optional[Self]:
75
- """Create an instance of QaMetadataPayload from a JSON string"""
64
+ """Create an instance of UserDatasetShared from a JSON string"""
76
65
  return cls.from_dict(json.loads(json_str))
77
66
 
78
67
  def to_dict(self) -> Dict[str, Any]:
@@ -93,18 +82,17 @@ class QaMetadataPayload(BaseModel):
93
82
  exclude=excluded_fields,
94
83
  exclude_none=True,
95
84
  )
96
- # override the default output from pydantic by calling `to_dict()` of each item in tags (list)
97
- _items = []
98
- if self.tags:
99
- for _item_tags in self.tags:
100
- if _item_tags:
101
- _items.append(_item_tags.to_dict())
102
- _dict['tags'] = _items
85
+ # override the default output from pydantic by calling `to_dict()` of ai_assistant
86
+ if self.ai_assistant:
87
+ _dict['aiAssistant'] = self.ai_assistant.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of user
89
+ if self.user:
90
+ _dict['user'] = self.user.to_dict()
103
91
  return _dict
104
92
 
105
93
  @classmethod
106
94
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107
- """Create an instance of QaMetadataPayload from a dict"""
95
+ """Create an instance of UserDatasetShared from a dict"""
108
96
  if obj is None:
109
97
  return None
110
98
 
@@ -112,12 +100,14 @@ class QaMetadataPayload(BaseModel):
112
100
  return cls.model_validate(obj)
113
101
 
114
102
  _obj = cls.model_validate({
115
- "dataset": obj.get("dataset"),
116
- "owner": obj.get("owner"),
117
- "accessTypeOpen": obj.get("accessTypeOpen"),
118
- "accessTypeShared": obj.get("accessTypeShared"),
119
- "tags": [TagPayload.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None
103
+ "id": obj.get("id"),
104
+ "aiAssistant": UserDataset.from_dict(obj["aiAssistant"]) if obj.get("aiAssistant") is not None else None,
105
+ "user": User.from_dict(obj["user"]) if obj.get("user") is not None else None,
106
+ "accessType": obj.get("accessType")
120
107
  })
121
108
  return _obj
122
109
 
110
+ from qanswer_sdk.models.user_dataset import UserDataset
111
+ # TODO: Rewrite to not use raise_errors
112
+ UserDatasetShared.model_rebuild(raise_errors=False)
123
113
 
@@ -22,9 +22,9 @@ 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 UserFilter(BaseModel):
25
+ class UserFilterDto(BaseModel):
26
26
  """
27
- UserFilter
27
+ UserFilterDto
28
28
  """ # noqa: E501
29
29
  search: Optional[StrictStr] = None
30
30
  user_id: Optional[StrictInt] = Field(default=None, alias="userId")
@@ -54,7 +54,7 @@ class UserFilter(BaseModel):
54
54
 
55
55
  @classmethod
56
56
  def from_json(cls, json_str: str) -> Optional[Self]:
57
- """Create an instance of UserFilter from a JSON string"""
57
+ """Create an instance of UserFilterDto from a JSON string"""
58
58
  return cls.from_dict(json.loads(json_str))
59
59
 
60
60
  def to_dict(self) -> Dict[str, Any]:
@@ -79,7 +79,7 @@ class UserFilter(BaseModel):
79
79
 
80
80
  @classmethod
81
81
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
- """Create an instance of UserFilter from a dict"""
82
+ """Create an instance of UserFilterDto from a dict"""
83
83
  if obj is None:
84
84
  return None
85
85
 
@@ -20,15 +20,15 @@ import json
20
20
  from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
- from qanswer_sdk.models.organization import Organization
23
+ from qanswer_sdk.models.organization_admin import OrganizationAdmin
24
24
  from qanswer_sdk.models.role import Role
25
- from qanswer_sdk.models.team import Team
25
+ from qanswer_sdk.models.team_admin import TeamAdmin
26
26
  from typing import Optional, Set
27
27
  from typing_extensions import Self
28
28
 
29
- class UserProfile(BaseModel):
29
+ class UserProfileDto(BaseModel):
30
30
  """
31
- Contains all information about a user.
31
+ UserProfileDto
32
32
  """ # noqa: E501
33
33
  id: Optional[StrictInt] = None
34
34
  username: Optional[StrictStr] = None
@@ -53,8 +53,8 @@ class UserProfile(BaseModel):
53
53
  activated: Optional[StrictBool] = None
54
54
  blocked: Optional[StrictBool] = None
55
55
  language: Optional[StrictStr] = None
56
- teams: Optional[List[Team]] = None
57
- organizations: Optional[List[Organization]] = None
56
+ teams: Optional[List[TeamAdmin]] = None
57
+ organizations: Optional[List[OrganizationAdmin]] = None
58
58
  origin: Optional[StrictStr] = None
59
59
  email: Optional[StrictStr] = None
60
60
  __properties: ClassVar[List[str]] = ["id", "username", "name", "created", "lastLogin", "quotaDatasetNumber", "quotaDatasetNumberUsed", "quotaDatasetSpaceMb", "quotaDatasetSpaceMbUsed", "questionCreditsStart", "quotaQuestionCredits", "quotaQuestionCreditsUsed", "quotaInputTokens", "quotaOutputTokens", "inputTokensUsed", "outputTokensUsed", "role", "pricingPlan", "dataPackage", "pricingPlanSubscription", "activated", "blocked", "language", "teams", "organizations", "origin", "email"]
@@ -97,7 +97,7 @@ class UserProfile(BaseModel):
97
97
 
98
98
  @classmethod
99
99
  def from_json(cls, json_str: str) -> Optional[Self]:
100
- """Create an instance of UserProfile from a JSON string"""
100
+ """Create an instance of UserProfileDto from a JSON string"""
101
101
  return cls.from_dict(json.loads(json_str))
102
102
 
103
103
  def to_dict(self) -> Dict[str, Any]:
@@ -143,7 +143,7 @@ class UserProfile(BaseModel):
143
143
 
144
144
  @classmethod
145
145
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
146
- """Create an instance of UserProfile from a dict"""
146
+ """Create an instance of UserProfileDto from a dict"""
147
147
  if obj is None:
148
148
  return None
149
149
 
@@ -174,8 +174,8 @@ class UserProfile(BaseModel):
174
174
  "activated": obj.get("activated"),
175
175
  "blocked": obj.get("blocked"),
176
176
  "language": obj.get("language"),
177
- "teams": [Team.from_dict(_item) for _item in obj["teams"]] if obj.get("teams") is not None else None,
178
- "organizations": [Organization.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None,
177
+ "teams": [TeamAdmin.from_dict(_item) for _item in obj["teams"]] if obj.get("teams") is not None else None,
178
+ "organizations": [OrganizationAdmin.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None,
179
179
  "origin": obj.get("origin"),
180
180
  "email": obj.get("email")
181
181
  })