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.
- {shaped-2.0.1 → shaped-2.0.4}/PKG-INFO +141 -6
- shaped-2.0.4/README.md +361 -0
- shaped-2.0.4/pyproject.toml +15 -0
- {shaped-2.0.1 → shaped-2.0.4}/setup.py +11 -11
- shaped-2.0.4/shaped/__init__.py +59 -0
- shaped-2.0.4/shaped/autogen/__init__.py +548 -0
- shaped-2.0.4/shaped/autogen/api/__init__.py +8 -0
- shaped-2.0.4/shaped/autogen/api/engine_api.py +1467 -0
- shaped-2.0.1/python/shaped/autogen/api/dataset_api.py → shaped-2.0.4/shaped/autogen/api/query_api.py +159 -194
- shaped-2.0.4/shaped/autogen/api/table_api.py +1494 -0
- shaped-2.0.1/python/shaped/autogen/api/model_management_api.py → shaped-2.0.4/shaped/autogen/api/view_api.py +179 -181
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/api_client.py +18 -11
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/configuration.py +22 -9
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/exceptions.py +25 -5
- shaped-2.0.4/shaped/autogen/models/__init__.py +263 -0
- shaped-2.0.4/shaped/autogen/models/ai_enrichment_view_config.py +123 -0
- shaped-2.0.1/python/shaped/autogen/models/path.py → shaped-2.0.4/shaped/autogen/models/algorithm.py +19 -19
- shaped-2.0.4/shaped/autogen/models/amplitude_table_config.py +106 -0
- shaped-2.0.4/shaped/autogen/models/ascending.py +148 -0
- shaped-2.0.4/shaped/autogen/models/attn_dropout_prob.py +136 -0
- shaped-2.0.4/shaped/autogen/models/attribute_journey.py +124 -0
- shaped-2.0.4/shaped/autogen/models/attribute_value.py +178 -0
- shaped-2.0.4/shaped/autogen/models/autoscaling_config.py +95 -0
- shaped-2.0.4/shaped/autogen/models/aws_pinpoint_table_config.py +108 -0
- shaped-2.0.4/shaped/autogen/models/batch_size.py +136 -0
- shaped-2.0.4/shaped/autogen/models/batch_size1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/batch_size2.py +136 -0
- shaped-2.0.4/shaped/autogen/models/big_query_table_config.py +147 -0
- shaped-2.0.4/shaped/autogen/models/bm25.py +136 -0
- shaped-2.0.4/shaped/autogen/models/boosted_reorder_step.py +125 -0
- shaped-2.0.4/shaped/autogen/models/canary_rollout.py +99 -0
- shaped-2.0.4/shaped/autogen/models/candidate_attributes_retrieve_step.py +113 -0
- shaped-2.0.4/shaped/autogen/models/candidate_ids_retrieve_step.py +113 -0
- shaped-2.0.4/shaped/autogen/models/candidate_retrieval_strategy.py +41 -0
- shaped-2.0.4/shaped/autogen/models/clickhouse_table_config.py +146 -0
- shaped-2.0.4/shaped/autogen/models/column_order_retrieve_step.py +123 -0
- shaped-2.0.4/shaped/autogen/models/column_ordering.py +91 -0
- shaped-2.0.4/shaped/autogen/models/create_table_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/create_view_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/custom_table_config.py +135 -0
- shaped-2.0.4/shaped/autogen/models/data_compute_config.py +89 -0
- shaped-2.0.4/shaped/autogen/models/data_config.py +145 -0
- shaped-2.0.4/shaped/autogen/models/data_config_interaction_table.py +146 -0
- shaped-2.0.4/shaped/autogen/models/data_split_config.py +88 -0
- shaped-2.0.4/shaped/autogen/models/data_split_strategy.py +37 -0
- shaped-2.0.4/shaped/autogen/models/data_tier.py +37 -0
- shaped-2.0.4/shaped/autogen/models/default.py +246 -0
- shaped-2.0.4/shaped/autogen/models/delete_engine_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/delete_table_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/delete_view_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/deployment_config.py +117 -0
- shaped-2.0.4/shaped/autogen/models/distance_function.py +38 -0
- shaped-2.0.4/shaped/autogen/models/diversity_reorder_step.py +137 -0
- shaped-2.0.4/shaped/autogen/models/dropout_rate.py +136 -0
- shaped-2.0.4/shaped/autogen/models/dynamo_db_table_config.py +160 -0
- shaped-2.0.4/shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +138 -0
- shaped-2.0.4/shaped/autogen/models/embedder_batch_size.py +136 -0
- shaped-2.0.4/shaped/autogen/models/embedding_config.py +93 -0
- shaped-2.0.4/shaped/autogen/models/embedding_dim.py +136 -0
- shaped-2.0.4/shaped/autogen/models/embedding_dims.py +136 -0
- shaped-2.0.4/shaped/autogen/models/embedding_size.py +136 -0
- shaped-2.0.4/shaped/autogen/models/encoder.py +140 -0
- shaped-2.0.4/shaped/autogen/models/encoding_pooling_strategy.py +38 -0
- shaped-2.0.4/shaped/autogen/models/engine.py +109 -0
- shaped-2.0.4/shaped/autogen/models/engine_config_v2.py +152 -0
- shaped-2.0.4/shaped/autogen/models/engine_details_response.py +120 -0
- shaped-2.0.4/shaped/autogen/models/engine_schema.py +113 -0
- shaped-2.0.4/shaped/autogen/models/engine_schema_user_inner.py +146 -0
- shaped-2.0.4/shaped/autogen/models/entity_config.py +109 -0
- shaped-2.0.4/shaped/autogen/models/entity_journey.py +161 -0
- shaped-2.0.4/shaped/autogen/models/entity_type.py +38 -0
- shaped-2.0.4/shaped/autogen/models/evaluation_config.py +92 -0
- shaped-2.0.4/shaped/autogen/models/exploration_reorder_step.py +125 -0
- shaped-2.0.4/shaped/autogen/models/expression_filter_step.py +106 -0
- shaped-2.0.4/shaped/autogen/models/factors.py +136 -0
- shaped-2.0.4/shaped/autogen/models/factors1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/feature.py +90 -0
- shaped-2.0.4/shaped/autogen/models/feature_type.py +60 -0
- shaped-2.0.4/shaped/autogen/models/file_table_config.py +112 -0
- shaped-2.0.4/shaped/autogen/models/filter_config.py +99 -0
- shaped-2.0.4/shaped/autogen/models/filter_dataset.py +164 -0
- shaped-2.0.4/shaped/autogen/models/filter_index_type.py +36 -0
- shaped-2.0.4/shaped/autogen/models/filter_retrieve_step.py +113 -0
- shaped-2.0.4/shaped/autogen/models/filter_step_explanation.py +165 -0
- shaped-2.0.4/shaped/autogen/models/filter_table.py +140 -0
- shaped-2.0.4/shaped/autogen/models/filter_type.py +134 -0
- shaped-2.0.4/shaped/autogen/models/global_filter.py +102 -0
- shaped-2.0.4/shaped/autogen/models/hidden_dropout_prob.py +136 -0
- shaped-2.0.4/shaped/autogen/models/hidden_size.py +136 -0
- shaped-2.0.4/shaped/autogen/models/hidden_size1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/http_problem_response.py +115 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/models/http_validation_error.py +2 -2
- shaped-2.0.4/shaped/autogen/models/hugging_face_encoder.py +115 -0
- shaped-2.0.4/shaped/autogen/models/iceberg_table_config.py +154 -0
- shaped-2.0.4/shaped/autogen/models/index_config.py +101 -0
- shaped-2.0.4/shaped/autogen/models/inner_entity_id.py +144 -0
- shaped-2.0.4/shaped/autogen/models/inner_size.py +136 -0
- shaped-2.0.4/shaped/autogen/models/inner_size1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/inner_uid.py +144 -0
- shaped-2.0.4/shaped/autogen/models/interaction_config.py +122 -0
- shaped-2.0.4/shaped/autogen/models/interaction_pooling_encoder.py +104 -0
- shaped-2.0.4/shaped/autogen/models/interaction_round_robin_encoder.py +104 -0
- shaped-2.0.4/shaped/autogen/models/item_attribute_pooling_encoder.py +111 -0
- shaped-2.0.4/shaped/autogen/models/journey.py +140 -0
- shaped-2.0.4/shaped/autogen/models/kafka_table_config.py +129 -0
- shaped-2.0.4/shaped/autogen/models/kinesis_table_config.py +140 -0
- shaped-2.0.4/shaped/autogen/models/kinesis_table_config_column_schema_value.py +136 -0
- shaped-2.0.4/shaped/autogen/models/label.py +90 -0
- shaped-2.0.4/shaped/autogen/models/label_type.py +36 -0
- shaped-2.0.4/shaped/autogen/models/laplace_smoothing.py +136 -0
- shaped-2.0.4/shaped/autogen/models/latency_scaling_policy.py +112 -0
- shaped-2.0.4/shaped/autogen/models/learning_rate.py +136 -0
- shaped-2.0.4/shaped/autogen/models/learning_rate1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/learning_rate2.py +136 -0
- shaped-2.0.4/shaped/autogen/models/learning_rate3.py +136 -0
- shaped-2.0.4/shaped/autogen/models/lexical_search_mode.py +99 -0
- shaped-2.0.4/shaped/autogen/models/list_engines_response.py +95 -0
- shaped-2.0.4/shaped/autogen/models/list_tables_response.py +95 -0
- shaped-2.0.4/shaped/autogen/models/list_views_response.py +95 -0
- shaped-2.0.4/shaped/autogen/models/location_inner.py +138 -0
- shaped-2.0.4/shaped/autogen/models/loss_types.py +37 -0
- shaped-2.0.4/shaped/autogen/models/lr.py +136 -0
- shaped-2.0.4/shaped/autogen/models/lr1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/lr2.py +136 -0
- shaped-2.0.4/shaped/autogen/models/max_depth.py +136 -0
- shaped-2.0.4/shaped/autogen/models/max_leaves.py +136 -0
- shaped-2.0.4/shaped/autogen/models/max_seq_length.py +136 -0
- shaped-2.0.4/shaped/autogen/models/max_seq_length1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/max_seq_length2.py +136 -0
- shaped-2.0.4/shaped/autogen/models/mode.py +134 -0
- shaped-2.0.4/shaped/autogen/models/mode1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/mode2.py +150 -0
- shaped-2.0.4/shaped/autogen/models/models_inner.py +308 -0
- shaped-2.0.4/shaped/autogen/models/mongo_db_table_config.py +147 -0
- shaped-2.0.4/shaped/autogen/models/mssql_table_config.py +155 -0
- 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
- shaped-2.0.4/shaped/autogen/models/n_epochs.py +136 -0
- shaped-2.0.4/shaped/autogen/models/n_epochs1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/n_epochs2.py +136 -0
- shaped-2.0.4/shaped/autogen/models/n_estimators.py +136 -0
- shaped-2.0.4/shaped/autogen/models/n_heads.py +136 -0
- shaped-2.0.4/shaped/autogen/models/n_layers.py +136 -0
- shaped-2.0.4/shaped/autogen/models/neg_per_positive.py +136 -0
- shaped-2.0.4/shaped/autogen/models/negative_samples_count.py +136 -0
- shaped-2.0.4/shaped/autogen/models/ngram_tokenizer.py +103 -0
- shaped-2.0.4/shaped/autogen/models/no_op_config.py +117 -0
- shaped-2.0.4/shaped/autogen/models/num_blocks.py +136 -0
- shaped-2.0.4/shaped/autogen/models/num_heads.py +136 -0
- shaped-2.0.4/shaped/autogen/models/num_leaves.py +136 -0
- shaped-2.0.4/shaped/autogen/models/objective.py +40 -0
- shaped-2.0.4/shaped/autogen/models/objective1.py +134 -0
- shaped-2.0.4/shaped/autogen/models/online_store_config.py +89 -0
- shaped-2.0.4/shaped/autogen/models/pagination_config.py +87 -0
- shaped-2.0.4/shaped/autogen/models/parameter_definition.py +96 -0
- shaped-2.0.4/shaped/autogen/models/parameters_value.py +240 -0
- shaped-2.0.4/shaped/autogen/models/passthrough_score.py +104 -0
- shaped-2.0.4/shaped/autogen/models/personal_filter.py +104 -0
- shaped-2.0.4/shaped/autogen/models/pipeline_stage_explanation.py +118 -0
- shaped-2.0.4/shaped/autogen/models/policy.py +134 -0
- shaped-2.0.4/shaped/autogen/models/pool_fn.py +152 -0
- shaped-2.0.4/shaped/autogen/models/pooling_function.py +37 -0
- 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
- shaped-2.0.4/shaped/autogen/models/posthog_table_config.py +133 -0
- shaped-2.0.4/shaped/autogen/models/prebuilt_filter_step.py +113 -0
- shaped-2.0.4/shaped/autogen/models/precomputed_item_embedding.py +99 -0
- shaped-2.0.4/shaped/autogen/models/precomputed_user_embedding.py +99 -0
- shaped-2.0.4/shaped/autogen/models/query.py +136 -0
- shaped-2.0.4/shaped/autogen/models/query1.py +136 -0
- shaped-2.0.4/shaped/autogen/models/query_any_of.py +172 -0
- shaped-2.0.4/shaped/autogen/models/query_config.py +140 -0
- shaped-2.0.4/shaped/autogen/models/query_definition.py +106 -0
- shaped-2.0.4/shaped/autogen/models/query_encoder.py +194 -0
- shaped-2.0.4/shaped/autogen/models/query_explanation.py +201 -0
- shaped-2.0.4/shaped/autogen/models/query_request.py +121 -0
- shaped-2.0.4/shaped/autogen/models/query_result.py +113 -0
- shaped-2.0.4/shaped/autogen/models/query_table_config.py +99 -0
- shaped-2.0.4/shaped/autogen/models/rank_item_attribute_values_query_config.py +122 -0
- shaped-2.0.4/shaped/autogen/models/rank_query_config.py +167 -0
- shaped-2.0.4/shaped/autogen/models/rank_query_config_filter_inner.py +149 -0
- shaped-2.0.4/shaped/autogen/models/rank_query_config_reorder_inner.py +186 -0
- shaped-2.0.4/shaped/autogen/models/rank_query_config_retrieve_inner.py +265 -0
- shaped-2.0.4/shaped/autogen/models/recreate_rollout.py +97 -0
- 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
- shaped-2.0.4/shaped/autogen/models/reference_table_config.py +113 -0
- shaped-2.0.4/shaped/autogen/models/regularization.py +136 -0
- shaped-2.0.4/shaped/autogen/models/reorder_inner.py +149 -0
- shaped-2.0.4/shaped/autogen/models/reorder_step_explanation.py +207 -0
- shaped-2.0.4/shaped/autogen/models/request.py +378 -0
- shaped-2.0.4/shaped/autogen/models/request1.py +140 -0
- shaped-2.0.4/shaped/autogen/models/requests_per_second_scaling_policy.py +112 -0
- shaped-2.0.4/shaped/autogen/models/resource_config.py +100 -0
- shaped-2.0.4/shaped/autogen/models/response_get_view_details_views_view_name_get.py +134 -0
- shaped-2.0.4/shaped/autogen/models/result.py +132 -0
- shaped-2.0.4/shaped/autogen/models/result_embeddings_value.py +127 -0
- shaped-2.0.4/shaped/autogen/models/retrieval_scores_value.py +127 -0
- shaped-2.0.4/shaped/autogen/models/retrieve_inner.py +196 -0
- shaped-2.0.4/shaped/autogen/models/retrieve_step_explanation.py +172 -0
- shaped-2.0.4/shaped/autogen/models/retriever.py +196 -0
- shaped-2.0.4/shaped/autogen/models/retriever1.py +196 -0
- shaped-2.0.4/shaped/autogen/models/rollout_config.py +91 -0
- shaped-2.0.4/shaped/autogen/models/rudderstack_table_config.py +106 -0
- shaped-2.0.4/shaped/autogen/models/sampling_strategy.py +36 -0
- shaped-2.0.4/shaped/autogen/models/saved_query_info_response.py +103 -0
- shaped-2.0.4/shaped/autogen/models/saved_query_list_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/saved_query_request.py +115 -0
- shaped-2.0.4/shaped/autogen/models/schema_config.py +117 -0
- shaped-2.0.4/shaped/autogen/models/score.py +134 -0
- shaped-2.0.4/shaped/autogen/models/score_ensemble.py +127 -0
- shaped-2.0.4/shaped/autogen/models/score_ensemble_policy_config.py +165 -0
- shaped-2.0.4/shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +755 -0
- shaped-2.0.4/shaped/autogen/models/score_step_explanation.py +224 -0
- shaped-2.0.4/shaped/autogen/models/search_config.py +105 -0
- shaped-2.0.4/shaped/autogen/models/segment_table_config.py +106 -0
- shaped-2.0.4/shaped/autogen/models/sequence_length.py +136 -0
- shaped-2.0.4/shaped/autogen/models/server_config.py +100 -0
- shaped-2.0.4/shaped/autogen/models/setup_engine_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +154 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +160 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +215 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +156 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +141 -0
- 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
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +140 -0
- 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
- 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
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +119 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +161 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +108 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +143 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +123 -0
- 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
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +119 -0
- 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
- 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
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +137 -0
- shaped-2.0.4/shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +155 -0
- shaped-2.0.4/shaped/autogen/models/shopify_table_config.py +156 -0
- shaped-2.0.4/shaped/autogen/models/similarity_retrieve_step.py +123 -0
- 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
- shaped-2.0.4/shaped/autogen/models/sql_transform_type.py +37 -0
- shaped-2.0.4/shaped/autogen/models/sql_view_config.py +111 -0
- shaped-2.0.4/shaped/autogen/models/stemmer_tokenizer.py +105 -0
- shaped-2.0.4/shaped/autogen/models/step_explanation.py +137 -0
- shaped-2.0.4/shaped/autogen/models/steps_inner.py +179 -0
- shaped-2.0.4/shaped/autogen/models/strategy.py +134 -0
- shaped-2.0.4/shaped/autogen/models/table.py +102 -0
- shaped-2.0.4/shaped/autogen/models/table_deployment_type.py +38 -0
- shaped-2.0.4/shaped/autogen/models/table_insert_arguments.py +87 -0
- shaped-2.0.4/shaped/autogen/models/table_insert_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/text_encoding.py +148 -0
- shaped-2.0.4/shaped/autogen/models/text_search_retrieve_step.py +121 -0
- shaped-2.0.4/shaped/autogen/models/time_frequency.py +136 -0
- shaped-2.0.4/shaped/autogen/models/time_window.py +136 -0
- shaped-2.0.4/shaped/autogen/models/time_window_in_days.py +154 -0
- shaped-2.0.4/shaped/autogen/models/tokenizer.py +149 -0
- shaped-2.0.4/shaped/autogen/models/trained_model_encoder.py +99 -0
- shaped-2.0.4/shaped/autogen/models/training_compute_config.py +99 -0
- shaped-2.0.4/shaped/autogen/models/training_config.py +121 -0
- shaped-2.0.4/shaped/autogen/models/training_config_models_inner.py +540 -0
- shaped-2.0.4/shaped/autogen/models/training_strategy.py +37 -0
- shaped-2.0.4/shaped/autogen/models/transform_status.py +41 -0
- shaped-2.0.4/shaped/autogen/models/trending_mode.py +37 -0
- shaped-2.0.4/shaped/autogen/models/truncate_filter_step.py +106 -0
- shaped-2.0.4/shaped/autogen/models/tunable_bool.py +97 -0
- shaped-2.0.4/shaped/autogen/models/tunable_float.py +118 -0
- shaped-2.0.4/shaped/autogen/models/tunable_int.py +118 -0
- shaped-2.0.4/shaped/autogen/models/tunable_int_categorical.py +99 -0
- shaped-2.0.4/shaped/autogen/models/tunable_string.py +99 -0
- shaped-2.0.4/shaped/autogen/models/tuning_config.py +89 -0
- shaped-2.0.4/shaped/autogen/models/type.py +150 -0
- shaped-2.0.4/shaped/autogen/models/update_table_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/update_view_response.py +87 -0
- shaped-2.0.4/shaped/autogen/models/user_attribute_pooling_encoder.py +124 -0
- shaped-2.0.4/shaped/autogen/models/user_inner.py +134 -0
- shaped-2.0.4/shaped/autogen/models/val_split.py +136 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/models/validation_error.py +13 -3
- shaped-2.0.4/shaped/autogen/models/validation_error_loc_inner.py +150 -0
- shaped-2.0.4/shaped/autogen/models/value_type.py +50 -0
- shaped-2.0.4/shaped/autogen/models/vector_search_mode.py +101 -0
- shaped-2.0.4/shaped/autogen/models/view.py +104 -0
- shaped-2.0.4/shaped/autogen/models/view_details_ai.py +140 -0
- shaped-2.0.4/shaped/autogen/models/view_details_ai_schema_value.py +153 -0
- shaped-2.0.4/shaped/autogen/models/view_details_sql.py +140 -0
- shaped-2.0.4/shaped/autogen/models/view_status.py +41 -0
- shaped-2.0.4/shaped/autogen/models/weight_decay.py +136 -0
- shaped-2.0.4/shaped/autogen/models/whitespace_tokenizer.py +97 -0
- shaped-2.0.4/shaped/autogen/models/window_size.py +136 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/rest.py +10 -4
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/cli/shaped_cli.py +163 -35
- shaped-2.0.4/shaped/client.py +631 -0
- shaped-2.0.4/shaped/config_builders.py +705 -0
- shaped-2.0.4/shaped/query_builder.py +781 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/PKG-INFO +141 -6
- shaped-2.0.4/shaped.egg-info/SOURCES.txt +601 -0
- shaped-2.0.4/shaped.egg-info/entry_points.txt +2 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/requires.txt +5 -3
- shaped-2.0.4/tests/test_cli.py +554 -0
- shaped-2.0.4/tests/test_client_production.py +424 -0
- shaped-2.0.4/tests/test_client_query_comprehensive.py +363 -0
- shaped-2.0.4/tests/test_client_v2.py +632 -0
- shaped-2.0.4/tests/test_client_v2_edge_cases.py +307 -0
- shaped-2.0.4/tests/test_client_v2_errors.py +197 -0
- shaped-2.0.4/tests/test_client_v2_integration.py +448 -0
- shaped-2.0.4/tests/test_config_builders.py +153 -0
- shaped-2.0.4/tests/test_query_builder_comprehensive.py +463 -0
- shaped-2.0.4/tests/test_query_builder_v2.py +378 -0
- shaped-2.0.4/tests/test_query_builder_v2_edge_cases.py +307 -0
- shaped-2.0.1/README.md +0 -228
- shaped-2.0.1/pyproject.toml +0 -9
- shaped-2.0.1/python/shaped/__init__.py +0 -4
- shaped-2.0.1/python/shaped/autogen/__init__.py +0 -87
- shaped-2.0.1/python/shaped/autogen/api/__init__.py +0 -7
- shaped-2.0.1/python/shaped/autogen/api/model_inference_api.py +0 -2825
- shaped-2.0.1/python/shaped/autogen/models/__init__.py +0 -68
- shaped-2.0.1/python/shaped/autogen/models/amplitude_dataset_config.py +0 -96
- shaped-2.0.1/python/shaped/autogen/models/aws_pinpoint_dataset_config.py +0 -96
- shaped-2.0.1/python/shaped/autogen/models/big_query_dataset_config.py +0 -114
- shaped-2.0.1/python/shaped/autogen/models/complement_items_request.py +0 -99
- shaped-2.0.1/python/shaped/autogen/models/complement_items_response.py +0 -89
- shaped-2.0.1/python/shaped/autogen/models/connectors_inner.py +0 -134
- shaped-2.0.1/python/shaped/autogen/models/create_dataset_arguments.py +0 -263
- shaped-2.0.1/python/shaped/autogen/models/create_embedding_response.py +0 -87
- shaped-2.0.1/python/shaped/autogen/models/create_item_embedding_request.py +0 -89
- shaped-2.0.1/python/shaped/autogen/models/create_model_arguments.py +0 -107
- shaped-2.0.1/python/shaped/autogen/models/create_model_response.py +0 -87
- shaped-2.0.1/python/shaped/autogen/models/create_user_embedding_request.py +0 -89
- shaped-2.0.1/python/shaped/autogen/models/custom_dataset_config.py +0 -115
- shaped-2.0.1/python/shaped/autogen/models/dataset_config.py +0 -101
- shaped-2.0.1/python/shaped/autogen/models/dataset_schema_type.py +0 -47
- shaped-2.0.1/python/shaped/autogen/models/datasets_inner.py +0 -91
- shaped-2.0.1/python/shaped/autogen/models/delete_model_response.py +0 -87
- shaped-2.0.1/python/shaped/autogen/models/fetch_config.py +0 -95
- shaped-2.0.1/python/shaped/autogen/models/file_config.py +0 -105
- shaped-2.0.1/python/shaped/autogen/models/file_source_config.py +0 -89
- shaped-2.0.1/python/shaped/autogen/models/inference_config.py +0 -101
- shaped-2.0.1/python/shaped/autogen/models/insert_model_response.py +0 -87
- shaped-2.0.1/python/shaped/autogen/models/interaction.py +0 -87
- shaped-2.0.1/python/shaped/autogen/models/list_datasets_response.py +0 -95
- shaped-2.0.1/python/shaped/autogen/models/list_models_response.py +0 -95
- shaped-2.0.1/python/shaped/autogen/models/model_config.py +0 -99
- shaped-2.0.1/python/shaped/autogen/models/model_response.py +0 -95
- shaped-2.0.1/python/shaped/autogen/models/mongo_db_dataset_config.py +0 -119
- shaped-2.0.1/python/shaped/autogen/models/post_rank_request.py +0 -117
- shaped-2.0.1/python/shaped/autogen/models/rank_attribute_response.py +0 -89
- shaped-2.0.1/python/shaped/autogen/models/rank_grid_attribute_request.py +0 -91
- shaped-2.0.1/python/shaped/autogen/models/rank_grid_attribute_request1.py +0 -93
- shaped-2.0.1/python/shaped/autogen/models/rank_grid_attribute_response.py +0 -91
- shaped-2.0.1/python/shaped/autogen/models/rank_response.py +0 -91
- shaped-2.0.1/python/shaped/autogen/models/retrieve_request.py +0 -101
- shaped-2.0.1/python/shaped/autogen/models/retrieve_response.py +0 -91
- shaped-2.0.1/python/shaped/autogen/models/retriever_top_k_override.py +0 -97
- shaped-2.0.1/python/shaped/autogen/models/rudder_stack_dataset_config.py +0 -96
- shaped-2.0.1/python/shaped/autogen/models/segment_dataset_config.py +0 -96
- shaped-2.0.1/python/shaped/autogen/models/similar_item_request.py +0 -101
- shaped-2.0.1/python/shaped/autogen/models/similar_response.py +0 -89
- shaped-2.0.1/python/shaped/autogen/models/similar_users_request.py +0 -99
- shaped-2.0.1/python/shaped/autogen/models/successful_response.py +0 -87
- shaped-2.0.1/python/shaped/autogen/models/value_type.py +0 -48
- shaped-2.0.1/python/shaped/autogen/models/view_model_response.py +0 -99
- shaped-2.0.1/python/shaped/client.py +0 -211
- shaped-2.0.1/python/shaped.egg-info/SOURCES.txt +0 -77
- shaped-2.0.1/python/shaped.egg-info/entry_points.txt +0 -2
- {shaped-2.0.1 → shaped-2.0.4}/setup.cfg +0 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/autogen/api_response.py +0 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped/cli/__init__.py +0 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/dependency_links.txt +0 -0
- {shaped-2.0.1/python → shaped-2.0.4}/shaped.egg-info/top_level.txt +0 -0
- {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.
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
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/
|
|
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="
|
|
29
|
+
where=".",
|
|
32
30
|
include=["shaped*"],
|
|
33
|
-
exclude=["
|
|
31
|
+
exclude=["tests"],
|
|
34
32
|
),
|
|
35
|
-
package_dir={
|
|
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
|
|
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 >=
|
|
48
|
+
"urllib3 >= 2.2.3",
|
|
49
|
+
"h2 >= 4.0.0",
|
|
50
50
|
"python-dateutil",
|
|
51
51
|
"typing-extensions >= 4.7.1",
|
|
52
|
-
"pytest
|
|
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:
|
|
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
|
+
]
|