shaped 2.0.1__tar.gz → 2.0.4__tar.gz

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 (368) hide show
  1. {shaped-2.0.1 → shaped-2.0.4}/PKG-INFO +141 -6
  2. shaped-2.0.4/README.md +361 -0
  3. shaped-2.0.4/pyproject.toml +15 -0
  4. {shaped-2.0.1 → shaped-2.0.4}/setup.py +11 -11
  5. shaped-2.0.4/shaped/__init__.py +59 -0
  6. shaped-2.0.4/shaped/autogen/__init__.py +548 -0
  7. shaped-2.0.4/shaped/autogen/api/__init__.py +8 -0
  8. shaped-2.0.4/shaped/autogen/api/engine_api.py +1467 -0
  9. shaped-2.0.1/python/shaped/autogen/api/dataset_api.py → shaped-2.0.4/shaped/autogen/api/query_api.py +159 -194
  10. shaped-2.0.4/shaped/autogen/api/table_api.py +1494 -0
  11. shaped-2.0.1/python/shaped/autogen/api/model_management_api.py → shaped-2.0.4/shaped/autogen/api/view_api.py +179 -181
  12. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/api_client.py +18 -11
  13. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/configuration.py +22 -9
  14. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/exceptions.py +25 -5
  15. shaped-2.0.4/shaped/autogen/models/__init__.py +263 -0
  16. shaped-2.0.4/shaped/autogen/models/ai_enrichment_view_config.py +123 -0
  17. shaped-2.0.1/python/shaped/autogen/models/path.py → shaped-2.0.4/shaped/autogen/models/algorithm.py +19 -19
  18. shaped-2.0.4/shaped/autogen/models/amplitude_table_config.py +106 -0
  19. shaped-2.0.4/shaped/autogen/models/ascending.py +148 -0
  20. shaped-2.0.4/shaped/autogen/models/attn_dropout_prob.py +136 -0
  21. shaped-2.0.4/shaped/autogen/models/attribute_journey.py +124 -0
  22. shaped-2.0.4/shaped/autogen/models/attribute_value.py +178 -0
  23. shaped-2.0.4/shaped/autogen/models/autoscaling_config.py +95 -0
  24. shaped-2.0.4/shaped/autogen/models/aws_pinpoint_table_config.py +108 -0
  25. shaped-2.0.4/shaped/autogen/models/batch_size.py +136 -0
  26. shaped-2.0.4/shaped/autogen/models/batch_size1.py +136 -0
  27. shaped-2.0.4/shaped/autogen/models/batch_size2.py +136 -0
  28. shaped-2.0.4/shaped/autogen/models/big_query_table_config.py +147 -0
  29. shaped-2.0.4/shaped/autogen/models/bm25.py +136 -0
  30. shaped-2.0.4/shaped/autogen/models/boosted_reorder_step.py +125 -0
  31. shaped-2.0.4/shaped/autogen/models/canary_rollout.py +99 -0
  32. shaped-2.0.4/shaped/autogen/models/candidate_attributes_retrieve_step.py +113 -0
  33. shaped-2.0.4/shaped/autogen/models/candidate_ids_retrieve_step.py +113 -0
  34. shaped-2.0.4/shaped/autogen/models/candidate_retrieval_strategy.py +41 -0
  35. shaped-2.0.4/shaped/autogen/models/clickhouse_table_config.py +146 -0
  36. shaped-2.0.4/shaped/autogen/models/column_order_retrieve_step.py +123 -0
  37. shaped-2.0.4/shaped/autogen/models/column_ordering.py +91 -0
  38. shaped-2.0.4/shaped/autogen/models/create_table_response.py +87 -0
  39. shaped-2.0.4/shaped/autogen/models/create_view_response.py +87 -0
  40. shaped-2.0.4/shaped/autogen/models/custom_table_config.py +135 -0
  41. shaped-2.0.4/shaped/autogen/models/data_compute_config.py +89 -0
  42. shaped-2.0.4/shaped/autogen/models/data_config.py +145 -0
  43. shaped-2.0.4/shaped/autogen/models/data_config_interaction_table.py +146 -0
  44. shaped-2.0.4/shaped/autogen/models/data_split_config.py +88 -0
  45. shaped-2.0.4/shaped/autogen/models/data_split_strategy.py +37 -0
  46. shaped-2.0.4/shaped/autogen/models/data_tier.py +37 -0
  47. shaped-2.0.4/shaped/autogen/models/default.py +246 -0
  48. shaped-2.0.4/shaped/autogen/models/delete_engine_response.py +87 -0
  49. shaped-2.0.4/shaped/autogen/models/delete_table_response.py +87 -0
  50. shaped-2.0.4/shaped/autogen/models/delete_view_response.py +87 -0
  51. shaped-2.0.4/shaped/autogen/models/deployment_config.py +117 -0
  52. shaped-2.0.4/shaped/autogen/models/distance_function.py +38 -0
  53. shaped-2.0.4/shaped/autogen/models/diversity_reorder_step.py +137 -0
  54. shaped-2.0.4/shaped/autogen/models/dropout_rate.py +136 -0
  55. shaped-2.0.4/shaped/autogen/models/dynamo_db_table_config.py +160 -0
  56. shaped-2.0.4/shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +138 -0
  57. shaped-2.0.4/shaped/autogen/models/embedder_batch_size.py +136 -0
  58. shaped-2.0.4/shaped/autogen/models/embedding_config.py +93 -0
  59. shaped-2.0.4/shaped/autogen/models/embedding_dim.py +136 -0
  60. shaped-2.0.4/shaped/autogen/models/embedding_dims.py +136 -0
  61. shaped-2.0.4/shaped/autogen/models/embedding_size.py +136 -0
  62. shaped-2.0.4/shaped/autogen/models/encoder.py +140 -0
  63. shaped-2.0.4/shaped/autogen/models/encoding_pooling_strategy.py +38 -0
  64. shaped-2.0.4/shaped/autogen/models/engine.py +109 -0
  65. shaped-2.0.4/shaped/autogen/models/engine_config_v2.py +152 -0
  66. shaped-2.0.4/shaped/autogen/models/engine_details_response.py +120 -0
  67. shaped-2.0.4/shaped/autogen/models/engine_schema.py +113 -0
  68. shaped-2.0.4/shaped/autogen/models/engine_schema_user_inner.py +146 -0
  69. shaped-2.0.4/shaped/autogen/models/entity_config.py +109 -0
  70. shaped-2.0.4/shaped/autogen/models/entity_journey.py +161 -0
  71. shaped-2.0.4/shaped/autogen/models/entity_type.py +38 -0
  72. shaped-2.0.4/shaped/autogen/models/evaluation_config.py +92 -0
  73. shaped-2.0.4/shaped/autogen/models/exploration_reorder_step.py +125 -0
  74. shaped-2.0.4/shaped/autogen/models/expression_filter_step.py +106 -0
  75. shaped-2.0.4/shaped/autogen/models/factors.py +136 -0
  76. shaped-2.0.4/shaped/autogen/models/factors1.py +136 -0
  77. shaped-2.0.4/shaped/autogen/models/feature.py +90 -0
  78. shaped-2.0.4/shaped/autogen/models/feature_type.py +60 -0
  79. shaped-2.0.4/shaped/autogen/models/file_table_config.py +112 -0
  80. shaped-2.0.4/shaped/autogen/models/filter_config.py +99 -0
  81. shaped-2.0.4/shaped/autogen/models/filter_dataset.py +164 -0
  82. shaped-2.0.4/shaped/autogen/models/filter_index_type.py +36 -0
  83. shaped-2.0.4/shaped/autogen/models/filter_retrieve_step.py +113 -0
  84. shaped-2.0.4/shaped/autogen/models/filter_step_explanation.py +165 -0
  85. shaped-2.0.4/shaped/autogen/models/filter_table.py +140 -0
  86. shaped-2.0.4/shaped/autogen/models/filter_type.py +134 -0
  87. shaped-2.0.4/shaped/autogen/models/global_filter.py +102 -0
  88. shaped-2.0.4/shaped/autogen/models/hidden_dropout_prob.py +136 -0
  89. shaped-2.0.4/shaped/autogen/models/hidden_size.py +136 -0
  90. shaped-2.0.4/shaped/autogen/models/hidden_size1.py +136 -0
  91. shaped-2.0.4/shaped/autogen/models/http_problem_response.py +115 -0
  92. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/models/http_validation_error.py +2 -2
  93. shaped-2.0.4/shaped/autogen/models/hugging_face_encoder.py +115 -0
  94. shaped-2.0.4/shaped/autogen/models/iceberg_table_config.py +154 -0
  95. shaped-2.0.4/shaped/autogen/models/index_config.py +101 -0
  96. shaped-2.0.4/shaped/autogen/models/inner_entity_id.py +144 -0
  97. shaped-2.0.4/shaped/autogen/models/inner_size.py +136 -0
  98. shaped-2.0.4/shaped/autogen/models/inner_size1.py +136 -0
  99. shaped-2.0.4/shaped/autogen/models/inner_uid.py +144 -0
  100. shaped-2.0.4/shaped/autogen/models/interaction_config.py +122 -0
  101. shaped-2.0.4/shaped/autogen/models/interaction_pooling_encoder.py +104 -0
  102. shaped-2.0.4/shaped/autogen/models/interaction_round_robin_encoder.py +104 -0
  103. shaped-2.0.4/shaped/autogen/models/item_attribute_pooling_encoder.py +111 -0
  104. shaped-2.0.4/shaped/autogen/models/journey.py +140 -0
  105. shaped-2.0.4/shaped/autogen/models/kafka_table_config.py +129 -0
  106. shaped-2.0.4/shaped/autogen/models/kinesis_table_config.py +140 -0
  107. shaped-2.0.4/shaped/autogen/models/kinesis_table_config_column_schema_value.py +136 -0
  108. shaped-2.0.4/shaped/autogen/models/label.py +90 -0
  109. shaped-2.0.4/shaped/autogen/models/label_type.py +36 -0
  110. shaped-2.0.4/shaped/autogen/models/laplace_smoothing.py +136 -0
  111. shaped-2.0.4/shaped/autogen/models/latency_scaling_policy.py +112 -0
  112. shaped-2.0.4/shaped/autogen/models/learning_rate.py +136 -0
  113. shaped-2.0.4/shaped/autogen/models/learning_rate1.py +136 -0
  114. shaped-2.0.4/shaped/autogen/models/learning_rate2.py +136 -0
  115. shaped-2.0.4/shaped/autogen/models/learning_rate3.py +136 -0
  116. shaped-2.0.4/shaped/autogen/models/lexical_search_mode.py +99 -0
  117. shaped-2.0.4/shaped/autogen/models/list_engines_response.py +95 -0
  118. shaped-2.0.4/shaped/autogen/models/list_tables_response.py +95 -0
  119. shaped-2.0.4/shaped/autogen/models/list_views_response.py +95 -0
  120. shaped-2.0.4/shaped/autogen/models/location_inner.py +138 -0
  121. shaped-2.0.4/shaped/autogen/models/loss_types.py +37 -0
  122. shaped-2.0.4/shaped/autogen/models/lr.py +136 -0
  123. shaped-2.0.4/shaped/autogen/models/lr1.py +136 -0
  124. shaped-2.0.4/shaped/autogen/models/lr2.py +136 -0
  125. shaped-2.0.4/shaped/autogen/models/max_depth.py +136 -0
  126. shaped-2.0.4/shaped/autogen/models/max_leaves.py +136 -0
  127. shaped-2.0.4/shaped/autogen/models/max_seq_length.py +136 -0
  128. shaped-2.0.4/shaped/autogen/models/max_seq_length1.py +136 -0
  129. shaped-2.0.4/shaped/autogen/models/max_seq_length2.py +136 -0
  130. shaped-2.0.4/shaped/autogen/models/mode.py +134 -0
  131. shaped-2.0.4/shaped/autogen/models/mode1.py +136 -0
  132. shaped-2.0.4/shaped/autogen/models/mode2.py +150 -0
  133. shaped-2.0.4/shaped/autogen/models/models_inner.py +308 -0
  134. shaped-2.0.4/shaped/autogen/models/mongo_db_table_config.py +147 -0
  135. shaped-2.0.4/shaped/autogen/models/mssql_table_config.py +155 -0
  136. shaped-2.0.1/python/shaped/autogen/models/my_sql_dataset_config.py → shaped-2.0.4/shaped/autogen/models/my_sql_table_config.py +45 -28
  137. shaped-2.0.4/shaped/autogen/models/n_epochs.py +136 -0
  138. shaped-2.0.4/shaped/autogen/models/n_epochs1.py +136 -0
  139. shaped-2.0.4/shaped/autogen/models/n_epochs2.py +136 -0
  140. shaped-2.0.4/shaped/autogen/models/n_estimators.py +136 -0
  141. shaped-2.0.4/shaped/autogen/models/n_heads.py +136 -0
  142. shaped-2.0.4/shaped/autogen/models/n_layers.py +136 -0
  143. shaped-2.0.4/shaped/autogen/models/neg_per_positive.py +136 -0
  144. shaped-2.0.4/shaped/autogen/models/negative_samples_count.py +136 -0
  145. shaped-2.0.4/shaped/autogen/models/ngram_tokenizer.py +103 -0
  146. shaped-2.0.4/shaped/autogen/models/no_op_config.py +117 -0
  147. shaped-2.0.4/shaped/autogen/models/num_blocks.py +136 -0
  148. shaped-2.0.4/shaped/autogen/models/num_heads.py +136 -0
  149. shaped-2.0.4/shaped/autogen/models/num_leaves.py +136 -0
  150. shaped-2.0.4/shaped/autogen/models/objective.py +40 -0
  151. shaped-2.0.4/shaped/autogen/models/objective1.py +134 -0
  152. shaped-2.0.4/shaped/autogen/models/online_store_config.py +89 -0
  153. shaped-2.0.4/shaped/autogen/models/pagination_config.py +87 -0
  154. shaped-2.0.4/shaped/autogen/models/parameter_definition.py +96 -0
  155. shaped-2.0.4/shaped/autogen/models/parameters_value.py +240 -0
  156. shaped-2.0.4/shaped/autogen/models/passthrough_score.py +104 -0
  157. shaped-2.0.4/shaped/autogen/models/personal_filter.py +104 -0
  158. shaped-2.0.4/shaped/autogen/models/pipeline_stage_explanation.py +118 -0
  159. shaped-2.0.4/shaped/autogen/models/policy.py +134 -0
  160. shaped-2.0.4/shaped/autogen/models/pool_fn.py +152 -0
  161. shaped-2.0.4/shaped/autogen/models/pooling_function.py +37 -0
  162. shaped-2.0.1/python/shaped/autogen/models/postgres_dataset_config.py → shaped-2.0.4/shaped/autogen/models/postgres_table_config.py +66 -28
  163. shaped-2.0.4/shaped/autogen/models/posthog_table_config.py +133 -0
  164. shaped-2.0.4/shaped/autogen/models/prebuilt_filter_step.py +113 -0
  165. shaped-2.0.4/shaped/autogen/models/precomputed_item_embedding.py +99 -0
  166. shaped-2.0.4/shaped/autogen/models/precomputed_user_embedding.py +99 -0
  167. shaped-2.0.4/shaped/autogen/models/query.py +136 -0
  168. shaped-2.0.4/shaped/autogen/models/query1.py +136 -0
  169. shaped-2.0.4/shaped/autogen/models/query_any_of.py +172 -0
  170. shaped-2.0.4/shaped/autogen/models/query_config.py +140 -0
  171. shaped-2.0.4/shaped/autogen/models/query_definition.py +106 -0
  172. shaped-2.0.4/shaped/autogen/models/query_encoder.py +194 -0
  173. shaped-2.0.4/shaped/autogen/models/query_explanation.py +201 -0
  174. shaped-2.0.4/shaped/autogen/models/query_request.py +121 -0
  175. shaped-2.0.4/shaped/autogen/models/query_result.py +113 -0
  176. shaped-2.0.4/shaped/autogen/models/query_table_config.py +99 -0
  177. shaped-2.0.4/shaped/autogen/models/rank_item_attribute_values_query_config.py +122 -0
  178. shaped-2.0.4/shaped/autogen/models/rank_query_config.py +167 -0
  179. shaped-2.0.4/shaped/autogen/models/rank_query_config_filter_inner.py +149 -0
  180. shaped-2.0.4/shaped/autogen/models/rank_query_config_reorder_inner.py +186 -0
  181. shaped-2.0.4/shaped/autogen/models/rank_query_config_retrieve_inner.py +265 -0
  182. shaped-2.0.4/shaped/autogen/models/recreate_rollout.py +97 -0
  183. shaped-2.0.1/python/shaped/autogen/models/redshift_dataset_config.py → shaped-2.0.4/shaped/autogen/models/redshift_table_config.py +48 -25
  184. shaped-2.0.4/shaped/autogen/models/reference_table_config.py +113 -0
  185. shaped-2.0.4/shaped/autogen/models/regularization.py +136 -0
  186. shaped-2.0.4/shaped/autogen/models/reorder_inner.py +149 -0
  187. shaped-2.0.4/shaped/autogen/models/reorder_step_explanation.py +207 -0
  188. shaped-2.0.4/shaped/autogen/models/request.py +378 -0
  189. shaped-2.0.4/shaped/autogen/models/request1.py +140 -0
  190. shaped-2.0.4/shaped/autogen/models/requests_per_second_scaling_policy.py +112 -0
  191. shaped-2.0.4/shaped/autogen/models/resource_config.py +100 -0
  192. shaped-2.0.4/shaped/autogen/models/response_get_view_details_views_view_name_get.py +134 -0
  193. shaped-2.0.4/shaped/autogen/models/result.py +132 -0
  194. shaped-2.0.4/shaped/autogen/models/result_embeddings_value.py +127 -0
  195. shaped-2.0.4/shaped/autogen/models/retrieval_scores_value.py +127 -0
  196. shaped-2.0.4/shaped/autogen/models/retrieve_inner.py +196 -0
  197. shaped-2.0.4/shaped/autogen/models/retrieve_step_explanation.py +172 -0
  198. shaped-2.0.4/shaped/autogen/models/retriever.py +196 -0
  199. shaped-2.0.4/shaped/autogen/models/retriever1.py +196 -0
  200. shaped-2.0.4/shaped/autogen/models/rollout_config.py +91 -0
  201. shaped-2.0.4/shaped/autogen/models/rudderstack_table_config.py +106 -0
  202. shaped-2.0.4/shaped/autogen/models/sampling_strategy.py +36 -0
  203. shaped-2.0.4/shaped/autogen/models/saved_query_info_response.py +103 -0
  204. shaped-2.0.4/shaped/autogen/models/saved_query_list_response.py +87 -0
  205. shaped-2.0.4/shaped/autogen/models/saved_query_request.py +115 -0
  206. shaped-2.0.4/shaped/autogen/models/schema_config.py +117 -0
  207. shaped-2.0.4/shaped/autogen/models/score.py +134 -0
  208. shaped-2.0.4/shaped/autogen/models/score_ensemble.py +127 -0
  209. shaped-2.0.4/shaped/autogen/models/score_ensemble_policy_config.py +165 -0
  210. shaped-2.0.4/shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +755 -0
  211. shaped-2.0.4/shaped/autogen/models/score_step_explanation.py +224 -0
  212. shaped-2.0.4/shaped/autogen/models/search_config.py +105 -0
  213. shaped-2.0.4/shaped/autogen/models/segment_table_config.py +106 -0
  214. shaped-2.0.4/shaped/autogen/models/sequence_length.py +136 -0
  215. shaped-2.0.4/shaped/autogen/models/server_config.py +100 -0
  216. shaped-2.0.4/shaped/autogen/models/setup_engine_response.py +87 -0
  217. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +154 -0
  218. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +160 -0
  219. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +215 -0
  220. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +156 -0
  221. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +141 -0
  222. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config.py +211 -0
  223. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +140 -0
  224. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config.py +195 -0
  225. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config.py +245 -0
  226. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +119 -0
  227. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +161 -0
  228. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +108 -0
  229. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +143 -0
  230. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +123 -0
  231. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config.py +230 -0
  232. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +119 -0
  233. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config.py +165 -0
  234. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config.py +153 -0
  235. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +137 -0
  236. shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +155 -0
  237. shaped-2.0.4/shaped/autogen/models/shopify_table_config.py +156 -0
  238. shaped-2.0.4/shaped/autogen/models/similarity_retrieve_step.py +123 -0
  239. shaped-2.0.1/python/shaped/autogen/models/snowflake_dataset_config.py → shaped-2.0.4/shaped/autogen/models/snowflake_table_config.py +47 -18
  240. shaped-2.0.4/shaped/autogen/models/sql_transform_type.py +37 -0
  241. shaped-2.0.4/shaped/autogen/models/sql_view_config.py +111 -0
  242. shaped-2.0.4/shaped/autogen/models/stemmer_tokenizer.py +105 -0
  243. shaped-2.0.4/shaped/autogen/models/step_explanation.py +137 -0
  244. shaped-2.0.4/shaped/autogen/models/steps_inner.py +179 -0
  245. shaped-2.0.4/shaped/autogen/models/strategy.py +134 -0
  246. shaped-2.0.4/shaped/autogen/models/table.py +102 -0
  247. shaped-2.0.4/shaped/autogen/models/table_deployment_type.py +38 -0
  248. shaped-2.0.4/shaped/autogen/models/table_insert_arguments.py +87 -0
  249. shaped-2.0.4/shaped/autogen/models/table_insert_response.py +87 -0
  250. shaped-2.0.4/shaped/autogen/models/text_encoding.py +148 -0
  251. shaped-2.0.4/shaped/autogen/models/text_search_retrieve_step.py +121 -0
  252. shaped-2.0.4/shaped/autogen/models/time_frequency.py +136 -0
  253. shaped-2.0.4/shaped/autogen/models/time_window.py +136 -0
  254. shaped-2.0.4/shaped/autogen/models/time_window_in_days.py +154 -0
  255. shaped-2.0.4/shaped/autogen/models/tokenizer.py +149 -0
  256. shaped-2.0.4/shaped/autogen/models/trained_model_encoder.py +99 -0
  257. shaped-2.0.4/shaped/autogen/models/training_compute_config.py +99 -0
  258. shaped-2.0.4/shaped/autogen/models/training_config.py +121 -0
  259. shaped-2.0.4/shaped/autogen/models/training_config_models_inner.py +540 -0
  260. shaped-2.0.4/shaped/autogen/models/training_strategy.py +37 -0
  261. shaped-2.0.4/shaped/autogen/models/transform_status.py +41 -0
  262. shaped-2.0.4/shaped/autogen/models/trending_mode.py +37 -0
  263. shaped-2.0.4/shaped/autogen/models/truncate_filter_step.py +106 -0
  264. shaped-2.0.4/shaped/autogen/models/tunable_bool.py +97 -0
  265. shaped-2.0.4/shaped/autogen/models/tunable_float.py +118 -0
  266. shaped-2.0.4/shaped/autogen/models/tunable_int.py +118 -0
  267. shaped-2.0.4/shaped/autogen/models/tunable_int_categorical.py +99 -0
  268. shaped-2.0.4/shaped/autogen/models/tunable_string.py +99 -0
  269. shaped-2.0.4/shaped/autogen/models/tuning_config.py +89 -0
  270. shaped-2.0.4/shaped/autogen/models/type.py +150 -0
  271. shaped-2.0.4/shaped/autogen/models/update_table_response.py +87 -0
  272. shaped-2.0.4/shaped/autogen/models/update_view_response.py +87 -0
  273. shaped-2.0.4/shaped/autogen/models/user_attribute_pooling_encoder.py +124 -0
  274. shaped-2.0.4/shaped/autogen/models/user_inner.py +134 -0
  275. shaped-2.0.4/shaped/autogen/models/val_split.py +136 -0
  276. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/models/validation_error.py +13 -3
  277. shaped-2.0.4/shaped/autogen/models/validation_error_loc_inner.py +150 -0
  278. shaped-2.0.4/shaped/autogen/models/value_type.py +50 -0
  279. shaped-2.0.4/shaped/autogen/models/vector_search_mode.py +101 -0
  280. shaped-2.0.4/shaped/autogen/models/view.py +104 -0
  281. shaped-2.0.4/shaped/autogen/models/view_details_ai.py +140 -0
  282. shaped-2.0.4/shaped/autogen/models/view_details_ai_schema_value.py +153 -0
  283. shaped-2.0.4/shaped/autogen/models/view_details_sql.py +140 -0
  284. shaped-2.0.4/shaped/autogen/models/view_status.py +41 -0
  285. shaped-2.0.4/shaped/autogen/models/weight_decay.py +136 -0
  286. shaped-2.0.4/shaped/autogen/models/whitespace_tokenizer.py +97 -0
  287. shaped-2.0.4/shaped/autogen/models/window_size.py +136 -0
  288. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/rest.py +10 -4
  289. {shaped-2.0.1/python → shaped-2.0.4}/shaped/cli/shaped_cli.py +163 -35
  290. shaped-2.0.4/shaped/client.py +631 -0
  291. shaped-2.0.4/shaped/config_builders.py +705 -0
  292. shaped-2.0.4/shaped/query_builder.py +781 -0
  293. {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/PKG-INFO +141 -6
  294. shaped-2.0.4/shaped.egg-info/SOURCES.txt +601 -0
  295. shaped-2.0.4/shaped.egg-info/entry_points.txt +2 -0
  296. {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/requires.txt +5 -3
  297. shaped-2.0.4/tests/test_cli.py +554 -0
  298. shaped-2.0.4/tests/test_client_production.py +424 -0
  299. shaped-2.0.4/tests/test_client_query_comprehensive.py +363 -0
  300. shaped-2.0.4/tests/test_client_v2.py +632 -0
  301. shaped-2.0.4/tests/test_client_v2_edge_cases.py +307 -0
  302. shaped-2.0.4/tests/test_client_v2_errors.py +197 -0
  303. shaped-2.0.4/tests/test_client_v2_integration.py +448 -0
  304. shaped-2.0.4/tests/test_config_builders.py +153 -0
  305. shaped-2.0.4/tests/test_query_builder_comprehensive.py +463 -0
  306. shaped-2.0.4/tests/test_query_builder_v2.py +378 -0
  307. shaped-2.0.4/tests/test_query_builder_v2_edge_cases.py +307 -0
  308. shaped-2.0.1/README.md +0 -228
  309. shaped-2.0.1/pyproject.toml +0 -9
  310. shaped-2.0.1/python/shaped/__init__.py +0 -4
  311. shaped-2.0.1/python/shaped/autogen/__init__.py +0 -87
  312. shaped-2.0.1/python/shaped/autogen/api/__init__.py +0 -7
  313. shaped-2.0.1/python/shaped/autogen/api/model_inference_api.py +0 -2825
  314. shaped-2.0.1/python/shaped/autogen/models/__init__.py +0 -68
  315. shaped-2.0.1/python/shaped/autogen/models/amplitude_dataset_config.py +0 -96
  316. shaped-2.0.1/python/shaped/autogen/models/aws_pinpoint_dataset_config.py +0 -96
  317. shaped-2.0.1/python/shaped/autogen/models/big_query_dataset_config.py +0 -114
  318. shaped-2.0.1/python/shaped/autogen/models/complement_items_request.py +0 -99
  319. shaped-2.0.1/python/shaped/autogen/models/complement_items_response.py +0 -89
  320. shaped-2.0.1/python/shaped/autogen/models/connectors_inner.py +0 -134
  321. shaped-2.0.1/python/shaped/autogen/models/create_dataset_arguments.py +0 -263
  322. shaped-2.0.1/python/shaped/autogen/models/create_embedding_response.py +0 -87
  323. shaped-2.0.1/python/shaped/autogen/models/create_item_embedding_request.py +0 -89
  324. shaped-2.0.1/python/shaped/autogen/models/create_model_arguments.py +0 -107
  325. shaped-2.0.1/python/shaped/autogen/models/create_model_response.py +0 -87
  326. shaped-2.0.1/python/shaped/autogen/models/create_user_embedding_request.py +0 -89
  327. shaped-2.0.1/python/shaped/autogen/models/custom_dataset_config.py +0 -115
  328. shaped-2.0.1/python/shaped/autogen/models/dataset_config.py +0 -101
  329. shaped-2.0.1/python/shaped/autogen/models/dataset_schema_type.py +0 -47
  330. shaped-2.0.1/python/shaped/autogen/models/datasets_inner.py +0 -91
  331. shaped-2.0.1/python/shaped/autogen/models/delete_model_response.py +0 -87
  332. shaped-2.0.1/python/shaped/autogen/models/fetch_config.py +0 -95
  333. shaped-2.0.1/python/shaped/autogen/models/file_config.py +0 -105
  334. shaped-2.0.1/python/shaped/autogen/models/file_source_config.py +0 -89
  335. shaped-2.0.1/python/shaped/autogen/models/inference_config.py +0 -101
  336. shaped-2.0.1/python/shaped/autogen/models/insert_model_response.py +0 -87
  337. shaped-2.0.1/python/shaped/autogen/models/interaction.py +0 -87
  338. shaped-2.0.1/python/shaped/autogen/models/list_datasets_response.py +0 -95
  339. shaped-2.0.1/python/shaped/autogen/models/list_models_response.py +0 -95
  340. shaped-2.0.1/python/shaped/autogen/models/model_config.py +0 -99
  341. shaped-2.0.1/python/shaped/autogen/models/model_response.py +0 -95
  342. shaped-2.0.1/python/shaped/autogen/models/mongo_db_dataset_config.py +0 -119
  343. shaped-2.0.1/python/shaped/autogen/models/post_rank_request.py +0 -117
  344. shaped-2.0.1/python/shaped/autogen/models/rank_attribute_response.py +0 -89
  345. shaped-2.0.1/python/shaped/autogen/models/rank_grid_attribute_request.py +0 -91
  346. shaped-2.0.1/python/shaped/autogen/models/rank_grid_attribute_request1.py +0 -93
  347. shaped-2.0.1/python/shaped/autogen/models/rank_grid_attribute_response.py +0 -91
  348. shaped-2.0.1/python/shaped/autogen/models/rank_response.py +0 -91
  349. shaped-2.0.1/python/shaped/autogen/models/retrieve_request.py +0 -101
  350. shaped-2.0.1/python/shaped/autogen/models/retrieve_response.py +0 -91
  351. shaped-2.0.1/python/shaped/autogen/models/retriever_top_k_override.py +0 -97
  352. shaped-2.0.1/python/shaped/autogen/models/rudder_stack_dataset_config.py +0 -96
  353. shaped-2.0.1/python/shaped/autogen/models/segment_dataset_config.py +0 -96
  354. shaped-2.0.1/python/shaped/autogen/models/similar_item_request.py +0 -101
  355. shaped-2.0.1/python/shaped/autogen/models/similar_response.py +0 -89
  356. shaped-2.0.1/python/shaped/autogen/models/similar_users_request.py +0 -99
  357. shaped-2.0.1/python/shaped/autogen/models/successful_response.py +0 -87
  358. shaped-2.0.1/python/shaped/autogen/models/value_type.py +0 -48
  359. shaped-2.0.1/python/shaped/autogen/models/view_model_response.py +0 -99
  360. shaped-2.0.1/python/shaped/client.py +0 -211
  361. shaped-2.0.1/python/shaped.egg-info/SOURCES.txt +0 -77
  362. shaped-2.0.1/python/shaped.egg-info/entry_points.txt +0 -2
  363. {shaped-2.0.1 → shaped-2.0.4}/setup.cfg +0 -0
  364. {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/api_response.py +0 -0
  365. {shaped-2.0.1/python → shaped-2.0.4}/shaped/cli/__init__.py +0 -0
  366. {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/dependency_links.txt +0 -0
  367. {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/top_level.txt +0 -0
  368. {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/zip-safe +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shaped
3
- Version: 2.0.1
3
+ Version: 2.0.4
4
4
  Summary: CLI and SDK tools for interacting with the Shaped API.
5
- Home-page: https://github.com/shaped-ai/shaped-cli
5
+ Home-page: https://github.com/shaped-ai/magnus
6
6
  Author: Shaped Team
7
7
  Author-email: support@shaped.ai
8
8
  Keywords: shaped-ai
@@ -16,17 +16,19 @@ Description-Content-Type: text/markdown
16
16
  Requires-Dist: pyarrow==20.0.0
17
17
  Requires-Dist: pandas==2.3.0
18
18
  Requires-Dist: numpy==1.26.4
19
- Requires-Dist: typer>=0.7.0
19
+ Requires-Dist: typer==0.7.0
20
+ Requires-Dist: click==8.2.1
20
21
  Requires-Dist: requests>=2.28.1
21
22
  Requires-Dist: pydantic>=2.8.2
22
23
  Requires-Dist: pyyaml>=6.0
23
24
  Requires-Dist: tqdm==4.67.1
24
25
  Requires-Dist: s3fs==0.4.2
25
26
  Requires-Dist: fsspec==2023.5.0
26
- Requires-Dist: urllib3<2.1.0,>=1.25.3
27
+ Requires-Dist: urllib3>=2.2.3
28
+ Requires-Dist: h2>=4.0.0
27
29
  Requires-Dist: python-dateutil
28
30
  Requires-Dist: typing-extensions>=4.7.1
29
- Requires-Dist: pytest>=6.2.5
31
+ Requires-Dist: pytest==8.4.1
30
32
  Requires-Dist: pytest-mock==3.14.0
31
33
  Dynamic: author
32
34
  Dynamic: author-email
@@ -258,7 +260,7 @@ shaped view-saved-query --engine-name <ENGINE_NAME> --query-name <QUERY_NAME>
258
260
 
259
261
  ---
260
262
 
261
- # Python SDK
263
+ # Python SDK (V2)
262
264
 
263
265
  ## Installation
264
266
 
@@ -267,3 +269,136 @@ shaped view-saved-query --engine-name <ENGINE_NAME> --query-name <QUERY_NAME>
267
269
  ```sh
268
270
  pip install shaped
269
271
  ```
272
+
273
+ ## V2 Query API with Fluent Builders
274
+
275
+ The V2 SDK provides a fluent query builder API that leverages Shaped's declarative query language:
276
+
277
+ ```python
278
+ from shaped import (
279
+ Client,
280
+ RankQueryBuilder,
281
+ ColumnOrder,
282
+ TextSearch,
283
+ Ensemble,
284
+ Diversity,
285
+ )
286
+
287
+ client = Client(api_key="your-api-key")
288
+
289
+ # Build a query using the fluent builder with step objects
290
+ query = (RankQueryBuilder()
291
+ .from_entity('item')
292
+ .retrieve(
293
+ ColumnOrder(
294
+ [{'name': 'popularity', 'ascending': False}],
295
+ limit=1000
296
+ ),
297
+ TextSearch(
298
+ 'laptop',
299
+ mode={'type': 'vector', 'text_embedding_ref': 'text_emb'}
300
+ )
301
+ )
302
+ .filter(Expression('price < 1000')) filter
303
+ .score(Ensemble('lightgbm', input_user_id='$parameters.userId'))
304
+ .reorder(Diversity(diversity_attributes=['category']))
305
+ .limit(50)
306
+ .columns(['item_id', 'title', 'price'])
307
+ .build())
308
+
309
+ # Execute the query
310
+ result = client.execute_query(
311
+ 'my_engine',
312
+ query,
313
+ parameters={'userId': '123'}
314
+ )
315
+ ```
316
+
317
+ ### Available Step Factory Functions
318
+
319
+ The SDK provides convenient factory functions for creating step objects:
320
+
321
+ **Retrieve Steps:**
322
+ - `ColumnOrder(columns, limit=100, where=None, name=None)` - Sort by columns
323
+ - `TextSearch(input_text_query, mode, limit=100, where=None, name=None)` - Text search
324
+ - `Similarity(embedding_ref, query_encoder, limit=100, where=None, name=None)` - Similarity search
325
+ - `Filter(where=None, limit=100, name=None)` - Filter without ordering
326
+ - `CandidateIds(item_ids, limit=None, name=None)` - Specific item IDs
327
+ - `CandidateAttributes(item_attributes, limit=None, name=None)` - Item attributes
328
+
329
+ **Filter Steps:**
330
+ - `Expression(expression, name=None)` - DuckDB filter expression
331
+ - `Truncate(max_length=500, name=None)` - Truncate results to max_length
332
+ - `Prebuilt(filter_ref, input_user_id=None, name=None)` - Reference to prebuilt filter
333
+
334
+ **Score Configs:**
335
+ - `Ensemble(value_model, input_user_id=None, ...)`
336
+ - `Passthrough(name=None)`
337
+
338
+ **Reorder Steps:**
339
+ - `Diversity(diversity_attributes=None, strength=0.5, ...)`
340
+ - `Boosted(retriever, strength=0.5, name=None)`
341
+ - `Exploration(retriever, strength=0.5, name=None)`
342
+
343
+ ### Execute Saved Query
344
+
345
+ ```python
346
+ result = client.execute_saved_query(
347
+ 'my_engine',
348
+ 'recommendations',
349
+ parameters={'userId': '123', 'limit': 20}
350
+ )
351
+ ```
352
+
353
+ ---
354
+
355
+ # TypeScript/Node.js SDK (V2)
356
+
357
+ ## Installation
358
+
359
+ ### NPM Installation
360
+
361
+ ```sh
362
+ npm install @shaped.ai/client
363
+ ```
364
+
365
+ ## V2 Query API with Fluent Builders
366
+
367
+ The V2 SDK provides a fluent, type-safe query builder API:
368
+
369
+ ```typescript
370
+ import { Client, RankQueryBuilder } from '@shaped.ai/client';
371
+
372
+ const client = new Client({ apiKey: 'your-api-key' });
373
+
374
+ // Build a query using the fluent builder
375
+ const query = new RankQueryBuilder()
376
+ .from('item')
377
+ .retrieve(step => step
378
+ .columnOrder([{name: 'popularity', ascending: false}], {limit: 1000}))
379
+ .retrieve(step => step
380
+ .textSearch('laptop', {type: 'vector', textEmbeddingRef: 'text_emb'}))
381
+ .filter(step => step.expression('price < 1000'))
382
+ .score(step => step.ensemble('lightgbm', {inputUserId: '$parameters.userId'}))
383
+ .reorder(step => step.diversity({attribute: 'category'}))
384
+ .limit(50)
385
+ .columns(['item_id', 'title', 'price'])
386
+ .build();
387
+
388
+ // Execute the query
389
+ const result = await client.executeQuery(
390
+ 'my_engine',
391
+ query,
392
+ {userId: '123'}
393
+ );
394
+ ```
395
+
396
+ ### Execute Saved Query
397
+
398
+ ```typescript
399
+ const result = await client.executeSavedQuery(
400
+ 'my_engine',
401
+ 'recommendations',
402
+ {userId: '123', limit: 20}
403
+ );
404
+ ```
shaped-2.0.4/README.md ADDED
@@ -0,0 +1,361 @@
1
+ # Shaped CLI
2
+
3
+ CLI for interactions with the Shaped API.
4
+
5
+ For full documentation, see [docs.shaped.ai](https://docs.shaped.ai/).
6
+
7
+ ## Installing the Shaped CLI
8
+
9
+ ```
10
+ pip install shaped
11
+ ```
12
+
13
+ ## Initialize
14
+
15
+ ```
16
+ shaped init --api-key <API_KEY> [--env <ENV>]
17
+ ```
18
+
19
+ The `--env` option defaults to `prod` and can be set to other environments like `dev` or `staging`.
20
+
21
+ ## Engine API
22
+
23
+ ### Create Engine
24
+
25
+ ```
26
+ shaped create-engine --file <PATH_TO_FILE>
27
+ ```
28
+
29
+ Or pipe from stdin:
30
+
31
+ ```
32
+ cat <PATH_TO_FILE> | shaped create-engine
33
+ ```
34
+
35
+ ### Update Engine
36
+
37
+ ```
38
+ shaped update-engine --file <PATH_TO_FILE>
39
+ ```
40
+
41
+ Or pipe from stdin:
42
+
43
+ ```
44
+ cat <PATH_TO_FILE> | shaped update-engine
45
+ ```
46
+
47
+ ### List Engines
48
+
49
+ ```
50
+ shaped list-engines
51
+ ```
52
+
53
+ ### View Engine
54
+
55
+ ```
56
+ shaped view-engine --engine-name <ENGINE_NAME>
57
+ ```
58
+
59
+ ### Delete Engine
60
+
61
+ ```
62
+ shaped delete-engine --engine-name <ENGINE_NAME>
63
+ ```
64
+
65
+ ## Table API
66
+
67
+ ### Create Table
68
+
69
+ ```
70
+ shaped create-table --file <PATH_TO_FILE>
71
+ ```
72
+
73
+ Or pipe from stdin:
74
+
75
+ ```
76
+ cat <PATH_TO_FILE> | shaped create-table
77
+ ```
78
+
79
+ ### Create Table from URI
80
+
81
+ Create a table and automatically insert data from a file:
82
+
83
+ ```
84
+ shaped create-table-from-uri --name <TABLE_NAME> --path <PATH_TO_FILE> --type <FILE_TYPE>
85
+ ```
86
+
87
+ Supported file types: `parquet`, `csv`, `tsv`, `json`, `jsonl`
88
+
89
+ ### List Tables
90
+
91
+ ```
92
+ shaped list-tables
93
+ ```
94
+
95
+ ### Table Insert
96
+
97
+ Insert data into an existing table:
98
+
99
+ ```
100
+ shaped table-insert --table-name <TABLE_NAME> --file <DATAFRAME_FILE> --type <FILE_TYPE>
101
+ ```
102
+
103
+ Supported file types: `parquet`, `csv`, `tsv`, `json`, `jsonl`
104
+
105
+ ### View Table
106
+
107
+ ```
108
+ shaped view-table --table-name <TABLE_NAME>
109
+ ```
110
+
111
+ ### Update Table
112
+
113
+ ```
114
+ shaped update-table --file <PATH_TO_FILE>
115
+ ```
116
+
117
+ Or pipe from stdin:
118
+
119
+ ```
120
+ cat <PATH_TO_FILE> | shaped update-table
121
+ ```
122
+
123
+ ### Delete Table
124
+
125
+ ```
126
+ shaped delete-table --table-name <TABLE_NAME>
127
+ ```
128
+
129
+ ## View API
130
+
131
+ ### Create View
132
+
133
+ ```
134
+ shaped create-view --file <PATH_TO_FILE>
135
+ ```
136
+
137
+ Or pipe from stdin:
138
+
139
+ ```
140
+ cat <PATH_TO_FILE> | shaped create-view
141
+ ```
142
+
143
+ ### List Views
144
+
145
+ ```
146
+ shaped list-views
147
+ ```
148
+
149
+ ### View View
150
+
151
+ ```
152
+ shaped view-view --view-name <VIEW_NAME>
153
+ ```
154
+
155
+ ### Update View
156
+
157
+ ```
158
+ shaped update-view --file <PATH_TO_FILE>
159
+ ```
160
+
161
+ Or pipe from stdin:
162
+
163
+ ```
164
+ cat <PATH_TO_FILE> | shaped update-view
165
+ ```
166
+
167
+ ### Delete View
168
+
169
+ ```
170
+ shaped delete-view --view-name <VIEW_NAME>
171
+ ```
172
+
173
+ ## Query API
174
+
175
+ ### Execute Query
176
+
177
+ Execute an ad-hoc query against an engine. The query can be provided in three ways:
178
+
179
+ **From a file:**
180
+ ```
181
+ shaped query --engine-name <ENGINE_NAME> --query-file <PATH_TO_FILE>
182
+ ```
183
+
184
+ **As a JSON string:**
185
+ ```
186
+ shaped query --engine-name <ENGINE_NAME> --query '{"sql": "SELECT * FROM table"}'
187
+ ```
188
+
189
+ **From stdin:**
190
+ ```
191
+ cat <PATH_TO_FILE> | shaped query --engine-name <ENGINE_NAME>
192
+ ```
193
+
194
+ ### Execute Saved Query
195
+
196
+ Execute a previously saved query by name:
197
+
198
+ ```
199
+ shaped execute-saved-query --engine-name <ENGINE_NAME> --query-name <QUERY_NAME>
200
+ ```
201
+
202
+ ### List Saved Queries
203
+
204
+ List all saved queries for an engine:
205
+
206
+ ```
207
+ shaped list-saved-queries --engine-name <ENGINE_NAME>
208
+ ```
209
+
210
+ ### View Saved Query
211
+
212
+ View the definition of a saved query:
213
+
214
+ ```
215
+ shaped view-saved-query --engine-name <ENGINE_NAME> --query-name <QUERY_NAME>
216
+ ```
217
+
218
+ ---
219
+
220
+ # Python SDK (V2)
221
+
222
+ ## Installation
223
+
224
+ ### Pip Installation
225
+
226
+ ```sh
227
+ pip install shaped
228
+ ```
229
+
230
+ ## V2 Query API with Fluent Builders
231
+
232
+ The V2 SDK provides a fluent query builder API that leverages Shaped's declarative query language:
233
+
234
+ ```python
235
+ from shaped import (
236
+ Client,
237
+ RankQueryBuilder,
238
+ ColumnOrder,
239
+ TextSearch,
240
+ Ensemble,
241
+ Diversity,
242
+ )
243
+
244
+ client = Client(api_key="your-api-key")
245
+
246
+ # Build a query using the fluent builder with step objects
247
+ query = (RankQueryBuilder()
248
+ .from_entity('item')
249
+ .retrieve(
250
+ ColumnOrder(
251
+ [{'name': 'popularity', 'ascending': False}],
252
+ limit=1000
253
+ ),
254
+ TextSearch(
255
+ 'laptop',
256
+ mode={'type': 'vector', 'text_embedding_ref': 'text_emb'}
257
+ )
258
+ )
259
+ .filter(Expression('price < 1000')) filter
260
+ .score(Ensemble('lightgbm', input_user_id='$parameters.userId'))
261
+ .reorder(Diversity(diversity_attributes=['category']))
262
+ .limit(50)
263
+ .columns(['item_id', 'title', 'price'])
264
+ .build())
265
+
266
+ # Execute the query
267
+ result = client.execute_query(
268
+ 'my_engine',
269
+ query,
270
+ parameters={'userId': '123'}
271
+ )
272
+ ```
273
+
274
+ ### Available Step Factory Functions
275
+
276
+ The SDK provides convenient factory functions for creating step objects:
277
+
278
+ **Retrieve Steps:**
279
+ - `ColumnOrder(columns, limit=100, where=None, name=None)` - Sort by columns
280
+ - `TextSearch(input_text_query, mode, limit=100, where=None, name=None)` - Text search
281
+ - `Similarity(embedding_ref, query_encoder, limit=100, where=None, name=None)` - Similarity search
282
+ - `Filter(where=None, limit=100, name=None)` - Filter without ordering
283
+ - `CandidateIds(item_ids, limit=None, name=None)` - Specific item IDs
284
+ - `CandidateAttributes(item_attributes, limit=None, name=None)` - Item attributes
285
+
286
+ **Filter Steps:**
287
+ - `Expression(expression, name=None)` - DuckDB filter expression
288
+ - `Truncate(max_length=500, name=None)` - Truncate results to max_length
289
+ - `Prebuilt(filter_ref, input_user_id=None, name=None)` - Reference to prebuilt filter
290
+
291
+ **Score Configs:**
292
+ - `Ensemble(value_model, input_user_id=None, ...)`
293
+ - `Passthrough(name=None)`
294
+
295
+ **Reorder Steps:**
296
+ - `Diversity(diversity_attributes=None, strength=0.5, ...)`
297
+ - `Boosted(retriever, strength=0.5, name=None)`
298
+ - `Exploration(retriever, strength=0.5, name=None)`
299
+
300
+ ### Execute Saved Query
301
+
302
+ ```python
303
+ result = client.execute_saved_query(
304
+ 'my_engine',
305
+ 'recommendations',
306
+ parameters={'userId': '123', 'limit': 20}
307
+ )
308
+ ```
309
+
310
+ ---
311
+
312
+ # TypeScript/Node.js SDK (V2)
313
+
314
+ ## Installation
315
+
316
+ ### NPM Installation
317
+
318
+ ```sh
319
+ npm install @shaped.ai/client
320
+ ```
321
+
322
+ ## V2 Query API with Fluent Builders
323
+
324
+ The V2 SDK provides a fluent, type-safe query builder API:
325
+
326
+ ```typescript
327
+ import { Client, RankQueryBuilder } from '@shaped.ai/client';
328
+
329
+ const client = new Client({ apiKey: 'your-api-key' });
330
+
331
+ // Build a query using the fluent builder
332
+ const query = new RankQueryBuilder()
333
+ .from('item')
334
+ .retrieve(step => step
335
+ .columnOrder([{name: 'popularity', ascending: false}], {limit: 1000}))
336
+ .retrieve(step => step
337
+ .textSearch('laptop', {type: 'vector', textEmbeddingRef: 'text_emb'}))
338
+ .filter(step => step.expression('price < 1000'))
339
+ .score(step => step.ensemble('lightgbm', {inputUserId: '$parameters.userId'}))
340
+ .reorder(step => step.diversity({attribute: 'category'}))
341
+ .limit(50)
342
+ .columns(['item_id', 'title', 'price'])
343
+ .build();
344
+
345
+ // Execute the query
346
+ const result = await client.executeQuery(
347
+ 'my_engine',
348
+ query,
349
+ {userId: '123'}
350
+ );
351
+ ```
352
+
353
+ ### Execute Saved Query
354
+
355
+ ```typescript
356
+ const result = await client.executeSavedQuery(
357
+ 'my_engine',
358
+ 'recommendations',
359
+ {userId: '123', limit: 20}
360
+ );
361
+ ```
@@ -0,0 +1,15 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.ruff]
6
+ exclude = [
7
+ "shaped/autogen",
8
+ "shaped/__init__.py",
9
+ ]
10
+
11
+ [tool.ruff.lint]
12
+ exclude = [
13
+ "shaped/autogen",
14
+ "shaped/__init__.py",
15
+ ]
@@ -7,15 +7,13 @@ from setuptools import find_packages, setup
7
7
 
8
8
  with open("README.md") as f:
9
9
  long_description = f.read()
10
-
11
- version = "2.0.1"
12
-
10
+ version = "2.0.4"
13
11
  setup(
14
12
  name="shaped",
15
13
  version=version,
16
14
  author="Shaped Team",
17
15
  author_email="support@shaped.ai",
18
- url="https://github.com/shaped-ai/shaped-cli",
16
+ url="https://github.com/shaped-ai/magnus",
19
17
  description="CLI and SDK tools for interacting with the Shaped API.",
20
18
  long_description=long_description,
21
19
  long_description_content_type="text/markdown",
@@ -28,31 +26,33 @@ setup(
28
26
  "Intended Audience :: Developers",
29
27
  ],
30
28
  packages=find_packages(
31
- where="python",
29
+ where=".",
32
30
  include=["shaped*"],
33
- exclude=["python/tests"],
31
+ exclude=["tests"],
34
32
  ),
35
- package_dir={'': 'python'},
33
+ package_dir={"": "."},
36
34
  include_package_data=True,
37
35
  zip_safe=True,
38
36
  install_requires=[
39
37
  "pyarrow==20.0.0",
40
38
  "pandas==2.3.0",
41
39
  "numpy==1.26.4",
42
- "typer>=0.7.0",
40
+ "typer==0.7.0",
41
+ "click==8.2.1",
43
42
  "requests>=2.28.1",
44
43
  "pydantic>=2.8.2",
45
44
  "pyyaml>=6.0",
46
45
  "tqdm==4.67.1",
47
46
  "s3fs==0.4.2",
48
47
  "fsspec==2023.5.0",
49
- "urllib3 >= 1.25.3, < 2.1.0",
48
+ "urllib3 >= 2.2.3",
49
+ "h2 >= 4.0.0",
50
50
  "python-dateutil",
51
51
  "typing-extensions >= 4.7.1",
52
- "pytest>=6.2.5",
52
+ "pytest==8.4.1",
53
53
  "pytest-mock==3.14.0",
54
54
  ],
55
55
  python_requires=">=3.9, <3.14",
56
- entry_points={"console_scripts": ["shaped=shaped.cli.shaped_cli:app"]},
56
+ entry_points={"console_scripts": ["shaped=shaped.cli.shaped_cli:main"]},
57
57
  test_suite="python.tests",
58
58
  )
@@ -0,0 +1,59 @@
1
+ """
2
+ Shaped Python SDK public API.
3
+
4
+ This module re-exports the primary user-facing symbols so users can write:
5
+
6
+ from shaped import Client, Engine, Table, View
7
+ from shaped import RankQueryBuilder, Similarity, ColumnOrder
8
+
9
+ Keep this file lightweight and stable: it is part of the SDK's public surface.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from shaped.client import Client, ViewConfig
15
+ from shaped.config_builders import Engine, Table, View
16
+ from shaped.query_builder import (
17
+ Boosted,
18
+ CandidateAttributes,
19
+ CandidateIds,
20
+ ColumnOrder,
21
+ Diversity,
22
+ Exploration,
23
+ Expression,
24
+ Filter,
25
+ Passthrough,
26
+ Prebuilt,
27
+ RankQueryBuilder,
28
+ Similarity,
29
+ TextSearch,
30
+ Truncate,
31
+ ensemble,
32
+ )
33
+
34
+ # Backwards-compatible alias.
35
+ Ensemble = ensemble
36
+
37
+ __all__ = [
38
+ "Boosted",
39
+ "CandidateAttributes",
40
+ "CandidateIds",
41
+ "Client",
42
+ "ColumnOrder",
43
+ "Diversity",
44
+ "Ensemble",
45
+ "Engine",
46
+ "Exploration",
47
+ "Expression",
48
+ "Filter",
49
+ "Passthrough",
50
+ "Prebuilt",
51
+ "RankQueryBuilder",
52
+ "Similarity",
53
+ "Table",
54
+ "TextSearch",
55
+ "Truncate",
56
+ "View",
57
+ "ViewConfig",
58
+ "ensemble",
59
+ ]