qanswer-sdk 0.46.0.dev0__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 (624) hide show
  1. qanswer_sdk/__init__.py +1268 -0
  2. qanswer_sdk/api/__init__.py +64 -0
  3. qanswer_sdk/api/admin_api.py +7383 -0
  4. qanswer_sdk/api/ai_assistant_access_rights_api.py +5879 -0
  5. qanswer_sdk/api/ai_assistant_api.py +8960 -0
  6. qanswer_sdk/api/auto_complete_api.py +612 -0
  7. qanswer_sdk/api/bot_slack_api.py +1069 -0
  8. qanswer_sdk/api/branding_api.py +5723 -0
  9. qanswer_sdk/api/chatbot_api.py +1102 -0
  10. qanswer_sdk/api/connector_audio_api.py +3264 -0
  11. qanswer_sdk/api/connector_document_api.py +1990 -0
  12. qanswer_sdk/api/connector_e_consilium_api.py +313 -0
  13. qanswer_sdk/api/connector_e_consilium_search_index_api_api.py +1164 -0
  14. qanswer_sdk/api/connector_google_drive_api.py +1896 -0
  15. qanswer_sdk/api/connector_imapapi_api.py +1775 -0
  16. qanswer_sdk/api/connector_one_drive_api.py +1579 -0
  17. qanswer_sdk/api/connector_onenote_api.py +1596 -0
  18. qanswer_sdk/api/connector_pinecone_api.py +893 -0
  19. qanswer_sdk/api/connector_publication_office_api_api.py +1230 -0
  20. qanswer_sdk/api/connector_qn_a_api.py +1521 -0
  21. qanswer_sdk/api/connector_rdf_answer_api.py +1393 -0
  22. qanswer_sdk/api/connector_rdf_api.py +5093 -0
  23. qanswer_sdk/api/connector_sharepoint_api.py +3445 -0
  24. qanswer_sdk/api/connector_websearch_api.py +332 -0
  25. qanswer_sdk/api/connector_website_api.py +2829 -0
  26. qanswer_sdk/api/connectors_api.py +6824 -0
  27. qanswer_sdk/api/connectors_data_api.py +5415 -0
  28. qanswer_sdk/api/conversation_logs_api.py +13159 -0
  29. qanswer_sdk/api/dataset_api.py +6487 -0
  30. qanswer_sdk/api/dataset_config_api.py +4643 -0
  31. qanswer_sdk/api/debug_api.py +278 -0
  32. qanswer_sdk/api/default_api.py +763 -0
  33. qanswer_sdk/api/embedder_endpoint_api.py +3330 -0
  34. qanswer_sdk/api/frontend_config_api.py +270 -0
  35. qanswer_sdk/api/health_check_api_api.py +278 -0
  36. qanswer_sdk/api/llm_endpoint_api.py +4660 -0
  37. qanswer_sdk/api/mcp_api.py +11201 -0
  38. qanswer_sdk/api/metadata_api.py +2070 -0
  39. qanswer_sdk/api/notifications_api.py +1841 -0
  40. qanswer_sdk/api/o_auth2_api.py +648 -0
  41. qanswer_sdk/api/payment_api.py +1852 -0
  42. qanswer_sdk/api/socket_api.py +4220 -0
  43. qanswer_sdk/api/speech_to_text_api.py +919 -0
  44. qanswer_sdk/api/task_ai_excel_api.py +7541 -0
  45. qanswer_sdk/api/task_chat_api.py +2598 -0
  46. qanswer_sdk/api/task_document_parsing_api.py +619 -0
  47. qanswer_sdk/api/task_entity_linking_api.py +315 -0
  48. qanswer_sdk/api/task_rdf_linker_api.py +4408 -0
  49. qanswer_sdk/api/task_rdf_sparql_endpoint_api.py +3189 -0
  50. qanswer_sdk/api/task_rdf_text_linker_api.py +1452 -0
  51. qanswer_sdk/api/task_report_copilot_api.py +7010 -0
  52. qanswer_sdk/api/task_search_api.py +2012 -0
  53. qanswer_sdk/api/task_text2sparql_api.py +902 -0
  54. qanswer_sdk/api/task_text_classification_api.py +592 -0
  55. qanswer_sdk/api/tasks_api.py +318 -0
  56. qanswer_sdk/api/tool_embedder_api.py +5208 -0
  57. qanswer_sdk/api/tool_llm_api.py +6518 -0
  58. qanswer_sdk/api/unit_organizations_api.py +7086 -0
  59. qanswer_sdk/api/unit_teams_api.py +4255 -0
  60. qanswer_sdk/api/unit_user_api.py +11948 -0
  61. qanswer_sdk/api/v1_chat_completion_api.py +330 -0
  62. qanswer_sdk/api/v1_embeddings_api.py +297 -0
  63. qanswer_sdk/api_client.py +804 -0
  64. qanswer_sdk/api_response.py +21 -0
  65. qanswer_sdk/configuration.py +614 -0
  66. qanswer_sdk/exceptions.py +216 -0
  67. qanswer_sdk/models/__init__.py +567 -0
  68. qanswer_sdk/models/access_audio_spans_response_model.py +91 -0
  69. qanswer_sdk/models/access_pdf_payload_model.py +111 -0
  70. qanswer_sdk/models/access_type.py +42 -0
  71. qanswer_sdk/models/access_type_shared.py +38 -0
  72. qanswer_sdk/models/add_qn_a_request.py +103 -0
  73. qanswer_sdk/models/add_synonyms.py +93 -0
  74. qanswer_sdk/models/add_synonyms_resp.py +89 -0
  75. qanswer_sdk/models/admin_overall_stats_response.py +105 -0
  76. qanswer_sdk/models/admin_user_overall_stats.py +99 -0
  77. qanswer_sdk/models/advanced_o_auth2_mcp_authentication_config.py +95 -0
  78. qanswer_sdk/models/aggregate.py +93 -0
  79. qanswer_sdk/models/aggregation.py +116 -0
  80. qanswer_sdk/models/aggregation_type.py +41 -0
  81. qanswer_sdk/models/aggregations_group.py +102 -0
  82. qanswer_sdk/models/ai_assistant_clone_response.py +91 -0
  83. qanswer_sdk/models/ai_assistant_dto.py +122 -0
  84. qanswer_sdk/models/ai_assistant_filter_dto.py +113 -0
  85. qanswer_sdk/models/ai_assistant_list.py +101 -0
  86. qanswer_sdk/models/ai_assistant_share_response.py +93 -0
  87. qanswer_sdk/models/ai_assistant_shared_access.py +113 -0
  88. qanswer_sdk/models/ai_excel_task_settings.py +125 -0
  89. qanswer_sdk/models/ai_excel_task_update.py +125 -0
  90. qanswer_sdk/models/ai_task_settings_update_payload.py +95 -0
  91. qanswer_sdk/models/ai_template_base_with_id.py +95 -0
  92. qanswer_sdk/models/ai_template_cell.py +113 -0
  93. qanswer_sdk/models/ai_template_cell_base.py +87 -0
  94. qanswer_sdk/models/ai_template_cell_update_payload.py +95 -0
  95. qanswer_sdk/models/ai_template_column.py +99 -0
  96. qanswer_sdk/models/ai_template_column_base.py +93 -0
  97. qanswer_sdk/models/ai_template_column_update_payload.py +109 -0
  98. qanswer_sdk/models/ai_template_column_with_cells.py +109 -0
  99. qanswer_sdk/models/ai_template_create_payload.py +128 -0
  100. qanswer_sdk/models/ai_template_row.py +93 -0
  101. qanswer_sdk/models/ai_template_row_base.py +87 -0
  102. qanswer_sdk/models/ai_template_row_update_payload.py +103 -0
  103. qanswer_sdk/models/ai_template_row_with_cells.py +103 -0
  104. qanswer_sdk/models/ai_template_with_cells.py +134 -0
  105. qanswer_sdk/models/ai_template_with_cells_new_column_id.py +136 -0
  106. qanswer_sdk/models/allowed_extension.py +53 -0
  107. qanswer_sdk/models/allowed_file_extensions.py +98 -0
  108. qanswer_sdk/models/api_key_header_type.py +38 -0
  109. qanswer_sdk/models/api_key_mcp_authentication_config.py +94 -0
  110. qanswer_sdk/models/applied_filter_type.py +37 -0
  111. qanswer_sdk/models/applied_metadata_filter.py +103 -0
  112. qanswer_sdk/models/apply_template_task_settings_to_slots_response.py +89 -0
  113. qanswer_sdk/models/assistant_category_color_definition.py +89 -0
  114. qanswer_sdk/models/assistant_category_color_item.py +89 -0
  115. qanswer_sdk/models/assistant_category_colors_update_payload.py +95 -0
  116. qanswer_sdk/models/assistant_category_count.py +91 -0
  117. qanswer_sdk/models/assistant_message_stop.py +93 -0
  118. qanswer_sdk/models/assistant_task.py +43 -0
  119. qanswer_sdk/models/assistant_template.py +111 -0
  120. qanswer_sdk/models/assistant_template_filter_dto.py +120 -0
  121. qanswer_sdk/models/assistant_template_with_tools_selection_dto.py +121 -0
  122. qanswer_sdk/models/audio_allowed_file_extensions.py +87 -0
  123. qanswer_sdk/models/audio_file_upload_payload.py +107 -0
  124. qanswer_sdk/models/audio_format.py +37 -0
  125. qanswer_sdk/models/audio_segment.py +95 -0
  126. qanswer_sdk/models/audio_segment_update_payload.py +97 -0
  127. qanswer_sdk/models/audio_segment_update_response.py +91 -0
  128. qanswer_sdk/models/audio_speaker_update_payload.py +99 -0
  129. qanswer_sdk/models/audio_speaker_update_response.py +91 -0
  130. qanswer_sdk/models/audio_transcription_list_response.py +101 -0
  131. qanswer_sdk/models/audio_transcription_mode.py +37 -0
  132. qanswer_sdk/models/audio_transcription_record.py +101 -0
  133. qanswer_sdk/models/audio_upload_response.py +99 -0
  134. qanswer_sdk/models/audio_upload_transcription.py +99 -0
  135. qanswer_sdk/models/audio_word_segment.py +93 -0
  136. qanswer_sdk/models/audio_word_span_change.py +94 -0
  137. qanswer_sdk/models/audio_word_span_update_payload.py +104 -0
  138. qanswer_sdk/models/audio_word_span_update_response.py +91 -0
  139. qanswer_sdk/models/audio_word_update_payload.py +100 -0
  140. qanswer_sdk/models/audio_word_update_response.py +91 -0
  141. qanswer_sdk/models/auth_link_response.py +91 -0
  142. qanswer_sdk/models/auto_bot_description_request.py +89 -0
  143. qanswer_sdk/models/auto_bot_description_response.py +87 -0
  144. qanswer_sdk/models/available_aggregation.py +98 -0
  145. qanswer_sdk/models/available_connectors_response.py +99 -0
  146. qanswer_sdk/models/available_embedding_models_response.py +95 -0
  147. qanswer_sdk/models/available_endpoints_response.py +95 -0
  148. qanswer_sdk/models/available_logs_visibility_policy.py +103 -0
  149. qanswer_sdk/models/available_space_quota_for_dataset.py +95 -0
  150. qanswer_sdk/models/available_storage_preference.py +103 -0
  151. qanswer_sdk/models/base_connectors_response.py +89 -0
  152. qanswer_sdk/models/base_conversation_response.py +89 -0
  153. qanswer_sdk/models/base_feedback_response.py +89 -0
  154. qanswer_sdk/models/bot_answer_length.py +38 -0
  155. qanswer_sdk/models/branding_app_title.py +87 -0
  156. qanswer_sdk/models/branding_system_message.py +87 -0
  157. qanswer_sdk/models/bulk_update_tool_selections_request.py +87 -0
  158. qanswer_sdk/models/capability_type.py +37 -0
  159. qanswer_sdk/models/cell.py +89 -0
  160. qanswer_sdk/models/change_password.py +89 -0
  161. qanswer_sdk/models/change_password_admin.py +89 -0
  162. qanswer_sdk/models/change_role.py +96 -0
  163. qanswer_sdk/models/chat_task_settings.py +141 -0
  164. qanswer_sdk/models/chat_task_settings_update_payload.py +95 -0
  165. qanswer_sdk/models/chat_task_update.py +139 -0
  166. qanswer_sdk/models/chatbot_chat_payload.py +148 -0
  167. qanswer_sdk/models/chatbot_default_settings_response.py +95 -0
  168. qanswer_sdk/models/chatbot_llm_dto.py +147 -0
  169. qanswer_sdk/models/chatbot_response.py +151 -0
  170. qanswer_sdk/models/chatbot_setting_dto.py +99 -0
  171. qanswer_sdk/models/chatbot_setting_request.py +91 -0
  172. qanswer_sdk/models/class_info.py +89 -0
  173. qanswer_sdk/models/clone_dataset_request.py +104 -0
  174. qanswer_sdk/models/clone_dataset_response.py +91 -0
  175. qanswer_sdk/models/config.py +228 -0
  176. qanswer_sdk/models/config1.py +138 -0
  177. qanswer_sdk/models/connector_config_list_response.py +99 -0
  178. qanswer_sdk/models/connector_config_model.py +102 -0
  179. qanswer_sdk/models/connector_config_patch_payload.py +93 -0
  180. qanswer_sdk/models/connector_config_response.py +95 -0
  181. qanswer_sdk/models/connector_config_sync_response.py +93 -0
  182. qanswer_sdk/models/connector_config_type.py +37 -0
  183. qanswer_sdk/models/connector_model.py +118 -0
  184. qanswer_sdk/models/connector_type.py +50 -0
  185. qanswer_sdk/models/connector_type_dto.py +98 -0
  186. qanswer_sdk/models/connector_type_list_dto.py +95 -0
  187. qanswer_sdk/models/content_item.py +130 -0
  188. qanswer_sdk/models/content_item_type.py +39 -0
  189. qanswer_sdk/models/conversation_message.py +259 -0
  190. qanswer_sdk/models/conversation_message_error_key.py +52 -0
  191. qanswer_sdk/models/conversation_message_search_result.py +121 -0
  192. qanswer_sdk/models/conversation_model.py +169 -0
  193. qanswer_sdk/models/conversation_overall_stats.py +97 -0
  194. qanswer_sdk/models/conversation_overall_stats_response.py +95 -0
  195. qanswer_sdk/models/conversation_retention_response.py +91 -0
  196. qanswer_sdk/models/conversation_statistics.py +95 -0
  197. qanswer_sdk/models/conversation_update.py +93 -0
  198. qanswer_sdk/models/conversation_users_stats.py +99 -0
  199. qanswer_sdk/models/conversation_users_stats_response.py +99 -0
  200. qanswer_sdk/models/coordinates.py +89 -0
  201. qanswer_sdk/models/cost_summary_dto.py +99 -0
  202. qanswer_sdk/models/create_connector_request.py +95 -0
  203. qanswer_sdk/models/create_connector_response.py +95 -0
  204. qanswer_sdk/models/create_dataset_request.py +145 -0
  205. qanswer_sdk/models/create_imap_connector_request.py +105 -0
  206. qanswer_sdk/models/create_pinecone_connector_request.py +97 -0
  207. qanswer_sdk/models/create_sharepoint_connector_from_certificate_request.py +105 -0
  208. qanswer_sdk/models/create_sharepoint_connector_request.py +103 -0
  209. qanswer_sdk/models/credits_info_global_dto.py +97 -0
  210. qanswer_sdk/models/credits_info_organization_dto.py +95 -0
  211. qanswer_sdk/models/currency.py +38 -0
  212. qanswer_sdk/models/data_filling_mode.py +39 -0
  213. qanswer_sdk/models/data_storage_preference.py +38 -0
  214. qanswer_sdk/models/dataset_config_request.py +138 -0
  215. qanswer_sdk/models/dataset_default_values_model.py +138 -0
  216. qanswer_sdk/models/dataset_detail.py +137 -0
  217. qanswer_sdk/models/dataset_detail_kg.py +97 -0
  218. qanswer_sdk/models/dataset_schema.py +242 -0
  219. qanswer_sdk/models/dataset_size_response.py +91 -0
  220. qanswer_sdk/models/dataset_type.py +38 -0
  221. qanswer_sdk/models/dataset_update_object.py +216 -0
  222. qanswer_sdk/models/dataset_users_response.py +87 -0
  223. qanswer_sdk/models/default_prompt.py +106 -0
  224. qanswer_sdk/models/delete_connector_model.py +96 -0
  225. qanswer_sdk/models/delete_connector_request.py +99 -0
  226. qanswer_sdk/models/delete_connectors_response.py +89 -0
  227. qanswer_sdk/models/delete_files_status_response.py +91 -0
  228. qanswer_sdk/models/delete_index.py +91 -0
  229. qanswer_sdk/models/delete_index_resp.py +89 -0
  230. qanswer_sdk/models/delete_qn_a_pair_request.py +95 -0
  231. qanswer_sdk/models/delete_qn_a_pair_response.py +89 -0
  232. qanswer_sdk/models/delete_synonym.py +93 -0
  233. qanswer_sdk/models/delete_synonym_resp.py +89 -0
  234. qanswer_sdk/models/delete_synonyms.py +91 -0
  235. qanswer_sdk/models/delete_user_response.py +89 -0
  236. qanswer_sdk/models/diarization_queue_status.py +99 -0
  237. qanswer_sdk/models/document_content_response.py +91 -0
  238. qanswer_sdk/models/document_content_update_model.py +99 -0
  239. qanswer_sdk/models/document_file_delete_by_connector_model.py +101 -0
  240. qanswer_sdk/models/document_file_delete_by_id_model.py +91 -0
  241. qanswer_sdk/models/document_metadata.py +173 -0
  242. qanswer_sdk/models/document_metadata_list_wrapper.py +100 -0
  243. qanswer_sdk/models/document_parsing_task_settings.py +130 -0
  244. qanswer_sdk/models/document_parsing_task_settings_update_payload.py +95 -0
  245. qanswer_sdk/models/document_parsing_task_update.py +127 -0
  246. qanswer_sdk/models/document_status_response.py +89 -0
  247. qanswer_sdk/models/dummy_error.py +89 -0
  248. qanswer_sdk/models/duplicate_report_template_payload.py +97 -0
  249. qanswer_sdk/models/duplicate_report_template_response.py +87 -0
  250. qanswer_sdk/models/e_consilium_connector_config.py +108 -0
  251. qanswer_sdk/models/e_consilium_search_index_search_response.py +113 -0
  252. qanswer_sdk/models/econsilium_file_metadata.py +105 -0
  253. qanswer_sdk/models/econsilium_search_index_add_payload.py +107 -0
  254. qanswer_sdk/models/econsilium_search_index_additional_fields.py +103 -0
  255. qanswer_sdk/models/email_folder.py +91 -0
  256. qanswer_sdk/models/email_request.py +87 -0
  257. qanswer_sdk/models/embedder_cost_entry.py +91 -0
  258. qanswer_sdk/models/embedder_cost_filter.py +112 -0
  259. qanswer_sdk/models/embedder_cost_list.py +111 -0
  260. qanswer_sdk/models/embedder_create_dto.py +149 -0
  261. qanswer_sdk/models/embedder_detailed_dto.py +171 -0
  262. qanswer_sdk/models/embedder_dto.py +101 -0
  263. qanswer_sdk/models/embedder_list_dto.py +101 -0
  264. qanswer_sdk/models/embedder_update_dto.py +143 -0
  265. qanswer_sdk/models/embedding_endpoint.py +149 -0
  266. qanswer_sdk/models/embedding_endpoint_create.py +147 -0
  267. qanswer_sdk/models/embedding_endpoint_export_payload.py +87 -0
  268. qanswer_sdk/models/embedding_endpoint_import_failure.py +89 -0
  269. qanswer_sdk/models/embedding_endpoint_import_response.py +99 -0
  270. qanswer_sdk/models/embedding_endpoint_modality.py +37 -0
  271. qanswer_sdk/models/embedding_endpoint_names_validation_payload.py +87 -0
  272. qanswer_sdk/models/embedding_endpoint_update.py +141 -0
  273. qanswer_sdk/models/embedding_endpoint_validation_response.py +96 -0
  274. qanswer_sdk/models/embedding_model.py +96 -0
  275. qanswer_sdk/models/embedding_provider.py +44 -0
  276. qanswer_sdk/models/enable_enhanced_context_payload.py +91 -0
  277. qanswer_sdk/models/enable_enhanced_context_response.py +87 -0
  278. qanswer_sdk/models/endpoint_status.py +38 -0
  279. qanswer_sdk/models/entity_description.py +93 -0
  280. qanswer_sdk/models/entity_description_dto.py +93 -0
  281. qanswer_sdk/models/entity_linking_payload.py +97 -0
  282. qanswer_sdk/models/entity_linking_response.py +97 -0
  283. qanswer_sdk/models/entity_model_in_linking.py +95 -0
  284. qanswer_sdk/models/es_meta_data.py +98 -0
  285. qanswer_sdk/models/es_meta_data_value.py +87 -0
  286. qanswer_sdk/models/evaluate_feedback_response.py +109 -0
  287. qanswer_sdk/models/evaluate_single_feedback_response.py +97 -0
  288. qanswer_sdk/models/external_sources_quota_request.py +91 -0
  289. qanswer_sdk/models/external_sources_quota_response.py +89 -0
  290. qanswer_sdk/models/extra_body.py +91 -0
  291. qanswer_sdk/models/extract_hyper_links_payload.py +100 -0
  292. qanswer_sdk/models/extract_robot_links_payload.py +88 -0
  293. qanswer_sdk/models/extract_robot_links_response.py +88 -0
  294. qanswer_sdk/models/fact.py +96 -0
  295. qanswer_sdk/models/feedback_evaluation_history_entries_response.py +101 -0
  296. qanswer_sdk/models/feedback_evaluation_history_entry_model.py +105 -0
  297. qanswer_sdk/models/feedback_model.py +141 -0
  298. qanswer_sdk/models/feedback_response.py +95 -0
  299. qanswer_sdk/models/feedback_update.py +105 -0
  300. qanswer_sdk/models/file_es_meta_data.py +116 -0
  301. qanswer_sdk/models/file_failure_reason.py +48 -0
  302. qanswer_sdk/models/file_folder_model.py +115 -0
  303. qanswer_sdk/models/file_model.py +130 -0
  304. qanswer_sdk/models/file_status.py +43 -0
  305. qanswer_sdk/models/file_type.py +37 -0
  306. qanswer_sdk/models/file_upload_payload.py +107 -0
  307. qanswer_sdk/models/files_by_connector_model.py +89 -0
  308. qanswer_sdk/models/g_drive_connector_info.py +96 -0
  309. qanswer_sdk/models/g_drive_download_by_ids.py +89 -0
  310. qanswer_sdk/models/g_drive_download_request.py +103 -0
  311. qanswer_sdk/models/generate_ai_cells_by_dimension_payload.py +91 -0
  312. qanswer_sdk/models/generate_ai_cells_payload.py +95 -0
  313. qanswer_sdk/models/generation_params.py +89 -0
  314. qanswer_sdk/models/get_aggregations_payload.py +104 -0
  315. qanswer_sdk/models/get_connector_by_id_response.py +91 -0
  316. qanswer_sdk/models/get_conversation_response.py +95 -0
  317. qanswer_sdk/models/global_config_dto.py +135 -0
  318. qanswer_sdk/models/google_drive_connector_config.py +110 -0
  319. qanswer_sdk/models/guardrail_endpoint.py +121 -0
  320. qanswer_sdk/models/guardrail_mode.py +38 -0
  321. qanswer_sdk/models/highlight_audio_payload_model.py +109 -0
  322. qanswer_sdk/models/http_validation_error.py +95 -0
  323. qanswer_sdk/models/iframe_strategy.py +38 -0
  324. qanswer_sdk/models/image_url_detail.py +38 -0
  325. qanswer_sdk/models/imap_add_payload.py +105 -0
  326. qanswer_sdk/models/imap_additional_fields.py +101 -0
  327. qanswer_sdk/models/imap_file_metadata.py +114 -0
  328. qanswer_sdk/models/imap_search_response.py +113 -0
  329. qanswer_sdk/models/index_config.py +89 -0
  330. qanswer_sdk/models/install_response.py +89 -0
  331. qanswer_sdk/models/interface_origin.py +48 -0
  332. qanswer_sdk/models/ip2_geo_response.py +91 -0
  333. qanswer_sdk/models/is_enabled_response.py +87 -0
  334. qanswer_sdk/models/jwt_authentication_response.py +93 -0
  335. qanswer_sdk/models/label.py +89 -0
  336. qanswer_sdk/models/labeled_node.py +89 -0
  337. qanswer_sdk/models/language.py +42 -0
  338. qanswer_sdk/models/last_updated_template_conversation_id_response.py +87 -0
  339. qanswer_sdk/models/link.py +99 -0
  340. qanswer_sdk/models/link_extraction_response.py +97 -0
  341. qanswer_sdk/models/link_result_paginated.py +97 -0
  342. qanswer_sdk/models/linked_entity_model_in_linking.py +99 -0
  343. qanswer_sdk/models/linker.py +103 -0
  344. qanswer_sdk/models/linking_result_input.py +95 -0
  345. qanswer_sdk/models/linking_result_output.py +95 -0
  346. qanswer_sdk/models/links.py +99 -0
  347. qanswer_sdk/models/list_ai_templates_response.py +101 -0
  348. qanswer_sdk/models/list_connectors_response.py +95 -0
  349. qanswer_sdk/models/list_conversation_response.py +105 -0
  350. qanswer_sdk/models/list_feedback_response.py +105 -0
  351. qanswer_sdk/models/list_files_connector_response.py +107 -0
  352. qanswer_sdk/models/list_published_assistants_payload.py +115 -0
  353. qanswer_sdk/models/list_socket_events.py +95 -0
  354. qanswer_sdk/models/list_synonyms_model.py +95 -0
  355. qanswer_sdk/models/llm_context_ranges.py +93 -0
  356. qanswer_sdk/models/llm_context_ranges_response.py +93 -0
  357. qanswer_sdk/models/llm_cost_entry.py +97 -0
  358. qanswer_sdk/models/llm_cost_filter.py +112 -0
  359. qanswer_sdk/models/llm_cost_list.py +111 -0
  360. qanswer_sdk/models/llm_create_dto.py +208 -0
  361. qanswer_sdk/models/llm_detailed_dto.py +231 -0
  362. qanswer_sdk/models/llm_details.py +123 -0
  363. qanswer_sdk/models/llm_dto.py +147 -0
  364. qanswer_sdk/models/llm_endpoint.py +212 -0
  365. qanswer_sdk/models/llm_endpoint_create.py +204 -0
  366. qanswer_sdk/models/llm_endpoint_default_prompts.py +93 -0
  367. qanswer_sdk/models/llm_endpoint_export_payload.py +87 -0
  368. qanswer_sdk/models/llm_endpoint_import_failure.py +89 -0
  369. qanswer_sdk/models/llm_endpoint_import_response.py +99 -0
  370. qanswer_sdk/models/llm_endpoint_input.py +212 -0
  371. qanswer_sdk/models/llm_endpoint_modality.py +37 -0
  372. qanswer_sdk/models/llm_endpoint_names_validation_payload.py +87 -0
  373. qanswer_sdk/models/llm_endpoint_provider.py +44 -0
  374. qanswer_sdk/models/llm_endpoint_read_input.py +212 -0
  375. qanswer_sdk/models/llm_endpoint_read_output.py +212 -0
  376. qanswer_sdk/models/llm_endpoint_update.py +204 -0
  377. qanswer_sdk/models/llm_endpoint_usage_migration_response.py +93 -0
  378. qanswer_sdk/models/llm_endpoint_validation_response.py +96 -0
  379. qanswer_sdk/models/llm_filter_dto.py +111 -0
  380. qanswer_sdk/models/llm_health_response.py +89 -0
  381. qanswer_sdk/models/llm_list_detailed_dto.py +101 -0
  382. qanswer_sdk/models/llm_list_dto.py +101 -0
  383. qanswer_sdk/models/llm_update_dto.py +208 -0
  384. qanswer_sdk/models/llm_usage_origin.py +63 -0
  385. qanswer_sdk/models/location_details.py +97 -0
  386. qanswer_sdk/models/log_request.py +125 -0
  387. qanswer_sdk/models/login_request.py +89 -0
  388. qanswer_sdk/models/logs_visibility_policy.py +38 -0
  389. qanswer_sdk/models/logs_visibility_policy_payload.py +98 -0
  390. qanswer_sdk/models/logs_visibility_policy_response.py +98 -0
  391. qanswer_sdk/models/mcp_authentication_type.py +39 -0
  392. qanswer_sdk/models/mcp_connection.py +105 -0
  393. qanswer_sdk/models/mcp_connection_create.py +98 -0
  394. qanswer_sdk/models/mcp_server.py +167 -0
  395. qanswer_sdk/models/mcp_server0.py +167 -0
  396. qanswer_sdk/models/mcp_server_create.py +133 -0
  397. qanswer_sdk/models/mcp_server_dto.py +167 -0
  398. qanswer_sdk/models/mcp_server_type.py +37 -0
  399. qanswer_sdk/models/mcp_server_update.py +131 -0
  400. qanswer_sdk/models/mcp_tool_dto.py +141 -0
  401. qanswer_sdk/models/mcp_tool_info.py +95 -0
  402. qanswer_sdk/models/mcp_tool_selection_source.py +37 -0
  403. qanswer_sdk/models/mcp_tool_update.py +91 -0
  404. qanswer_sdk/models/mcp_transport.py +37 -0
  405. qanswer_sdk/models/mcp_visibility.py +38 -0
  406. qanswer_sdk/models/mcpo_auth2_initiating_origin.py +42 -0
  407. qanswer_sdk/models/message_role.py +38 -0
  408. qanswer_sdk/models/messages_stats_per_day_response.py +99 -0
  409. qanswer_sdk/models/microsoft_connector_config.py +110 -0
  410. qanswer_sdk/models/modify_connector_request.py +107 -0
  411. qanswer_sdk/models/modify_file_display_name_request.py +97 -0
  412. qanswer_sdk/models/notification_dto.py +137 -0
  413. qanswer_sdk/models/notification_filter.py +116 -0
  414. qanswer_sdk/models/notification_list_dto.py +101 -0
  415. qanswer_sdk/models/notification_payload_add_to_org_dto.py +87 -0
  416. qanswer_sdk/models/notification_payload_add_to_team_dto.py +89 -0
  417. qanswer_sdk/models/notification_payload_ai_assistant_shared_dto.py +109 -0
  418. qanswer_sdk/models/notification_payload_conversation_shared_dto.py +105 -0
  419. qanswer_sdk/models/notification_payload_dto.py +193 -0
  420. qanswer_sdk/models/notification_payload_human_takeover_requested_dto.py +89 -0
  421. qanswer_sdk/models/notification_payload_quota_reaching_dto.py +91 -0
  422. qanswer_sdk/models/notification_read_dto.py +89 -0
  423. qanswer_sdk/models/notification_type.py +44 -0
  424. qanswer_sdk/models/o_auth_redirect_response.py +89 -0
  425. qanswer_sdk/models/o_auth_service_dto.py +89 -0
  426. qanswer_sdk/models/one_drive_download_by_ids.py +89 -0
  427. qanswer_sdk/models/one_drive_download_request.py +103 -0
  428. qanswer_sdk/models/one_note_download_by_ids.py +91 -0
  429. qanswer_sdk/models/one_note_download_request.py +103 -0
  430. qanswer_sdk/models/org_llm_detailed_dto.py +105 -0
  431. qanswer_sdk/models/organization.py +93 -0
  432. qanswer_sdk/models/organization_creation.py +91 -0
  433. qanswer_sdk/models/organization_dto.py +93 -0
  434. qanswer_sdk/models/organization_filter_dto.py +134 -0
  435. qanswer_sdk/models/organization_list_dto.py +101 -0
  436. qanswer_sdk/models/paginated_report_templates.py +101 -0
  437. qanswer_sdk/models/password.py +89 -0
  438. qanswer_sdk/models/pinecone_index_model.py +91 -0
  439. qanswer_sdk/models/plan_dto.py +132 -0
  440. qanswer_sdk/models/predicted_class.py +89 -0
  441. qanswer_sdk/models/prepare_synonyms_upload_resp.py +99 -0
  442. qanswer_sdk/models/prepared_synonym_group.py +87 -0
  443. qanswer_sdk/models/pricing_plan.py +51 -0
  444. qanswer_sdk/models/pricing_type.py +38 -0
  445. qanswer_sdk/models/prompt_type.py +51 -0
  446. qanswer_sdk/models/provider.py +87 -0
  447. qanswer_sdk/models/publication_add_payload.py +105 -0
  448. qanswer_sdk/models/publication_file_metadata.py +105 -0
  449. qanswer_sdk/models/publication_office_additional_fields.py +111 -0
  450. qanswer_sdk/models/publication_office_connector_config.py +110 -0
  451. qanswer_sdk/models/publication_search_index_search_response.py +113 -0
  452. qanswer_sdk/models/published_assistant_from_java.py +94 -0
  453. qanswer_sdk/models/put_cell_payload.py +89 -0
  454. qanswer_sdk/models/qa_context.py +129 -0
  455. qanswer_sdk/models/qa_context_display_type.py +44 -0
  456. qanswer_sdk/models/qa_contexts.py +116 -0
  457. qanswer_sdk/models/qa_table.py +100 -0
  458. qanswer_sdk/models/qn_a_pair_model.py +103 -0
  459. qanswer_sdk/models/qn_a_pair_response.py +95 -0
  460. qanswer_sdk/models/question_suggestion_response.py +87 -0
  461. qanswer_sdk/models/rag_params.py +89 -0
  462. qanswer_sdk/models/rag_payload.py +186 -0
  463. qanswer_sdk/models/rag_response.py +155 -0
  464. qanswer_sdk/models/rdf_entity_linker_response.py +99 -0
  465. qanswer_sdk/models/rdf_linked_entity.py +97 -0
  466. qanswer_sdk/models/reasoning_effort.py +39 -0
  467. qanswer_sdk/models/reference_model.py +99 -0
  468. qanswer_sdk/models/refresh_frequency.py +39 -0
  469. qanswer_sdk/models/refresh_token_request.py +87 -0
  470. qanswer_sdk/models/refresh_website_connector_payload.py +94 -0
  471. qanswer_sdk/models/register_pinecone_connector_request.py +95 -0
  472. qanswer_sdk/models/report_copilot_generation_from_slots_ack.py +91 -0
  473. qanswer_sdk/models/report_copilot_generation_from_slots_payload.py +95 -0
  474. qanswer_sdk/models/report_copilot_refinement_payload.py +106 -0
  475. qanswer_sdk/models/report_copilot_refinement_response.py +87 -0
  476. qanswer_sdk/models/report_copilot_slot_feedback_update.py +95 -0
  477. qanswer_sdk/models/report_copilot_slot_feedback_update_response.py +95 -0
  478. qanswer_sdk/models/report_copilot_slot_task_settings.py +127 -0
  479. qanswer_sdk/models/report_copilot_slot_task_settings_update.py +127 -0
  480. qanswer_sdk/models/report_copilot_task_settings.py +125 -0
  481. qanswer_sdk/models/report_copilot_task_settings_update_payload.py +95 -0
  482. qanswer_sdk/models/report_copilot_task_update.py +125 -0
  483. qanswer_sdk/models/report_template.py +139 -0
  484. qanswer_sdk/models/report_template_create_payload.py +117 -0
  485. qanswer_sdk/models/report_template_image_upload_response.py +87 -0
  486. qanswer_sdk/models/report_template_simplified.py +115 -0
  487. qanswer_sdk/models/report_template_simplified_payload.py +91 -0
  488. qanswer_sdk/models/report_template_task_settings_update_payload.py +91 -0
  489. qanswer_sdk/models/report_template_update_payload.py +121 -0
  490. qanswer_sdk/models/report_templates_search_payload.py +106 -0
  491. qanswer_sdk/models/reset_password.py +87 -0
  492. qanswer_sdk/models/response_audit_model.py +99 -0
  493. qanswer_sdk/models/response_audit_stats_response.py +101 -0
  494. qanswer_sdk/models/response_get_dummy_union_connector_config_model_backend_api_connectors_config_dummy_models_union_get.py +228 -0
  495. qanswer_sdk/models/retreive_all_synonyms_resp.py +99 -0
  496. qanswer_sdk/models/retry_params.py +89 -0
  497. qanswer_sdk/models/return_type.py +38 -0
  498. qanswer_sdk/models/role.py +99 -0
  499. qanswer_sdk/models/role_name.py +37 -0
  500. qanswer_sdk/models/scrolling_strategy.py +37 -0
  501. qanswer_sdk/models/search_conversation_messages_response.py +105 -0
  502. qanswer_sdk/models/search_document_response.py +105 -0
  503. qanswer_sdk/models/search_index_payload.py +114 -0
  504. qanswer_sdk/models/search_metadata_filter.py +94 -0
  505. qanswer_sdk/models/search_payload.py +146 -0
  506. qanswer_sdk/models/search_response.py +125 -0
  507. qanswer_sdk/models/search_synonyms_resp.py +91 -0
  508. qanswer_sdk/models/search_task_settings.py +139 -0
  509. qanswer_sdk/models/search_task_settings_update_payload.py +95 -0
  510. qanswer_sdk/models/search_task_update.py +137 -0
  511. qanswer_sdk/models/sender_type.py +38 -0
  512. qanswer_sdk/models/share_point_connector_settings.py +94 -0
  513. qanswer_sdk/models/share_point_download_by_ids.py +99 -0
  514. qanswer_sdk/models/share_point_download_request.py +103 -0
  515. qanswer_sdk/models/shared_by.py +38 -0
  516. qanswer_sdk/models/shared_entity_type.py +38 -0
  517. qanswer_sdk/models/shared_organization_access.py +125 -0
  518. qanswer_sdk/models/shared_organization_access_dto.py +125 -0
  519. qanswer_sdk/models/shared_team_access.py +125 -0
  520. qanswer_sdk/models/shared_team_access_dto.py +125 -0
  521. qanswer_sdk/models/shared_user.py +99 -0
  522. qanswer_sdk/models/sign_up_request.py +108 -0
  523. qanswer_sdk/models/signout_request.py +87 -0
  524. qanswer_sdk/models/slot.py +162 -0
  525. qanswer_sdk/models/slot_history_entry.py +127 -0
  526. qanswer_sdk/models/slot_in_prompt.py +91 -0
  527. qanswer_sdk/models/slot_info_with_latest_version.py +95 -0
  528. qanswer_sdk/models/slot_update.py +142 -0
  529. qanswer_sdk/models/socker_join_user.py +91 -0
  530. qanswer_sdk/models/socket_ai_cell_generation.py +99 -0
  531. qanswer_sdk/models/socket_conversation_message.py +280 -0
  532. qanswer_sdk/models/socket_events_q_answer.py +51 -0
  533. qanswer_sdk/models/socket_feedback_evaluation_progress.py +114 -0
  534. qanswer_sdk/models/socket_file_metadata.py +207 -0
  535. qanswer_sdk/models/socket_join_conversation.py +97 -0
  536. qanswer_sdk/models/socket_join_dataset.py +93 -0
  537. qanswer_sdk/models/socket_message_status.py +40 -0
  538. qanswer_sdk/models/socket_notification.py +127 -0
  539. qanswer_sdk/models/socket_report_continuation_response.py +106 -0
  540. qanswer_sdk/models/socket_report_copilot_generation_from_slots_response.py +122 -0
  541. qanswer_sdk/models/socket_report_copilot_generation_from_template_response.py +122 -0
  542. qanswer_sdk/models/socket_report_copilot_refinement_response.py +108 -0
  543. qanswer_sdk/models/socket_speech2_text_response.py +131 -0
  544. qanswer_sdk/models/socket_stop_conversation.py +97 -0
  545. qanswer_sdk/models/source.py +125 -0
  546. qanswer_sdk/models/source_metadata.py +109 -0
  547. qanswer_sdk/models/speech2_text_response.py +119 -0
  548. qanswer_sdk/models/stat_per_date.py +89 -0
  549. qanswer_sdk/models/status_response.py +89 -0
  550. qanswer_sdk/models/stop_template_generation_payload.py +91 -0
  551. qanswer_sdk/models/storage_active_status.py +37 -0
  552. qanswer_sdk/models/subscription_response.py +101 -0
  553. qanswer_sdk/models/subscription_status.py +39 -0
  554. qanswer_sdk/models/suggestion_list_response.py +87 -0
  555. qanswer_sdk/models/summa_server.py +101 -0
  556. qanswer_sdk/models/task_category.py +58 -0
  557. qanswer_sdk/models/task_name.py +43 -0
  558. qanswer_sdk/models/team.py +93 -0
  559. qanswer_sdk/models/team_creation.py +89 -0
  560. qanswer_sdk/models/team_creation_dto.py +89 -0
  561. qanswer_sdk/models/team_dto.py +93 -0
  562. qanswer_sdk/models/team_filter_dto.py +141 -0
  563. qanswer_sdk/models/team_list_dto.py +101 -0
  564. qanswer_sdk/models/template_clip_structure.py +114 -0
  565. qanswer_sdk/models/template_toggle_request.py +93 -0
  566. qanswer_sdk/models/terms_bucket.py +94 -0
  567. qanswer_sdk/models/test_imap_connection_payload.py +95 -0
  568. qanswer_sdk/models/text2_sparql_payload.py +188 -0
  569. qanswer_sdk/models/text2_sparql_task_settings.py +125 -0
  570. qanswer_sdk/models/text2_sparql_task_settings_update_payload.py +95 -0
  571. qanswer_sdk/models/text2_sparql_task_update.py +125 -0
  572. qanswer_sdk/models/text_classification_payload.py +99 -0
  573. qanswer_sdk/models/text_classification_response.py +87 -0
  574. qanswer_sdk/models/text_classification_v2_payload.py +99 -0
  575. qanswer_sdk/models/text_classification_v2_response.py +95 -0
  576. qanswer_sdk/models/thinking_block.py +91 -0
  577. qanswer_sdk/models/tool_selection.py +89 -0
  578. qanswer_sdk/models/total_stat.py +96 -0
  579. qanswer_sdk/models/ui_mappings.py +141 -0
  580. qanswer_sdk/models/update_cells_payload.py +93 -0
  581. qanswer_sdk/models/update_file_es_meta_data.py +116 -0
  582. qanswer_sdk/models/update_metadata_model_input.py +97 -0
  583. qanswer_sdk/models/update_metadata_model_output.py +97 -0
  584. qanswer_sdk/models/update_qn_a_pair_request.py +101 -0
  585. qanswer_sdk/models/update_qn_a_pair_response.py +89 -0
  586. qanswer_sdk/models/update_synonyms.py +95 -0
  587. qanswer_sdk/models/update_synonyms_resp.py +89 -0
  588. qanswer_sdk/models/update_template_cells_payload.py +101 -0
  589. qanswer_sdk/models/upload_metadata.py +115 -0
  590. qanswer_sdk/models/user.py +91 -0
  591. qanswer_sdk/models/user_credits_config_dto.py +99 -0
  592. qanswer_sdk/models/user_credits_dto.py +106 -0
  593. qanswer_sdk/models/user_dataset_api_key.py +120 -0
  594. qanswer_sdk/models/user_dataset_api_key_dto.py +120 -0
  595. qanswer_sdk/models/user_dataset_mcp_tool_selection_dto.py +102 -0
  596. qanswer_sdk/models/user_dto.py +91 -0
  597. qanswer_sdk/models/user_filter_dto.py +155 -0
  598. qanswer_sdk/models/user_identity_availability.py +87 -0
  599. qanswer_sdk/models/user_info_dto.py +95 -0
  600. qanswer_sdk/models/user_list_dto.py +101 -0
  601. qanswer_sdk/models/user_log.py +102 -0
  602. qanswer_sdk/models/user_log_dto.py +102 -0
  603. qanswer_sdk/models/user_logs_list_dto.py +97 -0
  604. qanswer_sdk/models/user_mcp_tool_selection_dto.py +118 -0
  605. qanswer_sdk/models/user_oauth_token.py +96 -0
  606. qanswer_sdk/models/user_oauth_token_dto.py +96 -0
  607. qanswer_sdk/models/user_profile_dto.py +200 -0
  608. qanswer_sdk/models/user_profile_list_dto.py +101 -0
  609. qanswer_sdk/models/user_stat_per_date.py +90 -0
  610. qanswer_sdk/models/validation_error.py +108 -0
  611. qanswer_sdk/models/validation_error_loc_inner.py +138 -0
  612. qanswer_sdk/models/warn_visibility.py +40 -0
  613. qanswer_sdk/models/websearch_connector_config.py +102 -0
  614. qanswer_sdk/models/websearch_scraping_site.py +91 -0
  615. qanswer_sdk/models/website_add_payload.py +102 -0
  616. qanswer_sdk/models/website_connector_config.py +102 -0
  617. qanswer_sdk/models/website_connector_settings.py +160 -0
  618. qanswer_sdk/models/widget_configs.py +109 -0
  619. qanswer_sdk/py.typed +0 -0
  620. qanswer_sdk/rest.py +258 -0
  621. qanswer_sdk-0.46.0.dev0.dist-info/METADATA +252 -0
  622. qanswer_sdk-0.46.0.dev0.dist-info/RECORD +624 -0
  623. qanswer_sdk-0.46.0.dev0.dist-info/WHEEL +5 -0
  624. qanswer_sdk-0.46.0.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,4660 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ free-text-client
5
+
6
+ QAnswer 2.0 API
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr
20
+ from typing import Any, Dict, List, Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from qanswer_sdk.models.llm_details import LLMDetails
23
+ from qanswer_sdk.models.llm_endpoint import LLMEndpoint
24
+ from qanswer_sdk.models.llm_endpoint_create import LLMEndpointCreate
25
+ from qanswer_sdk.models.llm_endpoint_default_prompts import LLMEndpointDefaultPrompts
26
+ from qanswer_sdk.models.llm_endpoint_export_payload import LLMEndpointExportPayload
27
+ from qanswer_sdk.models.llm_endpoint_import_response import LLMEndpointImportResponse
28
+ from qanswer_sdk.models.llm_endpoint_input import LLMEndpointInput
29
+ from qanswer_sdk.models.llm_endpoint_names_validation_payload import LLMEndpointNamesValidationPayload
30
+ from qanswer_sdk.models.llm_endpoint_update import LLMEndpointUpdate
31
+ from qanswer_sdk.models.llm_endpoint_usage_migration_response import LLMEndpointUsageMigrationResponse
32
+ from qanswer_sdk.models.llm_endpoint_validation_response import LLMEndpointValidationResponse
33
+ from qanswer_sdk.models.llm_usage_origin import LLMUsageOrigin
34
+
35
+ from qanswer_sdk.api_client import ApiClient, RequestSerialized
36
+ from qanswer_sdk.api_response import ApiResponse
37
+ from qanswer_sdk.rest import RESTResponseType
38
+
39
+
40
+ class LLMEndpointApi:
41
+ """NOTE: This class is auto generated by OpenAPI Generator
42
+ Ref: https://openapi-generator.tech
43
+
44
+ Do not edit the class manually.
45
+ """
46
+
47
+ def __init__(self, api_client=None) -> None:
48
+ if api_client is None:
49
+ api_client = ApiClient.get_default()
50
+ self.api_client = api_client
51
+
52
+
53
+ @validate_call
54
+ def create_llm_endpoint_v2(
55
+ self,
56
+ llm_endpoint_create: LLMEndpointCreate,
57
+ _request_timeout: Union[
58
+ None,
59
+ Annotated[StrictFloat, Field(gt=0)],
60
+ Tuple[
61
+ Annotated[StrictFloat, Field(gt=0)],
62
+ Annotated[StrictFloat, Field(gt=0)]
63
+ ]
64
+ ] = None,
65
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
66
+ _content_type: Optional[StrictStr] = None,
67
+ _headers: Optional[Dict[StrictStr, Any]] = None,
68
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
69
+ ) -> LLMEndpoint:
70
+ """Create Llm Endpoint V2
71
+
72
+
73
+ :param llm_endpoint_create: (required)
74
+ :type llm_endpoint_create: LLMEndpointCreate
75
+ :param _request_timeout: timeout setting for this request. If one
76
+ number provided, it will be total request
77
+ timeout. It can also be a pair (tuple) of
78
+ (connection, read) timeouts.
79
+ :type _request_timeout: int, tuple(int, int), optional
80
+ :param _request_auth: set to override the auth_settings for an a single
81
+ request; this effectively ignores the
82
+ authentication in the spec for a single request.
83
+ :type _request_auth: dict, optional
84
+ :param _content_type: force content-type for the request.
85
+ :type _content_type: str, Optional
86
+ :param _headers: set to override the headers for a single
87
+ request; this effectively ignores the headers
88
+ in the spec for a single request.
89
+ :type _headers: dict, optional
90
+ :param _host_index: set to override the host_index for a single
91
+ request; this effectively ignores the host_index
92
+ in the spec for a single request.
93
+ :type _host_index: int, optional
94
+ :return: Returns the result object.
95
+ """ # noqa: E501
96
+
97
+ _param = self._create_llm_endpoint_v2_serialize(
98
+ llm_endpoint_create=llm_endpoint_create,
99
+ _request_auth=_request_auth,
100
+ _content_type=_content_type,
101
+ _headers=_headers,
102
+ _host_index=_host_index
103
+ )
104
+
105
+ _response_types_map: Dict[str, Optional[str]] = {
106
+ '200': "LLMEndpoint",
107
+ '404': None,
108
+ '422': "HTTPValidationError",
109
+ }
110
+ response_data = self.api_client.call_api(
111
+ *_param,
112
+ _request_timeout=_request_timeout
113
+ )
114
+ response_data.read()
115
+ return self.api_client.response_deserialize(
116
+ response_data=response_data,
117
+ response_types_map=_response_types_map,
118
+ ).data
119
+
120
+
121
+ @validate_call
122
+ def create_llm_endpoint_v2_with_http_info(
123
+ self,
124
+ llm_endpoint_create: LLMEndpointCreate,
125
+ _request_timeout: Union[
126
+ None,
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Tuple[
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Annotated[StrictFloat, Field(gt=0)]
131
+ ]
132
+ ] = None,
133
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
134
+ _content_type: Optional[StrictStr] = None,
135
+ _headers: Optional[Dict[StrictStr, Any]] = None,
136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
137
+ ) -> ApiResponse[LLMEndpoint]:
138
+ """Create Llm Endpoint V2
139
+
140
+
141
+ :param llm_endpoint_create: (required)
142
+ :type llm_endpoint_create: LLMEndpointCreate
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_llm_endpoint_v2_serialize(
166
+ llm_endpoint_create=llm_endpoint_create,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index
171
+ )
172
+
173
+ _response_types_map: Dict[str, Optional[str]] = {
174
+ '200': "LLMEndpoint",
175
+ '404': None,
176
+ '422': "HTTPValidationError",
177
+ }
178
+ response_data = self.api_client.call_api(
179
+ *_param,
180
+ _request_timeout=_request_timeout
181
+ )
182
+ response_data.read()
183
+ return self.api_client.response_deserialize(
184
+ response_data=response_data,
185
+ response_types_map=_response_types_map,
186
+ )
187
+
188
+
189
+ @validate_call
190
+ def create_llm_endpoint_v2_without_preload_content(
191
+ self,
192
+ llm_endpoint_create: LLMEndpointCreate,
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Create Llm Endpoint V2
207
+
208
+
209
+ :param llm_endpoint_create: (required)
210
+ :type llm_endpoint_create: LLMEndpointCreate
211
+ :param _request_timeout: timeout setting for this request. If one
212
+ number provided, it will be total request
213
+ timeout. It can also be a pair (tuple) of
214
+ (connection, read) timeouts.
215
+ :type _request_timeout: int, tuple(int, int), optional
216
+ :param _request_auth: set to override the auth_settings for an a single
217
+ request; this effectively ignores the
218
+ authentication in the spec for a single request.
219
+ :type _request_auth: dict, optional
220
+ :param _content_type: force content-type for the request.
221
+ :type _content_type: str, Optional
222
+ :param _headers: set to override the headers for a single
223
+ request; this effectively ignores the headers
224
+ in the spec for a single request.
225
+ :type _headers: dict, optional
226
+ :param _host_index: set to override the host_index for a single
227
+ request; this effectively ignores the host_index
228
+ in the spec for a single request.
229
+ :type _host_index: int, optional
230
+ :return: Returns the result object.
231
+ """ # noqa: E501
232
+
233
+ _param = self._create_llm_endpoint_v2_serialize(
234
+ llm_endpoint_create=llm_endpoint_create,
235
+ _request_auth=_request_auth,
236
+ _content_type=_content_type,
237
+ _headers=_headers,
238
+ _host_index=_host_index
239
+ )
240
+
241
+ _response_types_map: Dict[str, Optional[str]] = {
242
+ '200': "LLMEndpoint",
243
+ '404': None,
244
+ '422': "HTTPValidationError",
245
+ }
246
+ response_data = self.api_client.call_api(
247
+ *_param,
248
+ _request_timeout=_request_timeout
249
+ )
250
+ return response_data.response
251
+
252
+
253
+ def _create_llm_endpoint_v2_serialize(
254
+ self,
255
+ llm_endpoint_create,
256
+ _request_auth,
257
+ _content_type,
258
+ _headers,
259
+ _host_index,
260
+ ) -> RequestSerialized:
261
+
262
+ _host = None
263
+
264
+ _collection_formats: Dict[str, str] = {
265
+ }
266
+
267
+ _path_params: Dict[str, str] = {}
268
+ _query_params: List[Tuple[str, str]] = []
269
+ _header_params: Dict[str, Optional[str]] = _headers or {}
270
+ _form_params: List[Tuple[str, str]] = []
271
+ _files: Dict[
272
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
273
+ ] = {}
274
+ _body_params: Optional[bytes] = None
275
+
276
+ # process the path parameters
277
+ # process the query parameters
278
+ # process the header parameters
279
+ # process the form parameters
280
+ # process the body parameter
281
+ if llm_endpoint_create is not None:
282
+ _body_params = llm_endpoint_create
283
+
284
+
285
+ # set the HTTP header `Accept`
286
+ if 'Accept' not in _header_params:
287
+ _header_params['Accept'] = self.api_client.select_header_accept(
288
+ [
289
+ 'application/json'
290
+ ]
291
+ )
292
+
293
+ # set the HTTP header `Content-Type`
294
+ if _content_type:
295
+ _header_params['Content-Type'] = _content_type
296
+ else:
297
+ _default_content_type = (
298
+ self.api_client.select_header_content_type(
299
+ [
300
+ 'application/json'
301
+ ]
302
+ )
303
+ )
304
+ if _default_content_type is not None:
305
+ _header_params['Content-Type'] = _default_content_type
306
+
307
+ # authentication setting
308
+ _auth_settings: List[str] = [
309
+ 'QAnswer-Api-Key',
310
+ 'Bearer token'
311
+ ]
312
+
313
+ return self.api_client.param_serialize(
314
+ method='POST',
315
+ resource_path='/backend/api/llm-endpoint',
316
+ path_params=_path_params,
317
+ query_params=_query_params,
318
+ header_params=_header_params,
319
+ body=_body_params,
320
+ post_params=_form_params,
321
+ files=_files,
322
+ auth_settings=_auth_settings,
323
+ collection_formats=_collection_formats,
324
+ _host=_host,
325
+ _request_auth=_request_auth
326
+ )
327
+
328
+
329
+
330
+
331
+ @validate_call
332
+ def delete_llm_endpoint_v2(
333
+ self,
334
+ id: StrictInt,
335
+ replacement_llm_id: Annotated[Optional[StrictInt], Field(description="ID of the replacement LLM endpoint to reassign usages to. If not provided, usages will be reassigned to the default LLM endpoint if exists, otherwise deletion will be blocked if there are active usages.")] = None,
336
+ _request_timeout: Union[
337
+ None,
338
+ Annotated[StrictFloat, Field(gt=0)],
339
+ Tuple[
340
+ Annotated[StrictFloat, Field(gt=0)],
341
+ Annotated[StrictFloat, Field(gt=0)]
342
+ ]
343
+ ] = None,
344
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
345
+ _content_type: Optional[StrictStr] = None,
346
+ _headers: Optional[Dict[StrictStr, Any]] = None,
347
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
348
+ ) -> object:
349
+ """Delete Llm Endpoint V2
350
+
351
+
352
+ :param id: (required)
353
+ :type id: int
354
+ :param replacement_llm_id: ID of the replacement LLM endpoint to reassign usages to. If not provided, usages will be reassigned to the default LLM endpoint if exists, otherwise deletion will be blocked if there are active usages.
355
+ :type replacement_llm_id: int
356
+ :param _request_timeout: timeout setting for this request. If one
357
+ number provided, it will be total request
358
+ timeout. It can also be a pair (tuple) of
359
+ (connection, read) timeouts.
360
+ :type _request_timeout: int, tuple(int, int), optional
361
+ :param _request_auth: set to override the auth_settings for an a single
362
+ request; this effectively ignores the
363
+ authentication in the spec for a single request.
364
+ :type _request_auth: dict, optional
365
+ :param _content_type: force content-type for the request.
366
+ :type _content_type: str, Optional
367
+ :param _headers: set to override the headers for a single
368
+ request; this effectively ignores the headers
369
+ in the spec for a single request.
370
+ :type _headers: dict, optional
371
+ :param _host_index: set to override the host_index for a single
372
+ request; this effectively ignores the host_index
373
+ in the spec for a single request.
374
+ :type _host_index: int, optional
375
+ :return: Returns the result object.
376
+ """ # noqa: E501
377
+
378
+ _param = self._delete_llm_endpoint_v2_serialize(
379
+ id=id,
380
+ replacement_llm_id=replacement_llm_id,
381
+ _request_auth=_request_auth,
382
+ _content_type=_content_type,
383
+ _headers=_headers,
384
+ _host_index=_host_index
385
+ )
386
+
387
+ _response_types_map: Dict[str, Optional[str]] = {
388
+ '200': "object",
389
+ '404': None,
390
+ '422': "HTTPValidationError",
391
+ }
392
+ response_data = self.api_client.call_api(
393
+ *_param,
394
+ _request_timeout=_request_timeout
395
+ )
396
+ response_data.read()
397
+ return self.api_client.response_deserialize(
398
+ response_data=response_data,
399
+ response_types_map=_response_types_map,
400
+ ).data
401
+
402
+
403
+ @validate_call
404
+ def delete_llm_endpoint_v2_with_http_info(
405
+ self,
406
+ id: StrictInt,
407
+ replacement_llm_id: Annotated[Optional[StrictInt], Field(description="ID of the replacement LLM endpoint to reassign usages to. If not provided, usages will be reassigned to the default LLM endpoint if exists, otherwise deletion will be blocked if there are active usages.")] = None,
408
+ _request_timeout: Union[
409
+ None,
410
+ Annotated[StrictFloat, Field(gt=0)],
411
+ Tuple[
412
+ Annotated[StrictFloat, Field(gt=0)],
413
+ Annotated[StrictFloat, Field(gt=0)]
414
+ ]
415
+ ] = None,
416
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
417
+ _content_type: Optional[StrictStr] = None,
418
+ _headers: Optional[Dict[StrictStr, Any]] = None,
419
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
420
+ ) -> ApiResponse[object]:
421
+ """Delete Llm Endpoint V2
422
+
423
+
424
+ :param id: (required)
425
+ :type id: int
426
+ :param replacement_llm_id: ID of the replacement LLM endpoint to reassign usages to. If not provided, usages will be reassigned to the default LLM endpoint if exists, otherwise deletion will be blocked if there are active usages.
427
+ :type replacement_llm_id: int
428
+ :param _request_timeout: timeout setting for this request. If one
429
+ number provided, it will be total request
430
+ timeout. It can also be a pair (tuple) of
431
+ (connection, read) timeouts.
432
+ :type _request_timeout: int, tuple(int, int), optional
433
+ :param _request_auth: set to override the auth_settings for an a single
434
+ request; this effectively ignores the
435
+ authentication in the spec for a single request.
436
+ :type _request_auth: dict, optional
437
+ :param _content_type: force content-type for the request.
438
+ :type _content_type: str, Optional
439
+ :param _headers: set to override the headers for a single
440
+ request; this effectively ignores the headers
441
+ in the spec for a single request.
442
+ :type _headers: dict, optional
443
+ :param _host_index: set to override the host_index for a single
444
+ request; this effectively ignores the host_index
445
+ in the spec for a single request.
446
+ :type _host_index: int, optional
447
+ :return: Returns the result object.
448
+ """ # noqa: E501
449
+
450
+ _param = self._delete_llm_endpoint_v2_serialize(
451
+ id=id,
452
+ replacement_llm_id=replacement_llm_id,
453
+ _request_auth=_request_auth,
454
+ _content_type=_content_type,
455
+ _headers=_headers,
456
+ _host_index=_host_index
457
+ )
458
+
459
+ _response_types_map: Dict[str, Optional[str]] = {
460
+ '200': "object",
461
+ '404': None,
462
+ '422': "HTTPValidationError",
463
+ }
464
+ response_data = self.api_client.call_api(
465
+ *_param,
466
+ _request_timeout=_request_timeout
467
+ )
468
+ response_data.read()
469
+ return self.api_client.response_deserialize(
470
+ response_data=response_data,
471
+ response_types_map=_response_types_map,
472
+ )
473
+
474
+
475
+ @validate_call
476
+ def delete_llm_endpoint_v2_without_preload_content(
477
+ self,
478
+ id: StrictInt,
479
+ replacement_llm_id: Annotated[Optional[StrictInt], Field(description="ID of the replacement LLM endpoint to reassign usages to. If not provided, usages will be reassigned to the default LLM endpoint if exists, otherwise deletion will be blocked if there are active usages.")] = None,
480
+ _request_timeout: Union[
481
+ None,
482
+ Annotated[StrictFloat, Field(gt=0)],
483
+ Tuple[
484
+ Annotated[StrictFloat, Field(gt=0)],
485
+ Annotated[StrictFloat, Field(gt=0)]
486
+ ]
487
+ ] = None,
488
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
489
+ _content_type: Optional[StrictStr] = None,
490
+ _headers: Optional[Dict[StrictStr, Any]] = None,
491
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
492
+ ) -> RESTResponseType:
493
+ """Delete Llm Endpoint V2
494
+
495
+
496
+ :param id: (required)
497
+ :type id: int
498
+ :param replacement_llm_id: ID of the replacement LLM endpoint to reassign usages to. If not provided, usages will be reassigned to the default LLM endpoint if exists, otherwise deletion will be blocked if there are active usages.
499
+ :type replacement_llm_id: int
500
+ :param _request_timeout: timeout setting for this request. If one
501
+ number provided, it will be total request
502
+ timeout. It can also be a pair (tuple) of
503
+ (connection, read) timeouts.
504
+ :type _request_timeout: int, tuple(int, int), optional
505
+ :param _request_auth: set to override the auth_settings for an a single
506
+ request; this effectively ignores the
507
+ authentication in the spec for a single request.
508
+ :type _request_auth: dict, optional
509
+ :param _content_type: force content-type for the request.
510
+ :type _content_type: str, Optional
511
+ :param _headers: set to override the headers for a single
512
+ request; this effectively ignores the headers
513
+ in the spec for a single request.
514
+ :type _headers: dict, optional
515
+ :param _host_index: set to override the host_index for a single
516
+ request; this effectively ignores the host_index
517
+ in the spec for a single request.
518
+ :type _host_index: int, optional
519
+ :return: Returns the result object.
520
+ """ # noqa: E501
521
+
522
+ _param = self._delete_llm_endpoint_v2_serialize(
523
+ id=id,
524
+ replacement_llm_id=replacement_llm_id,
525
+ _request_auth=_request_auth,
526
+ _content_type=_content_type,
527
+ _headers=_headers,
528
+ _host_index=_host_index
529
+ )
530
+
531
+ _response_types_map: Dict[str, Optional[str]] = {
532
+ '200': "object",
533
+ '404': None,
534
+ '422': "HTTPValidationError",
535
+ }
536
+ response_data = self.api_client.call_api(
537
+ *_param,
538
+ _request_timeout=_request_timeout
539
+ )
540
+ return response_data.response
541
+
542
+
543
+ def _delete_llm_endpoint_v2_serialize(
544
+ self,
545
+ id,
546
+ replacement_llm_id,
547
+ _request_auth,
548
+ _content_type,
549
+ _headers,
550
+ _host_index,
551
+ ) -> RequestSerialized:
552
+
553
+ _host = None
554
+
555
+ _collection_formats: Dict[str, str] = {
556
+ }
557
+
558
+ _path_params: Dict[str, str] = {}
559
+ _query_params: List[Tuple[str, str]] = []
560
+ _header_params: Dict[str, Optional[str]] = _headers or {}
561
+ _form_params: List[Tuple[str, str]] = []
562
+ _files: Dict[
563
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
564
+ ] = {}
565
+ _body_params: Optional[bytes] = None
566
+
567
+ # process the path parameters
568
+ if id is not None:
569
+ _path_params['id'] = id
570
+ # process the query parameters
571
+ if replacement_llm_id is not None:
572
+
573
+ _query_params.append(('replacement_llm_id', replacement_llm_id))
574
+
575
+ # process the header parameters
576
+ # process the form parameters
577
+ # process the body parameter
578
+
579
+
580
+ # set the HTTP header `Accept`
581
+ if 'Accept' not in _header_params:
582
+ _header_params['Accept'] = self.api_client.select_header_accept(
583
+ [
584
+ 'application/json'
585
+ ]
586
+ )
587
+
588
+
589
+ # authentication setting
590
+ _auth_settings: List[str] = [
591
+ 'QAnswer-Api-Key',
592
+ 'Bearer token'
593
+ ]
594
+
595
+ return self.api_client.param_serialize(
596
+ method='DELETE',
597
+ resource_path='/backend/api/llm-endpoint/{id}',
598
+ path_params=_path_params,
599
+ query_params=_query_params,
600
+ header_params=_header_params,
601
+ body=_body_params,
602
+ post_params=_form_params,
603
+ files=_files,
604
+ auth_settings=_auth_settings,
605
+ collection_formats=_collection_formats,
606
+ _host=_host,
607
+ _request_auth=_request_auth
608
+ )
609
+
610
+
611
+
612
+
613
+ @validate_call
614
+ def export_llm_endpoints_v2(
615
+ self,
616
+ llm_endpoint_export_payload: LLMEndpointExportPayload,
617
+ _request_timeout: Union[
618
+ None,
619
+ Annotated[StrictFloat, Field(gt=0)],
620
+ Tuple[
621
+ Annotated[StrictFloat, Field(gt=0)],
622
+ Annotated[StrictFloat, Field(gt=0)]
623
+ ]
624
+ ] = None,
625
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
626
+ _content_type: Optional[StrictStr] = None,
627
+ _headers: Optional[Dict[StrictStr, Any]] = None,
628
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
629
+ ) -> object:
630
+ """Export Llm Endpoints V2
631
+
632
+
633
+ :param llm_endpoint_export_payload: (required)
634
+ :type llm_endpoint_export_payload: LLMEndpointExportPayload
635
+ :param _request_timeout: timeout setting for this request. If one
636
+ number provided, it will be total request
637
+ timeout. It can also be a pair (tuple) of
638
+ (connection, read) timeouts.
639
+ :type _request_timeout: int, tuple(int, int), optional
640
+ :param _request_auth: set to override the auth_settings for an a single
641
+ request; this effectively ignores the
642
+ authentication in the spec for a single request.
643
+ :type _request_auth: dict, optional
644
+ :param _content_type: force content-type for the request.
645
+ :type _content_type: str, Optional
646
+ :param _headers: set to override the headers for a single
647
+ request; this effectively ignores the headers
648
+ in the spec for a single request.
649
+ :type _headers: dict, optional
650
+ :param _host_index: set to override the host_index for a single
651
+ request; this effectively ignores the host_index
652
+ in the spec for a single request.
653
+ :type _host_index: int, optional
654
+ :return: Returns the result object.
655
+ """ # noqa: E501
656
+
657
+ _param = self._export_llm_endpoints_v2_serialize(
658
+ llm_endpoint_export_payload=llm_endpoint_export_payload,
659
+ _request_auth=_request_auth,
660
+ _content_type=_content_type,
661
+ _headers=_headers,
662
+ _host_index=_host_index
663
+ )
664
+
665
+ _response_types_map: Dict[str, Optional[str]] = {
666
+ '200': "object",
667
+ '404': None,
668
+ '422': "HTTPValidationError",
669
+ }
670
+ response_data = self.api_client.call_api(
671
+ *_param,
672
+ _request_timeout=_request_timeout
673
+ )
674
+ response_data.read()
675
+ return self.api_client.response_deserialize(
676
+ response_data=response_data,
677
+ response_types_map=_response_types_map,
678
+ ).data
679
+
680
+
681
+ @validate_call
682
+ def export_llm_endpoints_v2_with_http_info(
683
+ self,
684
+ llm_endpoint_export_payload: LLMEndpointExportPayload,
685
+ _request_timeout: Union[
686
+ None,
687
+ Annotated[StrictFloat, Field(gt=0)],
688
+ Tuple[
689
+ Annotated[StrictFloat, Field(gt=0)],
690
+ Annotated[StrictFloat, Field(gt=0)]
691
+ ]
692
+ ] = None,
693
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
694
+ _content_type: Optional[StrictStr] = None,
695
+ _headers: Optional[Dict[StrictStr, Any]] = None,
696
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
697
+ ) -> ApiResponse[object]:
698
+ """Export Llm Endpoints V2
699
+
700
+
701
+ :param llm_endpoint_export_payload: (required)
702
+ :type llm_endpoint_export_payload: LLMEndpointExportPayload
703
+ :param _request_timeout: timeout setting for this request. If one
704
+ number provided, it will be total request
705
+ timeout. It can also be a pair (tuple) of
706
+ (connection, read) timeouts.
707
+ :type _request_timeout: int, tuple(int, int), optional
708
+ :param _request_auth: set to override the auth_settings for an a single
709
+ request; this effectively ignores the
710
+ authentication in the spec for a single request.
711
+ :type _request_auth: dict, optional
712
+ :param _content_type: force content-type for the request.
713
+ :type _content_type: str, Optional
714
+ :param _headers: set to override the headers for a single
715
+ request; this effectively ignores the headers
716
+ in the spec for a single request.
717
+ :type _headers: dict, optional
718
+ :param _host_index: set to override the host_index for a single
719
+ request; this effectively ignores the host_index
720
+ in the spec for a single request.
721
+ :type _host_index: int, optional
722
+ :return: Returns the result object.
723
+ """ # noqa: E501
724
+
725
+ _param = self._export_llm_endpoints_v2_serialize(
726
+ llm_endpoint_export_payload=llm_endpoint_export_payload,
727
+ _request_auth=_request_auth,
728
+ _content_type=_content_type,
729
+ _headers=_headers,
730
+ _host_index=_host_index
731
+ )
732
+
733
+ _response_types_map: Dict[str, Optional[str]] = {
734
+ '200': "object",
735
+ '404': None,
736
+ '422': "HTTPValidationError",
737
+ }
738
+ response_data = self.api_client.call_api(
739
+ *_param,
740
+ _request_timeout=_request_timeout
741
+ )
742
+ response_data.read()
743
+ return self.api_client.response_deserialize(
744
+ response_data=response_data,
745
+ response_types_map=_response_types_map,
746
+ )
747
+
748
+
749
+ @validate_call
750
+ def export_llm_endpoints_v2_without_preload_content(
751
+ self,
752
+ llm_endpoint_export_payload: LLMEndpointExportPayload,
753
+ _request_timeout: Union[
754
+ None,
755
+ Annotated[StrictFloat, Field(gt=0)],
756
+ Tuple[
757
+ Annotated[StrictFloat, Field(gt=0)],
758
+ Annotated[StrictFloat, Field(gt=0)]
759
+ ]
760
+ ] = None,
761
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
762
+ _content_type: Optional[StrictStr] = None,
763
+ _headers: Optional[Dict[StrictStr, Any]] = None,
764
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
765
+ ) -> RESTResponseType:
766
+ """Export Llm Endpoints V2
767
+
768
+
769
+ :param llm_endpoint_export_payload: (required)
770
+ :type llm_endpoint_export_payload: LLMEndpointExportPayload
771
+ :param _request_timeout: timeout setting for this request. If one
772
+ number provided, it will be total request
773
+ timeout. It can also be a pair (tuple) of
774
+ (connection, read) timeouts.
775
+ :type _request_timeout: int, tuple(int, int), optional
776
+ :param _request_auth: set to override the auth_settings for an a single
777
+ request; this effectively ignores the
778
+ authentication in the spec for a single request.
779
+ :type _request_auth: dict, optional
780
+ :param _content_type: force content-type for the request.
781
+ :type _content_type: str, Optional
782
+ :param _headers: set to override the headers for a single
783
+ request; this effectively ignores the headers
784
+ in the spec for a single request.
785
+ :type _headers: dict, optional
786
+ :param _host_index: set to override the host_index for a single
787
+ request; this effectively ignores the host_index
788
+ in the spec for a single request.
789
+ :type _host_index: int, optional
790
+ :return: Returns the result object.
791
+ """ # noqa: E501
792
+
793
+ _param = self._export_llm_endpoints_v2_serialize(
794
+ llm_endpoint_export_payload=llm_endpoint_export_payload,
795
+ _request_auth=_request_auth,
796
+ _content_type=_content_type,
797
+ _headers=_headers,
798
+ _host_index=_host_index
799
+ )
800
+
801
+ _response_types_map: Dict[str, Optional[str]] = {
802
+ '200': "object",
803
+ '404': None,
804
+ '422': "HTTPValidationError",
805
+ }
806
+ response_data = self.api_client.call_api(
807
+ *_param,
808
+ _request_timeout=_request_timeout
809
+ )
810
+ return response_data.response
811
+
812
+
813
+ def _export_llm_endpoints_v2_serialize(
814
+ self,
815
+ llm_endpoint_export_payload,
816
+ _request_auth,
817
+ _content_type,
818
+ _headers,
819
+ _host_index,
820
+ ) -> RequestSerialized:
821
+
822
+ _host = None
823
+
824
+ _collection_formats: Dict[str, str] = {
825
+ }
826
+
827
+ _path_params: Dict[str, str] = {}
828
+ _query_params: List[Tuple[str, str]] = []
829
+ _header_params: Dict[str, Optional[str]] = _headers or {}
830
+ _form_params: List[Tuple[str, str]] = []
831
+ _files: Dict[
832
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
833
+ ] = {}
834
+ _body_params: Optional[bytes] = None
835
+
836
+ # process the path parameters
837
+ # process the query parameters
838
+ # process the header parameters
839
+ # process the form parameters
840
+ # process the body parameter
841
+ if llm_endpoint_export_payload is not None:
842
+ _body_params = llm_endpoint_export_payload
843
+
844
+
845
+ # set the HTTP header `Accept`
846
+ if 'Accept' not in _header_params:
847
+ _header_params['Accept'] = self.api_client.select_header_accept(
848
+ [
849
+ 'application/json'
850
+ ]
851
+ )
852
+
853
+ # set the HTTP header `Content-Type`
854
+ if _content_type:
855
+ _header_params['Content-Type'] = _content_type
856
+ else:
857
+ _default_content_type = (
858
+ self.api_client.select_header_content_type(
859
+ [
860
+ 'application/json'
861
+ ]
862
+ )
863
+ )
864
+ if _default_content_type is not None:
865
+ _header_params['Content-Type'] = _default_content_type
866
+
867
+ # authentication setting
868
+ _auth_settings: List[str] = [
869
+ 'QAnswer-Api-Key',
870
+ 'Bearer token'
871
+ ]
872
+
873
+ return self.api_client.param_serialize(
874
+ method='POST',
875
+ resource_path='/backend/api/llm-endpoint/export',
876
+ path_params=_path_params,
877
+ query_params=_query_params,
878
+ header_params=_header_params,
879
+ body=_body_params,
880
+ post_params=_form_params,
881
+ files=_files,
882
+ auth_settings=_auth_settings,
883
+ collection_formats=_collection_formats,
884
+ _host=_host,
885
+ _request_auth=_request_auth
886
+ )
887
+
888
+
889
+
890
+
891
+ @validate_call
892
+ def fetch_default_prompts_of_llm_endpoint(
893
+ self,
894
+ _request_timeout: Union[
895
+ None,
896
+ Annotated[StrictFloat, Field(gt=0)],
897
+ Tuple[
898
+ Annotated[StrictFloat, Field(gt=0)],
899
+ Annotated[StrictFloat, Field(gt=0)]
900
+ ]
901
+ ] = None,
902
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
903
+ _content_type: Optional[StrictStr] = None,
904
+ _headers: Optional[Dict[StrictStr, Any]] = None,
905
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
906
+ ) -> LLMEndpointDefaultPrompts:
907
+ """Fetch Default Prompts Of Llm Endpoint
908
+
909
+
910
+ :param _request_timeout: timeout setting for this request. If one
911
+ number provided, it will be total request
912
+ timeout. It can also be a pair (tuple) of
913
+ (connection, read) timeouts.
914
+ :type _request_timeout: int, tuple(int, int), optional
915
+ :param _request_auth: set to override the auth_settings for an a single
916
+ request; this effectively ignores the
917
+ authentication in the spec for a single request.
918
+ :type _request_auth: dict, optional
919
+ :param _content_type: force content-type for the request.
920
+ :type _content_type: str, Optional
921
+ :param _headers: set to override the headers for a single
922
+ request; this effectively ignores the headers
923
+ in the spec for a single request.
924
+ :type _headers: dict, optional
925
+ :param _host_index: set to override the host_index for a single
926
+ request; this effectively ignores the host_index
927
+ in the spec for a single request.
928
+ :type _host_index: int, optional
929
+ :return: Returns the result object.
930
+ """ # noqa: E501
931
+
932
+ _param = self._fetch_default_prompts_of_llm_endpoint_serialize(
933
+ _request_auth=_request_auth,
934
+ _content_type=_content_type,
935
+ _headers=_headers,
936
+ _host_index=_host_index
937
+ )
938
+
939
+ _response_types_map: Dict[str, Optional[str]] = {
940
+ '200': "LLMEndpointDefaultPrompts",
941
+ '404': None,
942
+ }
943
+ response_data = self.api_client.call_api(
944
+ *_param,
945
+ _request_timeout=_request_timeout
946
+ )
947
+ response_data.read()
948
+ return self.api_client.response_deserialize(
949
+ response_data=response_data,
950
+ response_types_map=_response_types_map,
951
+ ).data
952
+
953
+
954
+ @validate_call
955
+ def fetch_default_prompts_of_llm_endpoint_with_http_info(
956
+ self,
957
+ _request_timeout: Union[
958
+ None,
959
+ Annotated[StrictFloat, Field(gt=0)],
960
+ Tuple[
961
+ Annotated[StrictFloat, Field(gt=0)],
962
+ Annotated[StrictFloat, Field(gt=0)]
963
+ ]
964
+ ] = None,
965
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
966
+ _content_type: Optional[StrictStr] = None,
967
+ _headers: Optional[Dict[StrictStr, Any]] = None,
968
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
969
+ ) -> ApiResponse[LLMEndpointDefaultPrompts]:
970
+ """Fetch Default Prompts Of Llm Endpoint
971
+
972
+
973
+ :param _request_timeout: timeout setting for this request. If one
974
+ number provided, it will be total request
975
+ timeout. It can also be a pair (tuple) of
976
+ (connection, read) timeouts.
977
+ :type _request_timeout: int, tuple(int, int), optional
978
+ :param _request_auth: set to override the auth_settings for an a single
979
+ request; this effectively ignores the
980
+ authentication in the spec for a single request.
981
+ :type _request_auth: dict, optional
982
+ :param _content_type: force content-type for the request.
983
+ :type _content_type: str, Optional
984
+ :param _headers: set to override the headers for a single
985
+ request; this effectively ignores the headers
986
+ in the spec for a single request.
987
+ :type _headers: dict, optional
988
+ :param _host_index: set to override the host_index for a single
989
+ request; this effectively ignores the host_index
990
+ in the spec for a single request.
991
+ :type _host_index: int, optional
992
+ :return: Returns the result object.
993
+ """ # noqa: E501
994
+
995
+ _param = self._fetch_default_prompts_of_llm_endpoint_serialize(
996
+ _request_auth=_request_auth,
997
+ _content_type=_content_type,
998
+ _headers=_headers,
999
+ _host_index=_host_index
1000
+ )
1001
+
1002
+ _response_types_map: Dict[str, Optional[str]] = {
1003
+ '200': "LLMEndpointDefaultPrompts",
1004
+ '404': None,
1005
+ }
1006
+ response_data = self.api_client.call_api(
1007
+ *_param,
1008
+ _request_timeout=_request_timeout
1009
+ )
1010
+ response_data.read()
1011
+ return self.api_client.response_deserialize(
1012
+ response_data=response_data,
1013
+ response_types_map=_response_types_map,
1014
+ )
1015
+
1016
+
1017
+ @validate_call
1018
+ def fetch_default_prompts_of_llm_endpoint_without_preload_content(
1019
+ self,
1020
+ _request_timeout: Union[
1021
+ None,
1022
+ Annotated[StrictFloat, Field(gt=0)],
1023
+ Tuple[
1024
+ Annotated[StrictFloat, Field(gt=0)],
1025
+ Annotated[StrictFloat, Field(gt=0)]
1026
+ ]
1027
+ ] = None,
1028
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1029
+ _content_type: Optional[StrictStr] = None,
1030
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1031
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1032
+ ) -> RESTResponseType:
1033
+ """Fetch Default Prompts Of Llm Endpoint
1034
+
1035
+
1036
+ :param _request_timeout: timeout setting for this request. If one
1037
+ number provided, it will be total request
1038
+ timeout. It can also be a pair (tuple) of
1039
+ (connection, read) timeouts.
1040
+ :type _request_timeout: int, tuple(int, int), optional
1041
+ :param _request_auth: set to override the auth_settings for an a single
1042
+ request; this effectively ignores the
1043
+ authentication in the spec for a single request.
1044
+ :type _request_auth: dict, optional
1045
+ :param _content_type: force content-type for the request.
1046
+ :type _content_type: str, Optional
1047
+ :param _headers: set to override the headers for a single
1048
+ request; this effectively ignores the headers
1049
+ in the spec for a single request.
1050
+ :type _headers: dict, optional
1051
+ :param _host_index: set to override the host_index for a single
1052
+ request; this effectively ignores the host_index
1053
+ in the spec for a single request.
1054
+ :type _host_index: int, optional
1055
+ :return: Returns the result object.
1056
+ """ # noqa: E501
1057
+
1058
+ _param = self._fetch_default_prompts_of_llm_endpoint_serialize(
1059
+ _request_auth=_request_auth,
1060
+ _content_type=_content_type,
1061
+ _headers=_headers,
1062
+ _host_index=_host_index
1063
+ )
1064
+
1065
+ _response_types_map: Dict[str, Optional[str]] = {
1066
+ '200': "LLMEndpointDefaultPrompts",
1067
+ '404': None,
1068
+ }
1069
+ response_data = self.api_client.call_api(
1070
+ *_param,
1071
+ _request_timeout=_request_timeout
1072
+ )
1073
+ return response_data.response
1074
+
1075
+
1076
+ def _fetch_default_prompts_of_llm_endpoint_serialize(
1077
+ self,
1078
+ _request_auth,
1079
+ _content_type,
1080
+ _headers,
1081
+ _host_index,
1082
+ ) -> RequestSerialized:
1083
+
1084
+ _host = None
1085
+
1086
+ _collection_formats: Dict[str, str] = {
1087
+ }
1088
+
1089
+ _path_params: Dict[str, str] = {}
1090
+ _query_params: List[Tuple[str, str]] = []
1091
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1092
+ _form_params: List[Tuple[str, str]] = []
1093
+ _files: Dict[
1094
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1095
+ ] = {}
1096
+ _body_params: Optional[bytes] = None
1097
+
1098
+ # process the path parameters
1099
+ # process the query parameters
1100
+ # process the header parameters
1101
+ # process the form parameters
1102
+ # process the body parameter
1103
+
1104
+
1105
+ # set the HTTP header `Accept`
1106
+ if 'Accept' not in _header_params:
1107
+ _header_params['Accept'] = self.api_client.select_header_accept(
1108
+ [
1109
+ 'application/json'
1110
+ ]
1111
+ )
1112
+
1113
+
1114
+ # authentication setting
1115
+ _auth_settings: List[str] = [
1116
+ 'QAnswer-Api-Key',
1117
+ 'Bearer token'
1118
+ ]
1119
+
1120
+ return self.api_client.param_serialize(
1121
+ method='GET',
1122
+ resource_path='/backend/api/llm-endpoint/default-prompts',
1123
+ path_params=_path_params,
1124
+ query_params=_query_params,
1125
+ header_params=_header_params,
1126
+ body=_body_params,
1127
+ post_params=_form_params,
1128
+ files=_files,
1129
+ auth_settings=_auth_settings,
1130
+ collection_formats=_collection_formats,
1131
+ _host=_host,
1132
+ _request_auth=_request_auth
1133
+ )
1134
+
1135
+
1136
+
1137
+
1138
+ @validate_call
1139
+ def get_usage_origin(
1140
+ self,
1141
+ _request_timeout: Union[
1142
+ None,
1143
+ Annotated[StrictFloat, Field(gt=0)],
1144
+ Tuple[
1145
+ Annotated[StrictFloat, Field(gt=0)],
1146
+ Annotated[StrictFloat, Field(gt=0)]
1147
+ ]
1148
+ ] = None,
1149
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1150
+ _content_type: Optional[StrictStr] = None,
1151
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1152
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1153
+ ) -> LLMUsageOrigin:
1154
+ """Get Usage Origin
1155
+
1156
+
1157
+ :param _request_timeout: timeout setting for this request. If one
1158
+ number provided, it will be total request
1159
+ timeout. It can also be a pair (tuple) of
1160
+ (connection, read) timeouts.
1161
+ :type _request_timeout: int, tuple(int, int), optional
1162
+ :param _request_auth: set to override the auth_settings for an a single
1163
+ request; this effectively ignores the
1164
+ authentication in the spec for a single request.
1165
+ :type _request_auth: dict, optional
1166
+ :param _content_type: force content-type for the request.
1167
+ :type _content_type: str, Optional
1168
+ :param _headers: set to override the headers for a single
1169
+ request; this effectively ignores the headers
1170
+ in the spec for a single request.
1171
+ :type _headers: dict, optional
1172
+ :param _host_index: set to override the host_index for a single
1173
+ request; this effectively ignores the host_index
1174
+ in the spec for a single request.
1175
+ :type _host_index: int, optional
1176
+ :return: Returns the result object.
1177
+ """ # noqa: E501
1178
+
1179
+ _param = self._get_usage_origin_serialize(
1180
+ _request_auth=_request_auth,
1181
+ _content_type=_content_type,
1182
+ _headers=_headers,
1183
+ _host_index=_host_index
1184
+ )
1185
+
1186
+ _response_types_map: Dict[str, Optional[str]] = {
1187
+ '200': "LLMUsageOrigin",
1188
+ '404': None,
1189
+ }
1190
+ response_data = self.api_client.call_api(
1191
+ *_param,
1192
+ _request_timeout=_request_timeout
1193
+ )
1194
+ response_data.read()
1195
+ return self.api_client.response_deserialize(
1196
+ response_data=response_data,
1197
+ response_types_map=_response_types_map,
1198
+ ).data
1199
+
1200
+
1201
+ @validate_call
1202
+ def get_usage_origin_with_http_info(
1203
+ self,
1204
+ _request_timeout: Union[
1205
+ None,
1206
+ Annotated[StrictFloat, Field(gt=0)],
1207
+ Tuple[
1208
+ Annotated[StrictFloat, Field(gt=0)],
1209
+ Annotated[StrictFloat, Field(gt=0)]
1210
+ ]
1211
+ ] = None,
1212
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1213
+ _content_type: Optional[StrictStr] = None,
1214
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1215
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1216
+ ) -> ApiResponse[LLMUsageOrigin]:
1217
+ """Get Usage Origin
1218
+
1219
+
1220
+ :param _request_timeout: timeout setting for this request. If one
1221
+ number provided, it will be total request
1222
+ timeout. It can also be a pair (tuple) of
1223
+ (connection, read) timeouts.
1224
+ :type _request_timeout: int, tuple(int, int), optional
1225
+ :param _request_auth: set to override the auth_settings for an a single
1226
+ request; this effectively ignores the
1227
+ authentication in the spec for a single request.
1228
+ :type _request_auth: dict, optional
1229
+ :param _content_type: force content-type for the request.
1230
+ :type _content_type: str, Optional
1231
+ :param _headers: set to override the headers for a single
1232
+ request; this effectively ignores the headers
1233
+ in the spec for a single request.
1234
+ :type _headers: dict, optional
1235
+ :param _host_index: set to override the host_index for a single
1236
+ request; this effectively ignores the host_index
1237
+ in the spec for a single request.
1238
+ :type _host_index: int, optional
1239
+ :return: Returns the result object.
1240
+ """ # noqa: E501
1241
+
1242
+ _param = self._get_usage_origin_serialize(
1243
+ _request_auth=_request_auth,
1244
+ _content_type=_content_type,
1245
+ _headers=_headers,
1246
+ _host_index=_host_index
1247
+ )
1248
+
1249
+ _response_types_map: Dict[str, Optional[str]] = {
1250
+ '200': "LLMUsageOrigin",
1251
+ '404': None,
1252
+ }
1253
+ response_data = self.api_client.call_api(
1254
+ *_param,
1255
+ _request_timeout=_request_timeout
1256
+ )
1257
+ response_data.read()
1258
+ return self.api_client.response_deserialize(
1259
+ response_data=response_data,
1260
+ response_types_map=_response_types_map,
1261
+ )
1262
+
1263
+
1264
+ @validate_call
1265
+ def get_usage_origin_without_preload_content(
1266
+ self,
1267
+ _request_timeout: Union[
1268
+ None,
1269
+ Annotated[StrictFloat, Field(gt=0)],
1270
+ Tuple[
1271
+ Annotated[StrictFloat, Field(gt=0)],
1272
+ Annotated[StrictFloat, Field(gt=0)]
1273
+ ]
1274
+ ] = None,
1275
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1276
+ _content_type: Optional[StrictStr] = None,
1277
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1278
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1279
+ ) -> RESTResponseType:
1280
+ """Get Usage Origin
1281
+
1282
+
1283
+ :param _request_timeout: timeout setting for this request. If one
1284
+ number provided, it will be total request
1285
+ timeout. It can also be a pair (tuple) of
1286
+ (connection, read) timeouts.
1287
+ :type _request_timeout: int, tuple(int, int), optional
1288
+ :param _request_auth: set to override the auth_settings for an a single
1289
+ request; this effectively ignores the
1290
+ authentication in the spec for a single request.
1291
+ :type _request_auth: dict, optional
1292
+ :param _content_type: force content-type for the request.
1293
+ :type _content_type: str, Optional
1294
+ :param _headers: set to override the headers for a single
1295
+ request; this effectively ignores the headers
1296
+ in the spec for a single request.
1297
+ :type _headers: dict, optional
1298
+ :param _host_index: set to override the host_index for a single
1299
+ request; this effectively ignores the host_index
1300
+ in the spec for a single request.
1301
+ :type _host_index: int, optional
1302
+ :return: Returns the result object.
1303
+ """ # noqa: E501
1304
+
1305
+ _param = self._get_usage_origin_serialize(
1306
+ _request_auth=_request_auth,
1307
+ _content_type=_content_type,
1308
+ _headers=_headers,
1309
+ _host_index=_host_index
1310
+ )
1311
+
1312
+ _response_types_map: Dict[str, Optional[str]] = {
1313
+ '200': "LLMUsageOrigin",
1314
+ '404': None,
1315
+ }
1316
+ response_data = self.api_client.call_api(
1317
+ *_param,
1318
+ _request_timeout=_request_timeout
1319
+ )
1320
+ return response_data.response
1321
+
1322
+
1323
+ def _get_usage_origin_serialize(
1324
+ self,
1325
+ _request_auth,
1326
+ _content_type,
1327
+ _headers,
1328
+ _host_index,
1329
+ ) -> RequestSerialized:
1330
+
1331
+ _host = None
1332
+
1333
+ _collection_formats: Dict[str, str] = {
1334
+ }
1335
+
1336
+ _path_params: Dict[str, str] = {}
1337
+ _query_params: List[Tuple[str, str]] = []
1338
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1339
+ _form_params: List[Tuple[str, str]] = []
1340
+ _files: Dict[
1341
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1342
+ ] = {}
1343
+ _body_params: Optional[bytes] = None
1344
+
1345
+ # process the path parameters
1346
+ # process the query parameters
1347
+ # process the header parameters
1348
+ # process the form parameters
1349
+ # process the body parameter
1350
+
1351
+
1352
+ # set the HTTP header `Accept`
1353
+ if 'Accept' not in _header_params:
1354
+ _header_params['Accept'] = self.api_client.select_header_accept(
1355
+ [
1356
+ 'application/json'
1357
+ ]
1358
+ )
1359
+
1360
+
1361
+ # authentication setting
1362
+ _auth_settings: List[str] = [
1363
+ 'QAnswer-Api-Key',
1364
+ 'Bearer token'
1365
+ ]
1366
+
1367
+ return self.api_client.param_serialize(
1368
+ method='GET',
1369
+ resource_path='/backend/api/llm-endpoint/usage-origin',
1370
+ path_params=_path_params,
1371
+ query_params=_query_params,
1372
+ header_params=_header_params,
1373
+ body=_body_params,
1374
+ post_params=_form_params,
1375
+ files=_files,
1376
+ auth_settings=_auth_settings,
1377
+ collection_formats=_collection_formats,
1378
+ _host=_host,
1379
+ _request_auth=_request_auth
1380
+ )
1381
+
1382
+
1383
+
1384
+
1385
+ @validate_call
1386
+ def import_llm_endpoints_v2(
1387
+ self,
1388
+ file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
1389
+ _request_timeout: Union[
1390
+ None,
1391
+ Annotated[StrictFloat, Field(gt=0)],
1392
+ Tuple[
1393
+ Annotated[StrictFloat, Field(gt=0)],
1394
+ Annotated[StrictFloat, Field(gt=0)]
1395
+ ]
1396
+ ] = None,
1397
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1398
+ _content_type: Optional[StrictStr] = None,
1399
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1400
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1401
+ ) -> LLMEndpointImportResponse:
1402
+ """Import Llm Endpoints V2
1403
+
1404
+
1405
+ :param file: (required)
1406
+ :type file: bytearray
1407
+ :param _request_timeout: timeout setting for this request. If one
1408
+ number provided, it will be total request
1409
+ timeout. It can also be a pair (tuple) of
1410
+ (connection, read) timeouts.
1411
+ :type _request_timeout: int, tuple(int, int), optional
1412
+ :param _request_auth: set to override the auth_settings for an a single
1413
+ request; this effectively ignores the
1414
+ authentication in the spec for a single request.
1415
+ :type _request_auth: dict, optional
1416
+ :param _content_type: force content-type for the request.
1417
+ :type _content_type: str, Optional
1418
+ :param _headers: set to override the headers for a single
1419
+ request; this effectively ignores the headers
1420
+ in the spec for a single request.
1421
+ :type _headers: dict, optional
1422
+ :param _host_index: set to override the host_index for a single
1423
+ request; this effectively ignores the host_index
1424
+ in the spec for a single request.
1425
+ :type _host_index: int, optional
1426
+ :return: Returns the result object.
1427
+ """ # noqa: E501
1428
+
1429
+ _param = self._import_llm_endpoints_v2_serialize(
1430
+ file=file,
1431
+ _request_auth=_request_auth,
1432
+ _content_type=_content_type,
1433
+ _headers=_headers,
1434
+ _host_index=_host_index
1435
+ )
1436
+
1437
+ _response_types_map: Dict[str, Optional[str]] = {
1438
+ '200': "LLMEndpointImportResponse",
1439
+ '404': None,
1440
+ '422': "HTTPValidationError",
1441
+ }
1442
+ response_data = self.api_client.call_api(
1443
+ *_param,
1444
+ _request_timeout=_request_timeout
1445
+ )
1446
+ response_data.read()
1447
+ return self.api_client.response_deserialize(
1448
+ response_data=response_data,
1449
+ response_types_map=_response_types_map,
1450
+ ).data
1451
+
1452
+
1453
+ @validate_call
1454
+ def import_llm_endpoints_v2_with_http_info(
1455
+ self,
1456
+ file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
1457
+ _request_timeout: Union[
1458
+ None,
1459
+ Annotated[StrictFloat, Field(gt=0)],
1460
+ Tuple[
1461
+ Annotated[StrictFloat, Field(gt=0)],
1462
+ Annotated[StrictFloat, Field(gt=0)]
1463
+ ]
1464
+ ] = None,
1465
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1466
+ _content_type: Optional[StrictStr] = None,
1467
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1468
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1469
+ ) -> ApiResponse[LLMEndpointImportResponse]:
1470
+ """Import Llm Endpoints V2
1471
+
1472
+
1473
+ :param file: (required)
1474
+ :type file: bytearray
1475
+ :param _request_timeout: timeout setting for this request. If one
1476
+ number provided, it will be total request
1477
+ timeout. It can also be a pair (tuple) of
1478
+ (connection, read) timeouts.
1479
+ :type _request_timeout: int, tuple(int, int), optional
1480
+ :param _request_auth: set to override the auth_settings for an a single
1481
+ request; this effectively ignores the
1482
+ authentication in the spec for a single request.
1483
+ :type _request_auth: dict, optional
1484
+ :param _content_type: force content-type for the request.
1485
+ :type _content_type: str, Optional
1486
+ :param _headers: set to override the headers for a single
1487
+ request; this effectively ignores the headers
1488
+ in the spec for a single request.
1489
+ :type _headers: dict, optional
1490
+ :param _host_index: set to override the host_index for a single
1491
+ request; this effectively ignores the host_index
1492
+ in the spec for a single request.
1493
+ :type _host_index: int, optional
1494
+ :return: Returns the result object.
1495
+ """ # noqa: E501
1496
+
1497
+ _param = self._import_llm_endpoints_v2_serialize(
1498
+ file=file,
1499
+ _request_auth=_request_auth,
1500
+ _content_type=_content_type,
1501
+ _headers=_headers,
1502
+ _host_index=_host_index
1503
+ )
1504
+
1505
+ _response_types_map: Dict[str, Optional[str]] = {
1506
+ '200': "LLMEndpointImportResponse",
1507
+ '404': None,
1508
+ '422': "HTTPValidationError",
1509
+ }
1510
+ response_data = self.api_client.call_api(
1511
+ *_param,
1512
+ _request_timeout=_request_timeout
1513
+ )
1514
+ response_data.read()
1515
+ return self.api_client.response_deserialize(
1516
+ response_data=response_data,
1517
+ response_types_map=_response_types_map,
1518
+ )
1519
+
1520
+
1521
+ @validate_call
1522
+ def import_llm_endpoints_v2_without_preload_content(
1523
+ self,
1524
+ file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
1525
+ _request_timeout: Union[
1526
+ None,
1527
+ Annotated[StrictFloat, Field(gt=0)],
1528
+ Tuple[
1529
+ Annotated[StrictFloat, Field(gt=0)],
1530
+ Annotated[StrictFloat, Field(gt=0)]
1531
+ ]
1532
+ ] = None,
1533
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1534
+ _content_type: Optional[StrictStr] = None,
1535
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1536
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1537
+ ) -> RESTResponseType:
1538
+ """Import Llm Endpoints V2
1539
+
1540
+
1541
+ :param file: (required)
1542
+ :type file: bytearray
1543
+ :param _request_timeout: timeout setting for this request. If one
1544
+ number provided, it will be total request
1545
+ timeout. It can also be a pair (tuple) of
1546
+ (connection, read) timeouts.
1547
+ :type _request_timeout: int, tuple(int, int), optional
1548
+ :param _request_auth: set to override the auth_settings for an a single
1549
+ request; this effectively ignores the
1550
+ authentication in the spec for a single request.
1551
+ :type _request_auth: dict, optional
1552
+ :param _content_type: force content-type for the request.
1553
+ :type _content_type: str, Optional
1554
+ :param _headers: set to override the headers for a single
1555
+ request; this effectively ignores the headers
1556
+ in the spec for a single request.
1557
+ :type _headers: dict, optional
1558
+ :param _host_index: set to override the host_index for a single
1559
+ request; this effectively ignores the host_index
1560
+ in the spec for a single request.
1561
+ :type _host_index: int, optional
1562
+ :return: Returns the result object.
1563
+ """ # noqa: E501
1564
+
1565
+ _param = self._import_llm_endpoints_v2_serialize(
1566
+ file=file,
1567
+ _request_auth=_request_auth,
1568
+ _content_type=_content_type,
1569
+ _headers=_headers,
1570
+ _host_index=_host_index
1571
+ )
1572
+
1573
+ _response_types_map: Dict[str, Optional[str]] = {
1574
+ '200': "LLMEndpointImportResponse",
1575
+ '404': None,
1576
+ '422': "HTTPValidationError",
1577
+ }
1578
+ response_data = self.api_client.call_api(
1579
+ *_param,
1580
+ _request_timeout=_request_timeout
1581
+ )
1582
+ return response_data.response
1583
+
1584
+
1585
+ def _import_llm_endpoints_v2_serialize(
1586
+ self,
1587
+ file,
1588
+ _request_auth,
1589
+ _content_type,
1590
+ _headers,
1591
+ _host_index,
1592
+ ) -> RequestSerialized:
1593
+
1594
+ _host = None
1595
+
1596
+ _collection_formats: Dict[str, str] = {
1597
+ }
1598
+
1599
+ _path_params: Dict[str, str] = {}
1600
+ _query_params: List[Tuple[str, str]] = []
1601
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1602
+ _form_params: List[Tuple[str, str]] = []
1603
+ _files: Dict[
1604
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1605
+ ] = {}
1606
+ _body_params: Optional[bytes] = None
1607
+
1608
+ # process the path parameters
1609
+ # process the query parameters
1610
+ # process the header parameters
1611
+ # process the form parameters
1612
+ if file is not None:
1613
+ _files['file'] = file
1614
+ # process the body parameter
1615
+
1616
+
1617
+ # set the HTTP header `Accept`
1618
+ if 'Accept' not in _header_params:
1619
+ _header_params['Accept'] = self.api_client.select_header_accept(
1620
+ [
1621
+ 'application/json'
1622
+ ]
1623
+ )
1624
+
1625
+ # set the HTTP header `Content-Type`
1626
+ if _content_type:
1627
+ _header_params['Content-Type'] = _content_type
1628
+ else:
1629
+ _default_content_type = (
1630
+ self.api_client.select_header_content_type(
1631
+ [
1632
+ 'multipart/form-data'
1633
+ ]
1634
+ )
1635
+ )
1636
+ if _default_content_type is not None:
1637
+ _header_params['Content-Type'] = _default_content_type
1638
+
1639
+ # authentication setting
1640
+ _auth_settings: List[str] = [
1641
+ 'QAnswer-Api-Key',
1642
+ 'Bearer token'
1643
+ ]
1644
+
1645
+ return self.api_client.param_serialize(
1646
+ method='POST',
1647
+ resource_path='/backend/api/llm-endpoint/import',
1648
+ path_params=_path_params,
1649
+ query_params=_query_params,
1650
+ header_params=_header_params,
1651
+ body=_body_params,
1652
+ post_params=_form_params,
1653
+ files=_files,
1654
+ auth_settings=_auth_settings,
1655
+ collection_formats=_collection_formats,
1656
+ _host=_host,
1657
+ _request_auth=_request_auth
1658
+ )
1659
+
1660
+
1661
+
1662
+
1663
+ @validate_call
1664
+ def llm_chat_completions(
1665
+ self,
1666
+ llm_id: StrictInt,
1667
+ request_body: Dict[str, Any],
1668
+ _request_timeout: Union[
1669
+ None,
1670
+ Annotated[StrictFloat, Field(gt=0)],
1671
+ Tuple[
1672
+ Annotated[StrictFloat, Field(gt=0)],
1673
+ Annotated[StrictFloat, Field(gt=0)]
1674
+ ]
1675
+ ] = None,
1676
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1677
+ _content_type: Optional[StrictStr] = None,
1678
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1679
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1680
+ ) -> object:
1681
+ """Llm Chat Completions
1682
+
1683
+
1684
+ :param llm_id: (required)
1685
+ :type llm_id: int
1686
+ :param request_body: (required)
1687
+ :type request_body: Dict[str, object]
1688
+ :param _request_timeout: timeout setting for this request. If one
1689
+ number provided, it will be total request
1690
+ timeout. It can also be a pair (tuple) of
1691
+ (connection, read) timeouts.
1692
+ :type _request_timeout: int, tuple(int, int), optional
1693
+ :param _request_auth: set to override the auth_settings for an a single
1694
+ request; this effectively ignores the
1695
+ authentication in the spec for a single request.
1696
+ :type _request_auth: dict, optional
1697
+ :param _content_type: force content-type for the request.
1698
+ :type _content_type: str, Optional
1699
+ :param _headers: set to override the headers for a single
1700
+ request; this effectively ignores the headers
1701
+ in the spec for a single request.
1702
+ :type _headers: dict, optional
1703
+ :param _host_index: set to override the host_index for a single
1704
+ request; this effectively ignores the host_index
1705
+ in the spec for a single request.
1706
+ :type _host_index: int, optional
1707
+ :return: Returns the result object.
1708
+ """ # noqa: E501
1709
+
1710
+ _param = self._llm_chat_completions_serialize(
1711
+ llm_id=llm_id,
1712
+ request_body=request_body,
1713
+ _request_auth=_request_auth,
1714
+ _content_type=_content_type,
1715
+ _headers=_headers,
1716
+ _host_index=_host_index
1717
+ )
1718
+
1719
+ _response_types_map: Dict[str, Optional[str]] = {
1720
+ '200': "object",
1721
+ '404': None,
1722
+ '422': "HTTPValidationError",
1723
+ }
1724
+ response_data = self.api_client.call_api(
1725
+ *_param,
1726
+ _request_timeout=_request_timeout
1727
+ )
1728
+ response_data.read()
1729
+ return self.api_client.response_deserialize(
1730
+ response_data=response_data,
1731
+ response_types_map=_response_types_map,
1732
+ ).data
1733
+
1734
+
1735
+ @validate_call
1736
+ def llm_chat_completions_with_http_info(
1737
+ self,
1738
+ llm_id: StrictInt,
1739
+ request_body: Dict[str, Any],
1740
+ _request_timeout: Union[
1741
+ None,
1742
+ Annotated[StrictFloat, Field(gt=0)],
1743
+ Tuple[
1744
+ Annotated[StrictFloat, Field(gt=0)],
1745
+ Annotated[StrictFloat, Field(gt=0)]
1746
+ ]
1747
+ ] = None,
1748
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1749
+ _content_type: Optional[StrictStr] = None,
1750
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1751
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1752
+ ) -> ApiResponse[object]:
1753
+ """Llm Chat Completions
1754
+
1755
+
1756
+ :param llm_id: (required)
1757
+ :type llm_id: int
1758
+ :param request_body: (required)
1759
+ :type request_body: Dict[str, object]
1760
+ :param _request_timeout: timeout setting for this request. If one
1761
+ number provided, it will be total request
1762
+ timeout. It can also be a pair (tuple) of
1763
+ (connection, read) timeouts.
1764
+ :type _request_timeout: int, tuple(int, int), optional
1765
+ :param _request_auth: set to override the auth_settings for an a single
1766
+ request; this effectively ignores the
1767
+ authentication in the spec for a single request.
1768
+ :type _request_auth: dict, optional
1769
+ :param _content_type: force content-type for the request.
1770
+ :type _content_type: str, Optional
1771
+ :param _headers: set to override the headers for a single
1772
+ request; this effectively ignores the headers
1773
+ in the spec for a single request.
1774
+ :type _headers: dict, optional
1775
+ :param _host_index: set to override the host_index for a single
1776
+ request; this effectively ignores the host_index
1777
+ in the spec for a single request.
1778
+ :type _host_index: int, optional
1779
+ :return: Returns the result object.
1780
+ """ # noqa: E501
1781
+
1782
+ _param = self._llm_chat_completions_serialize(
1783
+ llm_id=llm_id,
1784
+ request_body=request_body,
1785
+ _request_auth=_request_auth,
1786
+ _content_type=_content_type,
1787
+ _headers=_headers,
1788
+ _host_index=_host_index
1789
+ )
1790
+
1791
+ _response_types_map: Dict[str, Optional[str]] = {
1792
+ '200': "object",
1793
+ '404': None,
1794
+ '422': "HTTPValidationError",
1795
+ }
1796
+ response_data = self.api_client.call_api(
1797
+ *_param,
1798
+ _request_timeout=_request_timeout
1799
+ )
1800
+ response_data.read()
1801
+ return self.api_client.response_deserialize(
1802
+ response_data=response_data,
1803
+ response_types_map=_response_types_map,
1804
+ )
1805
+
1806
+
1807
+ @validate_call
1808
+ def llm_chat_completions_without_preload_content(
1809
+ self,
1810
+ llm_id: StrictInt,
1811
+ request_body: Dict[str, Any],
1812
+ _request_timeout: Union[
1813
+ None,
1814
+ Annotated[StrictFloat, Field(gt=0)],
1815
+ Tuple[
1816
+ Annotated[StrictFloat, Field(gt=0)],
1817
+ Annotated[StrictFloat, Field(gt=0)]
1818
+ ]
1819
+ ] = None,
1820
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1821
+ _content_type: Optional[StrictStr] = None,
1822
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1823
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1824
+ ) -> RESTResponseType:
1825
+ """Llm Chat Completions
1826
+
1827
+
1828
+ :param llm_id: (required)
1829
+ :type llm_id: int
1830
+ :param request_body: (required)
1831
+ :type request_body: Dict[str, object]
1832
+ :param _request_timeout: timeout setting for this request. If one
1833
+ number provided, it will be total request
1834
+ timeout. It can also be a pair (tuple) of
1835
+ (connection, read) timeouts.
1836
+ :type _request_timeout: int, tuple(int, int), optional
1837
+ :param _request_auth: set to override the auth_settings for an a single
1838
+ request; this effectively ignores the
1839
+ authentication in the spec for a single request.
1840
+ :type _request_auth: dict, optional
1841
+ :param _content_type: force content-type for the request.
1842
+ :type _content_type: str, Optional
1843
+ :param _headers: set to override the headers for a single
1844
+ request; this effectively ignores the headers
1845
+ in the spec for a single request.
1846
+ :type _headers: dict, optional
1847
+ :param _host_index: set to override the host_index for a single
1848
+ request; this effectively ignores the host_index
1849
+ in the spec for a single request.
1850
+ :type _host_index: int, optional
1851
+ :return: Returns the result object.
1852
+ """ # noqa: E501
1853
+
1854
+ _param = self._llm_chat_completions_serialize(
1855
+ llm_id=llm_id,
1856
+ request_body=request_body,
1857
+ _request_auth=_request_auth,
1858
+ _content_type=_content_type,
1859
+ _headers=_headers,
1860
+ _host_index=_host_index
1861
+ )
1862
+
1863
+ _response_types_map: Dict[str, Optional[str]] = {
1864
+ '200': "object",
1865
+ '404': None,
1866
+ '422': "HTTPValidationError",
1867
+ }
1868
+ response_data = self.api_client.call_api(
1869
+ *_param,
1870
+ _request_timeout=_request_timeout
1871
+ )
1872
+ return response_data.response
1873
+
1874
+
1875
+ def _llm_chat_completions_serialize(
1876
+ self,
1877
+ llm_id,
1878
+ request_body,
1879
+ _request_auth,
1880
+ _content_type,
1881
+ _headers,
1882
+ _host_index,
1883
+ ) -> RequestSerialized:
1884
+
1885
+ _host = None
1886
+
1887
+ _collection_formats: Dict[str, str] = {
1888
+ }
1889
+
1890
+ _path_params: Dict[str, str] = {}
1891
+ _query_params: List[Tuple[str, str]] = []
1892
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1893
+ _form_params: List[Tuple[str, str]] = []
1894
+ _files: Dict[
1895
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1896
+ ] = {}
1897
+ _body_params: Optional[bytes] = None
1898
+
1899
+ # process the path parameters
1900
+ if llm_id is not None:
1901
+ _path_params['llm_id'] = llm_id
1902
+ # process the query parameters
1903
+ # process the header parameters
1904
+ # process the form parameters
1905
+ # process the body parameter
1906
+ if request_body is not None:
1907
+ _body_params = request_body
1908
+
1909
+
1910
+ # set the HTTP header `Accept`
1911
+ if 'Accept' not in _header_params:
1912
+ _header_params['Accept'] = self.api_client.select_header_accept(
1913
+ [
1914
+ 'application/json'
1915
+ ]
1916
+ )
1917
+
1918
+ # set the HTTP header `Content-Type`
1919
+ if _content_type:
1920
+ _header_params['Content-Type'] = _content_type
1921
+ else:
1922
+ _default_content_type = (
1923
+ self.api_client.select_header_content_type(
1924
+ [
1925
+ 'application/json'
1926
+ ]
1927
+ )
1928
+ )
1929
+ if _default_content_type is not None:
1930
+ _header_params['Content-Type'] = _default_content_type
1931
+
1932
+ # authentication setting
1933
+ _auth_settings: List[str] = [
1934
+ 'QAnswer-Api-Key',
1935
+ 'Bearer token'
1936
+ ]
1937
+
1938
+ return self.api_client.param_serialize(
1939
+ method='POST',
1940
+ resource_path='/backend/api/llm-endpoint/{llm_id}/chat/completions',
1941
+ path_params=_path_params,
1942
+ query_params=_query_params,
1943
+ header_params=_header_params,
1944
+ body=_body_params,
1945
+ post_params=_form_params,
1946
+ files=_files,
1947
+ auth_settings=_auth_settings,
1948
+ collection_formats=_collection_formats,
1949
+ _host=_host,
1950
+ _request_auth=_request_auth
1951
+ )
1952
+
1953
+
1954
+
1955
+
1956
+ @validate_call
1957
+ def read_llm_details_by_name(
1958
+ self,
1959
+ name: Annotated[StrictStr, Field(description="LLM endpoint name")],
1960
+ _request_timeout: Union[
1961
+ None,
1962
+ Annotated[StrictFloat, Field(gt=0)],
1963
+ Tuple[
1964
+ Annotated[StrictFloat, Field(gt=0)],
1965
+ Annotated[StrictFloat, Field(gt=0)]
1966
+ ]
1967
+ ] = None,
1968
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1969
+ _content_type: Optional[StrictStr] = None,
1970
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1971
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1972
+ ) -> LLMDetails:
1973
+ """Read Llm Details By Name
1974
+
1975
+
1976
+ :param name: LLM endpoint name (required)
1977
+ :type name: str
1978
+ :param _request_timeout: timeout setting for this request. If one
1979
+ number provided, it will be total request
1980
+ timeout. It can also be a pair (tuple) of
1981
+ (connection, read) timeouts.
1982
+ :type _request_timeout: int, tuple(int, int), optional
1983
+ :param _request_auth: set to override the auth_settings for an a single
1984
+ request; this effectively ignores the
1985
+ authentication in the spec for a single request.
1986
+ :type _request_auth: dict, optional
1987
+ :param _content_type: force content-type for the request.
1988
+ :type _content_type: str, Optional
1989
+ :param _headers: set to override the headers for a single
1990
+ request; this effectively ignores the headers
1991
+ in the spec for a single request.
1992
+ :type _headers: dict, optional
1993
+ :param _host_index: set to override the host_index for a single
1994
+ request; this effectively ignores the host_index
1995
+ in the spec for a single request.
1996
+ :type _host_index: int, optional
1997
+ :return: Returns the result object.
1998
+ """ # noqa: E501
1999
+
2000
+ _param = self._read_llm_details_by_name_serialize(
2001
+ name=name,
2002
+ _request_auth=_request_auth,
2003
+ _content_type=_content_type,
2004
+ _headers=_headers,
2005
+ _host_index=_host_index
2006
+ )
2007
+
2008
+ _response_types_map: Dict[str, Optional[str]] = {
2009
+ '200': "LLMDetails",
2010
+ '404': None,
2011
+ '422': "HTTPValidationError",
2012
+ }
2013
+ response_data = self.api_client.call_api(
2014
+ *_param,
2015
+ _request_timeout=_request_timeout
2016
+ )
2017
+ response_data.read()
2018
+ return self.api_client.response_deserialize(
2019
+ response_data=response_data,
2020
+ response_types_map=_response_types_map,
2021
+ ).data
2022
+
2023
+
2024
+ @validate_call
2025
+ def read_llm_details_by_name_with_http_info(
2026
+ self,
2027
+ name: Annotated[StrictStr, Field(description="LLM endpoint name")],
2028
+ _request_timeout: Union[
2029
+ None,
2030
+ Annotated[StrictFloat, Field(gt=0)],
2031
+ Tuple[
2032
+ Annotated[StrictFloat, Field(gt=0)],
2033
+ Annotated[StrictFloat, Field(gt=0)]
2034
+ ]
2035
+ ] = None,
2036
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2037
+ _content_type: Optional[StrictStr] = None,
2038
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2039
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2040
+ ) -> ApiResponse[LLMDetails]:
2041
+ """Read Llm Details By Name
2042
+
2043
+
2044
+ :param name: LLM endpoint name (required)
2045
+ :type name: str
2046
+ :param _request_timeout: timeout setting for this request. If one
2047
+ number provided, it will be total request
2048
+ timeout. It can also be a pair (tuple) of
2049
+ (connection, read) timeouts.
2050
+ :type _request_timeout: int, tuple(int, int), optional
2051
+ :param _request_auth: set to override the auth_settings for an a single
2052
+ request; this effectively ignores the
2053
+ authentication in the spec for a single request.
2054
+ :type _request_auth: dict, optional
2055
+ :param _content_type: force content-type for the request.
2056
+ :type _content_type: str, Optional
2057
+ :param _headers: set to override the headers for a single
2058
+ request; this effectively ignores the headers
2059
+ in the spec for a single request.
2060
+ :type _headers: dict, optional
2061
+ :param _host_index: set to override the host_index for a single
2062
+ request; this effectively ignores the host_index
2063
+ in the spec for a single request.
2064
+ :type _host_index: int, optional
2065
+ :return: Returns the result object.
2066
+ """ # noqa: E501
2067
+
2068
+ _param = self._read_llm_details_by_name_serialize(
2069
+ name=name,
2070
+ _request_auth=_request_auth,
2071
+ _content_type=_content_type,
2072
+ _headers=_headers,
2073
+ _host_index=_host_index
2074
+ )
2075
+
2076
+ _response_types_map: Dict[str, Optional[str]] = {
2077
+ '200': "LLMDetails",
2078
+ '404': None,
2079
+ '422': "HTTPValidationError",
2080
+ }
2081
+ response_data = self.api_client.call_api(
2082
+ *_param,
2083
+ _request_timeout=_request_timeout
2084
+ )
2085
+ response_data.read()
2086
+ return self.api_client.response_deserialize(
2087
+ response_data=response_data,
2088
+ response_types_map=_response_types_map,
2089
+ )
2090
+
2091
+
2092
+ @validate_call
2093
+ def read_llm_details_by_name_without_preload_content(
2094
+ self,
2095
+ name: Annotated[StrictStr, Field(description="LLM endpoint name")],
2096
+ _request_timeout: Union[
2097
+ None,
2098
+ Annotated[StrictFloat, Field(gt=0)],
2099
+ Tuple[
2100
+ Annotated[StrictFloat, Field(gt=0)],
2101
+ Annotated[StrictFloat, Field(gt=0)]
2102
+ ]
2103
+ ] = None,
2104
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2105
+ _content_type: Optional[StrictStr] = None,
2106
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2107
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2108
+ ) -> RESTResponseType:
2109
+ """Read Llm Details By Name
2110
+
2111
+
2112
+ :param name: LLM endpoint name (required)
2113
+ :type name: str
2114
+ :param _request_timeout: timeout setting for this request. If one
2115
+ number provided, it will be total request
2116
+ timeout. It can also be a pair (tuple) of
2117
+ (connection, read) timeouts.
2118
+ :type _request_timeout: int, tuple(int, int), optional
2119
+ :param _request_auth: set to override the auth_settings for an a single
2120
+ request; this effectively ignores the
2121
+ authentication in the spec for a single request.
2122
+ :type _request_auth: dict, optional
2123
+ :param _content_type: force content-type for the request.
2124
+ :type _content_type: str, Optional
2125
+ :param _headers: set to override the headers for a single
2126
+ request; this effectively ignores the headers
2127
+ in the spec for a single request.
2128
+ :type _headers: dict, optional
2129
+ :param _host_index: set to override the host_index for a single
2130
+ request; this effectively ignores the host_index
2131
+ in the spec for a single request.
2132
+ :type _host_index: int, optional
2133
+ :return: Returns the result object.
2134
+ """ # noqa: E501
2135
+
2136
+ _param = self._read_llm_details_by_name_serialize(
2137
+ name=name,
2138
+ _request_auth=_request_auth,
2139
+ _content_type=_content_type,
2140
+ _headers=_headers,
2141
+ _host_index=_host_index
2142
+ )
2143
+
2144
+ _response_types_map: Dict[str, Optional[str]] = {
2145
+ '200': "LLMDetails",
2146
+ '404': None,
2147
+ '422': "HTTPValidationError",
2148
+ }
2149
+ response_data = self.api_client.call_api(
2150
+ *_param,
2151
+ _request_timeout=_request_timeout
2152
+ )
2153
+ return response_data.response
2154
+
2155
+
2156
+ def _read_llm_details_by_name_serialize(
2157
+ self,
2158
+ name,
2159
+ _request_auth,
2160
+ _content_type,
2161
+ _headers,
2162
+ _host_index,
2163
+ ) -> RequestSerialized:
2164
+
2165
+ _host = None
2166
+
2167
+ _collection_formats: Dict[str, str] = {
2168
+ }
2169
+
2170
+ _path_params: Dict[str, str] = {}
2171
+ _query_params: List[Tuple[str, str]] = []
2172
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2173
+ _form_params: List[Tuple[str, str]] = []
2174
+ _files: Dict[
2175
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2176
+ ] = {}
2177
+ _body_params: Optional[bytes] = None
2178
+
2179
+ # process the path parameters
2180
+ # process the query parameters
2181
+ if name is not None:
2182
+
2183
+ _query_params.append(('name', name))
2184
+
2185
+ # process the header parameters
2186
+ # process the form parameters
2187
+ # process the body parameter
2188
+
2189
+
2190
+ # set the HTTP header `Accept`
2191
+ if 'Accept' not in _header_params:
2192
+ _header_params['Accept'] = self.api_client.select_header_accept(
2193
+ [
2194
+ 'application/json'
2195
+ ]
2196
+ )
2197
+
2198
+
2199
+ # authentication setting
2200
+ _auth_settings: List[str] = [
2201
+ 'QAnswer-Api-Key',
2202
+ 'Bearer token'
2203
+ ]
2204
+
2205
+ return self.api_client.param_serialize(
2206
+ method='GET',
2207
+ resource_path='/backend/api/llm-endpoint/by-name/details',
2208
+ path_params=_path_params,
2209
+ query_params=_query_params,
2210
+ header_params=_header_params,
2211
+ body=_body_params,
2212
+ post_params=_form_params,
2213
+ files=_files,
2214
+ auth_settings=_auth_settings,
2215
+ collection_formats=_collection_formats,
2216
+ _host=_host,
2217
+ _request_auth=_request_auth
2218
+ )
2219
+
2220
+
2221
+
2222
+
2223
+ @validate_call
2224
+ def read_llm_endpoint_by_id(
2225
+ self,
2226
+ id: StrictInt,
2227
+ _request_timeout: Union[
2228
+ None,
2229
+ Annotated[StrictFloat, Field(gt=0)],
2230
+ Tuple[
2231
+ Annotated[StrictFloat, Field(gt=0)],
2232
+ Annotated[StrictFloat, Field(gt=0)]
2233
+ ]
2234
+ ] = None,
2235
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2236
+ _content_type: Optional[StrictStr] = None,
2237
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2238
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2239
+ ) -> LLMEndpoint:
2240
+ """Read Llm Endpoint By Id
2241
+
2242
+
2243
+ :param id: (required)
2244
+ :type id: int
2245
+ :param _request_timeout: timeout setting for this request. If one
2246
+ number provided, it will be total request
2247
+ timeout. It can also be a pair (tuple) of
2248
+ (connection, read) timeouts.
2249
+ :type _request_timeout: int, tuple(int, int), optional
2250
+ :param _request_auth: set to override the auth_settings for an a single
2251
+ request; this effectively ignores the
2252
+ authentication in the spec for a single request.
2253
+ :type _request_auth: dict, optional
2254
+ :param _content_type: force content-type for the request.
2255
+ :type _content_type: str, Optional
2256
+ :param _headers: set to override the headers for a single
2257
+ request; this effectively ignores the headers
2258
+ in the spec for a single request.
2259
+ :type _headers: dict, optional
2260
+ :param _host_index: set to override the host_index for a single
2261
+ request; this effectively ignores the host_index
2262
+ in the spec for a single request.
2263
+ :type _host_index: int, optional
2264
+ :return: Returns the result object.
2265
+ """ # noqa: E501
2266
+
2267
+ _param = self._read_llm_endpoint_by_id_serialize(
2268
+ id=id,
2269
+ _request_auth=_request_auth,
2270
+ _content_type=_content_type,
2271
+ _headers=_headers,
2272
+ _host_index=_host_index
2273
+ )
2274
+
2275
+ _response_types_map: Dict[str, Optional[str]] = {
2276
+ '200': "LLMEndpoint",
2277
+ '404': None,
2278
+ '422': "HTTPValidationError",
2279
+ }
2280
+ response_data = self.api_client.call_api(
2281
+ *_param,
2282
+ _request_timeout=_request_timeout
2283
+ )
2284
+ response_data.read()
2285
+ return self.api_client.response_deserialize(
2286
+ response_data=response_data,
2287
+ response_types_map=_response_types_map,
2288
+ ).data
2289
+
2290
+
2291
+ @validate_call
2292
+ def read_llm_endpoint_by_id_with_http_info(
2293
+ self,
2294
+ id: StrictInt,
2295
+ _request_timeout: Union[
2296
+ None,
2297
+ Annotated[StrictFloat, Field(gt=0)],
2298
+ Tuple[
2299
+ Annotated[StrictFloat, Field(gt=0)],
2300
+ Annotated[StrictFloat, Field(gt=0)]
2301
+ ]
2302
+ ] = None,
2303
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2304
+ _content_type: Optional[StrictStr] = None,
2305
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2306
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2307
+ ) -> ApiResponse[LLMEndpoint]:
2308
+ """Read Llm Endpoint By Id
2309
+
2310
+
2311
+ :param id: (required)
2312
+ :type id: int
2313
+ :param _request_timeout: timeout setting for this request. If one
2314
+ number provided, it will be total request
2315
+ timeout. It can also be a pair (tuple) of
2316
+ (connection, read) timeouts.
2317
+ :type _request_timeout: int, tuple(int, int), optional
2318
+ :param _request_auth: set to override the auth_settings for an a single
2319
+ request; this effectively ignores the
2320
+ authentication in the spec for a single request.
2321
+ :type _request_auth: dict, optional
2322
+ :param _content_type: force content-type for the request.
2323
+ :type _content_type: str, Optional
2324
+ :param _headers: set to override the headers for a single
2325
+ request; this effectively ignores the headers
2326
+ in the spec for a single request.
2327
+ :type _headers: dict, optional
2328
+ :param _host_index: set to override the host_index for a single
2329
+ request; this effectively ignores the host_index
2330
+ in the spec for a single request.
2331
+ :type _host_index: int, optional
2332
+ :return: Returns the result object.
2333
+ """ # noqa: E501
2334
+
2335
+ _param = self._read_llm_endpoint_by_id_serialize(
2336
+ id=id,
2337
+ _request_auth=_request_auth,
2338
+ _content_type=_content_type,
2339
+ _headers=_headers,
2340
+ _host_index=_host_index
2341
+ )
2342
+
2343
+ _response_types_map: Dict[str, Optional[str]] = {
2344
+ '200': "LLMEndpoint",
2345
+ '404': None,
2346
+ '422': "HTTPValidationError",
2347
+ }
2348
+ response_data = self.api_client.call_api(
2349
+ *_param,
2350
+ _request_timeout=_request_timeout
2351
+ )
2352
+ response_data.read()
2353
+ return self.api_client.response_deserialize(
2354
+ response_data=response_data,
2355
+ response_types_map=_response_types_map,
2356
+ )
2357
+
2358
+
2359
+ @validate_call
2360
+ def read_llm_endpoint_by_id_without_preload_content(
2361
+ self,
2362
+ id: StrictInt,
2363
+ _request_timeout: Union[
2364
+ None,
2365
+ Annotated[StrictFloat, Field(gt=0)],
2366
+ Tuple[
2367
+ Annotated[StrictFloat, Field(gt=0)],
2368
+ Annotated[StrictFloat, Field(gt=0)]
2369
+ ]
2370
+ ] = None,
2371
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2372
+ _content_type: Optional[StrictStr] = None,
2373
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2374
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2375
+ ) -> RESTResponseType:
2376
+ """Read Llm Endpoint By Id
2377
+
2378
+
2379
+ :param id: (required)
2380
+ :type id: int
2381
+ :param _request_timeout: timeout setting for this request. If one
2382
+ number provided, it will be total request
2383
+ timeout. It can also be a pair (tuple) of
2384
+ (connection, read) timeouts.
2385
+ :type _request_timeout: int, tuple(int, int), optional
2386
+ :param _request_auth: set to override the auth_settings for an a single
2387
+ request; this effectively ignores the
2388
+ authentication in the spec for a single request.
2389
+ :type _request_auth: dict, optional
2390
+ :param _content_type: force content-type for the request.
2391
+ :type _content_type: str, Optional
2392
+ :param _headers: set to override the headers for a single
2393
+ request; this effectively ignores the headers
2394
+ in the spec for a single request.
2395
+ :type _headers: dict, optional
2396
+ :param _host_index: set to override the host_index for a single
2397
+ request; this effectively ignores the host_index
2398
+ in the spec for a single request.
2399
+ :type _host_index: int, optional
2400
+ :return: Returns the result object.
2401
+ """ # noqa: E501
2402
+
2403
+ _param = self._read_llm_endpoint_by_id_serialize(
2404
+ id=id,
2405
+ _request_auth=_request_auth,
2406
+ _content_type=_content_type,
2407
+ _headers=_headers,
2408
+ _host_index=_host_index
2409
+ )
2410
+
2411
+ _response_types_map: Dict[str, Optional[str]] = {
2412
+ '200': "LLMEndpoint",
2413
+ '404': None,
2414
+ '422': "HTTPValidationError",
2415
+ }
2416
+ response_data = self.api_client.call_api(
2417
+ *_param,
2418
+ _request_timeout=_request_timeout
2419
+ )
2420
+ return response_data.response
2421
+
2422
+
2423
+ def _read_llm_endpoint_by_id_serialize(
2424
+ self,
2425
+ id,
2426
+ _request_auth,
2427
+ _content_type,
2428
+ _headers,
2429
+ _host_index,
2430
+ ) -> RequestSerialized:
2431
+
2432
+ _host = None
2433
+
2434
+ _collection_formats: Dict[str, str] = {
2435
+ }
2436
+
2437
+ _path_params: Dict[str, str] = {}
2438
+ _query_params: List[Tuple[str, str]] = []
2439
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2440
+ _form_params: List[Tuple[str, str]] = []
2441
+ _files: Dict[
2442
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2443
+ ] = {}
2444
+ _body_params: Optional[bytes] = None
2445
+
2446
+ # process the path parameters
2447
+ if id is not None:
2448
+ _path_params['id'] = id
2449
+ # process the query parameters
2450
+ # process the header parameters
2451
+ # process the form parameters
2452
+ # process the body parameter
2453
+
2454
+
2455
+ # set the HTTP header `Accept`
2456
+ if 'Accept' not in _header_params:
2457
+ _header_params['Accept'] = self.api_client.select_header_accept(
2458
+ [
2459
+ 'application/json'
2460
+ ]
2461
+ )
2462
+
2463
+
2464
+ # authentication setting
2465
+ _auth_settings: List[str] = [
2466
+ 'QAnswer-Api-Key',
2467
+ 'Bearer token'
2468
+ ]
2469
+
2470
+ return self.api_client.param_serialize(
2471
+ method='GET',
2472
+ resource_path='/backend/api/llm-endpoint/{id}',
2473
+ path_params=_path_params,
2474
+ query_params=_query_params,
2475
+ header_params=_header_params,
2476
+ body=_body_params,
2477
+ post_params=_form_params,
2478
+ files=_files,
2479
+ auth_settings=_auth_settings,
2480
+ collection_formats=_collection_formats,
2481
+ _host=_host,
2482
+ _request_auth=_request_auth
2483
+ )
2484
+
2485
+
2486
+
2487
+
2488
+ @validate_call
2489
+ def read_llm_endpoint_by_name(
2490
+ self,
2491
+ name: Annotated[StrictStr, Field(description="LLM endpoint name")],
2492
+ _request_timeout: Union[
2493
+ None,
2494
+ Annotated[StrictFloat, Field(gt=0)],
2495
+ Tuple[
2496
+ Annotated[StrictFloat, Field(gt=0)],
2497
+ Annotated[StrictFloat, Field(gt=0)]
2498
+ ]
2499
+ ] = None,
2500
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2501
+ _content_type: Optional[StrictStr] = None,
2502
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2503
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2504
+ ) -> LLMEndpoint:
2505
+ """Read Llm Endpoint By Name
2506
+
2507
+
2508
+ :param name: LLM endpoint name (required)
2509
+ :type name: str
2510
+ :param _request_timeout: timeout setting for this request. If one
2511
+ number provided, it will be total request
2512
+ timeout. It can also be a pair (tuple) of
2513
+ (connection, read) timeouts.
2514
+ :type _request_timeout: int, tuple(int, int), optional
2515
+ :param _request_auth: set to override the auth_settings for an a single
2516
+ request; this effectively ignores the
2517
+ authentication in the spec for a single request.
2518
+ :type _request_auth: dict, optional
2519
+ :param _content_type: force content-type for the request.
2520
+ :type _content_type: str, Optional
2521
+ :param _headers: set to override the headers for a single
2522
+ request; this effectively ignores the headers
2523
+ in the spec for a single request.
2524
+ :type _headers: dict, optional
2525
+ :param _host_index: set to override the host_index for a single
2526
+ request; this effectively ignores the host_index
2527
+ in the spec for a single request.
2528
+ :type _host_index: int, optional
2529
+ :return: Returns the result object.
2530
+ """ # noqa: E501
2531
+
2532
+ _param = self._read_llm_endpoint_by_name_serialize(
2533
+ name=name,
2534
+ _request_auth=_request_auth,
2535
+ _content_type=_content_type,
2536
+ _headers=_headers,
2537
+ _host_index=_host_index
2538
+ )
2539
+
2540
+ _response_types_map: Dict[str, Optional[str]] = {
2541
+ '200': "LLMEndpoint",
2542
+ '404': None,
2543
+ '422': "HTTPValidationError",
2544
+ }
2545
+ response_data = self.api_client.call_api(
2546
+ *_param,
2547
+ _request_timeout=_request_timeout
2548
+ )
2549
+ response_data.read()
2550
+ return self.api_client.response_deserialize(
2551
+ response_data=response_data,
2552
+ response_types_map=_response_types_map,
2553
+ ).data
2554
+
2555
+
2556
+ @validate_call
2557
+ def read_llm_endpoint_by_name_with_http_info(
2558
+ self,
2559
+ name: Annotated[StrictStr, Field(description="LLM endpoint name")],
2560
+ _request_timeout: Union[
2561
+ None,
2562
+ Annotated[StrictFloat, Field(gt=0)],
2563
+ Tuple[
2564
+ Annotated[StrictFloat, Field(gt=0)],
2565
+ Annotated[StrictFloat, Field(gt=0)]
2566
+ ]
2567
+ ] = None,
2568
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2569
+ _content_type: Optional[StrictStr] = None,
2570
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2571
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2572
+ ) -> ApiResponse[LLMEndpoint]:
2573
+ """Read Llm Endpoint By Name
2574
+
2575
+
2576
+ :param name: LLM endpoint name (required)
2577
+ :type name: str
2578
+ :param _request_timeout: timeout setting for this request. If one
2579
+ number provided, it will be total request
2580
+ timeout. It can also be a pair (tuple) of
2581
+ (connection, read) timeouts.
2582
+ :type _request_timeout: int, tuple(int, int), optional
2583
+ :param _request_auth: set to override the auth_settings for an a single
2584
+ request; this effectively ignores the
2585
+ authentication in the spec for a single request.
2586
+ :type _request_auth: dict, optional
2587
+ :param _content_type: force content-type for the request.
2588
+ :type _content_type: str, Optional
2589
+ :param _headers: set to override the headers for a single
2590
+ request; this effectively ignores the headers
2591
+ in the spec for a single request.
2592
+ :type _headers: dict, optional
2593
+ :param _host_index: set to override the host_index for a single
2594
+ request; this effectively ignores the host_index
2595
+ in the spec for a single request.
2596
+ :type _host_index: int, optional
2597
+ :return: Returns the result object.
2598
+ """ # noqa: E501
2599
+
2600
+ _param = self._read_llm_endpoint_by_name_serialize(
2601
+ name=name,
2602
+ _request_auth=_request_auth,
2603
+ _content_type=_content_type,
2604
+ _headers=_headers,
2605
+ _host_index=_host_index
2606
+ )
2607
+
2608
+ _response_types_map: Dict[str, Optional[str]] = {
2609
+ '200': "LLMEndpoint",
2610
+ '404': None,
2611
+ '422': "HTTPValidationError",
2612
+ }
2613
+ response_data = self.api_client.call_api(
2614
+ *_param,
2615
+ _request_timeout=_request_timeout
2616
+ )
2617
+ response_data.read()
2618
+ return self.api_client.response_deserialize(
2619
+ response_data=response_data,
2620
+ response_types_map=_response_types_map,
2621
+ )
2622
+
2623
+
2624
+ @validate_call
2625
+ def read_llm_endpoint_by_name_without_preload_content(
2626
+ self,
2627
+ name: Annotated[StrictStr, Field(description="LLM endpoint name")],
2628
+ _request_timeout: Union[
2629
+ None,
2630
+ Annotated[StrictFloat, Field(gt=0)],
2631
+ Tuple[
2632
+ Annotated[StrictFloat, Field(gt=0)],
2633
+ Annotated[StrictFloat, Field(gt=0)]
2634
+ ]
2635
+ ] = None,
2636
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2637
+ _content_type: Optional[StrictStr] = None,
2638
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2639
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2640
+ ) -> RESTResponseType:
2641
+ """Read Llm Endpoint By Name
2642
+
2643
+
2644
+ :param name: LLM endpoint name (required)
2645
+ :type name: str
2646
+ :param _request_timeout: timeout setting for this request. If one
2647
+ number provided, it will be total request
2648
+ timeout. It can also be a pair (tuple) of
2649
+ (connection, read) timeouts.
2650
+ :type _request_timeout: int, tuple(int, int), optional
2651
+ :param _request_auth: set to override the auth_settings for an a single
2652
+ request; this effectively ignores the
2653
+ authentication in the spec for a single request.
2654
+ :type _request_auth: dict, optional
2655
+ :param _content_type: force content-type for the request.
2656
+ :type _content_type: str, Optional
2657
+ :param _headers: set to override the headers for a single
2658
+ request; this effectively ignores the headers
2659
+ in the spec for a single request.
2660
+ :type _headers: dict, optional
2661
+ :param _host_index: set to override the host_index for a single
2662
+ request; this effectively ignores the host_index
2663
+ in the spec for a single request.
2664
+ :type _host_index: int, optional
2665
+ :return: Returns the result object.
2666
+ """ # noqa: E501
2667
+
2668
+ _param = self._read_llm_endpoint_by_name_serialize(
2669
+ name=name,
2670
+ _request_auth=_request_auth,
2671
+ _content_type=_content_type,
2672
+ _headers=_headers,
2673
+ _host_index=_host_index
2674
+ )
2675
+
2676
+ _response_types_map: Dict[str, Optional[str]] = {
2677
+ '200': "LLMEndpoint",
2678
+ '404': None,
2679
+ '422': "HTTPValidationError",
2680
+ }
2681
+ response_data = self.api_client.call_api(
2682
+ *_param,
2683
+ _request_timeout=_request_timeout
2684
+ )
2685
+ return response_data.response
2686
+
2687
+
2688
+ def _read_llm_endpoint_by_name_serialize(
2689
+ self,
2690
+ name,
2691
+ _request_auth,
2692
+ _content_type,
2693
+ _headers,
2694
+ _host_index,
2695
+ ) -> RequestSerialized:
2696
+
2697
+ _host = None
2698
+
2699
+ _collection_formats: Dict[str, str] = {
2700
+ }
2701
+
2702
+ _path_params: Dict[str, str] = {}
2703
+ _query_params: List[Tuple[str, str]] = []
2704
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2705
+ _form_params: List[Tuple[str, str]] = []
2706
+ _files: Dict[
2707
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2708
+ ] = {}
2709
+ _body_params: Optional[bytes] = None
2710
+
2711
+ # process the path parameters
2712
+ # process the query parameters
2713
+ if name is not None:
2714
+
2715
+ _query_params.append(('name', name))
2716
+
2717
+ # process the header parameters
2718
+ # process the form parameters
2719
+ # process the body parameter
2720
+
2721
+
2722
+ # set the HTTP header `Accept`
2723
+ if 'Accept' not in _header_params:
2724
+ _header_params['Accept'] = self.api_client.select_header_accept(
2725
+ [
2726
+ 'application/json'
2727
+ ]
2728
+ )
2729
+
2730
+
2731
+ # authentication setting
2732
+ _auth_settings: List[str] = [
2733
+ 'QAnswer-Api-Key',
2734
+ 'Bearer token'
2735
+ ]
2736
+
2737
+ return self.api_client.param_serialize(
2738
+ method='GET',
2739
+ resource_path='/backend/api/llm-endpoint/by-name',
2740
+ path_params=_path_params,
2741
+ query_params=_query_params,
2742
+ header_params=_header_params,
2743
+ body=_body_params,
2744
+ post_params=_form_params,
2745
+ files=_files,
2746
+ auth_settings=_auth_settings,
2747
+ collection_formats=_collection_formats,
2748
+ _host=_host,
2749
+ _request_auth=_request_auth
2750
+ )
2751
+
2752
+
2753
+
2754
+
2755
+ @validate_call
2756
+ def read_llm_endpoints(
2757
+ self,
2758
+ _request_timeout: Union[
2759
+ None,
2760
+ Annotated[StrictFloat, Field(gt=0)],
2761
+ Tuple[
2762
+ Annotated[StrictFloat, Field(gt=0)],
2763
+ Annotated[StrictFloat, Field(gt=0)]
2764
+ ]
2765
+ ] = None,
2766
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2767
+ _content_type: Optional[StrictStr] = None,
2768
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2769
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2770
+ ) -> List[LLMEndpoint]:
2771
+ """Read Llm Endpoints
2772
+
2773
+
2774
+ :param _request_timeout: timeout setting for this request. If one
2775
+ number provided, it will be total request
2776
+ timeout. It can also be a pair (tuple) of
2777
+ (connection, read) timeouts.
2778
+ :type _request_timeout: int, tuple(int, int), optional
2779
+ :param _request_auth: set to override the auth_settings for an a single
2780
+ request; this effectively ignores the
2781
+ authentication in the spec for a single request.
2782
+ :type _request_auth: dict, optional
2783
+ :param _content_type: force content-type for the request.
2784
+ :type _content_type: str, Optional
2785
+ :param _headers: set to override the headers for a single
2786
+ request; this effectively ignores the headers
2787
+ in the spec for a single request.
2788
+ :type _headers: dict, optional
2789
+ :param _host_index: set to override the host_index for a single
2790
+ request; this effectively ignores the host_index
2791
+ in the spec for a single request.
2792
+ :type _host_index: int, optional
2793
+ :return: Returns the result object.
2794
+ """ # noqa: E501
2795
+
2796
+ _param = self._read_llm_endpoints_serialize(
2797
+ _request_auth=_request_auth,
2798
+ _content_type=_content_type,
2799
+ _headers=_headers,
2800
+ _host_index=_host_index
2801
+ )
2802
+
2803
+ _response_types_map: Dict[str, Optional[str]] = {
2804
+ '200': "List[LLMEndpoint]",
2805
+ '404': None,
2806
+ }
2807
+ response_data = self.api_client.call_api(
2808
+ *_param,
2809
+ _request_timeout=_request_timeout
2810
+ )
2811
+ response_data.read()
2812
+ return self.api_client.response_deserialize(
2813
+ response_data=response_data,
2814
+ response_types_map=_response_types_map,
2815
+ ).data
2816
+
2817
+
2818
+ @validate_call
2819
+ def read_llm_endpoints_with_http_info(
2820
+ self,
2821
+ _request_timeout: Union[
2822
+ None,
2823
+ Annotated[StrictFloat, Field(gt=0)],
2824
+ Tuple[
2825
+ Annotated[StrictFloat, Field(gt=0)],
2826
+ Annotated[StrictFloat, Field(gt=0)]
2827
+ ]
2828
+ ] = None,
2829
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2830
+ _content_type: Optional[StrictStr] = None,
2831
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2832
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2833
+ ) -> ApiResponse[List[LLMEndpoint]]:
2834
+ """Read Llm Endpoints
2835
+
2836
+
2837
+ :param _request_timeout: timeout setting for this request. If one
2838
+ number provided, it will be total request
2839
+ timeout. It can also be a pair (tuple) of
2840
+ (connection, read) timeouts.
2841
+ :type _request_timeout: int, tuple(int, int), optional
2842
+ :param _request_auth: set to override the auth_settings for an a single
2843
+ request; this effectively ignores the
2844
+ authentication in the spec for a single request.
2845
+ :type _request_auth: dict, optional
2846
+ :param _content_type: force content-type for the request.
2847
+ :type _content_type: str, Optional
2848
+ :param _headers: set to override the headers for a single
2849
+ request; this effectively ignores the headers
2850
+ in the spec for a single request.
2851
+ :type _headers: dict, optional
2852
+ :param _host_index: set to override the host_index for a single
2853
+ request; this effectively ignores the host_index
2854
+ in the spec for a single request.
2855
+ :type _host_index: int, optional
2856
+ :return: Returns the result object.
2857
+ """ # noqa: E501
2858
+
2859
+ _param = self._read_llm_endpoints_serialize(
2860
+ _request_auth=_request_auth,
2861
+ _content_type=_content_type,
2862
+ _headers=_headers,
2863
+ _host_index=_host_index
2864
+ )
2865
+
2866
+ _response_types_map: Dict[str, Optional[str]] = {
2867
+ '200': "List[LLMEndpoint]",
2868
+ '404': None,
2869
+ }
2870
+ response_data = self.api_client.call_api(
2871
+ *_param,
2872
+ _request_timeout=_request_timeout
2873
+ )
2874
+ response_data.read()
2875
+ return self.api_client.response_deserialize(
2876
+ response_data=response_data,
2877
+ response_types_map=_response_types_map,
2878
+ )
2879
+
2880
+
2881
+ @validate_call
2882
+ def read_llm_endpoints_without_preload_content(
2883
+ self,
2884
+ _request_timeout: Union[
2885
+ None,
2886
+ Annotated[StrictFloat, Field(gt=0)],
2887
+ Tuple[
2888
+ Annotated[StrictFloat, Field(gt=0)],
2889
+ Annotated[StrictFloat, Field(gt=0)]
2890
+ ]
2891
+ ] = None,
2892
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2893
+ _content_type: Optional[StrictStr] = None,
2894
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2895
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2896
+ ) -> RESTResponseType:
2897
+ """Read Llm Endpoints
2898
+
2899
+
2900
+ :param _request_timeout: timeout setting for this request. If one
2901
+ number provided, it will be total request
2902
+ timeout. It can also be a pair (tuple) of
2903
+ (connection, read) timeouts.
2904
+ :type _request_timeout: int, tuple(int, int), optional
2905
+ :param _request_auth: set to override the auth_settings for an a single
2906
+ request; this effectively ignores the
2907
+ authentication in the spec for a single request.
2908
+ :type _request_auth: dict, optional
2909
+ :param _content_type: force content-type for the request.
2910
+ :type _content_type: str, Optional
2911
+ :param _headers: set to override the headers for a single
2912
+ request; this effectively ignores the headers
2913
+ in the spec for a single request.
2914
+ :type _headers: dict, optional
2915
+ :param _host_index: set to override the host_index for a single
2916
+ request; this effectively ignores the host_index
2917
+ in the spec for a single request.
2918
+ :type _host_index: int, optional
2919
+ :return: Returns the result object.
2920
+ """ # noqa: E501
2921
+
2922
+ _param = self._read_llm_endpoints_serialize(
2923
+ _request_auth=_request_auth,
2924
+ _content_type=_content_type,
2925
+ _headers=_headers,
2926
+ _host_index=_host_index
2927
+ )
2928
+
2929
+ _response_types_map: Dict[str, Optional[str]] = {
2930
+ '200': "List[LLMEndpoint]",
2931
+ '404': None,
2932
+ }
2933
+ response_data = self.api_client.call_api(
2934
+ *_param,
2935
+ _request_timeout=_request_timeout
2936
+ )
2937
+ return response_data.response
2938
+
2939
+
2940
+ def _read_llm_endpoints_serialize(
2941
+ self,
2942
+ _request_auth,
2943
+ _content_type,
2944
+ _headers,
2945
+ _host_index,
2946
+ ) -> RequestSerialized:
2947
+
2948
+ _host = None
2949
+
2950
+ _collection_formats: Dict[str, str] = {
2951
+ }
2952
+
2953
+ _path_params: Dict[str, str] = {}
2954
+ _query_params: List[Tuple[str, str]] = []
2955
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2956
+ _form_params: List[Tuple[str, str]] = []
2957
+ _files: Dict[
2958
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2959
+ ] = {}
2960
+ _body_params: Optional[bytes] = None
2961
+
2962
+ # process the path parameters
2963
+ # process the query parameters
2964
+ # process the header parameters
2965
+ # process the form parameters
2966
+ # process the body parameter
2967
+
2968
+
2969
+ # set the HTTP header `Accept`
2970
+ if 'Accept' not in _header_params:
2971
+ _header_params['Accept'] = self.api_client.select_header_accept(
2972
+ [
2973
+ 'application/json'
2974
+ ]
2975
+ )
2976
+
2977
+
2978
+ # authentication setting
2979
+ _auth_settings: List[str] = [
2980
+ 'QAnswer-Api-Key',
2981
+ 'Bearer token'
2982
+ ]
2983
+
2984
+ return self.api_client.param_serialize(
2985
+ method='GET',
2986
+ resource_path='/backend/api/llm-endpoint/list',
2987
+ path_params=_path_params,
2988
+ query_params=_query_params,
2989
+ header_params=_header_params,
2990
+ body=_body_params,
2991
+ post_params=_form_params,
2992
+ files=_files,
2993
+ auth_settings=_auth_settings,
2994
+ collection_formats=_collection_formats,
2995
+ _host=_host,
2996
+ _request_auth=_request_auth
2997
+ )
2998
+
2999
+
3000
+
3001
+
3002
+ @validate_call
3003
+ def reassign_llm_endpoint_usage(
3004
+ self,
3005
+ id: StrictInt,
3006
+ replacement_llm_id: StrictInt,
3007
+ _request_timeout: Union[
3008
+ None,
3009
+ Annotated[StrictFloat, Field(gt=0)],
3010
+ Tuple[
3011
+ Annotated[StrictFloat, Field(gt=0)],
3012
+ Annotated[StrictFloat, Field(gt=0)]
3013
+ ]
3014
+ ] = None,
3015
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3016
+ _content_type: Optional[StrictStr] = None,
3017
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3018
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3019
+ ) -> LLMEndpointUsageMigrationResponse:
3020
+ """Reassign Llm Endpoint Usage
3021
+
3022
+
3023
+ :param id: (required)
3024
+ :type id: int
3025
+ :param replacement_llm_id: (required)
3026
+ :type replacement_llm_id: int
3027
+ :param _request_timeout: timeout setting for this request. If one
3028
+ number provided, it will be total request
3029
+ timeout. It can also be a pair (tuple) of
3030
+ (connection, read) timeouts.
3031
+ :type _request_timeout: int, tuple(int, int), optional
3032
+ :param _request_auth: set to override the auth_settings for an a single
3033
+ request; this effectively ignores the
3034
+ authentication in the spec for a single request.
3035
+ :type _request_auth: dict, optional
3036
+ :param _content_type: force content-type for the request.
3037
+ :type _content_type: str, Optional
3038
+ :param _headers: set to override the headers for a single
3039
+ request; this effectively ignores the headers
3040
+ in the spec for a single request.
3041
+ :type _headers: dict, optional
3042
+ :param _host_index: set to override the host_index for a single
3043
+ request; this effectively ignores the host_index
3044
+ in the spec for a single request.
3045
+ :type _host_index: int, optional
3046
+ :return: Returns the result object.
3047
+ """ # noqa: E501
3048
+
3049
+ _param = self._reassign_llm_endpoint_usage_serialize(
3050
+ id=id,
3051
+ replacement_llm_id=replacement_llm_id,
3052
+ _request_auth=_request_auth,
3053
+ _content_type=_content_type,
3054
+ _headers=_headers,
3055
+ _host_index=_host_index
3056
+ )
3057
+
3058
+ _response_types_map: Dict[str, Optional[str]] = {
3059
+ '200': "LLMEndpointUsageMigrationResponse",
3060
+ '404': None,
3061
+ '422': "HTTPValidationError",
3062
+ }
3063
+ response_data = self.api_client.call_api(
3064
+ *_param,
3065
+ _request_timeout=_request_timeout
3066
+ )
3067
+ response_data.read()
3068
+ return self.api_client.response_deserialize(
3069
+ response_data=response_data,
3070
+ response_types_map=_response_types_map,
3071
+ ).data
3072
+
3073
+
3074
+ @validate_call
3075
+ def reassign_llm_endpoint_usage_with_http_info(
3076
+ self,
3077
+ id: StrictInt,
3078
+ replacement_llm_id: StrictInt,
3079
+ _request_timeout: Union[
3080
+ None,
3081
+ Annotated[StrictFloat, Field(gt=0)],
3082
+ Tuple[
3083
+ Annotated[StrictFloat, Field(gt=0)],
3084
+ Annotated[StrictFloat, Field(gt=0)]
3085
+ ]
3086
+ ] = None,
3087
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3088
+ _content_type: Optional[StrictStr] = None,
3089
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3090
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3091
+ ) -> ApiResponse[LLMEndpointUsageMigrationResponse]:
3092
+ """Reassign Llm Endpoint Usage
3093
+
3094
+
3095
+ :param id: (required)
3096
+ :type id: int
3097
+ :param replacement_llm_id: (required)
3098
+ :type replacement_llm_id: int
3099
+ :param _request_timeout: timeout setting for this request. If one
3100
+ number provided, it will be total request
3101
+ timeout. It can also be a pair (tuple) of
3102
+ (connection, read) timeouts.
3103
+ :type _request_timeout: int, tuple(int, int), optional
3104
+ :param _request_auth: set to override the auth_settings for an a single
3105
+ request; this effectively ignores the
3106
+ authentication in the spec for a single request.
3107
+ :type _request_auth: dict, optional
3108
+ :param _content_type: force content-type for the request.
3109
+ :type _content_type: str, Optional
3110
+ :param _headers: set to override the headers for a single
3111
+ request; this effectively ignores the headers
3112
+ in the spec for a single request.
3113
+ :type _headers: dict, optional
3114
+ :param _host_index: set to override the host_index for a single
3115
+ request; this effectively ignores the host_index
3116
+ in the spec for a single request.
3117
+ :type _host_index: int, optional
3118
+ :return: Returns the result object.
3119
+ """ # noqa: E501
3120
+
3121
+ _param = self._reassign_llm_endpoint_usage_serialize(
3122
+ id=id,
3123
+ replacement_llm_id=replacement_llm_id,
3124
+ _request_auth=_request_auth,
3125
+ _content_type=_content_type,
3126
+ _headers=_headers,
3127
+ _host_index=_host_index
3128
+ )
3129
+
3130
+ _response_types_map: Dict[str, Optional[str]] = {
3131
+ '200': "LLMEndpointUsageMigrationResponse",
3132
+ '404': None,
3133
+ '422': "HTTPValidationError",
3134
+ }
3135
+ response_data = self.api_client.call_api(
3136
+ *_param,
3137
+ _request_timeout=_request_timeout
3138
+ )
3139
+ response_data.read()
3140
+ return self.api_client.response_deserialize(
3141
+ response_data=response_data,
3142
+ response_types_map=_response_types_map,
3143
+ )
3144
+
3145
+
3146
+ @validate_call
3147
+ def reassign_llm_endpoint_usage_without_preload_content(
3148
+ self,
3149
+ id: StrictInt,
3150
+ replacement_llm_id: StrictInt,
3151
+ _request_timeout: Union[
3152
+ None,
3153
+ Annotated[StrictFloat, Field(gt=0)],
3154
+ Tuple[
3155
+ Annotated[StrictFloat, Field(gt=0)],
3156
+ Annotated[StrictFloat, Field(gt=0)]
3157
+ ]
3158
+ ] = None,
3159
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3160
+ _content_type: Optional[StrictStr] = None,
3161
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3162
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3163
+ ) -> RESTResponseType:
3164
+ """Reassign Llm Endpoint Usage
3165
+
3166
+
3167
+ :param id: (required)
3168
+ :type id: int
3169
+ :param replacement_llm_id: (required)
3170
+ :type replacement_llm_id: int
3171
+ :param _request_timeout: timeout setting for this request. If one
3172
+ number provided, it will be total request
3173
+ timeout. It can also be a pair (tuple) of
3174
+ (connection, read) timeouts.
3175
+ :type _request_timeout: int, tuple(int, int), optional
3176
+ :param _request_auth: set to override the auth_settings for an a single
3177
+ request; this effectively ignores the
3178
+ authentication in the spec for a single request.
3179
+ :type _request_auth: dict, optional
3180
+ :param _content_type: force content-type for the request.
3181
+ :type _content_type: str, Optional
3182
+ :param _headers: set to override the headers for a single
3183
+ request; this effectively ignores the headers
3184
+ in the spec for a single request.
3185
+ :type _headers: dict, optional
3186
+ :param _host_index: set to override the host_index for a single
3187
+ request; this effectively ignores the host_index
3188
+ in the spec for a single request.
3189
+ :type _host_index: int, optional
3190
+ :return: Returns the result object.
3191
+ """ # noqa: E501
3192
+
3193
+ _param = self._reassign_llm_endpoint_usage_serialize(
3194
+ id=id,
3195
+ replacement_llm_id=replacement_llm_id,
3196
+ _request_auth=_request_auth,
3197
+ _content_type=_content_type,
3198
+ _headers=_headers,
3199
+ _host_index=_host_index
3200
+ )
3201
+
3202
+ _response_types_map: Dict[str, Optional[str]] = {
3203
+ '200': "LLMEndpointUsageMigrationResponse",
3204
+ '404': None,
3205
+ '422': "HTTPValidationError",
3206
+ }
3207
+ response_data = self.api_client.call_api(
3208
+ *_param,
3209
+ _request_timeout=_request_timeout
3210
+ )
3211
+ return response_data.response
3212
+
3213
+
3214
+ def _reassign_llm_endpoint_usage_serialize(
3215
+ self,
3216
+ id,
3217
+ replacement_llm_id,
3218
+ _request_auth,
3219
+ _content_type,
3220
+ _headers,
3221
+ _host_index,
3222
+ ) -> RequestSerialized:
3223
+
3224
+ _host = None
3225
+
3226
+ _collection_formats: Dict[str, str] = {
3227
+ }
3228
+
3229
+ _path_params: Dict[str, str] = {}
3230
+ _query_params: List[Tuple[str, str]] = []
3231
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3232
+ _form_params: List[Tuple[str, str]] = []
3233
+ _files: Dict[
3234
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3235
+ ] = {}
3236
+ _body_params: Optional[bytes] = None
3237
+
3238
+ # process the path parameters
3239
+ if id is not None:
3240
+ _path_params['id'] = id
3241
+ # process the query parameters
3242
+ if replacement_llm_id is not None:
3243
+
3244
+ _query_params.append(('replacement_llm_id', replacement_llm_id))
3245
+
3246
+ # process the header parameters
3247
+ # process the form parameters
3248
+ # process the body parameter
3249
+
3250
+
3251
+ # set the HTTP header `Accept`
3252
+ if 'Accept' not in _header_params:
3253
+ _header_params['Accept'] = self.api_client.select_header_accept(
3254
+ [
3255
+ 'application/json'
3256
+ ]
3257
+ )
3258
+
3259
+
3260
+ # authentication setting
3261
+ _auth_settings: List[str] = [
3262
+ 'QAnswer-Api-Key',
3263
+ 'Bearer token'
3264
+ ]
3265
+
3266
+ return self.api_client.param_serialize(
3267
+ method='PUT',
3268
+ resource_path='/backend/api/llm-endpoint/{id}/reassign-usage',
3269
+ path_params=_path_params,
3270
+ query_params=_query_params,
3271
+ header_params=_header_params,
3272
+ body=_body_params,
3273
+ post_params=_form_params,
3274
+ files=_files,
3275
+ auth_settings=_auth_settings,
3276
+ collection_formats=_collection_formats,
3277
+ _host=_host,
3278
+ _request_auth=_request_auth
3279
+ )
3280
+
3281
+
3282
+
3283
+
3284
+ @validate_call
3285
+ def set_default_llm_endpoint_v2(
3286
+ self,
3287
+ id: StrictInt,
3288
+ _request_timeout: Union[
3289
+ None,
3290
+ Annotated[StrictFloat, Field(gt=0)],
3291
+ Tuple[
3292
+ Annotated[StrictFloat, Field(gt=0)],
3293
+ Annotated[StrictFloat, Field(gt=0)]
3294
+ ]
3295
+ ] = None,
3296
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3297
+ _content_type: Optional[StrictStr] = None,
3298
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3299
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3300
+ ) -> object:
3301
+ """Set Default Llm Endpoint V2
3302
+
3303
+
3304
+ :param id: (required)
3305
+ :type id: int
3306
+ :param _request_timeout: timeout setting for this request. If one
3307
+ number provided, it will be total request
3308
+ timeout. It can also be a pair (tuple) of
3309
+ (connection, read) timeouts.
3310
+ :type _request_timeout: int, tuple(int, int), optional
3311
+ :param _request_auth: set to override the auth_settings for an a single
3312
+ request; this effectively ignores the
3313
+ authentication in the spec for a single request.
3314
+ :type _request_auth: dict, optional
3315
+ :param _content_type: force content-type for the request.
3316
+ :type _content_type: str, Optional
3317
+ :param _headers: set to override the headers for a single
3318
+ request; this effectively ignores the headers
3319
+ in the spec for a single request.
3320
+ :type _headers: dict, optional
3321
+ :param _host_index: set to override the host_index for a single
3322
+ request; this effectively ignores the host_index
3323
+ in the spec for a single request.
3324
+ :type _host_index: int, optional
3325
+ :return: Returns the result object.
3326
+ """ # noqa: E501
3327
+
3328
+ _param = self._set_default_llm_endpoint_v2_serialize(
3329
+ id=id,
3330
+ _request_auth=_request_auth,
3331
+ _content_type=_content_type,
3332
+ _headers=_headers,
3333
+ _host_index=_host_index
3334
+ )
3335
+
3336
+ _response_types_map: Dict[str, Optional[str]] = {
3337
+ '200': "object",
3338
+ '404': None,
3339
+ '422': "HTTPValidationError",
3340
+ }
3341
+ response_data = self.api_client.call_api(
3342
+ *_param,
3343
+ _request_timeout=_request_timeout
3344
+ )
3345
+ response_data.read()
3346
+ return self.api_client.response_deserialize(
3347
+ response_data=response_data,
3348
+ response_types_map=_response_types_map,
3349
+ ).data
3350
+
3351
+
3352
+ @validate_call
3353
+ def set_default_llm_endpoint_v2_with_http_info(
3354
+ self,
3355
+ id: StrictInt,
3356
+ _request_timeout: Union[
3357
+ None,
3358
+ Annotated[StrictFloat, Field(gt=0)],
3359
+ Tuple[
3360
+ Annotated[StrictFloat, Field(gt=0)],
3361
+ Annotated[StrictFloat, Field(gt=0)]
3362
+ ]
3363
+ ] = None,
3364
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3365
+ _content_type: Optional[StrictStr] = None,
3366
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3367
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3368
+ ) -> ApiResponse[object]:
3369
+ """Set Default Llm Endpoint V2
3370
+
3371
+
3372
+ :param id: (required)
3373
+ :type id: int
3374
+ :param _request_timeout: timeout setting for this request. If one
3375
+ number provided, it will be total request
3376
+ timeout. It can also be a pair (tuple) of
3377
+ (connection, read) timeouts.
3378
+ :type _request_timeout: int, tuple(int, int), optional
3379
+ :param _request_auth: set to override the auth_settings for an a single
3380
+ request; this effectively ignores the
3381
+ authentication in the spec for a single request.
3382
+ :type _request_auth: dict, optional
3383
+ :param _content_type: force content-type for the request.
3384
+ :type _content_type: str, Optional
3385
+ :param _headers: set to override the headers for a single
3386
+ request; this effectively ignores the headers
3387
+ in the spec for a single request.
3388
+ :type _headers: dict, optional
3389
+ :param _host_index: set to override the host_index for a single
3390
+ request; this effectively ignores the host_index
3391
+ in the spec for a single request.
3392
+ :type _host_index: int, optional
3393
+ :return: Returns the result object.
3394
+ """ # noqa: E501
3395
+
3396
+ _param = self._set_default_llm_endpoint_v2_serialize(
3397
+ id=id,
3398
+ _request_auth=_request_auth,
3399
+ _content_type=_content_type,
3400
+ _headers=_headers,
3401
+ _host_index=_host_index
3402
+ )
3403
+
3404
+ _response_types_map: Dict[str, Optional[str]] = {
3405
+ '200': "object",
3406
+ '404': None,
3407
+ '422': "HTTPValidationError",
3408
+ }
3409
+ response_data = self.api_client.call_api(
3410
+ *_param,
3411
+ _request_timeout=_request_timeout
3412
+ )
3413
+ response_data.read()
3414
+ return self.api_client.response_deserialize(
3415
+ response_data=response_data,
3416
+ response_types_map=_response_types_map,
3417
+ )
3418
+
3419
+
3420
+ @validate_call
3421
+ def set_default_llm_endpoint_v2_without_preload_content(
3422
+ self,
3423
+ id: StrictInt,
3424
+ _request_timeout: Union[
3425
+ None,
3426
+ Annotated[StrictFloat, Field(gt=0)],
3427
+ Tuple[
3428
+ Annotated[StrictFloat, Field(gt=0)],
3429
+ Annotated[StrictFloat, Field(gt=0)]
3430
+ ]
3431
+ ] = None,
3432
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3433
+ _content_type: Optional[StrictStr] = None,
3434
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3435
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3436
+ ) -> RESTResponseType:
3437
+ """Set Default Llm Endpoint V2
3438
+
3439
+
3440
+ :param id: (required)
3441
+ :type id: int
3442
+ :param _request_timeout: timeout setting for this request. If one
3443
+ number provided, it will be total request
3444
+ timeout. It can also be a pair (tuple) of
3445
+ (connection, read) timeouts.
3446
+ :type _request_timeout: int, tuple(int, int), optional
3447
+ :param _request_auth: set to override the auth_settings for an a single
3448
+ request; this effectively ignores the
3449
+ authentication in the spec for a single request.
3450
+ :type _request_auth: dict, optional
3451
+ :param _content_type: force content-type for the request.
3452
+ :type _content_type: str, Optional
3453
+ :param _headers: set to override the headers for a single
3454
+ request; this effectively ignores the headers
3455
+ in the spec for a single request.
3456
+ :type _headers: dict, optional
3457
+ :param _host_index: set to override the host_index for a single
3458
+ request; this effectively ignores the host_index
3459
+ in the spec for a single request.
3460
+ :type _host_index: int, optional
3461
+ :return: Returns the result object.
3462
+ """ # noqa: E501
3463
+
3464
+ _param = self._set_default_llm_endpoint_v2_serialize(
3465
+ id=id,
3466
+ _request_auth=_request_auth,
3467
+ _content_type=_content_type,
3468
+ _headers=_headers,
3469
+ _host_index=_host_index
3470
+ )
3471
+
3472
+ _response_types_map: Dict[str, Optional[str]] = {
3473
+ '200': "object",
3474
+ '404': None,
3475
+ '422': "HTTPValidationError",
3476
+ }
3477
+ response_data = self.api_client.call_api(
3478
+ *_param,
3479
+ _request_timeout=_request_timeout
3480
+ )
3481
+ return response_data.response
3482
+
3483
+
3484
+ def _set_default_llm_endpoint_v2_serialize(
3485
+ self,
3486
+ id,
3487
+ _request_auth,
3488
+ _content_type,
3489
+ _headers,
3490
+ _host_index,
3491
+ ) -> RequestSerialized:
3492
+
3493
+ _host = None
3494
+
3495
+ _collection_formats: Dict[str, str] = {
3496
+ }
3497
+
3498
+ _path_params: Dict[str, str] = {}
3499
+ _query_params: List[Tuple[str, str]] = []
3500
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3501
+ _form_params: List[Tuple[str, str]] = []
3502
+ _files: Dict[
3503
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3504
+ ] = {}
3505
+ _body_params: Optional[bytes] = None
3506
+
3507
+ # process the path parameters
3508
+ if id is not None:
3509
+ _path_params['id'] = id
3510
+ # process the query parameters
3511
+ # process the header parameters
3512
+ # process the form parameters
3513
+ # process the body parameter
3514
+
3515
+
3516
+ # set the HTTP header `Accept`
3517
+ if 'Accept' not in _header_params:
3518
+ _header_params['Accept'] = self.api_client.select_header_accept(
3519
+ [
3520
+ 'application/json'
3521
+ ]
3522
+ )
3523
+
3524
+
3525
+ # authentication setting
3526
+ _auth_settings: List[str] = [
3527
+ 'QAnswer-Api-Key',
3528
+ 'Bearer token'
3529
+ ]
3530
+
3531
+ return self.api_client.param_serialize(
3532
+ method='PUT',
3533
+ resource_path='/backend/api/llm-endpoint/{id}/default',
3534
+ path_params=_path_params,
3535
+ query_params=_query_params,
3536
+ header_params=_header_params,
3537
+ body=_body_params,
3538
+ post_params=_form_params,
3539
+ files=_files,
3540
+ auth_settings=_auth_settings,
3541
+ collection_formats=_collection_formats,
3542
+ _host=_host,
3543
+ _request_auth=_request_auth
3544
+ )
3545
+
3546
+
3547
+
3548
+
3549
+ @validate_call
3550
+ def update_llm_endpoint_v2(
3551
+ self,
3552
+ id: StrictInt,
3553
+ llm_endpoint_update: LLMEndpointUpdate,
3554
+ _request_timeout: Union[
3555
+ None,
3556
+ Annotated[StrictFloat, Field(gt=0)],
3557
+ Tuple[
3558
+ Annotated[StrictFloat, Field(gt=0)],
3559
+ Annotated[StrictFloat, Field(gt=0)]
3560
+ ]
3561
+ ] = None,
3562
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3563
+ _content_type: Optional[StrictStr] = None,
3564
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3565
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3566
+ ) -> LLMEndpoint:
3567
+ """Update Llm Endpoint V2
3568
+
3569
+
3570
+ :param id: (required)
3571
+ :type id: int
3572
+ :param llm_endpoint_update: (required)
3573
+ :type llm_endpoint_update: LLMEndpointUpdate
3574
+ :param _request_timeout: timeout setting for this request. If one
3575
+ number provided, it will be total request
3576
+ timeout. It can also be a pair (tuple) of
3577
+ (connection, read) timeouts.
3578
+ :type _request_timeout: int, tuple(int, int), optional
3579
+ :param _request_auth: set to override the auth_settings for an a single
3580
+ request; this effectively ignores the
3581
+ authentication in the spec for a single request.
3582
+ :type _request_auth: dict, optional
3583
+ :param _content_type: force content-type for the request.
3584
+ :type _content_type: str, Optional
3585
+ :param _headers: set to override the headers for a single
3586
+ request; this effectively ignores the headers
3587
+ in the spec for a single request.
3588
+ :type _headers: dict, optional
3589
+ :param _host_index: set to override the host_index for a single
3590
+ request; this effectively ignores the host_index
3591
+ in the spec for a single request.
3592
+ :type _host_index: int, optional
3593
+ :return: Returns the result object.
3594
+ """ # noqa: E501
3595
+
3596
+ _param = self._update_llm_endpoint_v2_serialize(
3597
+ id=id,
3598
+ llm_endpoint_update=llm_endpoint_update,
3599
+ _request_auth=_request_auth,
3600
+ _content_type=_content_type,
3601
+ _headers=_headers,
3602
+ _host_index=_host_index
3603
+ )
3604
+
3605
+ _response_types_map: Dict[str, Optional[str]] = {
3606
+ '200': "LLMEndpoint",
3607
+ '404': None,
3608
+ '422': "HTTPValidationError",
3609
+ }
3610
+ response_data = self.api_client.call_api(
3611
+ *_param,
3612
+ _request_timeout=_request_timeout
3613
+ )
3614
+ response_data.read()
3615
+ return self.api_client.response_deserialize(
3616
+ response_data=response_data,
3617
+ response_types_map=_response_types_map,
3618
+ ).data
3619
+
3620
+
3621
+ @validate_call
3622
+ def update_llm_endpoint_v2_with_http_info(
3623
+ self,
3624
+ id: StrictInt,
3625
+ llm_endpoint_update: LLMEndpointUpdate,
3626
+ _request_timeout: Union[
3627
+ None,
3628
+ Annotated[StrictFloat, Field(gt=0)],
3629
+ Tuple[
3630
+ Annotated[StrictFloat, Field(gt=0)],
3631
+ Annotated[StrictFloat, Field(gt=0)]
3632
+ ]
3633
+ ] = None,
3634
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3635
+ _content_type: Optional[StrictStr] = None,
3636
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3637
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3638
+ ) -> ApiResponse[LLMEndpoint]:
3639
+ """Update Llm Endpoint V2
3640
+
3641
+
3642
+ :param id: (required)
3643
+ :type id: int
3644
+ :param llm_endpoint_update: (required)
3645
+ :type llm_endpoint_update: LLMEndpointUpdate
3646
+ :param _request_timeout: timeout setting for this request. If one
3647
+ number provided, it will be total request
3648
+ timeout. It can also be a pair (tuple) of
3649
+ (connection, read) timeouts.
3650
+ :type _request_timeout: int, tuple(int, int), optional
3651
+ :param _request_auth: set to override the auth_settings for an a single
3652
+ request; this effectively ignores the
3653
+ authentication in the spec for a single request.
3654
+ :type _request_auth: dict, optional
3655
+ :param _content_type: force content-type for the request.
3656
+ :type _content_type: str, Optional
3657
+ :param _headers: set to override the headers for a single
3658
+ request; this effectively ignores the headers
3659
+ in the spec for a single request.
3660
+ :type _headers: dict, optional
3661
+ :param _host_index: set to override the host_index for a single
3662
+ request; this effectively ignores the host_index
3663
+ in the spec for a single request.
3664
+ :type _host_index: int, optional
3665
+ :return: Returns the result object.
3666
+ """ # noqa: E501
3667
+
3668
+ _param = self._update_llm_endpoint_v2_serialize(
3669
+ id=id,
3670
+ llm_endpoint_update=llm_endpoint_update,
3671
+ _request_auth=_request_auth,
3672
+ _content_type=_content_type,
3673
+ _headers=_headers,
3674
+ _host_index=_host_index
3675
+ )
3676
+
3677
+ _response_types_map: Dict[str, Optional[str]] = {
3678
+ '200': "LLMEndpoint",
3679
+ '404': None,
3680
+ '422': "HTTPValidationError",
3681
+ }
3682
+ response_data = self.api_client.call_api(
3683
+ *_param,
3684
+ _request_timeout=_request_timeout
3685
+ )
3686
+ response_data.read()
3687
+ return self.api_client.response_deserialize(
3688
+ response_data=response_data,
3689
+ response_types_map=_response_types_map,
3690
+ )
3691
+
3692
+
3693
+ @validate_call
3694
+ def update_llm_endpoint_v2_without_preload_content(
3695
+ self,
3696
+ id: StrictInt,
3697
+ llm_endpoint_update: LLMEndpointUpdate,
3698
+ _request_timeout: Union[
3699
+ None,
3700
+ Annotated[StrictFloat, Field(gt=0)],
3701
+ Tuple[
3702
+ Annotated[StrictFloat, Field(gt=0)],
3703
+ Annotated[StrictFloat, Field(gt=0)]
3704
+ ]
3705
+ ] = None,
3706
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3707
+ _content_type: Optional[StrictStr] = None,
3708
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3709
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3710
+ ) -> RESTResponseType:
3711
+ """Update Llm Endpoint V2
3712
+
3713
+
3714
+ :param id: (required)
3715
+ :type id: int
3716
+ :param llm_endpoint_update: (required)
3717
+ :type llm_endpoint_update: LLMEndpointUpdate
3718
+ :param _request_timeout: timeout setting for this request. If one
3719
+ number provided, it will be total request
3720
+ timeout. It can also be a pair (tuple) of
3721
+ (connection, read) timeouts.
3722
+ :type _request_timeout: int, tuple(int, int), optional
3723
+ :param _request_auth: set to override the auth_settings for an a single
3724
+ request; this effectively ignores the
3725
+ authentication in the spec for a single request.
3726
+ :type _request_auth: dict, optional
3727
+ :param _content_type: force content-type for the request.
3728
+ :type _content_type: str, Optional
3729
+ :param _headers: set to override the headers for a single
3730
+ request; this effectively ignores the headers
3731
+ in the spec for a single request.
3732
+ :type _headers: dict, optional
3733
+ :param _host_index: set to override the host_index for a single
3734
+ request; this effectively ignores the host_index
3735
+ in the spec for a single request.
3736
+ :type _host_index: int, optional
3737
+ :return: Returns the result object.
3738
+ """ # noqa: E501
3739
+
3740
+ _param = self._update_llm_endpoint_v2_serialize(
3741
+ id=id,
3742
+ llm_endpoint_update=llm_endpoint_update,
3743
+ _request_auth=_request_auth,
3744
+ _content_type=_content_type,
3745
+ _headers=_headers,
3746
+ _host_index=_host_index
3747
+ )
3748
+
3749
+ _response_types_map: Dict[str, Optional[str]] = {
3750
+ '200': "LLMEndpoint",
3751
+ '404': None,
3752
+ '422': "HTTPValidationError",
3753
+ }
3754
+ response_data = self.api_client.call_api(
3755
+ *_param,
3756
+ _request_timeout=_request_timeout
3757
+ )
3758
+ return response_data.response
3759
+
3760
+
3761
+ def _update_llm_endpoint_v2_serialize(
3762
+ self,
3763
+ id,
3764
+ llm_endpoint_update,
3765
+ _request_auth,
3766
+ _content_type,
3767
+ _headers,
3768
+ _host_index,
3769
+ ) -> RequestSerialized:
3770
+
3771
+ _host = None
3772
+
3773
+ _collection_formats: Dict[str, str] = {
3774
+ }
3775
+
3776
+ _path_params: Dict[str, str] = {}
3777
+ _query_params: List[Tuple[str, str]] = []
3778
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3779
+ _form_params: List[Tuple[str, str]] = []
3780
+ _files: Dict[
3781
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3782
+ ] = {}
3783
+ _body_params: Optional[bytes] = None
3784
+
3785
+ # process the path parameters
3786
+ if id is not None:
3787
+ _path_params['id'] = id
3788
+ # process the query parameters
3789
+ # process the header parameters
3790
+ # process the form parameters
3791
+ # process the body parameter
3792
+ if llm_endpoint_update is not None:
3793
+ _body_params = llm_endpoint_update
3794
+
3795
+
3796
+ # set the HTTP header `Accept`
3797
+ if 'Accept' not in _header_params:
3798
+ _header_params['Accept'] = self.api_client.select_header_accept(
3799
+ [
3800
+ 'application/json'
3801
+ ]
3802
+ )
3803
+
3804
+ # set the HTTP header `Content-Type`
3805
+ if _content_type:
3806
+ _header_params['Content-Type'] = _content_type
3807
+ else:
3808
+ _default_content_type = (
3809
+ self.api_client.select_header_content_type(
3810
+ [
3811
+ 'application/json'
3812
+ ]
3813
+ )
3814
+ )
3815
+ if _default_content_type is not None:
3816
+ _header_params['Content-Type'] = _default_content_type
3817
+
3818
+ # authentication setting
3819
+ _auth_settings: List[str] = [
3820
+ 'QAnswer-Api-Key',
3821
+ 'Bearer token'
3822
+ ]
3823
+
3824
+ return self.api_client.param_serialize(
3825
+ method='PUT',
3826
+ resource_path='/backend/api/llm-endpoint/{id}',
3827
+ path_params=_path_params,
3828
+ query_params=_query_params,
3829
+ header_params=_header_params,
3830
+ body=_body_params,
3831
+ post_params=_form_params,
3832
+ files=_files,
3833
+ auth_settings=_auth_settings,
3834
+ collection_formats=_collection_formats,
3835
+ _host=_host,
3836
+ _request_auth=_request_auth
3837
+ )
3838
+
3839
+
3840
+
3841
+
3842
+ @validate_call
3843
+ def validate_llm_endpoint_before_creation_in_db(
3844
+ self,
3845
+ llm_endpoint_input: LLMEndpointInput,
3846
+ _request_timeout: Union[
3847
+ None,
3848
+ Annotated[StrictFloat, Field(gt=0)],
3849
+ Tuple[
3850
+ Annotated[StrictFloat, Field(gt=0)],
3851
+ Annotated[StrictFloat, Field(gt=0)]
3852
+ ]
3853
+ ] = None,
3854
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3855
+ _content_type: Optional[StrictStr] = None,
3856
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3857
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3858
+ ) -> LLMEndpointValidationResponse:
3859
+ """Validate Llm Endpoint Before Creation In Db
3860
+
3861
+
3862
+ :param llm_endpoint_input: (required)
3863
+ :type llm_endpoint_input: LLMEndpointInput
3864
+ :param _request_timeout: timeout setting for this request. If one
3865
+ number provided, it will be total request
3866
+ timeout. It can also be a pair (tuple) of
3867
+ (connection, read) timeouts.
3868
+ :type _request_timeout: int, tuple(int, int), optional
3869
+ :param _request_auth: set to override the auth_settings for an a single
3870
+ request; this effectively ignores the
3871
+ authentication in the spec for a single request.
3872
+ :type _request_auth: dict, optional
3873
+ :param _content_type: force content-type for the request.
3874
+ :type _content_type: str, Optional
3875
+ :param _headers: set to override the headers for a single
3876
+ request; this effectively ignores the headers
3877
+ in the spec for a single request.
3878
+ :type _headers: dict, optional
3879
+ :param _host_index: set to override the host_index for a single
3880
+ request; this effectively ignores the host_index
3881
+ in the spec for a single request.
3882
+ :type _host_index: int, optional
3883
+ :return: Returns the result object.
3884
+ """ # noqa: E501
3885
+
3886
+ _param = self._validate_llm_endpoint_before_creation_in_db_serialize(
3887
+ llm_endpoint_input=llm_endpoint_input,
3888
+ _request_auth=_request_auth,
3889
+ _content_type=_content_type,
3890
+ _headers=_headers,
3891
+ _host_index=_host_index
3892
+ )
3893
+
3894
+ _response_types_map: Dict[str, Optional[str]] = {
3895
+ '200': "LLMEndpointValidationResponse",
3896
+ '404': None,
3897
+ '422': "HTTPValidationError",
3898
+ }
3899
+ response_data = self.api_client.call_api(
3900
+ *_param,
3901
+ _request_timeout=_request_timeout
3902
+ )
3903
+ response_data.read()
3904
+ return self.api_client.response_deserialize(
3905
+ response_data=response_data,
3906
+ response_types_map=_response_types_map,
3907
+ ).data
3908
+
3909
+
3910
+ @validate_call
3911
+ def validate_llm_endpoint_before_creation_in_db_with_http_info(
3912
+ self,
3913
+ llm_endpoint_input: LLMEndpointInput,
3914
+ _request_timeout: Union[
3915
+ None,
3916
+ Annotated[StrictFloat, Field(gt=0)],
3917
+ Tuple[
3918
+ Annotated[StrictFloat, Field(gt=0)],
3919
+ Annotated[StrictFloat, Field(gt=0)]
3920
+ ]
3921
+ ] = None,
3922
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3923
+ _content_type: Optional[StrictStr] = None,
3924
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3925
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3926
+ ) -> ApiResponse[LLMEndpointValidationResponse]:
3927
+ """Validate Llm Endpoint Before Creation In Db
3928
+
3929
+
3930
+ :param llm_endpoint_input: (required)
3931
+ :type llm_endpoint_input: LLMEndpointInput
3932
+ :param _request_timeout: timeout setting for this request. If one
3933
+ number provided, it will be total request
3934
+ timeout. It can also be a pair (tuple) of
3935
+ (connection, read) timeouts.
3936
+ :type _request_timeout: int, tuple(int, int), optional
3937
+ :param _request_auth: set to override the auth_settings for an a single
3938
+ request; this effectively ignores the
3939
+ authentication in the spec for a single request.
3940
+ :type _request_auth: dict, optional
3941
+ :param _content_type: force content-type for the request.
3942
+ :type _content_type: str, Optional
3943
+ :param _headers: set to override the headers for a single
3944
+ request; this effectively ignores the headers
3945
+ in the spec for a single request.
3946
+ :type _headers: dict, optional
3947
+ :param _host_index: set to override the host_index for a single
3948
+ request; this effectively ignores the host_index
3949
+ in the spec for a single request.
3950
+ :type _host_index: int, optional
3951
+ :return: Returns the result object.
3952
+ """ # noqa: E501
3953
+
3954
+ _param = self._validate_llm_endpoint_before_creation_in_db_serialize(
3955
+ llm_endpoint_input=llm_endpoint_input,
3956
+ _request_auth=_request_auth,
3957
+ _content_type=_content_type,
3958
+ _headers=_headers,
3959
+ _host_index=_host_index
3960
+ )
3961
+
3962
+ _response_types_map: Dict[str, Optional[str]] = {
3963
+ '200': "LLMEndpointValidationResponse",
3964
+ '404': None,
3965
+ '422': "HTTPValidationError",
3966
+ }
3967
+ response_data = self.api_client.call_api(
3968
+ *_param,
3969
+ _request_timeout=_request_timeout
3970
+ )
3971
+ response_data.read()
3972
+ return self.api_client.response_deserialize(
3973
+ response_data=response_data,
3974
+ response_types_map=_response_types_map,
3975
+ )
3976
+
3977
+
3978
+ @validate_call
3979
+ def validate_llm_endpoint_before_creation_in_db_without_preload_content(
3980
+ self,
3981
+ llm_endpoint_input: LLMEndpointInput,
3982
+ _request_timeout: Union[
3983
+ None,
3984
+ Annotated[StrictFloat, Field(gt=0)],
3985
+ Tuple[
3986
+ Annotated[StrictFloat, Field(gt=0)],
3987
+ Annotated[StrictFloat, Field(gt=0)]
3988
+ ]
3989
+ ] = None,
3990
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3991
+ _content_type: Optional[StrictStr] = None,
3992
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3993
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3994
+ ) -> RESTResponseType:
3995
+ """Validate Llm Endpoint Before Creation In Db
3996
+
3997
+
3998
+ :param llm_endpoint_input: (required)
3999
+ :type llm_endpoint_input: LLMEndpointInput
4000
+ :param _request_timeout: timeout setting for this request. If one
4001
+ number provided, it will be total request
4002
+ timeout. It can also be a pair (tuple) of
4003
+ (connection, read) timeouts.
4004
+ :type _request_timeout: int, tuple(int, int), optional
4005
+ :param _request_auth: set to override the auth_settings for an a single
4006
+ request; this effectively ignores the
4007
+ authentication in the spec for a single request.
4008
+ :type _request_auth: dict, optional
4009
+ :param _content_type: force content-type for the request.
4010
+ :type _content_type: str, Optional
4011
+ :param _headers: set to override the headers for a single
4012
+ request; this effectively ignores the headers
4013
+ in the spec for a single request.
4014
+ :type _headers: dict, optional
4015
+ :param _host_index: set to override the host_index for a single
4016
+ request; this effectively ignores the host_index
4017
+ in the spec for a single request.
4018
+ :type _host_index: int, optional
4019
+ :return: Returns the result object.
4020
+ """ # noqa: E501
4021
+
4022
+ _param = self._validate_llm_endpoint_before_creation_in_db_serialize(
4023
+ llm_endpoint_input=llm_endpoint_input,
4024
+ _request_auth=_request_auth,
4025
+ _content_type=_content_type,
4026
+ _headers=_headers,
4027
+ _host_index=_host_index
4028
+ )
4029
+
4030
+ _response_types_map: Dict[str, Optional[str]] = {
4031
+ '200': "LLMEndpointValidationResponse",
4032
+ '404': None,
4033
+ '422': "HTTPValidationError",
4034
+ }
4035
+ response_data = self.api_client.call_api(
4036
+ *_param,
4037
+ _request_timeout=_request_timeout
4038
+ )
4039
+ return response_data.response
4040
+
4041
+
4042
+ def _validate_llm_endpoint_before_creation_in_db_serialize(
4043
+ self,
4044
+ llm_endpoint_input,
4045
+ _request_auth,
4046
+ _content_type,
4047
+ _headers,
4048
+ _host_index,
4049
+ ) -> RequestSerialized:
4050
+
4051
+ _host = None
4052
+
4053
+ _collection_formats: Dict[str, str] = {
4054
+ }
4055
+
4056
+ _path_params: Dict[str, str] = {}
4057
+ _query_params: List[Tuple[str, str]] = []
4058
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4059
+ _form_params: List[Tuple[str, str]] = []
4060
+ _files: Dict[
4061
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4062
+ ] = {}
4063
+ _body_params: Optional[bytes] = None
4064
+
4065
+ # process the path parameters
4066
+ # process the query parameters
4067
+ # process the header parameters
4068
+ # process the form parameters
4069
+ # process the body parameter
4070
+ if llm_endpoint_input is not None:
4071
+ _body_params = llm_endpoint_input
4072
+
4073
+
4074
+ # set the HTTP header `Accept`
4075
+ if 'Accept' not in _header_params:
4076
+ _header_params['Accept'] = self.api_client.select_header_accept(
4077
+ [
4078
+ 'application/json'
4079
+ ]
4080
+ )
4081
+
4082
+ # set the HTTP header `Content-Type`
4083
+ if _content_type:
4084
+ _header_params['Content-Type'] = _content_type
4085
+ else:
4086
+ _default_content_type = (
4087
+ self.api_client.select_header_content_type(
4088
+ [
4089
+ 'application/json'
4090
+ ]
4091
+ )
4092
+ )
4093
+ if _default_content_type is not None:
4094
+ _header_params['Content-Type'] = _default_content_type
4095
+
4096
+ # authentication setting
4097
+ _auth_settings: List[str] = [
4098
+ 'QAnswer-Api-Key',
4099
+ 'Bearer token'
4100
+ ]
4101
+
4102
+ return self.api_client.param_serialize(
4103
+ method='POST',
4104
+ resource_path='/backend/api/llm-endpoint/validate-before-creation',
4105
+ path_params=_path_params,
4106
+ query_params=_query_params,
4107
+ header_params=_header_params,
4108
+ body=_body_params,
4109
+ post_params=_form_params,
4110
+ files=_files,
4111
+ auth_settings=_auth_settings,
4112
+ collection_formats=_collection_formats,
4113
+ _host=_host,
4114
+ _request_auth=_request_auth
4115
+ )
4116
+
4117
+
4118
+
4119
+
4120
+ @validate_call
4121
+ def validate_llm_endpoint_names(
4122
+ self,
4123
+ llm_endpoint_names_validation_payload: LLMEndpointNamesValidationPayload,
4124
+ _request_timeout: Union[
4125
+ None,
4126
+ Annotated[StrictFloat, Field(gt=0)],
4127
+ Tuple[
4128
+ Annotated[StrictFloat, Field(gt=0)],
4129
+ Annotated[StrictFloat, Field(gt=0)]
4130
+ ]
4131
+ ] = None,
4132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4133
+ _content_type: Optional[StrictStr] = None,
4134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4136
+ ) -> bool:
4137
+ """Validate Llm Endpoint Names
4138
+
4139
+
4140
+ :param llm_endpoint_names_validation_payload: (required)
4141
+ :type llm_endpoint_names_validation_payload: LLMEndpointNamesValidationPayload
4142
+ :param _request_timeout: timeout setting for this request. If one
4143
+ number provided, it will be total request
4144
+ timeout. It can also be a pair (tuple) of
4145
+ (connection, read) timeouts.
4146
+ :type _request_timeout: int, tuple(int, int), optional
4147
+ :param _request_auth: set to override the auth_settings for an a single
4148
+ request; this effectively ignores the
4149
+ authentication in the spec for a single request.
4150
+ :type _request_auth: dict, optional
4151
+ :param _content_type: force content-type for the request.
4152
+ :type _content_type: str, Optional
4153
+ :param _headers: set to override the headers for a single
4154
+ request; this effectively ignores the headers
4155
+ in the spec for a single request.
4156
+ :type _headers: dict, optional
4157
+ :param _host_index: set to override the host_index for a single
4158
+ request; this effectively ignores the host_index
4159
+ in the spec for a single request.
4160
+ :type _host_index: int, optional
4161
+ :return: Returns the result object.
4162
+ """ # noqa: E501
4163
+
4164
+ _param = self._validate_llm_endpoint_names_serialize(
4165
+ llm_endpoint_names_validation_payload=llm_endpoint_names_validation_payload,
4166
+ _request_auth=_request_auth,
4167
+ _content_type=_content_type,
4168
+ _headers=_headers,
4169
+ _host_index=_host_index
4170
+ )
4171
+
4172
+ _response_types_map: Dict[str, Optional[str]] = {
4173
+ '200': "bool",
4174
+ '404': None,
4175
+ '422': "HTTPValidationError",
4176
+ }
4177
+ response_data = self.api_client.call_api(
4178
+ *_param,
4179
+ _request_timeout=_request_timeout
4180
+ )
4181
+ response_data.read()
4182
+ return self.api_client.response_deserialize(
4183
+ response_data=response_data,
4184
+ response_types_map=_response_types_map,
4185
+ ).data
4186
+
4187
+
4188
+ @validate_call
4189
+ def validate_llm_endpoint_names_with_http_info(
4190
+ self,
4191
+ llm_endpoint_names_validation_payload: LLMEndpointNamesValidationPayload,
4192
+ _request_timeout: Union[
4193
+ None,
4194
+ Annotated[StrictFloat, Field(gt=0)],
4195
+ Tuple[
4196
+ Annotated[StrictFloat, Field(gt=0)],
4197
+ Annotated[StrictFloat, Field(gt=0)]
4198
+ ]
4199
+ ] = None,
4200
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4201
+ _content_type: Optional[StrictStr] = None,
4202
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4203
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4204
+ ) -> ApiResponse[bool]:
4205
+ """Validate Llm Endpoint Names
4206
+
4207
+
4208
+ :param llm_endpoint_names_validation_payload: (required)
4209
+ :type llm_endpoint_names_validation_payload: LLMEndpointNamesValidationPayload
4210
+ :param _request_timeout: timeout setting for this request. If one
4211
+ number provided, it will be total request
4212
+ timeout. It can also be a pair (tuple) of
4213
+ (connection, read) timeouts.
4214
+ :type _request_timeout: int, tuple(int, int), optional
4215
+ :param _request_auth: set to override the auth_settings for an a single
4216
+ request; this effectively ignores the
4217
+ authentication in the spec for a single request.
4218
+ :type _request_auth: dict, optional
4219
+ :param _content_type: force content-type for the request.
4220
+ :type _content_type: str, Optional
4221
+ :param _headers: set to override the headers for a single
4222
+ request; this effectively ignores the headers
4223
+ in the spec for a single request.
4224
+ :type _headers: dict, optional
4225
+ :param _host_index: set to override the host_index for a single
4226
+ request; this effectively ignores the host_index
4227
+ in the spec for a single request.
4228
+ :type _host_index: int, optional
4229
+ :return: Returns the result object.
4230
+ """ # noqa: E501
4231
+
4232
+ _param = self._validate_llm_endpoint_names_serialize(
4233
+ llm_endpoint_names_validation_payload=llm_endpoint_names_validation_payload,
4234
+ _request_auth=_request_auth,
4235
+ _content_type=_content_type,
4236
+ _headers=_headers,
4237
+ _host_index=_host_index
4238
+ )
4239
+
4240
+ _response_types_map: Dict[str, Optional[str]] = {
4241
+ '200': "bool",
4242
+ '404': None,
4243
+ '422': "HTTPValidationError",
4244
+ }
4245
+ response_data = self.api_client.call_api(
4246
+ *_param,
4247
+ _request_timeout=_request_timeout
4248
+ )
4249
+ response_data.read()
4250
+ return self.api_client.response_deserialize(
4251
+ response_data=response_data,
4252
+ response_types_map=_response_types_map,
4253
+ )
4254
+
4255
+
4256
+ @validate_call
4257
+ def validate_llm_endpoint_names_without_preload_content(
4258
+ self,
4259
+ llm_endpoint_names_validation_payload: LLMEndpointNamesValidationPayload,
4260
+ _request_timeout: Union[
4261
+ None,
4262
+ Annotated[StrictFloat, Field(gt=0)],
4263
+ Tuple[
4264
+ Annotated[StrictFloat, Field(gt=0)],
4265
+ Annotated[StrictFloat, Field(gt=0)]
4266
+ ]
4267
+ ] = None,
4268
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4269
+ _content_type: Optional[StrictStr] = None,
4270
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4271
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4272
+ ) -> RESTResponseType:
4273
+ """Validate Llm Endpoint Names
4274
+
4275
+
4276
+ :param llm_endpoint_names_validation_payload: (required)
4277
+ :type llm_endpoint_names_validation_payload: LLMEndpointNamesValidationPayload
4278
+ :param _request_timeout: timeout setting for this request. If one
4279
+ number provided, it will be total request
4280
+ timeout. It can also be a pair (tuple) of
4281
+ (connection, read) timeouts.
4282
+ :type _request_timeout: int, tuple(int, int), optional
4283
+ :param _request_auth: set to override the auth_settings for an a single
4284
+ request; this effectively ignores the
4285
+ authentication in the spec for a single request.
4286
+ :type _request_auth: dict, optional
4287
+ :param _content_type: force content-type for the request.
4288
+ :type _content_type: str, Optional
4289
+ :param _headers: set to override the headers for a single
4290
+ request; this effectively ignores the headers
4291
+ in the spec for a single request.
4292
+ :type _headers: dict, optional
4293
+ :param _host_index: set to override the host_index for a single
4294
+ request; this effectively ignores the host_index
4295
+ in the spec for a single request.
4296
+ :type _host_index: int, optional
4297
+ :return: Returns the result object.
4298
+ """ # noqa: E501
4299
+
4300
+ _param = self._validate_llm_endpoint_names_serialize(
4301
+ llm_endpoint_names_validation_payload=llm_endpoint_names_validation_payload,
4302
+ _request_auth=_request_auth,
4303
+ _content_type=_content_type,
4304
+ _headers=_headers,
4305
+ _host_index=_host_index
4306
+ )
4307
+
4308
+ _response_types_map: Dict[str, Optional[str]] = {
4309
+ '200': "bool",
4310
+ '404': None,
4311
+ '422': "HTTPValidationError",
4312
+ }
4313
+ response_data = self.api_client.call_api(
4314
+ *_param,
4315
+ _request_timeout=_request_timeout
4316
+ )
4317
+ return response_data.response
4318
+
4319
+
4320
+ def _validate_llm_endpoint_names_serialize(
4321
+ self,
4322
+ llm_endpoint_names_validation_payload,
4323
+ _request_auth,
4324
+ _content_type,
4325
+ _headers,
4326
+ _host_index,
4327
+ ) -> RequestSerialized:
4328
+
4329
+ _host = None
4330
+
4331
+ _collection_formats: Dict[str, str] = {
4332
+ }
4333
+
4334
+ _path_params: Dict[str, str] = {}
4335
+ _query_params: List[Tuple[str, str]] = []
4336
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4337
+ _form_params: List[Tuple[str, str]] = []
4338
+ _files: Dict[
4339
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4340
+ ] = {}
4341
+ _body_params: Optional[bytes] = None
4342
+
4343
+ # process the path parameters
4344
+ # process the query parameters
4345
+ # process the header parameters
4346
+ # process the form parameters
4347
+ # process the body parameter
4348
+ if llm_endpoint_names_validation_payload is not None:
4349
+ _body_params = llm_endpoint_names_validation_payload
4350
+
4351
+
4352
+ # set the HTTP header `Accept`
4353
+ if 'Accept' not in _header_params:
4354
+ _header_params['Accept'] = self.api_client.select_header_accept(
4355
+ [
4356
+ 'application/json'
4357
+ ]
4358
+ )
4359
+
4360
+ # set the HTTP header `Content-Type`
4361
+ if _content_type:
4362
+ _header_params['Content-Type'] = _content_type
4363
+ else:
4364
+ _default_content_type = (
4365
+ self.api_client.select_header_content_type(
4366
+ [
4367
+ 'application/json'
4368
+ ]
4369
+ )
4370
+ )
4371
+ if _default_content_type is not None:
4372
+ _header_params['Content-Type'] = _default_content_type
4373
+
4374
+ # authentication setting
4375
+ _auth_settings: List[str] = [
4376
+ 'QAnswer-Api-Key',
4377
+ 'Bearer token'
4378
+ ]
4379
+
4380
+ return self.api_client.param_serialize(
4381
+ method='POST',
4382
+ resource_path='/backend/api/llm-endpoint/validate-names',
4383
+ path_params=_path_params,
4384
+ query_params=_query_params,
4385
+ header_params=_header_params,
4386
+ body=_body_params,
4387
+ post_params=_form_params,
4388
+ files=_files,
4389
+ auth_settings=_auth_settings,
4390
+ collection_formats=_collection_formats,
4391
+ _host=_host,
4392
+ _request_auth=_request_auth
4393
+ )
4394
+
4395
+
4396
+
4397
+
4398
+ @validate_call
4399
+ def validate_llm_endpoint_v2(
4400
+ self,
4401
+ id: StrictInt,
4402
+ _request_timeout: Union[
4403
+ None,
4404
+ Annotated[StrictFloat, Field(gt=0)],
4405
+ Tuple[
4406
+ Annotated[StrictFloat, Field(gt=0)],
4407
+ Annotated[StrictFloat, Field(gt=0)]
4408
+ ]
4409
+ ] = None,
4410
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4411
+ _content_type: Optional[StrictStr] = None,
4412
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4413
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4414
+ ) -> LLMEndpointValidationResponse:
4415
+ """Validate Llm Endpoint V2
4416
+
4417
+
4418
+ :param id: (required)
4419
+ :type id: int
4420
+ :param _request_timeout: timeout setting for this request. If one
4421
+ number provided, it will be total request
4422
+ timeout. It can also be a pair (tuple) of
4423
+ (connection, read) timeouts.
4424
+ :type _request_timeout: int, tuple(int, int), optional
4425
+ :param _request_auth: set to override the auth_settings for an a single
4426
+ request; this effectively ignores the
4427
+ authentication in the spec for a single request.
4428
+ :type _request_auth: dict, optional
4429
+ :param _content_type: force content-type for the request.
4430
+ :type _content_type: str, Optional
4431
+ :param _headers: set to override the headers for a single
4432
+ request; this effectively ignores the headers
4433
+ in the spec for a single request.
4434
+ :type _headers: dict, optional
4435
+ :param _host_index: set to override the host_index for a single
4436
+ request; this effectively ignores the host_index
4437
+ in the spec for a single request.
4438
+ :type _host_index: int, optional
4439
+ :return: Returns the result object.
4440
+ """ # noqa: E501
4441
+
4442
+ _param = self._validate_llm_endpoint_v2_serialize(
4443
+ id=id,
4444
+ _request_auth=_request_auth,
4445
+ _content_type=_content_type,
4446
+ _headers=_headers,
4447
+ _host_index=_host_index
4448
+ )
4449
+
4450
+ _response_types_map: Dict[str, Optional[str]] = {
4451
+ '200': "LLMEndpointValidationResponse",
4452
+ '404': None,
4453
+ '422': "HTTPValidationError",
4454
+ }
4455
+ response_data = self.api_client.call_api(
4456
+ *_param,
4457
+ _request_timeout=_request_timeout
4458
+ )
4459
+ response_data.read()
4460
+ return self.api_client.response_deserialize(
4461
+ response_data=response_data,
4462
+ response_types_map=_response_types_map,
4463
+ ).data
4464
+
4465
+
4466
+ @validate_call
4467
+ def validate_llm_endpoint_v2_with_http_info(
4468
+ self,
4469
+ id: StrictInt,
4470
+ _request_timeout: Union[
4471
+ None,
4472
+ Annotated[StrictFloat, Field(gt=0)],
4473
+ Tuple[
4474
+ Annotated[StrictFloat, Field(gt=0)],
4475
+ Annotated[StrictFloat, Field(gt=0)]
4476
+ ]
4477
+ ] = None,
4478
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4479
+ _content_type: Optional[StrictStr] = None,
4480
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4481
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4482
+ ) -> ApiResponse[LLMEndpointValidationResponse]:
4483
+ """Validate Llm Endpoint V2
4484
+
4485
+
4486
+ :param id: (required)
4487
+ :type id: int
4488
+ :param _request_timeout: timeout setting for this request. If one
4489
+ number provided, it will be total request
4490
+ timeout. It can also be a pair (tuple) of
4491
+ (connection, read) timeouts.
4492
+ :type _request_timeout: int, tuple(int, int), optional
4493
+ :param _request_auth: set to override the auth_settings for an a single
4494
+ request; this effectively ignores the
4495
+ authentication in the spec for a single request.
4496
+ :type _request_auth: dict, optional
4497
+ :param _content_type: force content-type for the request.
4498
+ :type _content_type: str, Optional
4499
+ :param _headers: set to override the headers for a single
4500
+ request; this effectively ignores the headers
4501
+ in the spec for a single request.
4502
+ :type _headers: dict, optional
4503
+ :param _host_index: set to override the host_index for a single
4504
+ request; this effectively ignores the host_index
4505
+ in the spec for a single request.
4506
+ :type _host_index: int, optional
4507
+ :return: Returns the result object.
4508
+ """ # noqa: E501
4509
+
4510
+ _param = self._validate_llm_endpoint_v2_serialize(
4511
+ id=id,
4512
+ _request_auth=_request_auth,
4513
+ _content_type=_content_type,
4514
+ _headers=_headers,
4515
+ _host_index=_host_index
4516
+ )
4517
+
4518
+ _response_types_map: Dict[str, Optional[str]] = {
4519
+ '200': "LLMEndpointValidationResponse",
4520
+ '404': None,
4521
+ '422': "HTTPValidationError",
4522
+ }
4523
+ response_data = self.api_client.call_api(
4524
+ *_param,
4525
+ _request_timeout=_request_timeout
4526
+ )
4527
+ response_data.read()
4528
+ return self.api_client.response_deserialize(
4529
+ response_data=response_data,
4530
+ response_types_map=_response_types_map,
4531
+ )
4532
+
4533
+
4534
+ @validate_call
4535
+ def validate_llm_endpoint_v2_without_preload_content(
4536
+ self,
4537
+ id: StrictInt,
4538
+ _request_timeout: Union[
4539
+ None,
4540
+ Annotated[StrictFloat, Field(gt=0)],
4541
+ Tuple[
4542
+ Annotated[StrictFloat, Field(gt=0)],
4543
+ Annotated[StrictFloat, Field(gt=0)]
4544
+ ]
4545
+ ] = None,
4546
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4547
+ _content_type: Optional[StrictStr] = None,
4548
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4549
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4550
+ ) -> RESTResponseType:
4551
+ """Validate Llm Endpoint V2
4552
+
4553
+
4554
+ :param id: (required)
4555
+ :type id: int
4556
+ :param _request_timeout: timeout setting for this request. If one
4557
+ number provided, it will be total request
4558
+ timeout. It can also be a pair (tuple) of
4559
+ (connection, read) timeouts.
4560
+ :type _request_timeout: int, tuple(int, int), optional
4561
+ :param _request_auth: set to override the auth_settings for an a single
4562
+ request; this effectively ignores the
4563
+ authentication in the spec for a single request.
4564
+ :type _request_auth: dict, optional
4565
+ :param _content_type: force content-type for the request.
4566
+ :type _content_type: str, Optional
4567
+ :param _headers: set to override the headers for a single
4568
+ request; this effectively ignores the headers
4569
+ in the spec for a single request.
4570
+ :type _headers: dict, optional
4571
+ :param _host_index: set to override the host_index for a single
4572
+ request; this effectively ignores the host_index
4573
+ in the spec for a single request.
4574
+ :type _host_index: int, optional
4575
+ :return: Returns the result object.
4576
+ """ # noqa: E501
4577
+
4578
+ _param = self._validate_llm_endpoint_v2_serialize(
4579
+ id=id,
4580
+ _request_auth=_request_auth,
4581
+ _content_type=_content_type,
4582
+ _headers=_headers,
4583
+ _host_index=_host_index
4584
+ )
4585
+
4586
+ _response_types_map: Dict[str, Optional[str]] = {
4587
+ '200': "LLMEndpointValidationResponse",
4588
+ '404': None,
4589
+ '422': "HTTPValidationError",
4590
+ }
4591
+ response_data = self.api_client.call_api(
4592
+ *_param,
4593
+ _request_timeout=_request_timeout
4594
+ )
4595
+ return response_data.response
4596
+
4597
+
4598
+ def _validate_llm_endpoint_v2_serialize(
4599
+ self,
4600
+ id,
4601
+ _request_auth,
4602
+ _content_type,
4603
+ _headers,
4604
+ _host_index,
4605
+ ) -> RequestSerialized:
4606
+
4607
+ _host = None
4608
+
4609
+ _collection_formats: Dict[str, str] = {
4610
+ }
4611
+
4612
+ _path_params: Dict[str, str] = {}
4613
+ _query_params: List[Tuple[str, str]] = []
4614
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4615
+ _form_params: List[Tuple[str, str]] = []
4616
+ _files: Dict[
4617
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4618
+ ] = {}
4619
+ _body_params: Optional[bytes] = None
4620
+
4621
+ # process the path parameters
4622
+ if id is not None:
4623
+ _path_params['id'] = id
4624
+ # process the query parameters
4625
+ # process the header parameters
4626
+ # process the form parameters
4627
+ # process the body parameter
4628
+
4629
+
4630
+ # set the HTTP header `Accept`
4631
+ if 'Accept' not in _header_params:
4632
+ _header_params['Accept'] = self.api_client.select_header_accept(
4633
+ [
4634
+ 'application/json'
4635
+ ]
4636
+ )
4637
+
4638
+
4639
+ # authentication setting
4640
+ _auth_settings: List[str] = [
4641
+ 'QAnswer-Api-Key',
4642
+ 'Bearer token'
4643
+ ]
4644
+
4645
+ return self.api_client.param_serialize(
4646
+ method='POST',
4647
+ resource_path='/backend/api/llm-endpoint/validate/{id}',
4648
+ path_params=_path_params,
4649
+ query_params=_query_params,
4650
+ header_params=_header_params,
4651
+ body=_body_params,
4652
+ post_params=_form_params,
4653
+ files=_files,
4654
+ auth_settings=_auth_settings,
4655
+ collection_formats=_collection_formats,
4656
+ _host=_host,
4657
+ _request_auth=_request_auth
4658
+ )
4659
+
4660
+