shaped 2.0.1__py3-none-any.whl → 2.0.2__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 (323) hide show
  1. shaped/__init__.py +54 -4
  2. shaped/autogen/__init__.py +541 -66
  3. shaped/autogen/api/__init__.py +4 -3
  4. shaped/autogen/api/engine_api.py +1467 -0
  5. shaped/autogen/api/{dataset_api.py → query_api.py} +219 -194
  6. shaped/autogen/api/table_api.py +1494 -0
  7. shaped/autogen/api/{model_management_api.py → view_api.py} +179 -181
  8. shaped/autogen/api_client.py +15 -8
  9. shaped/autogen/configuration.py +20 -9
  10. shaped/autogen/exceptions.py +19 -2
  11. shaped/autogen/models/__init__.py +254 -52
  12. shaped/autogen/models/ai_enrichment_view_config.py +123 -0
  13. shaped/autogen/models/{path.py → algorithm.py} +19 -19
  14. shaped/autogen/models/amplitude_table_config.py +106 -0
  15. shaped/autogen/models/ascending.py +136 -0
  16. shaped/autogen/models/attn_dropout_prob.py +136 -0
  17. shaped/autogen/models/attribute_journey.py +124 -0
  18. shaped/autogen/models/attribute_value.py +178 -0
  19. shaped/autogen/models/autoscaling_config.py +95 -0
  20. shaped/autogen/models/aws_pinpoint_table_config.py +108 -0
  21. shaped/autogen/models/batch_size.py +136 -0
  22. shaped/autogen/models/batch_size1.py +136 -0
  23. shaped/autogen/models/batch_size2.py +136 -0
  24. shaped/autogen/models/big_query_table_config.py +147 -0
  25. shaped/autogen/models/bm25.py +136 -0
  26. shaped/autogen/models/boosted_reorder_step.py +125 -0
  27. shaped/autogen/models/canary_rollout.py +99 -0
  28. shaped/autogen/models/candidate_attributes_retrieve_step.py +126 -0
  29. shaped/autogen/models/candidate_ids_retrieve_step.py +113 -0
  30. shaped/autogen/models/candidate_retrieval_strategy.py +41 -0
  31. shaped/autogen/models/clickhouse_table_config.py +146 -0
  32. shaped/autogen/models/column_order_retrieve_step.py +123 -0
  33. shaped/autogen/models/column_ordering.py +91 -0
  34. shaped/autogen/models/create_table_response.py +87 -0
  35. shaped/autogen/models/create_view_response.py +87 -0
  36. shaped/autogen/models/custom_table_config.py +135 -0
  37. shaped/autogen/models/data_compute_config.py +89 -0
  38. shaped/autogen/models/data_config.py +145 -0
  39. shaped/autogen/models/data_config_interaction_table.py +146 -0
  40. shaped/autogen/models/data_split_config.py +88 -0
  41. shaped/autogen/models/data_split_strategy.py +37 -0
  42. shaped/autogen/models/data_tier.py +37 -0
  43. shaped/autogen/models/default.py +246 -0
  44. shaped/autogen/models/delete_engine_response.py +87 -0
  45. shaped/autogen/models/delete_table_response.py +87 -0
  46. shaped/autogen/models/delete_view_response.py +87 -0
  47. shaped/autogen/models/deployment_config.py +123 -0
  48. shaped/autogen/models/distance_function.py +38 -0
  49. shaped/autogen/models/diversity_reorder_step.py +137 -0
  50. shaped/autogen/models/dropout_rate.py +136 -0
  51. shaped/autogen/models/dynamo_db_table_config.py +160 -0
  52. shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +138 -0
  53. shaped/autogen/models/embedder_batch_size.py +136 -0
  54. shaped/autogen/models/embedding_config.py +93 -0
  55. shaped/autogen/models/embedding_dim.py +136 -0
  56. shaped/autogen/models/embedding_dims.py +136 -0
  57. shaped/autogen/models/embedding_size.py +136 -0
  58. shaped/autogen/models/encoder.py +140 -0
  59. shaped/autogen/models/encoding_pooling_strategy.py +38 -0
  60. shaped/autogen/models/engine.py +109 -0
  61. shaped/autogen/models/engine_config_v2.py +152 -0
  62. shaped/autogen/models/engine_details_response.py +120 -0
  63. shaped/autogen/models/engine_schema.py +113 -0
  64. shaped/autogen/models/engine_schema_user_inner.py +134 -0
  65. shaped/autogen/models/entity_config.py +109 -0
  66. shaped/autogen/models/entity_journey.py +152 -0
  67. shaped/autogen/models/entity_type.py +38 -0
  68. shaped/autogen/models/evaluation_config.py +92 -0
  69. shaped/autogen/models/exploration_reorder_step.py +125 -0
  70. shaped/autogen/models/expression_filter_step.py +106 -0
  71. shaped/autogen/models/factors.py +136 -0
  72. shaped/autogen/models/factors1.py +136 -0
  73. shaped/autogen/models/feature.py +90 -0
  74. shaped/autogen/models/feature_type.py +60 -0
  75. shaped/autogen/models/file_table_config.py +112 -0
  76. shaped/autogen/models/filter_config.py +99 -0
  77. shaped/autogen/models/filter_dataset.py +140 -0
  78. shaped/autogen/models/filter_index_type.py +36 -0
  79. shaped/autogen/models/filter_retrieve_step.py +113 -0
  80. shaped/autogen/models/global_filter.py +102 -0
  81. shaped/autogen/models/hidden_dropout_prob.py +136 -0
  82. shaped/autogen/models/hidden_size.py +136 -0
  83. shaped/autogen/models/hidden_size1.py +136 -0
  84. shaped/autogen/models/http_problem_response.py +115 -0
  85. shaped/autogen/models/http_validation_error.py +2 -2
  86. shaped/autogen/models/hugging_face_encoder.py +113 -0
  87. shaped/autogen/models/iceberg_table_config.py +154 -0
  88. shaped/autogen/models/index_config.py +101 -0
  89. shaped/autogen/models/inner_size.py +136 -0
  90. shaped/autogen/models/inner_size1.py +136 -0
  91. shaped/autogen/models/interaction_config.py +122 -0
  92. shaped/autogen/models/interaction_pooling_encoder.py +104 -0
  93. shaped/autogen/models/interaction_round_robin_encoder.py +104 -0
  94. shaped/autogen/models/item_attribute_pooling_encoder.py +124 -0
  95. shaped/autogen/models/journey.py +140 -0
  96. shaped/autogen/models/kafka_table_config.py +129 -0
  97. shaped/autogen/models/kinesis_table_config.py +140 -0
  98. shaped/autogen/models/kinesis_table_config_column_schema_value.py +136 -0
  99. shaped/autogen/models/label.py +90 -0
  100. shaped/autogen/models/label_type.py +37 -0
  101. shaped/autogen/models/laplace_smoothing.py +136 -0
  102. shaped/autogen/models/latency_scaling_policy.py +112 -0
  103. shaped/autogen/models/learning_rate.py +136 -0
  104. shaped/autogen/models/learning_rate1.py +136 -0
  105. shaped/autogen/models/learning_rate2.py +136 -0
  106. shaped/autogen/models/learning_rate3.py +136 -0
  107. shaped/autogen/models/lexical_search_mode.py +99 -0
  108. shaped/autogen/models/list_engines_response.py +95 -0
  109. shaped/autogen/models/list_tables_response.py +95 -0
  110. shaped/autogen/models/list_views_response.py +95 -0
  111. shaped/autogen/models/loss_types.py +37 -0
  112. shaped/autogen/models/lr.py +136 -0
  113. shaped/autogen/models/lr1.py +136 -0
  114. shaped/autogen/models/lr2.py +136 -0
  115. shaped/autogen/models/max_depth.py +136 -0
  116. shaped/autogen/models/max_leaves.py +136 -0
  117. shaped/autogen/models/max_seq_length.py +136 -0
  118. shaped/autogen/models/max_seq_length1.py +136 -0
  119. shaped/autogen/models/max_seq_length2.py +136 -0
  120. shaped/autogen/models/mode.py +134 -0
  121. shaped/autogen/models/mode1.py +134 -0
  122. shaped/autogen/models/mode2.py +136 -0
  123. shaped/autogen/models/mongo_db_table_config.py +147 -0
  124. shaped/autogen/models/mssql_table_config.py +155 -0
  125. shaped/autogen/models/{my_sql_dataset_config.py → my_sql_table_config.py} +45 -28
  126. shaped/autogen/models/n_epochs.py +136 -0
  127. shaped/autogen/models/n_epochs1.py +136 -0
  128. shaped/autogen/models/n_epochs2.py +136 -0
  129. shaped/autogen/models/n_estimators.py +136 -0
  130. shaped/autogen/models/n_heads.py +136 -0
  131. shaped/autogen/models/n_layers.py +136 -0
  132. shaped/autogen/models/neg_per_positive.py +136 -0
  133. shaped/autogen/models/negative_samples_count.py +136 -0
  134. shaped/autogen/models/ngram_tokenizer.py +103 -0
  135. shaped/autogen/models/no_op_config.py +117 -0
  136. shaped/autogen/models/num_blocks.py +136 -0
  137. shaped/autogen/models/num_heads.py +136 -0
  138. shaped/autogen/models/num_leaves.py +136 -0
  139. shaped/autogen/models/objective.py +40 -0
  140. shaped/autogen/models/objective1.py +134 -0
  141. shaped/autogen/models/online_store_config.py +89 -0
  142. shaped/autogen/models/pagination_config.py +87 -0
  143. shaped/autogen/models/parameter_definition.py +96 -0
  144. shaped/autogen/models/parameters_value.py +240 -0
  145. shaped/autogen/models/passthrough_score.py +104 -0
  146. shaped/autogen/models/personal_filter.py +104 -0
  147. shaped/autogen/models/pipeline_stage_explanation.py +118 -0
  148. shaped/autogen/models/policy.py +134 -0
  149. shaped/autogen/models/pool_fn.py +134 -0
  150. shaped/autogen/models/pooling_function.py +37 -0
  151. shaped/autogen/models/{postgres_dataset_config.py → postgres_table_config.py} +66 -28
  152. shaped/autogen/models/posthog_table_config.py +133 -0
  153. shaped/autogen/models/prebuilt_filter_step.py +113 -0
  154. shaped/autogen/models/precomputed_item_embedding.py +99 -0
  155. shaped/autogen/models/precomputed_user_embedding.py +99 -0
  156. shaped/autogen/models/query.py +136 -0
  157. shaped/autogen/models/query1.py +136 -0
  158. shaped/autogen/models/query_any_of.py +140 -0
  159. shaped/autogen/models/query_definition.py +106 -0
  160. shaped/autogen/models/query_encoder.py +194 -0
  161. shaped/autogen/models/query_explanation.py +197 -0
  162. shaped/autogen/models/query_request.py +121 -0
  163. shaped/autogen/models/query_result.py +113 -0
  164. shaped/autogen/models/query_table_config.py +99 -0
  165. shaped/autogen/models/rank_item_attribute_values_query_config.py +122 -0
  166. shaped/autogen/models/rank_query_config.py +167 -0
  167. shaped/autogen/models/rank_query_config_filter_inner.py +149 -0
  168. shaped/autogen/models/rank_query_config_reorder_inner.py +149 -0
  169. shaped/autogen/models/rank_query_config_retrieve_inner.py +196 -0
  170. shaped/autogen/models/recreate_rollout.py +97 -0
  171. shaped/autogen/models/{redshift_dataset_config.py → redshift_table_config.py} +48 -25
  172. shaped/autogen/models/reference_table_config.py +113 -0
  173. shaped/autogen/models/regularization.py +136 -0
  174. shaped/autogen/models/request.py +378 -0
  175. shaped/autogen/models/request1.py +140 -0
  176. shaped/autogen/models/requests_per_second_scaling_policy.py +112 -0
  177. shaped/autogen/models/response_get_view_details_views_view_name_get.py +134 -0
  178. shaped/autogen/models/result.py +145 -0
  179. shaped/autogen/models/result_embeddings_value.py +127 -0
  180. shaped/autogen/models/retriever.py +196 -0
  181. shaped/autogen/models/retriever1.py +196 -0
  182. shaped/autogen/models/rollout_config.py +91 -0
  183. shaped/autogen/models/rudderstack_table_config.py +106 -0
  184. shaped/autogen/models/sampling_strategy.py +36 -0
  185. shaped/autogen/models/saved_query_info_response.py +89 -0
  186. shaped/autogen/models/saved_query_list_response.py +87 -0
  187. shaped/autogen/models/saved_query_request.py +115 -0
  188. shaped/autogen/models/schema_config.py +117 -0
  189. shaped/autogen/models/score.py +134 -0
  190. shaped/autogen/models/score_ensemble.py +140 -0
  191. shaped/autogen/models/score_ensemble_policy_config.py +141 -0
  192. shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +422 -0
  193. shaped/autogen/models/search_config.py +105 -0
  194. shaped/autogen/models/segment_table_config.py +106 -0
  195. shaped/autogen/models/sequence_length.py +136 -0
  196. shaped/autogen/models/server_config.py +87 -0
  197. shaped/autogen/models/setup_engine_response.py +87 -0
  198. shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +148 -0
  199. shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +154 -0
  200. shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +209 -0
  201. shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +137 -0
  202. shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +139 -0
  203. shaped/autogen/models/shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config.py +205 -0
  204. shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +140 -0
  205. shaped/autogen/models/shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config.py +152 -0
  206. shaped/autogen/models/shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config.py +239 -0
  207. shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +119 -0
  208. shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +137 -0
  209. shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +104 -0
  210. shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +130 -0
  211. shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +123 -0
  212. shaped/autogen/models/shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config.py +224 -0
  213. shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +119 -0
  214. shaped/autogen/models/shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config.py +159 -0
  215. shaped/autogen/models/shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config.py +131 -0
  216. shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +131 -0
  217. shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +149 -0
  218. shaped/autogen/models/shopify_table_config.py +156 -0
  219. shaped/autogen/models/similarity_retrieve_step.py +121 -0
  220. shaped/autogen/models/{snowflake_dataset_config.py → snowflake_table_config.py} +47 -18
  221. shaped/autogen/models/sql_transform_type.py +37 -0
  222. shaped/autogen/models/sql_view_config.py +111 -0
  223. shaped/autogen/models/stemmer_tokenizer.py +105 -0
  224. shaped/autogen/models/step_explanation.py +137 -0
  225. shaped/autogen/models/strategy.py +134 -0
  226. shaped/autogen/models/table.py +102 -0
  227. shaped/autogen/models/table_deployment_type.py +38 -0
  228. shaped/autogen/models/table_insert_arguments.py +87 -0
  229. shaped/autogen/models/table_insert_response.py +87 -0
  230. shaped/autogen/models/text_encoding.py +136 -0
  231. shaped/autogen/models/text_search_retrieve_step.py +121 -0
  232. shaped/autogen/models/time_frequency.py +136 -0
  233. shaped/autogen/models/time_window.py +136 -0
  234. shaped/autogen/models/time_window_in_days.py +142 -0
  235. shaped/autogen/models/tokenizer.py +149 -0
  236. shaped/autogen/models/trained_model_encoder.py +99 -0
  237. shaped/autogen/models/training_compute_config.py +99 -0
  238. shaped/autogen/models/training_config.py +121 -0
  239. shaped/autogen/models/training_config_models_inner.py +308 -0
  240. shaped/autogen/models/training_strategy.py +37 -0
  241. shaped/autogen/models/trending_mode.py +37 -0
  242. shaped/autogen/models/truncate_filter_step.py +106 -0
  243. shaped/autogen/models/tunable_bool.py +97 -0
  244. shaped/autogen/models/tunable_float.py +118 -0
  245. shaped/autogen/models/tunable_int.py +118 -0
  246. shaped/autogen/models/tunable_int_categorical.py +99 -0
  247. shaped/autogen/models/tunable_string.py +99 -0
  248. shaped/autogen/models/tuning_config.py +89 -0
  249. shaped/autogen/models/type.py +134 -0
  250. shaped/autogen/models/update_table_response.py +87 -0
  251. shaped/autogen/models/update_view_response.py +87 -0
  252. shaped/autogen/models/user_attribute_pooling_encoder.py +124 -0
  253. shaped/autogen/models/val_split.py +136 -0
  254. shaped/autogen/models/validation_error.py +13 -3
  255. shaped/autogen/models/validation_error_loc_inner.py +138 -0
  256. shaped/autogen/models/value_type.py +7 -5
  257. shaped/autogen/models/vector_search_mode.py +99 -0
  258. shaped/autogen/models/view.py +104 -0
  259. shaped/autogen/models/view_details_ai.py +140 -0
  260. shaped/autogen/models/view_details_ai_schema_value.py +153 -0
  261. shaped/autogen/models/view_details_sql.py +140 -0
  262. shaped/autogen/models/view_status.py +41 -0
  263. shaped/autogen/models/weight_decay.py +136 -0
  264. shaped/autogen/models/whitespace_tokenizer.py +97 -0
  265. shaped/autogen/models/window_size.py +136 -0
  266. shaped/autogen/rest.py +8 -2
  267. shaped/cli/shaped_cli.py +12 -7
  268. shaped/client.py +587 -174
  269. shaped/config_builders.py +695 -0
  270. shaped/query_builder.py +774 -0
  271. {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/METADATA +140 -5
  272. shaped-2.0.2.dist-info/RECORD +278 -0
  273. shaped-2.0.2.dist-info/entry_points.txt +2 -0
  274. shaped/autogen/api/model_inference_api.py +0 -2825
  275. shaped/autogen/models/amplitude_dataset_config.py +0 -96
  276. shaped/autogen/models/aws_pinpoint_dataset_config.py +0 -96
  277. shaped/autogen/models/big_query_dataset_config.py +0 -114
  278. shaped/autogen/models/complement_items_request.py +0 -99
  279. shaped/autogen/models/complement_items_response.py +0 -89
  280. shaped/autogen/models/connectors_inner.py +0 -134
  281. shaped/autogen/models/create_dataset_arguments.py +0 -263
  282. shaped/autogen/models/create_embedding_response.py +0 -87
  283. shaped/autogen/models/create_item_embedding_request.py +0 -89
  284. shaped/autogen/models/create_model_arguments.py +0 -107
  285. shaped/autogen/models/create_model_response.py +0 -87
  286. shaped/autogen/models/create_user_embedding_request.py +0 -89
  287. shaped/autogen/models/custom_dataset_config.py +0 -115
  288. shaped/autogen/models/dataset_config.py +0 -101
  289. shaped/autogen/models/dataset_schema_type.py +0 -47
  290. shaped/autogen/models/datasets_inner.py +0 -91
  291. shaped/autogen/models/delete_model_response.py +0 -87
  292. shaped/autogen/models/fetch_config.py +0 -95
  293. shaped/autogen/models/file_config.py +0 -105
  294. shaped/autogen/models/file_source_config.py +0 -89
  295. shaped/autogen/models/inference_config.py +0 -101
  296. shaped/autogen/models/insert_model_response.py +0 -87
  297. shaped/autogen/models/interaction.py +0 -87
  298. shaped/autogen/models/list_datasets_response.py +0 -95
  299. shaped/autogen/models/list_models_response.py +0 -95
  300. shaped/autogen/models/model_config.py +0 -99
  301. shaped/autogen/models/model_response.py +0 -95
  302. shaped/autogen/models/mongo_db_dataset_config.py +0 -119
  303. shaped/autogen/models/post_rank_request.py +0 -117
  304. shaped/autogen/models/rank_attribute_response.py +0 -89
  305. shaped/autogen/models/rank_grid_attribute_request.py +0 -91
  306. shaped/autogen/models/rank_grid_attribute_request1.py +0 -93
  307. shaped/autogen/models/rank_grid_attribute_response.py +0 -91
  308. shaped/autogen/models/rank_response.py +0 -91
  309. shaped/autogen/models/retrieve_request.py +0 -101
  310. shaped/autogen/models/retrieve_response.py +0 -91
  311. shaped/autogen/models/retriever_top_k_override.py +0 -97
  312. shaped/autogen/models/rudder_stack_dataset_config.py +0 -96
  313. shaped/autogen/models/segment_dataset_config.py +0 -96
  314. shaped/autogen/models/similar_item_request.py +0 -101
  315. shaped/autogen/models/similar_response.py +0 -89
  316. shaped/autogen/models/similar_users_request.py +0 -99
  317. shaped/autogen/models/successful_response.py +0 -87
  318. shaped/autogen/models/view_model_response.py +0 -99
  319. shaped-2.0.1.dist-info/RECORD +0 -73
  320. shaped-2.0.1.dist-info/entry_points.txt +0 -2
  321. {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/WHEEL +0 -0
  322. {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/top_level.txt +0 -0
  323. {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/zip-safe +0 -0
@@ -0,0 +1,1467 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Shaped API
5
+
6
+ Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. The Shaped API has four main endpoints: **Tables** - Provision and manage batch and real-time data connectors. **Views** - Configure SQL transformations and AI enrichment on your input data. Use SQL to combine multiple data sources or use an LLM to add new categories, extract specific attributes from descriptions, etc. **Engines** - Deploy and manage your relevance engines. The Engine API exposes configuration for indexing logic, input datasets, externam embeddings, and more. **Query** - Execute queries against your engines, to return data based on an input query or rerank an existing list. The Query API exposes the retrieve, filter, score, and ranking steps of the 4-stage ranking architecture. The base URL for each endpoint is: `https://api.shaped.ai/v2`
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, StrictStr
20
+ from typing_extensions import Annotated
21
+ from shaped.autogen.models.delete_engine_response import DeleteEngineResponse
22
+ from shaped.autogen.models.engine_config_v2 import EngineConfigV2
23
+ from shaped.autogen.models.engine_details_response import EngineDetailsResponse
24
+ from shaped.autogen.models.list_engines_response import ListEnginesResponse
25
+ from shaped.autogen.models.setup_engine_response import SetupEngineResponse
26
+
27
+ from shaped.autogen.api_client import ApiClient, RequestSerialized
28
+ from shaped.autogen.api_response import ApiResponse
29
+ from shaped.autogen.rest import RESTResponseType
30
+
31
+
32
+ class EngineApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def delete_engine_engines_engine_name_delete(
47
+ self,
48
+ engine_name: Annotated[StrictStr, Field(description="Name of the engine to delete.")],
49
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
50
+ _request_timeout: Union[
51
+ None,
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Tuple[
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Annotated[StrictFloat, Field(gt=0)]
56
+ ]
57
+ ] = None,
58
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
59
+ _content_type: Optional[StrictStr] = None,
60
+ _headers: Optional[Dict[StrictStr, Any]] = None,
61
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
62
+ ) -> DeleteEngineResponse:
63
+ """Delete Engine
64
+
65
+ Delete the engine with identifier: {engine_name}.
66
+
67
+ :param engine_name: Name of the engine to delete. (required)
68
+ :type engine_name: str
69
+ :param x_api_key: API key for authentication. (required)
70
+ :type x_api_key: str
71
+ :param _request_timeout: timeout setting for this request. If one
72
+ number provided, it will be total request
73
+ timeout. It can also be a pair (tuple) of
74
+ (connection, read) timeouts.
75
+ :type _request_timeout: int, tuple(int, int), optional
76
+ :param _request_auth: set to override the auth_settings for an a single
77
+ request; this effectively ignores the
78
+ authentication in the spec for a single request.
79
+ :type _request_auth: dict, optional
80
+ :param _content_type: force content-type for the request.
81
+ :type _content_type: str, Optional
82
+ :param _headers: set to override the headers for a single
83
+ request; this effectively ignores the headers
84
+ in the spec for a single request.
85
+ :type _headers: dict, optional
86
+ :param _host_index: set to override the host_index for a single
87
+ request; this effectively ignores the host_index
88
+ in the spec for a single request.
89
+ :type _host_index: int, optional
90
+ :return: Returns the result object.
91
+ """ # noqa: E501
92
+
93
+ _param = self._delete_engine_engines_engine_name_delete_serialize(
94
+ engine_name=engine_name,
95
+ x_api_key=x_api_key,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index
100
+ )
101
+
102
+ _response_types_map: Dict[str, Optional[str]] = {
103
+ '200': "DeleteEngineResponse",
104
+ '404': "HttpProblemResponse",
105
+ '422': "HTTPValidationError",
106
+ }
107
+ response_data = self.api_client.call_api(
108
+ *_param,
109
+ _request_timeout=_request_timeout
110
+ )
111
+ response_data.read()
112
+ return self.api_client.response_deserialize(
113
+ response_data=response_data,
114
+ response_types_map=_response_types_map,
115
+ ).data
116
+
117
+
118
+ @validate_call
119
+ def delete_engine_engines_engine_name_delete_with_http_info(
120
+ self,
121
+ engine_name: Annotated[StrictStr, Field(description="Name of the engine to delete.")],
122
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
123
+ _request_timeout: Union[
124
+ None,
125
+ Annotated[StrictFloat, Field(gt=0)],
126
+ Tuple[
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Annotated[StrictFloat, Field(gt=0)]
129
+ ]
130
+ ] = None,
131
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
+ _content_type: Optional[StrictStr] = None,
133
+ _headers: Optional[Dict[StrictStr, Any]] = None,
134
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
+ ) -> ApiResponse[DeleteEngineResponse]:
136
+ """Delete Engine
137
+
138
+ Delete the engine with identifier: {engine_name}.
139
+
140
+ :param engine_name: Name of the engine to delete. (required)
141
+ :type engine_name: str
142
+ :param x_api_key: API key for authentication. (required)
143
+ :type x_api_key: str
144
+ :param _request_timeout: timeout setting for this request. If one
145
+ number provided, it will be total request
146
+ timeout. It can also be a pair (tuple) of
147
+ (connection, read) timeouts.
148
+ :type _request_timeout: int, tuple(int, int), optional
149
+ :param _request_auth: set to override the auth_settings for an a single
150
+ request; this effectively ignores the
151
+ authentication in the spec for a single request.
152
+ :type _request_auth: dict, optional
153
+ :param _content_type: force content-type for the request.
154
+ :type _content_type: str, Optional
155
+ :param _headers: set to override the headers for a single
156
+ request; this effectively ignores the headers
157
+ in the spec for a single request.
158
+ :type _headers: dict, optional
159
+ :param _host_index: set to override the host_index for a single
160
+ request; this effectively ignores the host_index
161
+ in the spec for a single request.
162
+ :type _host_index: int, optional
163
+ :return: Returns the result object.
164
+ """ # noqa: E501
165
+
166
+ _param = self._delete_engine_engines_engine_name_delete_serialize(
167
+ engine_name=engine_name,
168
+ x_api_key=x_api_key,
169
+ _request_auth=_request_auth,
170
+ _content_type=_content_type,
171
+ _headers=_headers,
172
+ _host_index=_host_index
173
+ )
174
+
175
+ _response_types_map: Dict[str, Optional[str]] = {
176
+ '200': "DeleteEngineResponse",
177
+ '404': "HttpProblemResponse",
178
+ '422': "HTTPValidationError",
179
+ }
180
+ response_data = self.api_client.call_api(
181
+ *_param,
182
+ _request_timeout=_request_timeout
183
+ )
184
+ response_data.read()
185
+ return self.api_client.response_deserialize(
186
+ response_data=response_data,
187
+ response_types_map=_response_types_map,
188
+ )
189
+
190
+
191
+ @validate_call
192
+ def delete_engine_engines_engine_name_delete_without_preload_content(
193
+ self,
194
+ engine_name: Annotated[StrictStr, Field(description="Name of the engine to delete.")],
195
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
196
+ _request_timeout: Union[
197
+ None,
198
+ Annotated[StrictFloat, Field(gt=0)],
199
+ Tuple[
200
+ Annotated[StrictFloat, Field(gt=0)],
201
+ Annotated[StrictFloat, Field(gt=0)]
202
+ ]
203
+ ] = None,
204
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
205
+ _content_type: Optional[StrictStr] = None,
206
+ _headers: Optional[Dict[StrictStr, Any]] = None,
207
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
208
+ ) -> RESTResponseType:
209
+ """Delete Engine
210
+
211
+ Delete the engine with identifier: {engine_name}.
212
+
213
+ :param engine_name: Name of the engine to delete. (required)
214
+ :type engine_name: str
215
+ :param x_api_key: API key for authentication. (required)
216
+ :type x_api_key: str
217
+ :param _request_timeout: timeout setting for this request. If one
218
+ number provided, it will be total request
219
+ timeout. It can also be a pair (tuple) of
220
+ (connection, read) timeouts.
221
+ :type _request_timeout: int, tuple(int, int), optional
222
+ :param _request_auth: set to override the auth_settings for an a single
223
+ request; this effectively ignores the
224
+ authentication in the spec for a single request.
225
+ :type _request_auth: dict, optional
226
+ :param _content_type: force content-type for the request.
227
+ :type _content_type: str, Optional
228
+ :param _headers: set to override the headers for a single
229
+ request; this effectively ignores the headers
230
+ in the spec for a single request.
231
+ :type _headers: dict, optional
232
+ :param _host_index: set to override the host_index for a single
233
+ request; this effectively ignores the host_index
234
+ in the spec for a single request.
235
+ :type _host_index: int, optional
236
+ :return: Returns the result object.
237
+ """ # noqa: E501
238
+
239
+ _param = self._delete_engine_engines_engine_name_delete_serialize(
240
+ engine_name=engine_name,
241
+ x_api_key=x_api_key,
242
+ _request_auth=_request_auth,
243
+ _content_type=_content_type,
244
+ _headers=_headers,
245
+ _host_index=_host_index
246
+ )
247
+
248
+ _response_types_map: Dict[str, Optional[str]] = {
249
+ '200': "DeleteEngineResponse",
250
+ '404': "HttpProblemResponse",
251
+ '422': "HTTPValidationError",
252
+ }
253
+ response_data = self.api_client.call_api(
254
+ *_param,
255
+ _request_timeout=_request_timeout
256
+ )
257
+ return response_data.response
258
+
259
+
260
+ def _delete_engine_engines_engine_name_delete_serialize(
261
+ self,
262
+ engine_name,
263
+ x_api_key,
264
+ _request_auth,
265
+ _content_type,
266
+ _headers,
267
+ _host_index,
268
+ ) -> RequestSerialized:
269
+
270
+ _host = None
271
+
272
+ _collection_formats: Dict[str, str] = {
273
+ }
274
+
275
+ _path_params: Dict[str, str] = {}
276
+ _query_params: List[Tuple[str, str]] = []
277
+ _header_params: Dict[str, Optional[str]] = _headers or {}
278
+ _form_params: List[Tuple[str, str]] = []
279
+ _files: Dict[
280
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
281
+ ] = {}
282
+ _body_params: Optional[bytes] = None
283
+
284
+ # process the path parameters
285
+ if engine_name is not None:
286
+ _path_params['engine_name'] = engine_name
287
+ # process the query parameters
288
+ # process the header parameters
289
+ if x_api_key is not None:
290
+ _header_params['x-api-key'] = x_api_key
291
+ # process the form parameters
292
+ # process the body parameter
293
+
294
+
295
+ # set the HTTP header `Accept`
296
+ if 'Accept' not in _header_params:
297
+ _header_params['Accept'] = self.api_client.select_header_accept(
298
+ [
299
+ 'application/json'
300
+ ]
301
+ )
302
+
303
+
304
+ # authentication setting
305
+ _auth_settings: List[str] = [
306
+ ]
307
+
308
+ return self.api_client.param_serialize(
309
+ method='DELETE',
310
+ resource_path='/engines/{engine_name}',
311
+ path_params=_path_params,
312
+ query_params=_query_params,
313
+ header_params=_header_params,
314
+ body=_body_params,
315
+ post_params=_form_params,
316
+ files=_files,
317
+ auth_settings=_auth_settings,
318
+ collection_formats=_collection_formats,
319
+ _host=_host,
320
+ _request_auth=_request_auth
321
+ )
322
+
323
+
324
+
325
+
326
+ @validate_call
327
+ def get_engine_details_engines_engine_name_get(
328
+ self,
329
+ engine_name: Annotated[StrictStr, Field(description="Name of the engine to view.")],
330
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
331
+ _request_timeout: Union[
332
+ None,
333
+ Annotated[StrictFloat, Field(gt=0)],
334
+ Tuple[
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Annotated[StrictFloat, Field(gt=0)]
337
+ ]
338
+ ] = None,
339
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
340
+ _content_type: Optional[StrictStr] = None,
341
+ _headers: Optional[Dict[StrictStr, Any]] = None,
342
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
343
+ ) -> EngineDetailsResponse:
344
+ """Get Engine Details
345
+
346
+ View Engines returns detailed information about the given {engine_name} including the input setup schemas details and status.
347
+
348
+ :param engine_name: Name of the engine to view. (required)
349
+ :type engine_name: str
350
+ :param x_api_key: API key for authentication. (required)
351
+ :type x_api_key: str
352
+ :param _request_timeout: timeout setting for this request. If one
353
+ number provided, it will be total request
354
+ timeout. It can also be a pair (tuple) of
355
+ (connection, read) timeouts.
356
+ :type _request_timeout: int, tuple(int, int), optional
357
+ :param _request_auth: set to override the auth_settings for an a single
358
+ request; this effectively ignores the
359
+ authentication in the spec for a single request.
360
+ :type _request_auth: dict, optional
361
+ :param _content_type: force content-type for the request.
362
+ :type _content_type: str, Optional
363
+ :param _headers: set to override the headers for a single
364
+ request; this effectively ignores the headers
365
+ in the spec for a single request.
366
+ :type _headers: dict, optional
367
+ :param _host_index: set to override the host_index for a single
368
+ request; this effectively ignores the host_index
369
+ in the spec for a single request.
370
+ :type _host_index: int, optional
371
+ :return: Returns the result object.
372
+ """ # noqa: E501
373
+
374
+ _param = self._get_engine_details_engines_engine_name_get_serialize(
375
+ engine_name=engine_name,
376
+ x_api_key=x_api_key,
377
+ _request_auth=_request_auth,
378
+ _content_type=_content_type,
379
+ _headers=_headers,
380
+ _host_index=_host_index
381
+ )
382
+
383
+ _response_types_map: Dict[str, Optional[str]] = {
384
+ '200': "EngineDetailsResponse",
385
+ '404': "HttpProblemResponse",
386
+ '422': "HTTPValidationError",
387
+ }
388
+ response_data = self.api_client.call_api(
389
+ *_param,
390
+ _request_timeout=_request_timeout
391
+ )
392
+ response_data.read()
393
+ return self.api_client.response_deserialize(
394
+ response_data=response_data,
395
+ response_types_map=_response_types_map,
396
+ ).data
397
+
398
+
399
+ @validate_call
400
+ def get_engine_details_engines_engine_name_get_with_http_info(
401
+ self,
402
+ engine_name: Annotated[StrictStr, Field(description="Name of the engine to view.")],
403
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
404
+ _request_timeout: Union[
405
+ None,
406
+ Annotated[StrictFloat, Field(gt=0)],
407
+ Tuple[
408
+ Annotated[StrictFloat, Field(gt=0)],
409
+ Annotated[StrictFloat, Field(gt=0)]
410
+ ]
411
+ ] = None,
412
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
413
+ _content_type: Optional[StrictStr] = None,
414
+ _headers: Optional[Dict[StrictStr, Any]] = None,
415
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
416
+ ) -> ApiResponse[EngineDetailsResponse]:
417
+ """Get Engine Details
418
+
419
+ View Engines returns detailed information about the given {engine_name} including the input setup schemas details and status.
420
+
421
+ :param engine_name: Name of the engine to view. (required)
422
+ :type engine_name: str
423
+ :param x_api_key: API key for authentication. (required)
424
+ :type x_api_key: str
425
+ :param _request_timeout: timeout setting for this request. If one
426
+ number provided, it will be total request
427
+ timeout. It can also be a pair (tuple) of
428
+ (connection, read) timeouts.
429
+ :type _request_timeout: int, tuple(int, int), optional
430
+ :param _request_auth: set to override the auth_settings for an a single
431
+ request; this effectively ignores the
432
+ authentication in the spec for a single request.
433
+ :type _request_auth: dict, optional
434
+ :param _content_type: force content-type for the request.
435
+ :type _content_type: str, Optional
436
+ :param _headers: set to override the headers for a single
437
+ request; this effectively ignores the headers
438
+ in the spec for a single request.
439
+ :type _headers: dict, optional
440
+ :param _host_index: set to override the host_index for a single
441
+ request; this effectively ignores the host_index
442
+ in the spec for a single request.
443
+ :type _host_index: int, optional
444
+ :return: Returns the result object.
445
+ """ # noqa: E501
446
+
447
+ _param = self._get_engine_details_engines_engine_name_get_serialize(
448
+ engine_name=engine_name,
449
+ x_api_key=x_api_key,
450
+ _request_auth=_request_auth,
451
+ _content_type=_content_type,
452
+ _headers=_headers,
453
+ _host_index=_host_index
454
+ )
455
+
456
+ _response_types_map: Dict[str, Optional[str]] = {
457
+ '200': "EngineDetailsResponse",
458
+ '404': "HttpProblemResponse",
459
+ '422': "HTTPValidationError",
460
+ }
461
+ response_data = self.api_client.call_api(
462
+ *_param,
463
+ _request_timeout=_request_timeout
464
+ )
465
+ response_data.read()
466
+ return self.api_client.response_deserialize(
467
+ response_data=response_data,
468
+ response_types_map=_response_types_map,
469
+ )
470
+
471
+
472
+ @validate_call
473
+ def get_engine_details_engines_engine_name_get_without_preload_content(
474
+ self,
475
+ engine_name: Annotated[StrictStr, Field(description="Name of the engine to view.")],
476
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
477
+ _request_timeout: Union[
478
+ None,
479
+ Annotated[StrictFloat, Field(gt=0)],
480
+ Tuple[
481
+ Annotated[StrictFloat, Field(gt=0)],
482
+ Annotated[StrictFloat, Field(gt=0)]
483
+ ]
484
+ ] = None,
485
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
486
+ _content_type: Optional[StrictStr] = None,
487
+ _headers: Optional[Dict[StrictStr, Any]] = None,
488
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
489
+ ) -> RESTResponseType:
490
+ """Get Engine Details
491
+
492
+ View Engines returns detailed information about the given {engine_name} including the input setup schemas details and status.
493
+
494
+ :param engine_name: Name of the engine to view. (required)
495
+ :type engine_name: str
496
+ :param x_api_key: API key for authentication. (required)
497
+ :type x_api_key: str
498
+ :param _request_timeout: timeout setting for this request. If one
499
+ number provided, it will be total request
500
+ timeout. It can also be a pair (tuple) of
501
+ (connection, read) timeouts.
502
+ :type _request_timeout: int, tuple(int, int), optional
503
+ :param _request_auth: set to override the auth_settings for an a single
504
+ request; this effectively ignores the
505
+ authentication in the spec for a single request.
506
+ :type _request_auth: dict, optional
507
+ :param _content_type: force content-type for the request.
508
+ :type _content_type: str, Optional
509
+ :param _headers: set to override the headers for a single
510
+ request; this effectively ignores the headers
511
+ in the spec for a single request.
512
+ :type _headers: dict, optional
513
+ :param _host_index: set to override the host_index for a single
514
+ request; this effectively ignores the host_index
515
+ in the spec for a single request.
516
+ :type _host_index: int, optional
517
+ :return: Returns the result object.
518
+ """ # noqa: E501
519
+
520
+ _param = self._get_engine_details_engines_engine_name_get_serialize(
521
+ engine_name=engine_name,
522
+ x_api_key=x_api_key,
523
+ _request_auth=_request_auth,
524
+ _content_type=_content_type,
525
+ _headers=_headers,
526
+ _host_index=_host_index
527
+ )
528
+
529
+ _response_types_map: Dict[str, Optional[str]] = {
530
+ '200': "EngineDetailsResponse",
531
+ '404': "HttpProblemResponse",
532
+ '422': "HTTPValidationError",
533
+ }
534
+ response_data = self.api_client.call_api(
535
+ *_param,
536
+ _request_timeout=_request_timeout
537
+ )
538
+ return response_data.response
539
+
540
+
541
+ def _get_engine_details_engines_engine_name_get_serialize(
542
+ self,
543
+ engine_name,
544
+ x_api_key,
545
+ _request_auth,
546
+ _content_type,
547
+ _headers,
548
+ _host_index,
549
+ ) -> RequestSerialized:
550
+
551
+ _host = None
552
+
553
+ _collection_formats: Dict[str, str] = {
554
+ }
555
+
556
+ _path_params: Dict[str, str] = {}
557
+ _query_params: List[Tuple[str, str]] = []
558
+ _header_params: Dict[str, Optional[str]] = _headers or {}
559
+ _form_params: List[Tuple[str, str]] = []
560
+ _files: Dict[
561
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
562
+ ] = {}
563
+ _body_params: Optional[bytes] = None
564
+
565
+ # process the path parameters
566
+ if engine_name is not None:
567
+ _path_params['engine_name'] = engine_name
568
+ # process the query parameters
569
+ # process the header parameters
570
+ if x_api_key is not None:
571
+ _header_params['x-api-key'] = x_api_key
572
+ # process the form parameters
573
+ # process the body parameter
574
+
575
+
576
+ # set the HTTP header `Accept`
577
+ if 'Accept' not in _header_params:
578
+ _header_params['Accept'] = self.api_client.select_header_accept(
579
+ [
580
+ 'application/json'
581
+ ]
582
+ )
583
+
584
+
585
+ # authentication setting
586
+ _auth_settings: List[str] = [
587
+ ]
588
+
589
+ return self.api_client.param_serialize(
590
+ method='GET',
591
+ resource_path='/engines/{engine_name}',
592
+ path_params=_path_params,
593
+ query_params=_query_params,
594
+ header_params=_header_params,
595
+ body=_body_params,
596
+ post_params=_form_params,
597
+ files=_files,
598
+ auth_settings=_auth_settings,
599
+ collection_formats=_collection_formats,
600
+ _host=_host,
601
+ _request_auth=_request_auth
602
+ )
603
+
604
+
605
+
606
+
607
+ @validate_call
608
+ def get_engines_engines_get(
609
+ self,
610
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
611
+ _request_timeout: Union[
612
+ None,
613
+ Annotated[StrictFloat, Field(gt=0)],
614
+ Tuple[
615
+ Annotated[StrictFloat, Field(gt=0)],
616
+ Annotated[StrictFloat, Field(gt=0)]
617
+ ]
618
+ ] = None,
619
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
620
+ _content_type: Optional[StrictStr] = None,
621
+ _headers: Optional[Dict[StrictStr, Any]] = None,
622
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
623
+ ) -> ListEnginesResponse:
624
+ """List Engines
625
+
626
+ List Engines returns a list of your previously created engines and their associated metadata (e.g. status and last train time).
627
+
628
+ :param x_api_key: API key for authentication. (required)
629
+ :type x_api_key: str
630
+ :param _request_timeout: timeout setting for this request. If one
631
+ number provided, it will be total request
632
+ timeout. It can also be a pair (tuple) of
633
+ (connection, read) timeouts.
634
+ :type _request_timeout: int, tuple(int, int), optional
635
+ :param _request_auth: set to override the auth_settings for an a single
636
+ request; this effectively ignores the
637
+ authentication in the spec for a single request.
638
+ :type _request_auth: dict, optional
639
+ :param _content_type: force content-type for the request.
640
+ :type _content_type: str, Optional
641
+ :param _headers: set to override the headers for a single
642
+ request; this effectively ignores the headers
643
+ in the spec for a single request.
644
+ :type _headers: dict, optional
645
+ :param _host_index: set to override the host_index for a single
646
+ request; this effectively ignores the host_index
647
+ in the spec for a single request.
648
+ :type _host_index: int, optional
649
+ :return: Returns the result object.
650
+ """ # noqa: E501
651
+
652
+ _param = self._get_engines_engines_get_serialize(
653
+ x_api_key=x_api_key,
654
+ _request_auth=_request_auth,
655
+ _content_type=_content_type,
656
+ _headers=_headers,
657
+ _host_index=_host_index
658
+ )
659
+
660
+ _response_types_map: Dict[str, Optional[str]] = {
661
+ '200': "ListEnginesResponse",
662
+ '422': "HTTPValidationError",
663
+ }
664
+ response_data = self.api_client.call_api(
665
+ *_param,
666
+ _request_timeout=_request_timeout
667
+ )
668
+ response_data.read()
669
+ return self.api_client.response_deserialize(
670
+ response_data=response_data,
671
+ response_types_map=_response_types_map,
672
+ ).data
673
+
674
+
675
+ @validate_call
676
+ def get_engines_engines_get_with_http_info(
677
+ self,
678
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
679
+ _request_timeout: Union[
680
+ None,
681
+ Annotated[StrictFloat, Field(gt=0)],
682
+ Tuple[
683
+ Annotated[StrictFloat, Field(gt=0)],
684
+ Annotated[StrictFloat, Field(gt=0)]
685
+ ]
686
+ ] = None,
687
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
688
+ _content_type: Optional[StrictStr] = None,
689
+ _headers: Optional[Dict[StrictStr, Any]] = None,
690
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
691
+ ) -> ApiResponse[ListEnginesResponse]:
692
+ """List Engines
693
+
694
+ List Engines returns a list of your previously created engines and their associated metadata (e.g. status and last train time).
695
+
696
+ :param x_api_key: API key for authentication. (required)
697
+ :type x_api_key: str
698
+ :param _request_timeout: timeout setting for this request. If one
699
+ number provided, it will be total request
700
+ timeout. It can also be a pair (tuple) of
701
+ (connection, read) timeouts.
702
+ :type _request_timeout: int, tuple(int, int), optional
703
+ :param _request_auth: set to override the auth_settings for an a single
704
+ request; this effectively ignores the
705
+ authentication in the spec for a single request.
706
+ :type _request_auth: dict, optional
707
+ :param _content_type: force content-type for the request.
708
+ :type _content_type: str, Optional
709
+ :param _headers: set to override the headers for a single
710
+ request; this effectively ignores the headers
711
+ in the spec for a single request.
712
+ :type _headers: dict, optional
713
+ :param _host_index: set to override the host_index for a single
714
+ request; this effectively ignores the host_index
715
+ in the spec for a single request.
716
+ :type _host_index: int, optional
717
+ :return: Returns the result object.
718
+ """ # noqa: E501
719
+
720
+ _param = self._get_engines_engines_get_serialize(
721
+ x_api_key=x_api_key,
722
+ _request_auth=_request_auth,
723
+ _content_type=_content_type,
724
+ _headers=_headers,
725
+ _host_index=_host_index
726
+ )
727
+
728
+ _response_types_map: Dict[str, Optional[str]] = {
729
+ '200': "ListEnginesResponse",
730
+ '422': "HTTPValidationError",
731
+ }
732
+ response_data = self.api_client.call_api(
733
+ *_param,
734
+ _request_timeout=_request_timeout
735
+ )
736
+ response_data.read()
737
+ return self.api_client.response_deserialize(
738
+ response_data=response_data,
739
+ response_types_map=_response_types_map,
740
+ )
741
+
742
+
743
+ @validate_call
744
+ def get_engines_engines_get_without_preload_content(
745
+ self,
746
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
747
+ _request_timeout: Union[
748
+ None,
749
+ Annotated[StrictFloat, Field(gt=0)],
750
+ Tuple[
751
+ Annotated[StrictFloat, Field(gt=0)],
752
+ Annotated[StrictFloat, Field(gt=0)]
753
+ ]
754
+ ] = None,
755
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
756
+ _content_type: Optional[StrictStr] = None,
757
+ _headers: Optional[Dict[StrictStr, Any]] = None,
758
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
759
+ ) -> RESTResponseType:
760
+ """List Engines
761
+
762
+ List Engines returns a list of your previously created engines and their associated metadata (e.g. status and last train time).
763
+
764
+ :param x_api_key: API key for authentication. (required)
765
+ :type x_api_key: str
766
+ :param _request_timeout: timeout setting for this request. If one
767
+ number provided, it will be total request
768
+ timeout. It can also be a pair (tuple) of
769
+ (connection, read) timeouts.
770
+ :type _request_timeout: int, tuple(int, int), optional
771
+ :param _request_auth: set to override the auth_settings for an a single
772
+ request; this effectively ignores the
773
+ authentication in the spec for a single request.
774
+ :type _request_auth: dict, optional
775
+ :param _content_type: force content-type for the request.
776
+ :type _content_type: str, Optional
777
+ :param _headers: set to override the headers for a single
778
+ request; this effectively ignores the headers
779
+ in the spec for a single request.
780
+ :type _headers: dict, optional
781
+ :param _host_index: set to override the host_index for a single
782
+ request; this effectively ignores the host_index
783
+ in the spec for a single request.
784
+ :type _host_index: int, optional
785
+ :return: Returns the result object.
786
+ """ # noqa: E501
787
+
788
+ _param = self._get_engines_engines_get_serialize(
789
+ x_api_key=x_api_key,
790
+ _request_auth=_request_auth,
791
+ _content_type=_content_type,
792
+ _headers=_headers,
793
+ _host_index=_host_index
794
+ )
795
+
796
+ _response_types_map: Dict[str, Optional[str]] = {
797
+ '200': "ListEnginesResponse",
798
+ '422': "HTTPValidationError",
799
+ }
800
+ response_data = self.api_client.call_api(
801
+ *_param,
802
+ _request_timeout=_request_timeout
803
+ )
804
+ return response_data.response
805
+
806
+
807
+ def _get_engines_engines_get_serialize(
808
+ self,
809
+ x_api_key,
810
+ _request_auth,
811
+ _content_type,
812
+ _headers,
813
+ _host_index,
814
+ ) -> RequestSerialized:
815
+
816
+ _host = None
817
+
818
+ _collection_formats: Dict[str, str] = {
819
+ }
820
+
821
+ _path_params: Dict[str, str] = {}
822
+ _query_params: List[Tuple[str, str]] = []
823
+ _header_params: Dict[str, Optional[str]] = _headers or {}
824
+ _form_params: List[Tuple[str, str]] = []
825
+ _files: Dict[
826
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
827
+ ] = {}
828
+ _body_params: Optional[bytes] = None
829
+
830
+ # process the path parameters
831
+ # process the query parameters
832
+ # process the header parameters
833
+ if x_api_key is not None:
834
+ _header_params['x-api-key'] = x_api_key
835
+ # process the form parameters
836
+ # process the body parameter
837
+
838
+
839
+ # set the HTTP header `Accept`
840
+ if 'Accept' not in _header_params:
841
+ _header_params['Accept'] = self.api_client.select_header_accept(
842
+ [
843
+ 'application/json'
844
+ ]
845
+ )
846
+
847
+
848
+ # authentication setting
849
+ _auth_settings: List[str] = [
850
+ ]
851
+
852
+ return self.api_client.param_serialize(
853
+ method='GET',
854
+ resource_path='/engines',
855
+ path_params=_path_params,
856
+ query_params=_query_params,
857
+ header_params=_header_params,
858
+ body=_body_params,
859
+ post_params=_form_params,
860
+ files=_files,
861
+ auth_settings=_auth_settings,
862
+ collection_formats=_collection_formats,
863
+ _host=_host,
864
+ _request_auth=_request_auth
865
+ )
866
+
867
+
868
+
869
+
870
+ @validate_call
871
+ def patch_update_engine_engines_patch(
872
+ self,
873
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
874
+ engine_config_v2: EngineConfigV2,
875
+ _request_timeout: Union[
876
+ None,
877
+ Annotated[StrictFloat, Field(gt=0)],
878
+ Tuple[
879
+ Annotated[StrictFloat, Field(gt=0)],
880
+ Annotated[StrictFloat, Field(gt=0)]
881
+ ]
882
+ ] = None,
883
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
884
+ _content_type: Optional[StrictStr] = None,
885
+ _headers: Optional[Dict[StrictStr, Any]] = None,
886
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
887
+ ) -> SetupEngineResponse:
888
+ """Update Engine
889
+
890
+ Update engine is used to update the configurations of a currently hosted engine within the ERROR or ACTIVE states.
891
+
892
+ :param x_api_key: API key for authentication. (required)
893
+ :type x_api_key: str
894
+ :param engine_config_v2: (required)
895
+ :type engine_config_v2: EngineConfigV2
896
+ :param _request_timeout: timeout setting for this request. If one
897
+ number provided, it will be total request
898
+ timeout. It can also be a pair (tuple) of
899
+ (connection, read) timeouts.
900
+ :type _request_timeout: int, tuple(int, int), optional
901
+ :param _request_auth: set to override the auth_settings for an a single
902
+ request; this effectively ignores the
903
+ authentication in the spec for a single request.
904
+ :type _request_auth: dict, optional
905
+ :param _content_type: force content-type for the request.
906
+ :type _content_type: str, Optional
907
+ :param _headers: set to override the headers for a single
908
+ request; this effectively ignores the headers
909
+ in the spec for a single request.
910
+ :type _headers: dict, optional
911
+ :param _host_index: set to override the host_index for a single
912
+ request; this effectively ignores the host_index
913
+ in the spec for a single request.
914
+ :type _host_index: int, optional
915
+ :return: Returns the result object.
916
+ """ # noqa: E501
917
+
918
+ _param = self._patch_update_engine_engines_patch_serialize(
919
+ x_api_key=x_api_key,
920
+ engine_config_v2=engine_config_v2,
921
+ _request_auth=_request_auth,
922
+ _content_type=_content_type,
923
+ _headers=_headers,
924
+ _host_index=_host_index
925
+ )
926
+
927
+ _response_types_map: Dict[str, Optional[str]] = {
928
+ '200': "SetupEngineResponse",
929
+ '400': "HttpProblemResponse",
930
+ '404': "HttpProblemResponse",
931
+ '409': "HttpProblemResponse",
932
+ '422': "HttpProblemResponse",
933
+ }
934
+ response_data = self.api_client.call_api(
935
+ *_param,
936
+ _request_timeout=_request_timeout
937
+ )
938
+ response_data.read()
939
+ return self.api_client.response_deserialize(
940
+ response_data=response_data,
941
+ response_types_map=_response_types_map,
942
+ ).data
943
+
944
+
945
+ @validate_call
946
+ def patch_update_engine_engines_patch_with_http_info(
947
+ self,
948
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
949
+ engine_config_v2: EngineConfigV2,
950
+ _request_timeout: Union[
951
+ None,
952
+ Annotated[StrictFloat, Field(gt=0)],
953
+ Tuple[
954
+ Annotated[StrictFloat, Field(gt=0)],
955
+ Annotated[StrictFloat, Field(gt=0)]
956
+ ]
957
+ ] = None,
958
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
959
+ _content_type: Optional[StrictStr] = None,
960
+ _headers: Optional[Dict[StrictStr, Any]] = None,
961
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
962
+ ) -> ApiResponse[SetupEngineResponse]:
963
+ """Update Engine
964
+
965
+ Update engine is used to update the configurations of a currently hosted engine within the ERROR or ACTIVE states.
966
+
967
+ :param x_api_key: API key for authentication. (required)
968
+ :type x_api_key: str
969
+ :param engine_config_v2: (required)
970
+ :type engine_config_v2: EngineConfigV2
971
+ :param _request_timeout: timeout setting for this request. If one
972
+ number provided, it will be total request
973
+ timeout. It can also be a pair (tuple) of
974
+ (connection, read) timeouts.
975
+ :type _request_timeout: int, tuple(int, int), optional
976
+ :param _request_auth: set to override the auth_settings for an a single
977
+ request; this effectively ignores the
978
+ authentication in the spec for a single request.
979
+ :type _request_auth: dict, optional
980
+ :param _content_type: force content-type for the request.
981
+ :type _content_type: str, Optional
982
+ :param _headers: set to override the headers for a single
983
+ request; this effectively ignores the headers
984
+ in the spec for a single request.
985
+ :type _headers: dict, optional
986
+ :param _host_index: set to override the host_index for a single
987
+ request; this effectively ignores the host_index
988
+ in the spec for a single request.
989
+ :type _host_index: int, optional
990
+ :return: Returns the result object.
991
+ """ # noqa: E501
992
+
993
+ _param = self._patch_update_engine_engines_patch_serialize(
994
+ x_api_key=x_api_key,
995
+ engine_config_v2=engine_config_v2,
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': "SetupEngineResponse",
1004
+ '400': "HttpProblemResponse",
1005
+ '404': "HttpProblemResponse",
1006
+ '409': "HttpProblemResponse",
1007
+ '422': "HttpProblemResponse",
1008
+ }
1009
+ response_data = self.api_client.call_api(
1010
+ *_param,
1011
+ _request_timeout=_request_timeout
1012
+ )
1013
+ response_data.read()
1014
+ return self.api_client.response_deserialize(
1015
+ response_data=response_data,
1016
+ response_types_map=_response_types_map,
1017
+ )
1018
+
1019
+
1020
+ @validate_call
1021
+ def patch_update_engine_engines_patch_without_preload_content(
1022
+ self,
1023
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
1024
+ engine_config_v2: EngineConfigV2,
1025
+ _request_timeout: Union[
1026
+ None,
1027
+ Annotated[StrictFloat, Field(gt=0)],
1028
+ Tuple[
1029
+ Annotated[StrictFloat, Field(gt=0)],
1030
+ Annotated[StrictFloat, Field(gt=0)]
1031
+ ]
1032
+ ] = None,
1033
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1034
+ _content_type: Optional[StrictStr] = None,
1035
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1036
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1037
+ ) -> RESTResponseType:
1038
+ """Update Engine
1039
+
1040
+ Update engine is used to update the configurations of a currently hosted engine within the ERROR or ACTIVE states.
1041
+
1042
+ :param x_api_key: API key for authentication. (required)
1043
+ :type x_api_key: str
1044
+ :param engine_config_v2: (required)
1045
+ :type engine_config_v2: EngineConfigV2
1046
+ :param _request_timeout: timeout setting for this request. If one
1047
+ number provided, it will be total request
1048
+ timeout. It can also be a pair (tuple) of
1049
+ (connection, read) timeouts.
1050
+ :type _request_timeout: int, tuple(int, int), optional
1051
+ :param _request_auth: set to override the auth_settings for an a single
1052
+ request; this effectively ignores the
1053
+ authentication in the spec for a single request.
1054
+ :type _request_auth: dict, optional
1055
+ :param _content_type: force content-type for the request.
1056
+ :type _content_type: str, Optional
1057
+ :param _headers: set to override the headers for a single
1058
+ request; this effectively ignores the headers
1059
+ in the spec for a single request.
1060
+ :type _headers: dict, optional
1061
+ :param _host_index: set to override the host_index for a single
1062
+ request; this effectively ignores the host_index
1063
+ in the spec for a single request.
1064
+ :type _host_index: int, optional
1065
+ :return: Returns the result object.
1066
+ """ # noqa: E501
1067
+
1068
+ _param = self._patch_update_engine_engines_patch_serialize(
1069
+ x_api_key=x_api_key,
1070
+ engine_config_v2=engine_config_v2,
1071
+ _request_auth=_request_auth,
1072
+ _content_type=_content_type,
1073
+ _headers=_headers,
1074
+ _host_index=_host_index
1075
+ )
1076
+
1077
+ _response_types_map: Dict[str, Optional[str]] = {
1078
+ '200': "SetupEngineResponse",
1079
+ '400': "HttpProblemResponse",
1080
+ '404': "HttpProblemResponse",
1081
+ '409': "HttpProblemResponse",
1082
+ '422': "HttpProblemResponse",
1083
+ }
1084
+ response_data = self.api_client.call_api(
1085
+ *_param,
1086
+ _request_timeout=_request_timeout
1087
+ )
1088
+ return response_data.response
1089
+
1090
+
1091
+ def _patch_update_engine_engines_patch_serialize(
1092
+ self,
1093
+ x_api_key,
1094
+ engine_config_v2,
1095
+ _request_auth,
1096
+ _content_type,
1097
+ _headers,
1098
+ _host_index,
1099
+ ) -> RequestSerialized:
1100
+
1101
+ _host = None
1102
+
1103
+ _collection_formats: Dict[str, str] = {
1104
+ }
1105
+
1106
+ _path_params: Dict[str, str] = {}
1107
+ _query_params: List[Tuple[str, str]] = []
1108
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1109
+ _form_params: List[Tuple[str, str]] = []
1110
+ _files: Dict[
1111
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1112
+ ] = {}
1113
+ _body_params: Optional[bytes] = None
1114
+
1115
+ # process the path parameters
1116
+ # process the query parameters
1117
+ # process the header parameters
1118
+ if x_api_key is not None:
1119
+ _header_params['x-api-key'] = x_api_key
1120
+ # process the form parameters
1121
+ # process the body parameter
1122
+ if engine_config_v2 is not None:
1123
+ _body_params = engine_config_v2
1124
+
1125
+
1126
+ # set the HTTP header `Accept`
1127
+ if 'Accept' not in _header_params:
1128
+ _header_params['Accept'] = self.api_client.select_header_accept(
1129
+ [
1130
+ 'application/json'
1131
+ ]
1132
+ )
1133
+
1134
+ # set the HTTP header `Content-Type`
1135
+ if _content_type:
1136
+ _header_params['Content-Type'] = _content_type
1137
+ else:
1138
+ _default_content_type = (
1139
+ self.api_client.select_header_content_type(
1140
+ [
1141
+ 'application/json'
1142
+ ]
1143
+ )
1144
+ )
1145
+ if _default_content_type is not None:
1146
+ _header_params['Content-Type'] = _default_content_type
1147
+
1148
+ # authentication setting
1149
+ _auth_settings: List[str] = [
1150
+ ]
1151
+
1152
+ return self.api_client.param_serialize(
1153
+ method='PATCH',
1154
+ resource_path='/engines',
1155
+ path_params=_path_params,
1156
+ query_params=_query_params,
1157
+ header_params=_header_params,
1158
+ body=_body_params,
1159
+ post_params=_form_params,
1160
+ files=_files,
1161
+ auth_settings=_auth_settings,
1162
+ collection_formats=_collection_formats,
1163
+ _host=_host,
1164
+ _request_auth=_request_auth
1165
+ )
1166
+
1167
+
1168
+
1169
+
1170
+ @validate_call
1171
+ def post_setup_engine_engines_post(
1172
+ self,
1173
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
1174
+ engine_config_v2: EngineConfigV2,
1175
+ _request_timeout: Union[
1176
+ None,
1177
+ Annotated[StrictFloat, Field(gt=0)],
1178
+ Tuple[
1179
+ Annotated[StrictFloat, Field(gt=0)],
1180
+ Annotated[StrictFloat, Field(gt=0)]
1181
+ ]
1182
+ ] = None,
1183
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1184
+ _content_type: Optional[StrictStr] = None,
1185
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1186
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1187
+ ) -> SetupEngineResponse:
1188
+ """Create Engine
1189
+
1190
+ Create Engine creates a retrieval engine that can be used for any down-stream retrieval-search, ranking-recommendation and user-understanding use-case.The create engine endpoint will do some validation of the input request (including verifying connected datasets are active and validating the fetch SQL). It then asynchronously provisions your data pipelines, and training and serving infrastructure. Use the View Engine and List Engines endpoints to view the status of the underlying asynchronous setup request.
1191
+
1192
+ :param x_api_key: API key for authentication. (required)
1193
+ :type x_api_key: str
1194
+ :param engine_config_v2: (required)
1195
+ :type engine_config_v2: EngineConfigV2
1196
+ :param _request_timeout: timeout setting for this request. If one
1197
+ number provided, it will be total request
1198
+ timeout. It can also be a pair (tuple) of
1199
+ (connection, read) timeouts.
1200
+ :type _request_timeout: int, tuple(int, int), optional
1201
+ :param _request_auth: set to override the auth_settings for an a single
1202
+ request; this effectively ignores the
1203
+ authentication in the spec for a single request.
1204
+ :type _request_auth: dict, optional
1205
+ :param _content_type: force content-type for the request.
1206
+ :type _content_type: str, Optional
1207
+ :param _headers: set to override the headers for a single
1208
+ request; this effectively ignores the headers
1209
+ in the spec for a single request.
1210
+ :type _headers: dict, optional
1211
+ :param _host_index: set to override the host_index for a single
1212
+ request; this effectively ignores the host_index
1213
+ in the spec for a single request.
1214
+ :type _host_index: int, optional
1215
+ :return: Returns the result object.
1216
+ """ # noqa: E501
1217
+
1218
+ _param = self._post_setup_engine_engines_post_serialize(
1219
+ x_api_key=x_api_key,
1220
+ engine_config_v2=engine_config_v2,
1221
+ _request_auth=_request_auth,
1222
+ _content_type=_content_type,
1223
+ _headers=_headers,
1224
+ _host_index=_host_index
1225
+ )
1226
+
1227
+ _response_types_map: Dict[str, Optional[str]] = {
1228
+ '200': "SetupEngineResponse",
1229
+ '400': "HttpProblemResponse",
1230
+ '404': "HttpProblemResponse",
1231
+ '409': "HttpProblemResponse",
1232
+ '422': "HttpProblemResponse",
1233
+ }
1234
+ response_data = self.api_client.call_api(
1235
+ *_param,
1236
+ _request_timeout=_request_timeout
1237
+ )
1238
+ response_data.read()
1239
+ return self.api_client.response_deserialize(
1240
+ response_data=response_data,
1241
+ response_types_map=_response_types_map,
1242
+ ).data
1243
+
1244
+
1245
+ @validate_call
1246
+ def post_setup_engine_engines_post_with_http_info(
1247
+ self,
1248
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
1249
+ engine_config_v2: EngineConfigV2,
1250
+ _request_timeout: Union[
1251
+ None,
1252
+ Annotated[StrictFloat, Field(gt=0)],
1253
+ Tuple[
1254
+ Annotated[StrictFloat, Field(gt=0)],
1255
+ Annotated[StrictFloat, Field(gt=0)]
1256
+ ]
1257
+ ] = None,
1258
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1259
+ _content_type: Optional[StrictStr] = None,
1260
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1261
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1262
+ ) -> ApiResponse[SetupEngineResponse]:
1263
+ """Create Engine
1264
+
1265
+ Create Engine creates a retrieval engine that can be used for any down-stream retrieval-search, ranking-recommendation and user-understanding use-case.The create engine endpoint will do some validation of the input request (including verifying connected datasets are active and validating the fetch SQL). It then asynchronously provisions your data pipelines, and training and serving infrastructure. Use the View Engine and List Engines endpoints to view the status of the underlying asynchronous setup request.
1266
+
1267
+ :param x_api_key: API key for authentication. (required)
1268
+ :type x_api_key: str
1269
+ :param engine_config_v2: (required)
1270
+ :type engine_config_v2: EngineConfigV2
1271
+ :param _request_timeout: timeout setting for this request. If one
1272
+ number provided, it will be total request
1273
+ timeout. It can also be a pair (tuple) of
1274
+ (connection, read) timeouts.
1275
+ :type _request_timeout: int, tuple(int, int), optional
1276
+ :param _request_auth: set to override the auth_settings for an a single
1277
+ request; this effectively ignores the
1278
+ authentication in the spec for a single request.
1279
+ :type _request_auth: dict, optional
1280
+ :param _content_type: force content-type for the request.
1281
+ :type _content_type: str, Optional
1282
+ :param _headers: set to override the headers for a single
1283
+ request; this effectively ignores the headers
1284
+ in the spec for a single request.
1285
+ :type _headers: dict, optional
1286
+ :param _host_index: set to override the host_index for a single
1287
+ request; this effectively ignores the host_index
1288
+ in the spec for a single request.
1289
+ :type _host_index: int, optional
1290
+ :return: Returns the result object.
1291
+ """ # noqa: E501
1292
+
1293
+ _param = self._post_setup_engine_engines_post_serialize(
1294
+ x_api_key=x_api_key,
1295
+ engine_config_v2=engine_config_v2,
1296
+ _request_auth=_request_auth,
1297
+ _content_type=_content_type,
1298
+ _headers=_headers,
1299
+ _host_index=_host_index
1300
+ )
1301
+
1302
+ _response_types_map: Dict[str, Optional[str]] = {
1303
+ '200': "SetupEngineResponse",
1304
+ '400': "HttpProblemResponse",
1305
+ '404': "HttpProblemResponse",
1306
+ '409': "HttpProblemResponse",
1307
+ '422': "HttpProblemResponse",
1308
+ }
1309
+ response_data = self.api_client.call_api(
1310
+ *_param,
1311
+ _request_timeout=_request_timeout
1312
+ )
1313
+ response_data.read()
1314
+ return self.api_client.response_deserialize(
1315
+ response_data=response_data,
1316
+ response_types_map=_response_types_map,
1317
+ )
1318
+
1319
+
1320
+ @validate_call
1321
+ def post_setup_engine_engines_post_without_preload_content(
1322
+ self,
1323
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
1324
+ engine_config_v2: EngineConfigV2,
1325
+ _request_timeout: Union[
1326
+ None,
1327
+ Annotated[StrictFloat, Field(gt=0)],
1328
+ Tuple[
1329
+ Annotated[StrictFloat, Field(gt=0)],
1330
+ Annotated[StrictFloat, Field(gt=0)]
1331
+ ]
1332
+ ] = None,
1333
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1334
+ _content_type: Optional[StrictStr] = None,
1335
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1336
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1337
+ ) -> RESTResponseType:
1338
+ """Create Engine
1339
+
1340
+ Create Engine creates a retrieval engine that can be used for any down-stream retrieval-search, ranking-recommendation and user-understanding use-case.The create engine endpoint will do some validation of the input request (including verifying connected datasets are active and validating the fetch SQL). It then asynchronously provisions your data pipelines, and training and serving infrastructure. Use the View Engine and List Engines endpoints to view the status of the underlying asynchronous setup request.
1341
+
1342
+ :param x_api_key: API key for authentication. (required)
1343
+ :type x_api_key: str
1344
+ :param engine_config_v2: (required)
1345
+ :type engine_config_v2: EngineConfigV2
1346
+ :param _request_timeout: timeout setting for this request. If one
1347
+ number provided, it will be total request
1348
+ timeout. It can also be a pair (tuple) of
1349
+ (connection, read) timeouts.
1350
+ :type _request_timeout: int, tuple(int, int), optional
1351
+ :param _request_auth: set to override the auth_settings for an a single
1352
+ request; this effectively ignores the
1353
+ authentication in the spec for a single request.
1354
+ :type _request_auth: dict, optional
1355
+ :param _content_type: force content-type for the request.
1356
+ :type _content_type: str, Optional
1357
+ :param _headers: set to override the headers for a single
1358
+ request; this effectively ignores the headers
1359
+ in the spec for a single request.
1360
+ :type _headers: dict, optional
1361
+ :param _host_index: set to override the host_index for a single
1362
+ request; this effectively ignores the host_index
1363
+ in the spec for a single request.
1364
+ :type _host_index: int, optional
1365
+ :return: Returns the result object.
1366
+ """ # noqa: E501
1367
+
1368
+ _param = self._post_setup_engine_engines_post_serialize(
1369
+ x_api_key=x_api_key,
1370
+ engine_config_v2=engine_config_v2,
1371
+ _request_auth=_request_auth,
1372
+ _content_type=_content_type,
1373
+ _headers=_headers,
1374
+ _host_index=_host_index
1375
+ )
1376
+
1377
+ _response_types_map: Dict[str, Optional[str]] = {
1378
+ '200': "SetupEngineResponse",
1379
+ '400': "HttpProblemResponse",
1380
+ '404': "HttpProblemResponse",
1381
+ '409': "HttpProblemResponse",
1382
+ '422': "HttpProblemResponse",
1383
+ }
1384
+ response_data = self.api_client.call_api(
1385
+ *_param,
1386
+ _request_timeout=_request_timeout
1387
+ )
1388
+ return response_data.response
1389
+
1390
+
1391
+ def _post_setup_engine_engines_post_serialize(
1392
+ self,
1393
+ x_api_key,
1394
+ engine_config_v2,
1395
+ _request_auth,
1396
+ _content_type,
1397
+ _headers,
1398
+ _host_index,
1399
+ ) -> RequestSerialized:
1400
+
1401
+ _host = None
1402
+
1403
+ _collection_formats: Dict[str, str] = {
1404
+ }
1405
+
1406
+ _path_params: Dict[str, str] = {}
1407
+ _query_params: List[Tuple[str, str]] = []
1408
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1409
+ _form_params: List[Tuple[str, str]] = []
1410
+ _files: Dict[
1411
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1412
+ ] = {}
1413
+ _body_params: Optional[bytes] = None
1414
+
1415
+ # process the path parameters
1416
+ # process the query parameters
1417
+ # process the header parameters
1418
+ if x_api_key is not None:
1419
+ _header_params['x-api-key'] = x_api_key
1420
+ # process the form parameters
1421
+ # process the body parameter
1422
+ if engine_config_v2 is not None:
1423
+ _body_params = engine_config_v2
1424
+
1425
+
1426
+ # set the HTTP header `Accept`
1427
+ if 'Accept' not in _header_params:
1428
+ _header_params['Accept'] = self.api_client.select_header_accept(
1429
+ [
1430
+ 'application/json'
1431
+ ]
1432
+ )
1433
+
1434
+ # set the HTTP header `Content-Type`
1435
+ if _content_type:
1436
+ _header_params['Content-Type'] = _content_type
1437
+ else:
1438
+ _default_content_type = (
1439
+ self.api_client.select_header_content_type(
1440
+ [
1441
+ 'application/json'
1442
+ ]
1443
+ )
1444
+ )
1445
+ if _default_content_type is not None:
1446
+ _header_params['Content-Type'] = _default_content_type
1447
+
1448
+ # authentication setting
1449
+ _auth_settings: List[str] = [
1450
+ ]
1451
+
1452
+ return self.api_client.param_serialize(
1453
+ method='POST',
1454
+ resource_path='/engines',
1455
+ path_params=_path_params,
1456
+ query_params=_query_params,
1457
+ header_params=_header_params,
1458
+ body=_body_params,
1459
+ post_params=_form_params,
1460
+ files=_files,
1461
+ auth_settings=_auth_settings,
1462
+ collection_formats=_collection_formats,
1463
+ _host=_host,
1464
+ _request_auth=_request_auth
1465
+ )
1466
+
1467
+