shaped 2.0.2__py3-none-any.whl → 2.0.4__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 (294) hide show
  1. shaped/__init__.py +47 -42
  2. shaped/autogen/__init__.py +37 -51
  3. shaped/autogen/api/engine_api.py +1 -1
  4. shaped/autogen/api/query_api.py +8 -68
  5. shaped/autogen/api/table_api.py +1 -1
  6. shaped/autogen/api/view_api.py +1 -1
  7. shaped/autogen/api_client.py +4 -4
  8. shaped/autogen/configuration.py +5 -3
  9. shaped/autogen/exceptions.py +7 -4
  10. shaped/autogen/models/__init__.py +19 -26
  11. shaped/autogen/models/ai_enrichment_view_config.py +1 -1
  12. shaped/autogen/models/algorithm.py +1 -1
  13. shaped/autogen/models/amplitude_table_config.py +1 -1
  14. shaped/autogen/models/ascending.py +29 -17
  15. shaped/autogen/models/attn_dropout_prob.py +1 -1
  16. shaped/autogen/models/attribute_journey.py +1 -1
  17. shaped/autogen/models/attribute_value.py +1 -1
  18. shaped/autogen/models/autoscaling_config.py +1 -1
  19. shaped/autogen/models/aws_pinpoint_table_config.py +1 -1
  20. shaped/autogen/models/batch_size.py +1 -1
  21. shaped/autogen/models/batch_size1.py +1 -1
  22. shaped/autogen/models/batch_size2.py +1 -1
  23. shaped/autogen/models/big_query_table_config.py +1 -1
  24. shaped/autogen/models/bm25.py +1 -1
  25. shaped/autogen/models/boosted_reorder_step.py +1 -1
  26. shaped/autogen/models/canary_rollout.py +1 -1
  27. shaped/autogen/models/candidate_attributes_retrieve_step.py +1 -14
  28. shaped/autogen/models/candidate_ids_retrieve_step.py +1 -1
  29. shaped/autogen/models/candidate_retrieval_strategy.py +1 -1
  30. shaped/autogen/models/clickhouse_table_config.py +1 -1
  31. shaped/autogen/models/column_order_retrieve_step.py +1 -1
  32. shaped/autogen/models/column_ordering.py +1 -1
  33. shaped/autogen/models/create_table_response.py +1 -1
  34. shaped/autogen/models/create_view_response.py +1 -1
  35. shaped/autogen/models/custom_table_config.py +1 -1
  36. shaped/autogen/models/data_compute_config.py +1 -1
  37. shaped/autogen/models/data_config.py +1 -1
  38. shaped/autogen/models/data_config_interaction_table.py +1 -1
  39. shaped/autogen/models/data_split_config.py +1 -1
  40. shaped/autogen/models/data_split_strategy.py +1 -1
  41. shaped/autogen/models/data_tier.py +1 -1
  42. shaped/autogen/models/default.py +1 -1
  43. shaped/autogen/models/delete_engine_response.py +1 -1
  44. shaped/autogen/models/delete_table_response.py +1 -1
  45. shaped/autogen/models/delete_view_response.py +1 -1
  46. shaped/autogen/models/deployment_config.py +2 -8
  47. shaped/autogen/models/distance_function.py +5 -5
  48. shaped/autogen/models/diversity_reorder_step.py +1 -1
  49. shaped/autogen/models/dropout_rate.py +1 -1
  50. shaped/autogen/models/dynamo_db_table_config.py +1 -1
  51. shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +1 -1
  52. shaped/autogen/models/embedder_batch_size.py +1 -1
  53. shaped/autogen/models/embedding_config.py +1 -1
  54. shaped/autogen/models/embedding_dim.py +1 -1
  55. shaped/autogen/models/embedding_dims.py +1 -1
  56. shaped/autogen/models/embedding_size.py +1 -1
  57. shaped/autogen/models/encoder.py +1 -1
  58. shaped/autogen/models/encoding_pooling_strategy.py +5 -5
  59. shaped/autogen/models/engine.py +1 -1
  60. shaped/autogen/models/engine_config_v2.py +1 -1
  61. shaped/autogen/models/engine_details_response.py +1 -1
  62. shaped/autogen/models/engine_schema.py +8 -8
  63. shaped/autogen/models/engine_schema_user_inner.py +30 -18
  64. shaped/autogen/models/entity_config.py +1 -1
  65. shaped/autogen/models/entity_journey.py +28 -19
  66. shaped/autogen/models/entity_type.py +1 -1
  67. shaped/autogen/models/evaluation_config.py +1 -1
  68. shaped/autogen/models/exploration_reorder_step.py +1 -1
  69. shaped/autogen/models/expression_filter_step.py +1 -1
  70. shaped/autogen/models/factors.py +1 -1
  71. shaped/autogen/models/factors1.py +1 -1
  72. shaped/autogen/models/feature.py +1 -1
  73. shaped/autogen/models/feature_type.py +1 -1
  74. shaped/autogen/models/file_table_config.py +1 -1
  75. shaped/autogen/models/filter_config.py +14 -14
  76. shaped/autogen/models/filter_dataset.py +47 -23
  77. shaped/autogen/models/filter_index_type.py +1 -1
  78. shaped/autogen/models/filter_retrieve_step.py +1 -1
  79. shaped/autogen/models/filter_step_explanation.py +165 -0
  80. shaped/autogen/models/filter_table.py +140 -0
  81. shaped/autogen/models/filter_type.py +134 -0
  82. shaped/autogen/models/global_filter.py +1 -1
  83. shaped/autogen/models/hidden_dropout_prob.py +1 -1
  84. shaped/autogen/models/hidden_size.py +1 -1
  85. shaped/autogen/models/hidden_size1.py +1 -1
  86. shaped/autogen/models/http_problem_response.py +1 -1
  87. shaped/autogen/models/http_validation_error.py +1 -1
  88. shaped/autogen/models/hugging_face_encoder.py +6 -4
  89. shaped/autogen/models/iceberg_table_config.py +1 -1
  90. shaped/autogen/models/index_config.py +1 -1
  91. shaped/autogen/models/inner_entity_id.py +144 -0
  92. shaped/autogen/models/inner_size.py +1 -1
  93. shaped/autogen/models/inner_size1.py +1 -1
  94. shaped/autogen/models/inner_uid.py +144 -0
  95. shaped/autogen/models/interaction_config.py +1 -1
  96. shaped/autogen/models/interaction_pooling_encoder.py +1 -1
  97. shaped/autogen/models/interaction_round_robin_encoder.py +1 -1
  98. shaped/autogen/models/item_attribute_pooling_encoder.py +1 -14
  99. shaped/autogen/models/journey.py +1 -1
  100. shaped/autogen/models/kafka_table_config.py +1 -1
  101. shaped/autogen/models/kinesis_table_config.py +1 -1
  102. shaped/autogen/models/kinesis_table_config_column_schema_value.py +1 -1
  103. shaped/autogen/models/label.py +1 -1
  104. shaped/autogen/models/label_type.py +1 -2
  105. shaped/autogen/models/laplace_smoothing.py +1 -1
  106. shaped/autogen/models/latency_scaling_policy.py +1 -1
  107. shaped/autogen/models/learning_rate.py +1 -1
  108. shaped/autogen/models/learning_rate1.py +1 -1
  109. shaped/autogen/models/learning_rate2.py +1 -1
  110. shaped/autogen/models/learning_rate3.py +1 -1
  111. shaped/autogen/models/lexical_search_mode.py +3 -3
  112. shaped/autogen/models/list_engines_response.py +1 -1
  113. shaped/autogen/models/list_tables_response.py +1 -1
  114. shaped/autogen/models/list_views_response.py +1 -1
  115. shaped/autogen/models/location_inner.py +138 -0
  116. shaped/autogen/models/loss_types.py +1 -1
  117. shaped/autogen/models/lr.py +1 -1
  118. shaped/autogen/models/lr1.py +1 -1
  119. shaped/autogen/models/lr2.py +1 -1
  120. shaped/autogen/models/max_depth.py +1 -1
  121. shaped/autogen/models/max_leaves.py +1 -1
  122. shaped/autogen/models/max_seq_length.py +1 -1
  123. shaped/autogen/models/max_seq_length1.py +1 -1
  124. shaped/autogen/models/max_seq_length2.py +1 -1
  125. shaped/autogen/models/mode.py +1 -1
  126. shaped/autogen/models/mode1.py +20 -18
  127. shaped/autogen/models/mode2.py +32 -18
  128. shaped/autogen/models/models_inner.py +308 -0
  129. shaped/autogen/models/mongo_db_table_config.py +1 -1
  130. shaped/autogen/models/mssql_table_config.py +1 -1
  131. shaped/autogen/models/my_sql_table_config.py +1 -1
  132. shaped/autogen/models/n_epochs.py +1 -1
  133. shaped/autogen/models/n_epochs1.py +1 -1
  134. shaped/autogen/models/n_epochs2.py +1 -1
  135. shaped/autogen/models/n_estimators.py +1 -1
  136. shaped/autogen/models/n_heads.py +1 -1
  137. shaped/autogen/models/n_layers.py +1 -1
  138. shaped/autogen/models/neg_per_positive.py +1 -1
  139. shaped/autogen/models/negative_samples_count.py +1 -1
  140. shaped/autogen/models/ngram_tokenizer.py +1 -1
  141. shaped/autogen/models/no_op_config.py +1 -1
  142. shaped/autogen/models/num_blocks.py +1 -1
  143. shaped/autogen/models/num_heads.py +1 -1
  144. shaped/autogen/models/num_leaves.py +1 -1
  145. shaped/autogen/models/objective.py +1 -1
  146. shaped/autogen/models/objective1.py +1 -1
  147. shaped/autogen/models/online_store_config.py +1 -1
  148. shaped/autogen/models/pagination_config.py +1 -1
  149. shaped/autogen/models/parameter_definition.py +1 -1
  150. shaped/autogen/models/parameters_value.py +1 -1
  151. shaped/autogen/models/passthrough_score.py +1 -1
  152. shaped/autogen/models/personal_filter.py +1 -1
  153. shaped/autogen/models/pipeline_stage_explanation.py +4 -4
  154. shaped/autogen/models/policy.py +1 -1
  155. shaped/autogen/models/pool_fn.py +39 -21
  156. shaped/autogen/models/pooling_function.py +1 -1
  157. shaped/autogen/models/postgres_table_config.py +1 -1
  158. shaped/autogen/models/posthog_table_config.py +1 -1
  159. shaped/autogen/models/prebuilt_filter_step.py +1 -1
  160. shaped/autogen/models/precomputed_item_embedding.py +1 -1
  161. shaped/autogen/models/precomputed_user_embedding.py +1 -1
  162. shaped/autogen/models/query.py +15 -15
  163. shaped/autogen/models/query1.py +15 -15
  164. shaped/autogen/models/query_any_of.py +58 -26
  165. shaped/autogen/models/query_config.py +140 -0
  166. shaped/autogen/models/query_definition.py +1 -1
  167. shaped/autogen/models/query_encoder.py +1 -1
  168. shaped/autogen/models/query_explanation.py +7 -3
  169. shaped/autogen/models/query_request.py +1 -1
  170. shaped/autogen/models/query_result.py +1 -1
  171. shaped/autogen/models/query_table_config.py +1 -1
  172. shaped/autogen/models/rank_item_attribute_values_query_config.py +1 -1
  173. shaped/autogen/models/rank_query_config.py +7 -7
  174. shaped/autogen/models/rank_query_config_filter_inner.py +1 -1
  175. shaped/autogen/models/rank_query_config_reorder_inner.py +62 -25
  176. shaped/autogen/models/rank_query_config_retrieve_inner.py +100 -31
  177. shaped/autogen/models/recreate_rollout.py +1 -1
  178. shaped/autogen/models/redshift_table_config.py +1 -1
  179. shaped/autogen/models/reference_table_config.py +1 -1
  180. shaped/autogen/models/regularization.py +1 -1
  181. shaped/autogen/models/reorder_inner.py +149 -0
  182. shaped/autogen/models/reorder_step_explanation.py +207 -0
  183. shaped/autogen/models/request.py +1 -1
  184. shaped/autogen/models/request1.py +1 -1
  185. shaped/autogen/models/requests_per_second_scaling_policy.py +1 -1
  186. shaped/autogen/models/resource_config.py +100 -0
  187. shaped/autogen/models/response_get_view_details_views_view_name_get.py +1 -1
  188. shaped/autogen/models/result.py +1 -14
  189. shaped/autogen/models/result_embeddings_value.py +1 -1
  190. shaped/autogen/models/retrieval_scores_value.py +127 -0
  191. shaped/autogen/models/retrieve_inner.py +196 -0
  192. shaped/autogen/models/retrieve_step_explanation.py +172 -0
  193. shaped/autogen/models/retriever.py +1 -1
  194. shaped/autogen/models/retriever1.py +1 -1
  195. shaped/autogen/models/rollout_config.py +1 -1
  196. shaped/autogen/models/rudderstack_table_config.py +1 -1
  197. shaped/autogen/models/sampling_strategy.py +1 -1
  198. shaped/autogen/models/saved_query_info_response.py +18 -4
  199. shaped/autogen/models/saved_query_list_response.py +1 -1
  200. shaped/autogen/models/saved_query_request.py +1 -1
  201. shaped/autogen/models/schema_config.py +1 -1
  202. shaped/autogen/models/score.py +1 -1
  203. shaped/autogen/models/score_ensemble.py +1 -14
  204. shaped/autogen/models/score_ensemble_policy_config.py +49 -25
  205. shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +456 -123
  206. shaped/autogen/models/score_step_explanation.py +224 -0
  207. shaped/autogen/models/search_config.py +1 -1
  208. shaped/autogen/models/segment_table_config.py +1 -1
  209. shaped/autogen/models/sequence_length.py +1 -1
  210. shaped/autogen/models/server_config.py +14 -1
  211. shaped/autogen/models/setup_engine_response.py +1 -1
  212. shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +9 -3
  213. shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +9 -3
  214. shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +10 -4
  215. shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +46 -27
  216. shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +6 -4
  217. shaped/autogen/models/shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config.py +9 -3
  218. shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +1 -1
  219. shaped/autogen/models/shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config.py +77 -34
  220. shaped/autogen/models/shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config.py +9 -3
  221. shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +1 -1
  222. shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +52 -28
  223. shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +21 -17
  224. shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +36 -23
  225. shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +1 -1
  226. shaped/autogen/models/shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config.py +9 -3
  227. shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +1 -1
  228. shaped/autogen/models/shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config.py +9 -3
  229. shaped/autogen/models/shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config.py +53 -31
  230. shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +10 -4
  231. shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +12 -6
  232. shaped/autogen/models/shopify_table_config.py +1 -1
  233. shaped/autogen/models/similarity_retrieve_step.py +6 -4
  234. shaped/autogen/models/snowflake_table_config.py +1 -1
  235. shaped/autogen/models/sql_transform_type.py +1 -1
  236. shaped/autogen/models/sql_view_config.py +1 -1
  237. shaped/autogen/models/stemmer_tokenizer.py +1 -1
  238. shaped/autogen/models/step_explanation.py +1 -1
  239. shaped/autogen/models/steps_inner.py +179 -0
  240. shaped/autogen/models/strategy.py +1 -1
  241. shaped/autogen/models/table.py +1 -1
  242. shaped/autogen/models/table_deployment_type.py +1 -1
  243. shaped/autogen/models/table_insert_arguments.py +3 -3
  244. shaped/autogen/models/table_insert_response.py +1 -1
  245. shaped/autogen/models/text_encoding.py +29 -17
  246. shaped/autogen/models/text_search_retrieve_step.py +1 -1
  247. shaped/autogen/models/time_frequency.py +1 -1
  248. shaped/autogen/models/time_window.py +1 -1
  249. shaped/autogen/models/time_window_in_days.py +29 -17
  250. shaped/autogen/models/tokenizer.py +1 -1
  251. shaped/autogen/models/trained_model_encoder.py +1 -1
  252. shaped/autogen/models/training_compute_config.py +4 -4
  253. shaped/autogen/models/training_config.py +4 -4
  254. shaped/autogen/models/training_config_models_inner.py +325 -93
  255. shaped/autogen/models/training_strategy.py +1 -1
  256. shaped/autogen/models/transform_status.py +41 -0
  257. shaped/autogen/models/trending_mode.py +4 -4
  258. shaped/autogen/models/truncate_filter_step.py +1 -1
  259. shaped/autogen/models/tunable_bool.py +1 -1
  260. shaped/autogen/models/tunable_float.py +1 -1
  261. shaped/autogen/models/tunable_int.py +1 -1
  262. shaped/autogen/models/tunable_int_categorical.py +1 -1
  263. shaped/autogen/models/tunable_string.py +1 -1
  264. shaped/autogen/models/tuning_config.py +1 -1
  265. shaped/autogen/models/type.py +36 -20
  266. shaped/autogen/models/update_table_response.py +1 -1
  267. shaped/autogen/models/update_view_response.py +1 -1
  268. shaped/autogen/models/user_attribute_pooling_encoder.py +1 -1
  269. shaped/autogen/models/user_inner.py +134 -0
  270. shaped/autogen/models/val_split.py +1 -1
  271. shaped/autogen/models/validation_error.py +4 -4
  272. shaped/autogen/models/validation_error_loc_inner.py +28 -16
  273. shaped/autogen/models/value_type.py +1 -1
  274. shaped/autogen/models/vector_search_mode.py +6 -4
  275. shaped/autogen/models/view.py +4 -4
  276. shaped/autogen/models/view_details_ai.py +6 -6
  277. shaped/autogen/models/view_details_ai_schema_value.py +1 -1
  278. shaped/autogen/models/view_details_sql.py +6 -6
  279. shaped/autogen/models/view_status.py +8 -8
  280. shaped/autogen/models/weight_decay.py +1 -1
  281. shaped/autogen/models/whitespace_tokenizer.py +1 -1
  282. shaped/autogen/models/window_size.py +1 -1
  283. shaped/autogen/rest.py +9 -9
  284. shaped/cli/shaped_cli.py +152 -29
  285. shaped/client.py +50 -43
  286. shaped/config_builders.py +110 -100
  287. shaped/query_builder.py +56 -49
  288. {shaped-2.0.2.dist-info → shaped-2.0.4.dist-info}/METADATA +2 -2
  289. shaped-2.0.4.dist-info/RECORD +296 -0
  290. {shaped-2.0.2.dist-info → shaped-2.0.4.dist-info}/WHEEL +1 -1
  291. shaped-2.0.2.dist-info/RECORD +0 -278
  292. {shaped-2.0.2.dist-info → shaped-2.0.4.dist-info}/entry_points.txt +0 -0
  293. {shaped-2.0.2.dist-info → shaped-2.0.4.dist-info}/top_level.txt +0 -0
  294. {shaped-2.0.2.dist-info → shaped-2.0.4.dist-info}/zip-safe +0 -0
@@ -5,7 +5,7 @@
5
5
 
6
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
7
 
8
- The version of the OpenAPI document: 2.0.0
8
+ The version of the OpenAPI document: 2.0.4
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -58,8 +58,11 @@ class ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecMod
58
58
  eval_after_epochs: Optional[StrictInt] = 1
59
59
  split_ratio: Optional[Union[StrictFloat, StrictInt]] = 0.9
60
60
  eps: Optional[Union[StrictFloat, StrictInt]] = 1.0E-10
61
+ normalize_numerical_features: Optional[StrictBool] = Field(default=True, description="Enable NormalizeNumerical transform for entity features.")
62
+ use_derived_timestamp_features: Optional[StrictBool] = Field(default=True, description="Enable TimestampSinCosEncoder and TimestampCountEncoder for entity features.")
63
+ balance_labels: Optional[StrictBool] = Field(default=True, description="Enable BalanceLabel transform for interactions.")
61
64
  additional_properties: Dict[str, Any] = {}
62
- __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "batch_size", "eval_batch_size", "n_epochs", "device", "learning_rate", "weight_decay", "patience", "sequence_length", "embedding_dim", "num_heads", "num_blocks", "dropout_rate", "reuse_item_embeddings", "max_batches_per_epoch", "gbce_t", "filter_rated", "neg_per_positive", "eval_after_epochs", "split_ratio", "eps"]
65
+ __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "batch_size", "eval_batch_size", "n_epochs", "device", "learning_rate", "weight_decay", "patience", "sequence_length", "embedding_dim", "num_heads", "num_blocks", "dropout_rate", "reuse_item_embeddings", "max_batches_per_epoch", "gbce_t", "filter_rated", "neg_per_positive", "eval_after_epochs", "split_ratio", "eps", "normalize_numerical_features", "use_derived_timestamp_features", "balance_labels"]
63
66
 
64
67
  @field_validator('policy_type')
65
68
  def policy_type_validate_enum(cls, value):
@@ -193,7 +196,10 @@ class ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecMod
193
196
  "neg_per_positive": NegPerPositive.from_dict(obj["neg_per_positive"]) if obj.get("neg_per_positive") is not None else None,
194
197
  "eval_after_epochs": obj.get("eval_after_epochs") if obj.get("eval_after_epochs") is not None else 1,
195
198
  "split_ratio": obj.get("split_ratio") if obj.get("split_ratio") is not None else 0.9,
196
- "eps": obj.get("eps") if obj.get("eps") is not None else 1.0E-10
199
+ "eps": obj.get("eps") if obj.get("eps") is not None else 1.0E-10,
200
+ "normalize_numerical_features": obj.get("normalize_numerical_features") if obj.get("normalize_numerical_features") is not None else True,
201
+ "use_derived_timestamp_features": obj.get("use_derived_timestamp_features") if obj.get("use_derived_timestamp_features") is not None else True,
202
+ "balance_labels": obj.get("balance_labels") if obj.get("balance_labels") is not None else True
197
203
  })
198
204
  # store additional fields in additional_properties
199
205
  for _key in obj.keys():
@@ -5,7 +5,7 @@
5
5
 
6
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
7
 
8
- The version of the OpenAPI document: 2.0.0
8
+ The version of the OpenAPI document: 2.0.4
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -13,23 +13,27 @@
13
13
 
14
14
 
15
15
  from __future__ import annotations
16
+
17
+ import json
16
18
  import pprint
17
19
  import re # noqa: F401
18
- import json
20
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
21
 
20
22
  from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
22
23
  from shaped.autogen.models.distance_function import DistanceFunction
23
24
  from shaped.autogen.models.pool_fn import PoolFn
24
25
  from shaped.autogen.models.text_encoding import TextEncoding
25
- from typing import Optional, Set
26
26
  from typing_extensions import Self
27
27
 
28
- class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig(BaseModel):
28
+
29
+ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig(
30
+ BaseModel
31
+ ):
29
32
  """
30
33
  ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig
31
- """ # noqa: E501
32
- policy_type: Optional[StrictStr] = 'item-content-similarity'
34
+ """ # noqa: E501
35
+
36
+ policy_type: Optional[StrictStr] = "item-content-similarity"
33
37
  name: Optional[StrictStr] = None
34
38
  event_values: Optional[List[StrictStr]] = None
35
39
  pool_fn: Optional[PoolFn] = None
@@ -40,15 +44,26 @@ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSim
40
44
  encode_items_using_stored_factors: Optional[StrictBool] = True
41
45
  item_feature_names: Optional[List[StrictStr]] = None
42
46
  additional_properties: Dict[str, Any] = {}
43
- __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "pool_fn", "include_item_id", "text_encoding", "categorical_and_numerical_encoding", "distance_fn", "encode_items_using_stored_factors", "item_feature_names"]
44
-
45
- @field_validator('policy_type')
47
+ __properties: ClassVar[List[str]] = [
48
+ "policy_type",
49
+ "name",
50
+ "event_values",
51
+ "pool_fn",
52
+ "include_item_id",
53
+ "text_encoding",
54
+ "categorical_and_numerical_encoding",
55
+ "distance_fn",
56
+ "encode_items_using_stored_factors",
57
+ "item_feature_names",
58
+ ]
59
+
60
+ @field_validator("policy_type")
46
61
  def policy_type_validate_enum(cls, value):
47
62
  """Validates the enum"""
48
63
  if value is None:
49
64
  return value
50
65
 
51
- if value not in set(['item-content-similarity']):
66
+ if value not in set(["item-content-similarity"]):
52
67
  raise ValueError("must be one of enum values ('item-content-similarity')")
53
68
  return value
54
69
 
@@ -58,7 +73,6 @@ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSim
58
73
  protected_namespaces=(),
59
74
  )
60
75
 
61
-
62
76
  def to_str(self) -> str:
63
77
  """Returns the string representation of the model using alias"""
64
78
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -84,9 +98,11 @@ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSim
84
98
  are ignored.
85
99
  * Fields in `self.additional_properties` are added to the output dict.
86
100
  """
87
- excluded_fields: Set[str] = set([
88
- "additional_properties",
89
- ])
101
+ excluded_fields: Set[str] = set(
102
+ [
103
+ "additional_properties",
104
+ ]
105
+ )
90
106
 
91
107
  _dict = self.model_dump(
92
108
  by_alias=True,
@@ -95,10 +111,10 @@ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSim
95
111
  )
96
112
  # override the default output from pydantic by calling `to_dict()` of pool_fn
97
113
  if self.pool_fn:
98
- _dict['pool_fn'] = self.pool_fn.to_dict()
114
+ _dict["pool_fn"] = self.pool_fn.to_dict()
99
115
  # override the default output from pydantic by calling `to_dict()` of text_encoding
100
116
  if self.text_encoding:
101
- _dict['text_encoding'] = self.text_encoding.to_dict()
117
+ _dict["text_encoding"] = self.text_encoding.to_dict()
102
118
  # puts key-value pairs in additional_properties in the top level
103
119
  if self.additional_properties is not None:
104
120
  for _key, _value in self.additional_properties.items():
@@ -107,17 +123,20 @@ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSim
107
123
  # set to None if name (nullable) is None
108
124
  # and model_fields_set contains the field
109
125
  if self.name is None and "name" in self.model_fields_set:
110
- _dict['name'] = None
126
+ _dict["name"] = None
111
127
 
112
128
  # set to None if event_values (nullable) is None
113
129
  # and model_fields_set contains the field
114
130
  if self.event_values is None and "event_values" in self.model_fields_set:
115
- _dict['event_values'] = None
131
+ _dict["event_values"] = None
116
132
 
117
133
  # set to None if item_feature_names (nullable) is None
118
134
  # and model_fields_set contains the field
119
- if self.item_feature_names is None and "item_feature_names" in self.model_fields_set:
120
- _dict['item_feature_names'] = None
135
+ if (
136
+ self.item_feature_names is None
137
+ and "item_feature_names" in self.model_fields_set
138
+ ):
139
+ _dict["item_feature_names"] = None
121
140
 
122
141
  return _dict
123
142
 
@@ -130,23 +149,47 @@ class ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSim
130
149
  if not isinstance(obj, dict):
131
150
  return cls.model_validate(obj)
132
151
 
133
- _obj = cls.model_validate({
134
- "policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'item-content-similarity',
135
- "name": obj.get("name"),
136
- "event_values": obj.get("event_values"),
137
- "pool_fn": PoolFn.from_dict(obj["pool_fn"]) if obj.get("pool_fn") is not None else None,
138
- "include_item_id": obj.get("include_item_id") if obj.get("include_item_id") is not None else True,
139
- "text_encoding": TextEncoding.from_dict(obj["text_encoding"]) if obj.get("text_encoding") is not None else None,
140
- "categorical_and_numerical_encoding": obj.get("categorical_and_numerical_encoding") if obj.get("categorical_and_numerical_encoding") is not None else False,
141
- "distance_fn": obj.get("distance_fn"),
142
- "encode_items_using_stored_factors": obj.get("encode_items_using_stored_factors") if obj.get("encode_items_using_stored_factors") is not None else True,
143
- "item_feature_names": obj.get("item_feature_names")
144
- })
152
+ _obj = cls.model_validate(
153
+ {
154
+ "policy_type": (
155
+ obj.get("policy_type")
156
+ if obj.get("policy_type") is not None
157
+ else "item-content-similarity"
158
+ ),
159
+ "name": obj.get("name"),
160
+ "event_values": obj.get("event_values"),
161
+ "pool_fn": (
162
+ PoolFn.from_dict(obj["pool_fn"])
163
+ if obj.get("pool_fn") is not None
164
+ else None
165
+ ),
166
+ "include_item_id": (
167
+ obj.get("include_item_id")
168
+ if obj.get("include_item_id") is not None
169
+ else True
170
+ ),
171
+ "text_encoding": (
172
+ TextEncoding.from_dict(obj["text_encoding"])
173
+ if obj.get("text_encoding") is not None
174
+ else None
175
+ ),
176
+ "categorical_and_numerical_encoding": (
177
+ obj.get("categorical_and_numerical_encoding")
178
+ if obj.get("categorical_and_numerical_encoding") is not None
179
+ else False
180
+ ),
181
+ "distance_fn": obj.get("distance_fn"),
182
+ "encode_items_using_stored_factors": (
183
+ obj.get("encode_items_using_stored_factors")
184
+ if obj.get("encode_items_using_stored_factors") is not None
185
+ else True
186
+ ),
187
+ "item_feature_names": obj.get("item_feature_names"),
188
+ }
189
+ )
145
190
  # store additional fields in additional_properties
146
191
  for _key in obj.keys():
147
192
  if _key not in cls.__properties:
148
193
  _obj.additional_properties[_key] = obj.get(_key)
149
194
 
150
195
  return _obj
151
-
152
-
@@ -5,7 +5,7 @@
5
5
 
6
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
7
 
8
- The version of the OpenAPI document: 2.0.0
8
+ The version of the OpenAPI document: 2.0.4
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -65,8 +65,11 @@ class ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBM
65
65
  drop_item_id: Optional[StrictBool] = False
66
66
  early_stopping_rounds: Optional[StrictInt] = None
67
67
  include_attributes: Optional[List[StrictStr]] = None
68
+ normalize_numerical_features: Optional[StrictBool] = Field(default=True, description="Enable NormalizeNumerical transform for entity features.")
69
+ use_derived_timestamp_features: Optional[StrictBool] = Field(default=True, description="Enable TimestampSinCosEncoder and TimestampCountEncoder for entity features.")
70
+ balance_labels: Optional[StrictBool] = Field(default=True, description="Enable BalanceLabel transform for interactions.")
68
71
  additional_properties: Dict[str, Any] = {}
69
- __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "objective", "n_estimators", "max_depth", "num_leaves", "min_child_weight", "learning_rate", "colsample_bytree", "subsample", "subsample_freq", "zero_as_missing", "bin_construct_sample_cnt", "verbose", "verbose_eval", "num_threads", "enable_resume", "lambdarank_truncation_level", "calibrate", "event_value_user_affinity_features", "event_value_affinity_features_value_filter", "rolling_window_hours", "negative_affinity_features", "content_affinity_features", "content_affinity_features_batch_size", "content_affinity_max_num_latest_items", "content_affinity_embedding_ref", "container_categorical_to_multi_hot", "container_to_container_affinities", "point_in_time_item_feature", "drop_user_id", "drop_item_id", "early_stopping_rounds", "include_attributes"]
72
+ __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "objective", "n_estimators", "max_depth", "num_leaves", "min_child_weight", "learning_rate", "colsample_bytree", "subsample", "subsample_freq", "zero_as_missing", "bin_construct_sample_cnt", "verbose", "verbose_eval", "num_threads", "enable_resume", "lambdarank_truncation_level", "calibrate", "event_value_user_affinity_features", "event_value_affinity_features_value_filter", "rolling_window_hours", "negative_affinity_features", "content_affinity_features", "content_affinity_features_batch_size", "content_affinity_max_num_latest_items", "content_affinity_embedding_ref", "container_categorical_to_multi_hot", "container_to_container_affinities", "point_in_time_item_feature", "drop_user_id", "drop_item_id", "early_stopping_rounds", "include_attributes", "normalize_numerical_features", "use_derived_timestamp_features", "balance_labels"]
70
73
 
71
74
  @field_validator('policy_type')
72
75
  def policy_type_validate_enum(cls, value):
@@ -227,7 +230,10 @@ class ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBM
227
230
  "drop_user_id": obj.get("drop_user_id") if obj.get("drop_user_id") is not None else True,
228
231
  "drop_item_id": obj.get("drop_item_id") if obj.get("drop_item_id") is not None else False,
229
232
  "early_stopping_rounds": obj.get("early_stopping_rounds"),
230
- "include_attributes": obj.get("include_attributes")
233
+ "include_attributes": obj.get("include_attributes"),
234
+ "normalize_numerical_features": obj.get("normalize_numerical_features") if obj.get("normalize_numerical_features") is not None else True,
235
+ "use_derived_timestamp_features": obj.get("use_derived_timestamp_features") if obj.get("use_derived_timestamp_features") is not None else True,
236
+ "balance_labels": obj.get("balance_labels") if obj.get("balance_labels") is not None else True
231
237
  })
232
238
  # store additional fields in additional_properties
233
239
  for _key in obj.keys():
@@ -5,7 +5,7 @@
5
5
 
6
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
7
 
8
- The version of the OpenAPI document: 2.0.0
8
+ The version of the OpenAPI document: 2.0.4
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -13,35 +13,43 @@
13
13
 
14
14
 
15
15
  from __future__ import annotations
16
+
17
+ import json
16
18
  import pprint
17
19
  import re # noqa: F401
18
- import json
20
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
21
 
20
22
  from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
22
23
  from shaped.autogen.models.time_window_in_days import TimeWindowInDays
23
- from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
+
26
27
  class ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig(BaseModel):
27
28
  """
28
29
  ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig
29
- """ # noqa: E501
30
- policy_type: Optional[StrictStr] = 'popular'
30
+ """ # noqa: E501
31
+
32
+ policy_type: Optional[StrictStr] = "popular"
31
33
  name: Optional[StrictStr] = None
32
34
  event_values: Optional[List[StrictStr]] = None
33
- mode: Optional[StrictStr] = 'positive_popularity'
35
+ mode: Optional[StrictStr] = "positive_popularity"
34
36
  time_window_in_days: Optional[TimeWindowInDays] = None
35
37
  additional_properties: Dict[str, Any] = {}
36
- __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "mode", "time_window_in_days"]
37
-
38
- @field_validator('policy_type')
38
+ __properties: ClassVar[List[str]] = [
39
+ "policy_type",
40
+ "name",
41
+ "event_values",
42
+ "mode",
43
+ "time_window_in_days",
44
+ ]
45
+
46
+ @field_validator("policy_type")
39
47
  def policy_type_validate_enum(cls, value):
40
48
  """Validates the enum"""
41
49
  if value is None:
42
50
  return value
43
51
 
44
- if value not in set(['popular']):
52
+ if value not in set(["popular"]):
45
53
  raise ValueError("must be one of enum values ('popular')")
46
54
  return value
47
55
 
@@ -51,7 +59,6 @@ class ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig(Bas
51
59
  protected_namespaces=(),
52
60
  )
53
61
 
54
-
55
62
  def to_str(self) -> str:
56
63
  """Returns the string representation of the model using alias"""
57
64
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -77,9 +84,11 @@ class ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig(Bas
77
84
  are ignored.
78
85
  * Fields in `self.additional_properties` are added to the output dict.
79
86
  """
80
- excluded_fields: Set[str] = set([
81
- "additional_properties",
82
- ])
87
+ excluded_fields: Set[str] = set(
88
+ [
89
+ "additional_properties",
90
+ ]
91
+ )
83
92
 
84
93
  _dict = self.model_dump(
85
94
  by_alias=True,
@@ -88,7 +97,7 @@ class ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig(Bas
88
97
  )
89
98
  # override the default output from pydantic by calling `to_dict()` of time_window_in_days
90
99
  if self.time_window_in_days:
91
- _dict['time_window_in_days'] = self.time_window_in_days.to_dict()
100
+ _dict["time_window_in_days"] = self.time_window_in_days.to_dict()
92
101
  # puts key-value pairs in additional_properties in the top level
93
102
  if self.additional_properties is not None:
94
103
  for _key, _value in self.additional_properties.items():
@@ -97,17 +106,20 @@ class ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig(Bas
97
106
  # set to None if name (nullable) is None
98
107
  # and model_fields_set contains the field
99
108
  if self.name is None and "name" in self.model_fields_set:
100
- _dict['name'] = None
109
+ _dict["name"] = None
101
110
 
102
111
  # set to None if event_values (nullable) is None
103
112
  # and model_fields_set contains the field
104
113
  if self.event_values is None and "event_values" in self.model_fields_set:
105
- _dict['event_values'] = None
114
+ _dict["event_values"] = None
106
115
 
107
116
  # set to None if time_window_in_days (nullable) is None
108
117
  # and model_fields_set contains the field
109
- if self.time_window_in_days is None and "time_window_in_days" in self.model_fields_set:
110
- _dict['time_window_in_days'] = None
118
+ if (
119
+ self.time_window_in_days is None
120
+ and "time_window_in_days" in self.model_fields_set
121
+ ):
122
+ _dict["time_window_in_days"] = None
111
123
 
112
124
  return _dict
113
125
 
@@ -120,18 +132,30 @@ class ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig(Bas
120
132
  if not isinstance(obj, dict):
121
133
  return cls.model_validate(obj)
122
134
 
123
- _obj = cls.model_validate({
124
- "policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'popular',
125
- "name": obj.get("name"),
126
- "event_values": obj.get("event_values"),
127
- "mode": obj.get("mode") if obj.get("mode") is not None else 'positive_popularity',
128
- "time_window_in_days": TimeWindowInDays.from_dict(obj["time_window_in_days"]) if obj.get("time_window_in_days") is not None else None
129
- })
135
+ _obj = cls.model_validate(
136
+ {
137
+ "policy_type": (
138
+ obj.get("policy_type")
139
+ if obj.get("policy_type") is not None
140
+ else "popular"
141
+ ),
142
+ "name": obj.get("name"),
143
+ "event_values": obj.get("event_values"),
144
+ "mode": (
145
+ obj.get("mode")
146
+ if obj.get("mode") is not None
147
+ else "positive_popularity"
148
+ ),
149
+ "time_window_in_days": (
150
+ TimeWindowInDays.from_dict(obj["time_window_in_days"])
151
+ if obj.get("time_window_in_days") is not None
152
+ else None
153
+ ),
154
+ }
155
+ )
130
156
  # store additional fields in additional_properties
131
157
  for _key in obj.keys():
132
158
  if _key not in cls.__properties:
133
159
  _obj.additional_properties[_key] = obj.get(_key)
134
160
 
135
161
  return _obj
136
-
137
-
@@ -13,30 +13,32 @@
13
13
 
14
14
 
15
15
  from __future__ import annotations
16
+
17
+ import json
16
18
  import pprint
17
19
  import re # noqa: F401
18
- import json
20
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
21
 
20
22
  from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
+
25
26
  class ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig(BaseModel):
26
27
  """
27
28
  ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig
28
- """ # noqa: E501
29
- policy_type: Optional[StrictStr] = 'random'
29
+ """ # noqa: E501
30
+
31
+ policy_type: Optional[StrictStr] = "random"
30
32
  name: Optional[StrictStr] = None
31
33
  __properties: ClassVar[List[str]] = ["policy_type", "name"]
32
34
 
33
- @field_validator('policy_type')
35
+ @field_validator("policy_type")
34
36
  def policy_type_validate_enum(cls, value):
35
37
  """Validates the enum"""
36
38
  if value is None:
37
39
  return value
38
40
 
39
- if value not in set(['random']):
41
+ if value not in set(["random"]):
40
42
  raise ValueError("must be one of enum values ('random')")
41
43
  return value
42
44
 
@@ -46,7 +48,6 @@ class ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig(BaseM
46
48
  protected_namespaces=(),
47
49
  )
48
50
 
49
-
50
51
  def to_str(self) -> str:
51
52
  """Returns the string representation of the model using alias"""
52
53
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -71,8 +72,7 @@ class ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig(BaseM
71
72
  were set at model initialization. Other fields with value `None`
72
73
  are ignored.
73
74
  """
74
- excluded_fields: Set[str] = set([
75
- ])
75
+ excluded_fields: Set[str] = set([])
76
76
 
77
77
  _dict = self.model_dump(
78
78
  by_alias=True,
@@ -82,7 +82,7 @@ class ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig(BaseM
82
82
  # set to None if name (nullable) is None
83
83
  # and model_fields_set contains the field
84
84
  if self.name is None and "name" in self.model_fields_set:
85
- _dict['name'] = None
85
+ _dict["name"] = None
86
86
 
87
87
  return _dict
88
88
 
@@ -95,10 +95,14 @@ class ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig(BaseM
95
95
  if not isinstance(obj, dict):
96
96
  return cls.model_validate(obj)
97
97
 
98
- _obj = cls.model_validate({
99
- "policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'random',
100
- "name": obj.get("name")
101
- })
98
+ _obj = cls.model_validate(
99
+ {
100
+ "policy_type": (
101
+ obj.get("policy_type")
102
+ if obj.get("policy_type") is not None
103
+ else "random"
104
+ ),
105
+ "name": obj.get("name"),
106
+ }
107
+ )
102
108
  return _obj
103
-
104
-
@@ -13,34 +13,38 @@
13
13
 
14
14
 
15
15
  from __future__ import annotations
16
+
17
+ import json
16
18
  import pprint
17
19
  import re # noqa: F401
18
- import json
20
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
21
 
20
22
  from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
22
23
  from shaped.autogen.models.mode1 import Mode1
23
- from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig(BaseModel):
26
+
27
+ class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig(
28
+ BaseModel
29
+ ):
27
30
  """
28
31
  ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig
29
- """ # noqa: E501
30
- policy_type: Optional[StrictStr] = 'recently-popular'
32
+ """ # noqa: E501
33
+
34
+ policy_type: Optional[StrictStr] = "recently-popular"
31
35
  name: Optional[StrictStr] = None
32
36
  event_values: Optional[List[StrictStr]] = None
33
37
  mode: Optional[Mode1] = None
34
38
  additional_properties: Dict[str, Any] = {}
35
39
  __properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "mode"]
36
40
 
37
- @field_validator('policy_type')
41
+ @field_validator("policy_type")
38
42
  def policy_type_validate_enum(cls, value):
39
43
  """Validates the enum"""
40
44
  if value is None:
41
45
  return value
42
46
 
43
- if value not in set(['recently-popular']):
47
+ if value not in set(["recently-popular"]):
44
48
  raise ValueError("must be one of enum values ('recently-popular')")
45
49
  return value
46
50
 
@@ -50,7 +54,6 @@ class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConf
50
54
  protected_namespaces=(),
51
55
  )
52
56
 
53
-
54
57
  def to_str(self) -> str:
55
58
  """Returns the string representation of the model using alias"""
56
59
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -76,9 +79,11 @@ class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConf
76
79
  are ignored.
77
80
  * Fields in `self.additional_properties` are added to the output dict.
78
81
  """
79
- excluded_fields: Set[str] = set([
80
- "additional_properties",
81
- ])
82
+ excluded_fields: Set[str] = set(
83
+ [
84
+ "additional_properties",
85
+ ]
86
+ )
82
87
 
83
88
  _dict = self.model_dump(
84
89
  by_alias=True,
@@ -87,7 +92,7 @@ class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConf
87
92
  )
88
93
  # override the default output from pydantic by calling `to_dict()` of mode
89
94
  if self.mode:
90
- _dict['mode'] = self.mode.to_dict()
95
+ _dict["mode"] = self.mode.to_dict()
91
96
  # puts key-value pairs in additional_properties in the top level
92
97
  if self.additional_properties is not None:
93
98
  for _key, _value in self.additional_properties.items():
@@ -96,12 +101,12 @@ class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConf
96
101
  # set to None if name (nullable) is None
97
102
  # and model_fields_set contains the field
98
103
  if self.name is None and "name" in self.model_fields_set:
99
- _dict['name'] = None
104
+ _dict["name"] = None
100
105
 
101
106
  # set to None if event_values (nullable) is None
102
107
  # and model_fields_set contains the field
103
108
  if self.event_values is None and "event_values" in self.model_fields_set:
104
- _dict['event_values'] = None
109
+ _dict["event_values"] = None
105
110
 
106
111
  return _dict
107
112
 
@@ -114,17 +119,25 @@ class ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConf
114
119
  if not isinstance(obj, dict):
115
120
  return cls.model_validate(obj)
116
121
 
117
- _obj = cls.model_validate({
118
- "policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'recently-popular',
119
- "name": obj.get("name"),
120
- "event_values": obj.get("event_values"),
121
- "mode": Mode1.from_dict(obj["mode"]) if obj.get("mode") is not None else None
122
- })
122
+ _obj = cls.model_validate(
123
+ {
124
+ "policy_type": (
125
+ obj.get("policy_type")
126
+ if obj.get("policy_type") is not None
127
+ else "recently-popular"
128
+ ),
129
+ "name": obj.get("name"),
130
+ "event_values": obj.get("event_values"),
131
+ "mode": (
132
+ Mode1.from_dict(obj["mode"])
133
+ if obj.get("mode") is not None
134
+ else None
135
+ ),
136
+ }
137
+ )
123
138
  # store additional fields in additional_properties
124
139
  for _key in obj.keys():
125
140
  if _key not in cls.__properties:
126
141
  _obj.additional_properties[_key] = obj.get(_key)
127
142
 
128
143
  return _obj
129
-
130
-