shaped 2.0.1__py3-none-any.whl → 2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shaped/__init__.py +54 -4
- shaped/autogen/__init__.py +541 -66
- shaped/autogen/api/__init__.py +4 -3
- shaped/autogen/api/engine_api.py +1467 -0
- shaped/autogen/api/{dataset_api.py → query_api.py} +219 -194
- shaped/autogen/api/table_api.py +1494 -0
- shaped/autogen/api/{model_management_api.py → view_api.py} +179 -181
- shaped/autogen/api_client.py +15 -8
- shaped/autogen/configuration.py +20 -9
- shaped/autogen/exceptions.py +19 -2
- shaped/autogen/models/__init__.py +254 -52
- shaped/autogen/models/ai_enrichment_view_config.py +123 -0
- shaped/autogen/models/{path.py → algorithm.py} +19 -19
- shaped/autogen/models/amplitude_table_config.py +106 -0
- shaped/autogen/models/ascending.py +136 -0
- shaped/autogen/models/attn_dropout_prob.py +136 -0
- shaped/autogen/models/attribute_journey.py +124 -0
- shaped/autogen/models/attribute_value.py +178 -0
- shaped/autogen/models/autoscaling_config.py +95 -0
- shaped/autogen/models/aws_pinpoint_table_config.py +108 -0
- shaped/autogen/models/batch_size.py +136 -0
- shaped/autogen/models/batch_size1.py +136 -0
- shaped/autogen/models/batch_size2.py +136 -0
- shaped/autogen/models/big_query_table_config.py +147 -0
- shaped/autogen/models/bm25.py +136 -0
- shaped/autogen/models/boosted_reorder_step.py +125 -0
- shaped/autogen/models/canary_rollout.py +99 -0
- shaped/autogen/models/candidate_attributes_retrieve_step.py +126 -0
- shaped/autogen/models/candidate_ids_retrieve_step.py +113 -0
- shaped/autogen/models/candidate_retrieval_strategy.py +41 -0
- shaped/autogen/models/clickhouse_table_config.py +146 -0
- shaped/autogen/models/column_order_retrieve_step.py +123 -0
- shaped/autogen/models/column_ordering.py +91 -0
- shaped/autogen/models/create_table_response.py +87 -0
- shaped/autogen/models/create_view_response.py +87 -0
- shaped/autogen/models/custom_table_config.py +135 -0
- shaped/autogen/models/data_compute_config.py +89 -0
- shaped/autogen/models/data_config.py +145 -0
- shaped/autogen/models/data_config_interaction_table.py +146 -0
- shaped/autogen/models/data_split_config.py +88 -0
- shaped/autogen/models/data_split_strategy.py +37 -0
- shaped/autogen/models/data_tier.py +37 -0
- shaped/autogen/models/default.py +246 -0
- shaped/autogen/models/delete_engine_response.py +87 -0
- shaped/autogen/models/delete_table_response.py +87 -0
- shaped/autogen/models/delete_view_response.py +87 -0
- shaped/autogen/models/deployment_config.py +123 -0
- shaped/autogen/models/distance_function.py +38 -0
- shaped/autogen/models/diversity_reorder_step.py +137 -0
- shaped/autogen/models/dropout_rate.py +136 -0
- shaped/autogen/models/dynamo_db_table_config.py +160 -0
- shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +138 -0
- shaped/autogen/models/embedder_batch_size.py +136 -0
- shaped/autogen/models/embedding_config.py +93 -0
- shaped/autogen/models/embedding_dim.py +136 -0
- shaped/autogen/models/embedding_dims.py +136 -0
- shaped/autogen/models/embedding_size.py +136 -0
- shaped/autogen/models/encoder.py +140 -0
- shaped/autogen/models/encoding_pooling_strategy.py +38 -0
- shaped/autogen/models/engine.py +109 -0
- shaped/autogen/models/engine_config_v2.py +152 -0
- shaped/autogen/models/engine_details_response.py +120 -0
- shaped/autogen/models/engine_schema.py +113 -0
- shaped/autogen/models/engine_schema_user_inner.py +134 -0
- shaped/autogen/models/entity_config.py +109 -0
- shaped/autogen/models/entity_journey.py +152 -0
- shaped/autogen/models/entity_type.py +38 -0
- shaped/autogen/models/evaluation_config.py +92 -0
- shaped/autogen/models/exploration_reorder_step.py +125 -0
- shaped/autogen/models/expression_filter_step.py +106 -0
- shaped/autogen/models/factors.py +136 -0
- shaped/autogen/models/factors1.py +136 -0
- shaped/autogen/models/feature.py +90 -0
- shaped/autogen/models/feature_type.py +60 -0
- shaped/autogen/models/file_table_config.py +112 -0
- shaped/autogen/models/filter_config.py +99 -0
- shaped/autogen/models/filter_dataset.py +140 -0
- shaped/autogen/models/filter_index_type.py +36 -0
- shaped/autogen/models/filter_retrieve_step.py +113 -0
- shaped/autogen/models/global_filter.py +102 -0
- shaped/autogen/models/hidden_dropout_prob.py +136 -0
- shaped/autogen/models/hidden_size.py +136 -0
- shaped/autogen/models/hidden_size1.py +136 -0
- shaped/autogen/models/http_problem_response.py +115 -0
- shaped/autogen/models/http_validation_error.py +2 -2
- shaped/autogen/models/hugging_face_encoder.py +113 -0
- shaped/autogen/models/iceberg_table_config.py +154 -0
- shaped/autogen/models/index_config.py +101 -0
- shaped/autogen/models/inner_size.py +136 -0
- shaped/autogen/models/inner_size1.py +136 -0
- shaped/autogen/models/interaction_config.py +122 -0
- shaped/autogen/models/interaction_pooling_encoder.py +104 -0
- shaped/autogen/models/interaction_round_robin_encoder.py +104 -0
- shaped/autogen/models/item_attribute_pooling_encoder.py +124 -0
- shaped/autogen/models/journey.py +140 -0
- shaped/autogen/models/kafka_table_config.py +129 -0
- shaped/autogen/models/kinesis_table_config.py +140 -0
- shaped/autogen/models/kinesis_table_config_column_schema_value.py +136 -0
- shaped/autogen/models/label.py +90 -0
- shaped/autogen/models/label_type.py +37 -0
- shaped/autogen/models/laplace_smoothing.py +136 -0
- shaped/autogen/models/latency_scaling_policy.py +112 -0
- shaped/autogen/models/learning_rate.py +136 -0
- shaped/autogen/models/learning_rate1.py +136 -0
- shaped/autogen/models/learning_rate2.py +136 -0
- shaped/autogen/models/learning_rate3.py +136 -0
- shaped/autogen/models/lexical_search_mode.py +99 -0
- shaped/autogen/models/list_engines_response.py +95 -0
- shaped/autogen/models/list_tables_response.py +95 -0
- shaped/autogen/models/list_views_response.py +95 -0
- shaped/autogen/models/loss_types.py +37 -0
- shaped/autogen/models/lr.py +136 -0
- shaped/autogen/models/lr1.py +136 -0
- shaped/autogen/models/lr2.py +136 -0
- shaped/autogen/models/max_depth.py +136 -0
- shaped/autogen/models/max_leaves.py +136 -0
- shaped/autogen/models/max_seq_length.py +136 -0
- shaped/autogen/models/max_seq_length1.py +136 -0
- shaped/autogen/models/max_seq_length2.py +136 -0
- shaped/autogen/models/mode.py +134 -0
- shaped/autogen/models/mode1.py +134 -0
- shaped/autogen/models/mode2.py +136 -0
- shaped/autogen/models/mongo_db_table_config.py +147 -0
- shaped/autogen/models/mssql_table_config.py +155 -0
- shaped/autogen/models/{my_sql_dataset_config.py → my_sql_table_config.py} +45 -28
- shaped/autogen/models/n_epochs.py +136 -0
- shaped/autogen/models/n_epochs1.py +136 -0
- shaped/autogen/models/n_epochs2.py +136 -0
- shaped/autogen/models/n_estimators.py +136 -0
- shaped/autogen/models/n_heads.py +136 -0
- shaped/autogen/models/n_layers.py +136 -0
- shaped/autogen/models/neg_per_positive.py +136 -0
- shaped/autogen/models/negative_samples_count.py +136 -0
- shaped/autogen/models/ngram_tokenizer.py +103 -0
- shaped/autogen/models/no_op_config.py +117 -0
- shaped/autogen/models/num_blocks.py +136 -0
- shaped/autogen/models/num_heads.py +136 -0
- shaped/autogen/models/num_leaves.py +136 -0
- shaped/autogen/models/objective.py +40 -0
- shaped/autogen/models/objective1.py +134 -0
- shaped/autogen/models/online_store_config.py +89 -0
- shaped/autogen/models/pagination_config.py +87 -0
- shaped/autogen/models/parameter_definition.py +96 -0
- shaped/autogen/models/parameters_value.py +240 -0
- shaped/autogen/models/passthrough_score.py +104 -0
- shaped/autogen/models/personal_filter.py +104 -0
- shaped/autogen/models/pipeline_stage_explanation.py +118 -0
- shaped/autogen/models/policy.py +134 -0
- shaped/autogen/models/pool_fn.py +134 -0
- shaped/autogen/models/pooling_function.py +37 -0
- shaped/autogen/models/{postgres_dataset_config.py → postgres_table_config.py} +66 -28
- shaped/autogen/models/posthog_table_config.py +133 -0
- shaped/autogen/models/prebuilt_filter_step.py +113 -0
- shaped/autogen/models/precomputed_item_embedding.py +99 -0
- shaped/autogen/models/precomputed_user_embedding.py +99 -0
- shaped/autogen/models/query.py +136 -0
- shaped/autogen/models/query1.py +136 -0
- shaped/autogen/models/query_any_of.py +140 -0
- shaped/autogen/models/query_definition.py +106 -0
- shaped/autogen/models/query_encoder.py +194 -0
- shaped/autogen/models/query_explanation.py +197 -0
- shaped/autogen/models/query_request.py +121 -0
- shaped/autogen/models/query_result.py +113 -0
- shaped/autogen/models/query_table_config.py +99 -0
- shaped/autogen/models/rank_item_attribute_values_query_config.py +122 -0
- shaped/autogen/models/rank_query_config.py +167 -0
- shaped/autogen/models/rank_query_config_filter_inner.py +149 -0
- shaped/autogen/models/rank_query_config_reorder_inner.py +149 -0
- shaped/autogen/models/rank_query_config_retrieve_inner.py +196 -0
- shaped/autogen/models/recreate_rollout.py +97 -0
- shaped/autogen/models/{redshift_dataset_config.py → redshift_table_config.py} +48 -25
- shaped/autogen/models/reference_table_config.py +113 -0
- shaped/autogen/models/regularization.py +136 -0
- shaped/autogen/models/request.py +378 -0
- shaped/autogen/models/request1.py +140 -0
- shaped/autogen/models/requests_per_second_scaling_policy.py +112 -0
- shaped/autogen/models/response_get_view_details_views_view_name_get.py +134 -0
- shaped/autogen/models/result.py +145 -0
- shaped/autogen/models/result_embeddings_value.py +127 -0
- shaped/autogen/models/retriever.py +196 -0
- shaped/autogen/models/retriever1.py +196 -0
- shaped/autogen/models/rollout_config.py +91 -0
- shaped/autogen/models/rudderstack_table_config.py +106 -0
- shaped/autogen/models/sampling_strategy.py +36 -0
- shaped/autogen/models/saved_query_info_response.py +89 -0
- shaped/autogen/models/saved_query_list_response.py +87 -0
- shaped/autogen/models/saved_query_request.py +115 -0
- shaped/autogen/models/schema_config.py +117 -0
- shaped/autogen/models/score.py +134 -0
- shaped/autogen/models/score_ensemble.py +140 -0
- shaped/autogen/models/score_ensemble_policy_config.py +141 -0
- shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +422 -0
- shaped/autogen/models/search_config.py +105 -0
- shaped/autogen/models/segment_table_config.py +106 -0
- shaped/autogen/models/sequence_length.py +136 -0
- shaped/autogen/models/server_config.py +87 -0
- shaped/autogen/models/setup_engine_response.py +87 -0
- shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +148 -0
- shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +154 -0
- shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +209 -0
- shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +137 -0
- shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +139 -0
- shaped/autogen/models/shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config.py +205 -0
- shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +140 -0
- shaped/autogen/models/shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config.py +152 -0
- shaped/autogen/models/shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config.py +239 -0
- shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +119 -0
- shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +137 -0
- shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +104 -0
- shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +130 -0
- shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +123 -0
- shaped/autogen/models/shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config.py +224 -0
- shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +119 -0
- shaped/autogen/models/shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config.py +159 -0
- shaped/autogen/models/shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config.py +131 -0
- shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +131 -0
- shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +149 -0
- shaped/autogen/models/shopify_table_config.py +156 -0
- shaped/autogen/models/similarity_retrieve_step.py +121 -0
- shaped/autogen/models/{snowflake_dataset_config.py → snowflake_table_config.py} +47 -18
- shaped/autogen/models/sql_transform_type.py +37 -0
- shaped/autogen/models/sql_view_config.py +111 -0
- shaped/autogen/models/stemmer_tokenizer.py +105 -0
- shaped/autogen/models/step_explanation.py +137 -0
- shaped/autogen/models/strategy.py +134 -0
- shaped/autogen/models/table.py +102 -0
- shaped/autogen/models/table_deployment_type.py +38 -0
- shaped/autogen/models/table_insert_arguments.py +87 -0
- shaped/autogen/models/table_insert_response.py +87 -0
- shaped/autogen/models/text_encoding.py +136 -0
- shaped/autogen/models/text_search_retrieve_step.py +121 -0
- shaped/autogen/models/time_frequency.py +136 -0
- shaped/autogen/models/time_window.py +136 -0
- shaped/autogen/models/time_window_in_days.py +142 -0
- shaped/autogen/models/tokenizer.py +149 -0
- shaped/autogen/models/trained_model_encoder.py +99 -0
- shaped/autogen/models/training_compute_config.py +99 -0
- shaped/autogen/models/training_config.py +121 -0
- shaped/autogen/models/training_config_models_inner.py +308 -0
- shaped/autogen/models/training_strategy.py +37 -0
- shaped/autogen/models/trending_mode.py +37 -0
- shaped/autogen/models/truncate_filter_step.py +106 -0
- shaped/autogen/models/tunable_bool.py +97 -0
- shaped/autogen/models/tunable_float.py +118 -0
- shaped/autogen/models/tunable_int.py +118 -0
- shaped/autogen/models/tunable_int_categorical.py +99 -0
- shaped/autogen/models/tunable_string.py +99 -0
- shaped/autogen/models/tuning_config.py +89 -0
- shaped/autogen/models/type.py +134 -0
- shaped/autogen/models/update_table_response.py +87 -0
- shaped/autogen/models/update_view_response.py +87 -0
- shaped/autogen/models/user_attribute_pooling_encoder.py +124 -0
- shaped/autogen/models/val_split.py +136 -0
- shaped/autogen/models/validation_error.py +13 -3
- shaped/autogen/models/validation_error_loc_inner.py +138 -0
- shaped/autogen/models/value_type.py +7 -5
- shaped/autogen/models/vector_search_mode.py +99 -0
- shaped/autogen/models/view.py +104 -0
- shaped/autogen/models/view_details_ai.py +140 -0
- shaped/autogen/models/view_details_ai_schema_value.py +153 -0
- shaped/autogen/models/view_details_sql.py +140 -0
- shaped/autogen/models/view_status.py +41 -0
- shaped/autogen/models/weight_decay.py +136 -0
- shaped/autogen/models/whitespace_tokenizer.py +97 -0
- shaped/autogen/models/window_size.py +136 -0
- shaped/autogen/rest.py +8 -2
- shaped/cli/shaped_cli.py +12 -7
- shaped/client.py +587 -174
- shaped/config_builders.py +695 -0
- shaped/query_builder.py +774 -0
- {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/METADATA +140 -5
- shaped-2.0.2.dist-info/RECORD +278 -0
- shaped-2.0.2.dist-info/entry_points.txt +2 -0
- shaped/autogen/api/model_inference_api.py +0 -2825
- shaped/autogen/models/amplitude_dataset_config.py +0 -96
- shaped/autogen/models/aws_pinpoint_dataset_config.py +0 -96
- shaped/autogen/models/big_query_dataset_config.py +0 -114
- shaped/autogen/models/complement_items_request.py +0 -99
- shaped/autogen/models/complement_items_response.py +0 -89
- shaped/autogen/models/connectors_inner.py +0 -134
- shaped/autogen/models/create_dataset_arguments.py +0 -263
- shaped/autogen/models/create_embedding_response.py +0 -87
- shaped/autogen/models/create_item_embedding_request.py +0 -89
- shaped/autogen/models/create_model_arguments.py +0 -107
- shaped/autogen/models/create_model_response.py +0 -87
- shaped/autogen/models/create_user_embedding_request.py +0 -89
- shaped/autogen/models/custom_dataset_config.py +0 -115
- shaped/autogen/models/dataset_config.py +0 -101
- shaped/autogen/models/dataset_schema_type.py +0 -47
- shaped/autogen/models/datasets_inner.py +0 -91
- shaped/autogen/models/delete_model_response.py +0 -87
- shaped/autogen/models/fetch_config.py +0 -95
- shaped/autogen/models/file_config.py +0 -105
- shaped/autogen/models/file_source_config.py +0 -89
- shaped/autogen/models/inference_config.py +0 -101
- shaped/autogen/models/insert_model_response.py +0 -87
- shaped/autogen/models/interaction.py +0 -87
- shaped/autogen/models/list_datasets_response.py +0 -95
- shaped/autogen/models/list_models_response.py +0 -95
- shaped/autogen/models/model_config.py +0 -99
- shaped/autogen/models/model_response.py +0 -95
- shaped/autogen/models/mongo_db_dataset_config.py +0 -119
- shaped/autogen/models/post_rank_request.py +0 -117
- shaped/autogen/models/rank_attribute_response.py +0 -89
- shaped/autogen/models/rank_grid_attribute_request.py +0 -91
- shaped/autogen/models/rank_grid_attribute_request1.py +0 -93
- shaped/autogen/models/rank_grid_attribute_response.py +0 -91
- shaped/autogen/models/rank_response.py +0 -91
- shaped/autogen/models/retrieve_request.py +0 -101
- shaped/autogen/models/retrieve_response.py +0 -91
- shaped/autogen/models/retriever_top_k_override.py +0 -97
- shaped/autogen/models/rudder_stack_dataset_config.py +0 -96
- shaped/autogen/models/segment_dataset_config.py +0 -96
- shaped/autogen/models/similar_item_request.py +0 -101
- shaped/autogen/models/similar_response.py +0 -89
- shaped/autogen/models/similar_users_request.py +0 -99
- shaped/autogen/models/successful_response.py +0 -87
- shaped/autogen/models/view_model_response.py +0 -99
- shaped-2.0.1.dist-info/RECORD +0 -73
- shaped-2.0.1.dist-info/entry_points.txt +0 -2
- {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/WHEEL +0 -0
- {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/top_level.txt +0 -0
- {shaped-2.0.1.dist-info → shaped-2.0.2.dist-info}/zip-safe +0 -0
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Shaped API
|
|
5
|
-
|
|
6
|
-
Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. Shaped's API is composed of 3 components: 1. **Dataset** - used to provision and manage 'Shaped Datasets', which are persisted data views of external data. Shaped Datasets can be created from any of our 'Shaped connectors' (e.g. S3, Segment, Snowflake, etc.) and support both batch ingestion (up to a 15min delay) and stream ingestion (up to a 30 second delay) depending on the specific connector used. Shaped datasets can also be created from local files, which is particularly useful for getting started with a snapshot of data. 2. **Model Management** - used to provision and manage 'Shaped Models', which represent a system of data pipelines, training and serving infrastructure for your ranking use-case. 3. **Model Inference** - a high performance API that's used to make user-understanding requests or ranking inferences to your 'Shaped Models'. For example, the 'rank' endpoint can be used to determine for a given user id query, what is the content that is most engaging to that user. The recommended workflow to interact with the Shaped API is as follows: 1. First create 'Shaped Datasets' to sync over data that your Shaped understanding models will need. The models at the minimum need interaction data to understand behavior of your users, so start with that and add your item and user catalog data later. 2. Then create 'Shaped Models' that use your created 'Shaped Datasets' as input. Your Shaped Model will will start streaming, processing and training from your connected data immediately. After a few hours your model will have tuned all parameters based on your data and will deploy an active model. 3. You can now use the 'Model Inference' endpoints to make real-time inferences to your model based on your use-case.
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.1
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
-
from shaped.autogen.models.inference_config import InferenceConfig
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class ModelConfig(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
ModelConfig
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
name: StrictStr = Field(description="Sets the model's identifier")
|
|
31
|
-
description: Optional[StrictStr] = Field(default=None, description="Describe your model or add notes future reference")
|
|
32
|
-
slate_size: Optional[Union[StrictFloat, StrictInt]] = Field(default=50, description="Slate size defines the number of items expected to be ranked in a single request, having this information at train time can improve the model selection process. ")
|
|
33
|
-
pagination_store_ttl: Optional[Union[StrictFloat, StrictInt]] = Field(default=3600, description="All served ids are added to the pagination store to be filtered out on subsequent requests. This parameter defines the time it takes for the inserted iids to be removed. ")
|
|
34
|
-
inference_config: Optional[InferenceConfig] = None
|
|
35
|
-
__properties: ClassVar[List[str]] = ["name", "description", "slate_size", "pagination_store_ttl", "inference_config"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def to_str(self) -> str:
|
|
45
|
-
"""Returns the string representation of the model using alias"""
|
|
46
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
-
|
|
48
|
-
def to_json(self) -> str:
|
|
49
|
-
"""Returns the JSON representation of the model using alias"""
|
|
50
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
-
return json.dumps(self.to_dict())
|
|
52
|
-
|
|
53
|
-
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
-
"""Create an instance of ModelConfig from a JSON string"""
|
|
56
|
-
return cls.from_dict(json.loads(json_str))
|
|
57
|
-
|
|
58
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
-
"""Return the dictionary representation of the model using alias.
|
|
60
|
-
|
|
61
|
-
This has the following differences from calling pydantic's
|
|
62
|
-
`self.model_dump(by_alias=True)`:
|
|
63
|
-
|
|
64
|
-
* `None` is only added to the output dict for nullable fields that
|
|
65
|
-
were set at model initialization. Other fields with value `None`
|
|
66
|
-
are ignored.
|
|
67
|
-
"""
|
|
68
|
-
excluded_fields: Set[str] = set([
|
|
69
|
-
])
|
|
70
|
-
|
|
71
|
-
_dict = self.model_dump(
|
|
72
|
-
by_alias=True,
|
|
73
|
-
exclude=excluded_fields,
|
|
74
|
-
exclude_none=True,
|
|
75
|
-
)
|
|
76
|
-
# override the default output from pydantic by calling `to_dict()` of inference_config
|
|
77
|
-
if self.inference_config:
|
|
78
|
-
_dict['inference_config'] = self.inference_config.to_dict()
|
|
79
|
-
return _dict
|
|
80
|
-
|
|
81
|
-
@classmethod
|
|
82
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
-
"""Create an instance of ModelConfig from a dict"""
|
|
84
|
-
if obj is None:
|
|
85
|
-
return None
|
|
86
|
-
|
|
87
|
-
if not isinstance(obj, dict):
|
|
88
|
-
return cls.model_validate(obj)
|
|
89
|
-
|
|
90
|
-
_obj = cls.model_validate({
|
|
91
|
-
"name": obj.get("name"),
|
|
92
|
-
"description": obj.get("description"),
|
|
93
|
-
"slate_size": obj.get("slate_size") if obj.get("slate_size") is not None else 50,
|
|
94
|
-
"pagination_store_ttl": obj.get("pagination_store_ttl") if obj.get("pagination_store_ttl") is not None else 3600,
|
|
95
|
-
"inference_config": InferenceConfig.from_dict(obj["inference_config"]) if obj.get("inference_config") is not None else None
|
|
96
|
-
})
|
|
97
|
-
return _obj
|
|
98
|
-
|
|
99
|
-
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Shaped API
|
|
5
|
-
|
|
6
|
-
Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. Shaped's API is composed of 3 components: 1. **Dataset** - used to provision and manage 'Shaped Datasets', which are persisted data views of external data. Shaped Datasets can be created from any of our 'Shaped connectors' (e.g. S3, Segment, Snowflake, etc.) and support both batch ingestion (up to a 15min delay) and stream ingestion (up to a 30 second delay) depending on the specific connector used. Shaped datasets can also be created from local files, which is particularly useful for getting started with a snapshot of data. 2. **Model Management** - used to provision and manage 'Shaped Models', which represent a system of data pipelines, training and serving infrastructure for your ranking use-case. 3. **Model Inference** - a high performance API that's used to make user-understanding requests or ranking inferences to your 'Shaped Models'. For example, the 'rank' endpoint can be used to determine for a given user id query, what is the content that is most engaging to that user. The recommended workflow to interact with the Shaped API is as follows: 1. First create 'Shaped Datasets' to sync over data that your Shaped understanding models will need. The models at the minimum need interaction data to understand behavior of your users, so start with that and add your item and user catalog data later. 2. Then create 'Shaped Models' that use your created 'Shaped Datasets' as input. Your Shaped Model will will start streaming, processing and training from your connected data immediately. After a few hours your model will have tuned all parameters based on your data and will deploy an active model. 3. You can now use the 'Model Inference' endpoints to make real-time inferences to your model based on your use-case.
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.1
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class ModelResponse(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
ModelResponse
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
model_name: StrictStr
|
|
30
|
-
model_uri: StrictStr
|
|
31
|
-
created_at: StrictStr
|
|
32
|
-
trained_at: StrictStr
|
|
33
|
-
status: StrictStr = Field(description="Status takes the following values depending on which stage of the model creation pipeline it's at: 1. SCHEDULING -- your model is awaiting resources to be provisioned and used to fetch, train, and deploy your model. 2. FETCHING -- your historic data is being fetched. 3. TUNING -- your recommendation system configuration and models are being optimized for your dataset. 4. TRAINING -- your model is being trained on your historic dataset. 5. DEPLOYING -- your model is being deployed to your custom real-time endpoint. 6. ACTIVE -- your model is active and ready for rank requests. 7. ERROR -- there was an error at some point when creating your model. ")
|
|
34
|
-
__properties: ClassVar[List[str]] = ["model_name", "model_uri", "created_at", "trained_at", "status"]
|
|
35
|
-
|
|
36
|
-
model_config = ConfigDict(
|
|
37
|
-
populate_by_name=True,
|
|
38
|
-
validate_assignment=True,
|
|
39
|
-
protected_namespaces=(),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of ModelResponse from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
"""
|
|
67
|
-
excluded_fields: Set[str] = set([
|
|
68
|
-
])
|
|
69
|
-
|
|
70
|
-
_dict = self.model_dump(
|
|
71
|
-
by_alias=True,
|
|
72
|
-
exclude=excluded_fields,
|
|
73
|
-
exclude_none=True,
|
|
74
|
-
)
|
|
75
|
-
return _dict
|
|
76
|
-
|
|
77
|
-
@classmethod
|
|
78
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
-
"""Create an instance of ModelResponse from a dict"""
|
|
80
|
-
if obj is None:
|
|
81
|
-
return None
|
|
82
|
-
|
|
83
|
-
if not isinstance(obj, dict):
|
|
84
|
-
return cls.model_validate(obj)
|
|
85
|
-
|
|
86
|
-
_obj = cls.model_validate({
|
|
87
|
-
"model_name": obj.get("model_name"),
|
|
88
|
-
"model_uri": obj.get("model_uri"),
|
|
89
|
-
"created_at": obj.get("created_at"),
|
|
90
|
-
"trained_at": obj.get("trained_at"),
|
|
91
|
-
"status": obj.get("status")
|
|
92
|
-
})
|
|
93
|
-
return _obj
|
|
94
|
-
|
|
95
|
-
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Shaped API
|
|
5
|
-
|
|
6
|
-
Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. Shaped's API is composed of 3 components: 1. **Dataset** - used to provision and manage 'Shaped Datasets', which are persisted data views of external data. Shaped Datasets can be created from any of our 'Shaped connectors' (e.g. S3, Segment, Snowflake, etc.) and support both batch ingestion (up to a 15min delay) and stream ingestion (up to a 30 second delay) depending on the specific connector used. Shaped datasets can also be created from local files, which is particularly useful for getting started with a snapshot of data. 2. **Model Management** - used to provision and manage 'Shaped Models', which represent a system of data pipelines, training and serving infrastructure for your ranking use-case. 3. **Model Inference** - a high performance API that's used to make user-understanding requests or ranking inferences to your 'Shaped Models'. For example, the 'rank' endpoint can be used to determine for a given user id query, what is the content that is most engaging to that user. The recommended workflow to interact with the Shaped API is as follows: 1. First create 'Shaped Datasets' to sync over data that your Shaped understanding models will need. The models at the minimum need interaction data to understand behavior of your users, so start with that and add your item and user catalog data later. 2. Then create 'Shaped Models' that use your created 'Shaped Datasets' as input. Your Shaped Model will will start streaming, processing and training from your connected data immediately. After a few hours your model will have tuned all parameters based on your data and will deploy an active model. 3. You can now use the 'Model Inference' endpoints to make real-time inferences to your model based on your use-case.
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.1
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class MongoDBDatasetConfig(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
MongoDBDatasetConfig
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
name: StrictStr
|
|
31
|
-
mongodb_connection_string: StrictStr
|
|
32
|
-
database: StrictStr
|
|
33
|
-
collection: StrictStr
|
|
34
|
-
replication_key: Optional[StrictStr] = None
|
|
35
|
-
start_date: Optional[datetime] = None
|
|
36
|
-
schedule_interval: Optional[StrictStr] = '@hourly'
|
|
37
|
-
schema_type: StrictStr
|
|
38
|
-
__properties: ClassVar[List[str]] = ["name", "mongodb_connection_string", "database", "collection", "replication_key", "start_date", "schedule_interval", "schema_type"]
|
|
39
|
-
|
|
40
|
-
@field_validator('schema_type')
|
|
41
|
-
def schema_type_validate_enum(cls, value):
|
|
42
|
-
"""Validates the enum"""
|
|
43
|
-
if value not in set(['MONGODB']):
|
|
44
|
-
raise ValueError("must be one of enum values ('MONGODB')")
|
|
45
|
-
return value
|
|
46
|
-
|
|
47
|
-
model_config = ConfigDict(
|
|
48
|
-
populate_by_name=True,
|
|
49
|
-
validate_assignment=True,
|
|
50
|
-
protected_namespaces=(),
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def to_str(self) -> str:
|
|
55
|
-
"""Returns the string representation of the model using alias"""
|
|
56
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
-
|
|
58
|
-
def to_json(self) -> str:
|
|
59
|
-
"""Returns the JSON representation of the model using alias"""
|
|
60
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
-
return json.dumps(self.to_dict())
|
|
62
|
-
|
|
63
|
-
@classmethod
|
|
64
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
-
"""Create an instance of MongoDBDatasetConfig from a JSON string"""
|
|
66
|
-
return cls.from_dict(json.loads(json_str))
|
|
67
|
-
|
|
68
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
-
"""Return the dictionary representation of the model using alias.
|
|
70
|
-
|
|
71
|
-
This has the following differences from calling pydantic's
|
|
72
|
-
`self.model_dump(by_alias=True)`:
|
|
73
|
-
|
|
74
|
-
* `None` is only added to the output dict for nullable fields that
|
|
75
|
-
were set at model initialization. Other fields with value `None`
|
|
76
|
-
are ignored.
|
|
77
|
-
"""
|
|
78
|
-
excluded_fields: Set[str] = set([
|
|
79
|
-
])
|
|
80
|
-
|
|
81
|
-
_dict = self.model_dump(
|
|
82
|
-
by_alias=True,
|
|
83
|
-
exclude=excluded_fields,
|
|
84
|
-
exclude_none=True,
|
|
85
|
-
)
|
|
86
|
-
# set to None if replication_key (nullable) is None
|
|
87
|
-
# and model_fields_set contains the field
|
|
88
|
-
if self.replication_key is None and "replication_key" in self.model_fields_set:
|
|
89
|
-
_dict['replication_key'] = None
|
|
90
|
-
|
|
91
|
-
# set to None if start_date (nullable) is None
|
|
92
|
-
# and model_fields_set contains the field
|
|
93
|
-
if self.start_date is None and "start_date" in self.model_fields_set:
|
|
94
|
-
_dict['start_date'] = None
|
|
95
|
-
|
|
96
|
-
return _dict
|
|
97
|
-
|
|
98
|
-
@classmethod
|
|
99
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
100
|
-
"""Create an instance of MongoDBDatasetConfig from a dict"""
|
|
101
|
-
if obj is None:
|
|
102
|
-
return None
|
|
103
|
-
|
|
104
|
-
if not isinstance(obj, dict):
|
|
105
|
-
return cls.model_validate(obj)
|
|
106
|
-
|
|
107
|
-
_obj = cls.model_validate({
|
|
108
|
-
"name": obj.get("name"),
|
|
109
|
-
"mongodb_connection_string": obj.get("mongodb_connection_string"),
|
|
110
|
-
"database": obj.get("database"),
|
|
111
|
-
"collection": obj.get("collection"),
|
|
112
|
-
"replication_key": obj.get("replication_key"),
|
|
113
|
-
"start_date": obj.get("start_date"),
|
|
114
|
-
"schedule_interval": obj.get("schedule_interval") if obj.get("schedule_interval") is not None else '@hourly',
|
|
115
|
-
"schema_type": obj.get("schema_type")
|
|
116
|
-
})
|
|
117
|
-
return _obj
|
|
118
|
-
|
|
119
|
-
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Shaped API
|
|
5
|
-
|
|
6
|
-
Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. Shaped's API is composed of 3 components: 1. **Dataset** - used to provision and manage 'Shaped Datasets', which are persisted data views of external data. Shaped Datasets can be created from any of our 'Shaped connectors' (e.g. S3, Segment, Snowflake, etc.) and support both batch ingestion (up to a 15min delay) and stream ingestion (up to a 30 second delay) depending on the specific connector used. Shaped datasets can also be created from local files, which is particularly useful for getting started with a snapshot of data. 2. **Model Management** - used to provision and manage 'Shaped Models', which represent a system of data pipelines, training and serving infrastructure for your ranking use-case. 3. **Model Inference** - a high performance API that's used to make user-understanding requests or ranking inferences to your 'Shaped Models'. For example, the 'rank' endpoint can be used to determine for a given user id query, what is the content that is most engaging to that user. The recommended workflow to interact with the Shaped API is as follows: 1. First create 'Shaped Datasets' to sync over data that your Shaped understanding models will need. The models at the minimum need interaction data to understand behavior of your users, so start with that and add your item and user catalog data later. 2. Then create 'Shaped Models' that use your created 'Shaped Datasets' as input. Your Shaped Model will will start streaming, processing and training from your connected data immediately. After a few hours your model will have tuned all parameters based on your data and will deploy an active model. 3. You can now use the 'Model Inference' endpoints to make real-time inferences to your model based on your use-case.
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.1
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from shaped.autogen.models.inference_config import InferenceConfig
|
|
23
|
-
from shaped.autogen.models.interaction import Interaction
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class PostRankRequest(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
PostRankRequest
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
user_id: Optional[StrictStr] = Field(default=None, description="The user id to personalize the ranking to.")
|
|
32
|
-
item_ids: Optional[List[StrictStr]] = Field(default=None, description="A list of candidate items to rank. If not provided then we will use our own retrieval algorithms to fetch relevant items from the input queries. ")
|
|
33
|
-
interactions: Optional[List[Interaction]] = Field(default=None, description="A list of historically ordered positive interactions for the current user's session. These interactions are appended onto the interactions found in Shaped's internal interaction store before ranking. ")
|
|
34
|
-
filter_predicate: Optional[StrictStr] = Field(default=None, description="A SQL where query that can be used to filter out candidate items.")
|
|
35
|
-
user_features: Optional[Dict[str, Any]] = Field(default=None, description="Instead of providing a user id, you may provide the user features directly. This can be helpful when the user features change in real-time and need to be ranked immediately with the updated features. ")
|
|
36
|
-
item_features: Optional[Dict[str, Any]] = Field(default=None, description="Instead of providing candidate item ids, you maybe provide their item features directly. This allows new items to be ranked in real-time, even if they haven't been ingested by Shaped yet. ")
|
|
37
|
-
text_query: Optional[StrictStr] = Field(default=None, description="A free text text query to filter retrieved items using our underlying hybrid bm25 and semantic search engine on text indexed fields. Note that text_index: True needs to be set when creating a model to enable the this feature. ")
|
|
38
|
-
flush_paginations: Optional[StrictBool] = Field(default=False, description="Clears the pagination store for the given input user. This is useful if you want to implement paginations on client side or if you want to start the rankings again, e.g. on a page refresh. ")
|
|
39
|
-
return_metadata: Optional[StrictBool] = Field(default=False, description="If true, return the corresponding metadata for the ranked items.")
|
|
40
|
-
config: Optional[InferenceConfig] = None
|
|
41
|
-
__properties: ClassVar[List[str]] = ["user_id", "item_ids", "interactions", "filter_predicate", "user_features", "item_features", "text_query", "flush_paginations", "return_metadata", "config"]
|
|
42
|
-
|
|
43
|
-
model_config = ConfigDict(
|
|
44
|
-
populate_by_name=True,
|
|
45
|
-
validate_assignment=True,
|
|
46
|
-
protected_namespaces=(),
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def to_str(self) -> str:
|
|
51
|
-
"""Returns the string representation of the model using alias"""
|
|
52
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
-
|
|
54
|
-
def to_json(self) -> str:
|
|
55
|
-
"""Returns the JSON representation of the model using alias"""
|
|
56
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
-
return json.dumps(self.to_dict())
|
|
58
|
-
|
|
59
|
-
@classmethod
|
|
60
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
-
"""Create an instance of PostRankRequest from a JSON string"""
|
|
62
|
-
return cls.from_dict(json.loads(json_str))
|
|
63
|
-
|
|
64
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
-
"""Return the dictionary representation of the model using alias.
|
|
66
|
-
|
|
67
|
-
This has the following differences from calling pydantic's
|
|
68
|
-
`self.model_dump(by_alias=True)`:
|
|
69
|
-
|
|
70
|
-
* `None` is only added to the output dict for nullable fields that
|
|
71
|
-
were set at model initialization. Other fields with value `None`
|
|
72
|
-
are ignored.
|
|
73
|
-
"""
|
|
74
|
-
excluded_fields: Set[str] = set([
|
|
75
|
-
])
|
|
76
|
-
|
|
77
|
-
_dict = self.model_dump(
|
|
78
|
-
by_alias=True,
|
|
79
|
-
exclude=excluded_fields,
|
|
80
|
-
exclude_none=True,
|
|
81
|
-
)
|
|
82
|
-
# override the default output from pydantic by calling `to_dict()` of each item in interactions (list)
|
|
83
|
-
_items = []
|
|
84
|
-
if self.interactions:
|
|
85
|
-
for _item_interactions in self.interactions:
|
|
86
|
-
if _item_interactions:
|
|
87
|
-
_items.append(_item_interactions.to_dict())
|
|
88
|
-
_dict['interactions'] = _items
|
|
89
|
-
# override the default output from pydantic by calling `to_dict()` of config
|
|
90
|
-
if self.config:
|
|
91
|
-
_dict['config'] = self.config.to_dict()
|
|
92
|
-
return _dict
|
|
93
|
-
|
|
94
|
-
@classmethod
|
|
95
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
96
|
-
"""Create an instance of PostRankRequest from a dict"""
|
|
97
|
-
if obj is None:
|
|
98
|
-
return None
|
|
99
|
-
|
|
100
|
-
if not isinstance(obj, dict):
|
|
101
|
-
return cls.model_validate(obj)
|
|
102
|
-
|
|
103
|
-
_obj = cls.model_validate({
|
|
104
|
-
"user_id": obj.get("user_id"),
|
|
105
|
-
"item_ids": obj.get("item_ids"),
|
|
106
|
-
"interactions": [Interaction.from_dict(_item) for _item in obj["interactions"]] if obj.get("interactions") is not None else None,
|
|
107
|
-
"filter_predicate": obj.get("filter_predicate"),
|
|
108
|
-
"user_features": obj.get("user_features"),
|
|
109
|
-
"item_features": obj.get("item_features"),
|
|
110
|
-
"text_query": obj.get("text_query"),
|
|
111
|
-
"flush_paginations": obj.get("flush_paginations") if obj.get("flush_paginations") is not None else False,
|
|
112
|
-
"return_metadata": obj.get("return_metadata") if obj.get("return_metadata") is not None else False,
|
|
113
|
-
"config": InferenceConfig.from_dict(obj["config"]) if obj.get("config") is not None else None
|
|
114
|
-
})
|
|
115
|
-
return _obj
|
|
116
|
-
|
|
117
|
-
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Shaped API
|
|
5
|
-
|
|
6
|
-
Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. Shaped's API is composed of 3 components: 1. **Dataset** - used to provision and manage 'Shaped Datasets', which are persisted data views of external data. Shaped Datasets can be created from any of our 'Shaped connectors' (e.g. S3, Segment, Snowflake, etc.) and support both batch ingestion (up to a 15min delay) and stream ingestion (up to a 30 second delay) depending on the specific connector used. Shaped datasets can also be created from local files, which is particularly useful for getting started with a snapshot of data. 2. **Model Management** - used to provision and manage 'Shaped Models', which represent a system of data pipelines, training and serving infrastructure for your ranking use-case. 3. **Model Inference** - a high performance API that's used to make user-understanding requests or ranking inferences to your 'Shaped Models'. For example, the 'rank' endpoint can be used to determine for a given user id query, what is the content that is most engaging to that user. The recommended workflow to interact with the Shaped API is as follows: 1. First create 'Shaped Datasets' to sync over data that your Shaped understanding models will need. The models at the minimum need interaction data to understand behavior of your users, so start with that and add your item and user catalog data later. 2. Then create 'Shaped Models' that use your created 'Shaped Datasets' as input. Your Shaped Model will will start streaming, processing and training from your connected data immediately. After a few hours your model will have tuned all parameters based on your data and will deploy an active model. 3. You can now use the 'Model Inference' endpoints to make real-time inferences to your model based on your use-case.
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.1
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Union
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class RankAttributeResponse(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
RankAttributeResponse
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
attributes: List[StrictStr]
|
|
30
|
-
scores: List[Union[StrictFloat, StrictInt]]
|
|
31
|
-
__properties: ClassVar[List[str]] = ["attributes", "scores"]
|
|
32
|
-
|
|
33
|
-
model_config = ConfigDict(
|
|
34
|
-
populate_by_name=True,
|
|
35
|
-
validate_assignment=True,
|
|
36
|
-
protected_namespaces=(),
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def to_str(self) -> str:
|
|
41
|
-
"""Returns the string representation of the model using alias"""
|
|
42
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
-
|
|
44
|
-
def to_json(self) -> str:
|
|
45
|
-
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
-
return json.dumps(self.to_dict())
|
|
48
|
-
|
|
49
|
-
@classmethod
|
|
50
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
-
"""Create an instance of RankAttributeResponse from a JSON string"""
|
|
52
|
-
return cls.from_dict(json.loads(json_str))
|
|
53
|
-
|
|
54
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
-
"""Return the dictionary representation of the model using alias.
|
|
56
|
-
|
|
57
|
-
This has the following differences from calling pydantic's
|
|
58
|
-
`self.model_dump(by_alias=True)`:
|
|
59
|
-
|
|
60
|
-
* `None` is only added to the output dict for nullable fields that
|
|
61
|
-
were set at model initialization. Other fields with value `None`
|
|
62
|
-
are ignored.
|
|
63
|
-
"""
|
|
64
|
-
excluded_fields: Set[str] = set([
|
|
65
|
-
])
|
|
66
|
-
|
|
67
|
-
_dict = self.model_dump(
|
|
68
|
-
by_alias=True,
|
|
69
|
-
exclude=excluded_fields,
|
|
70
|
-
exclude_none=True,
|
|
71
|
-
)
|
|
72
|
-
return _dict
|
|
73
|
-
|
|
74
|
-
@classmethod
|
|
75
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
-
"""Create an instance of RankAttributeResponse from a dict"""
|
|
77
|
-
if obj is None:
|
|
78
|
-
return None
|
|
79
|
-
|
|
80
|
-
if not isinstance(obj, dict):
|
|
81
|
-
return cls.model_validate(obj)
|
|
82
|
-
|
|
83
|
-
_obj = cls.model_validate({
|
|
84
|
-
"attributes": obj.get("attributes"),
|
|
85
|
-
"scores": obj.get("scores")
|
|
86
|
-
})
|
|
87
|
-
return _obj
|
|
88
|
-
|
|
89
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Shaped API
|
|
5
|
-
|
|
6
|
-
Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. Shaped's API is composed of 3 components: 1. **Dataset** - used to provision and manage 'Shaped Datasets', which are persisted data views of external data. Shaped Datasets can be created from any of our 'Shaped connectors' (e.g. S3, Segment, Snowflake, etc.) and support both batch ingestion (up to a 15min delay) and stream ingestion (up to a 30 second delay) depending on the specific connector used. Shaped datasets can also be created from local files, which is particularly useful for getting started with a snapshot of data. 2. **Model Management** - used to provision and manage 'Shaped Models', which represent a system of data pipelines, training and serving infrastructure for your ranking use-case. 3. **Model Inference** - a high performance API that's used to make user-understanding requests or ranking inferences to your 'Shaped Models'. For example, the 'rank' endpoint can be used to determine for a given user id query, what is the content that is most engaging to that user. The recommended workflow to interact with the Shaped API is as follows: 1. First create 'Shaped Datasets' to sync over data that your Shaped understanding models will need. The models at the minimum need interaction data to understand behavior of your users, so start with that and add your item and user catalog data later. 2. Then create 'Shaped Models' that use your created 'Shaped Datasets' as input. Your Shaped Model will will start streaming, processing and training from your connected data immediately. After a few hours your model will have tuned all parameters based on your data and will deploy an active model. 3. You can now use the 'Model Inference' endpoints to make real-time inferences to your model based on your use-case.
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.1
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class RankGridAttributeRequest(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
RankGridAttributeRequest
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
attribute_name: StrictStr
|
|
30
|
-
user_id: Optional[StrictStr] = None
|
|
31
|
-
limit: Optional[Union[StrictFloat, StrictInt]] = 10
|
|
32
|
-
__properties: ClassVar[List[str]] = ["attribute_name", "user_id", "limit"]
|
|
33
|
-
|
|
34
|
-
model_config = ConfigDict(
|
|
35
|
-
populate_by_name=True,
|
|
36
|
-
validate_assignment=True,
|
|
37
|
-
protected_namespaces=(),
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def to_str(self) -> str:
|
|
42
|
-
"""Returns the string representation of the model using alias"""
|
|
43
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
-
|
|
45
|
-
def to_json(self) -> str:
|
|
46
|
-
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
-
return json.dumps(self.to_dict())
|
|
49
|
-
|
|
50
|
-
@classmethod
|
|
51
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of RankGridAttributeRequest from a JSON string"""
|
|
53
|
-
return cls.from_dict(json.loads(json_str))
|
|
54
|
-
|
|
55
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
-
"""Return the dictionary representation of the model using alias.
|
|
57
|
-
|
|
58
|
-
This has the following differences from calling pydantic's
|
|
59
|
-
`self.model_dump(by_alias=True)`:
|
|
60
|
-
|
|
61
|
-
* `None` is only added to the output dict for nullable fields that
|
|
62
|
-
were set at model initialization. Other fields with value `None`
|
|
63
|
-
are ignored.
|
|
64
|
-
"""
|
|
65
|
-
excluded_fields: Set[str] = set([
|
|
66
|
-
])
|
|
67
|
-
|
|
68
|
-
_dict = self.model_dump(
|
|
69
|
-
by_alias=True,
|
|
70
|
-
exclude=excluded_fields,
|
|
71
|
-
exclude_none=True,
|
|
72
|
-
)
|
|
73
|
-
return _dict
|
|
74
|
-
|
|
75
|
-
@classmethod
|
|
76
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of RankGridAttributeRequest from a dict"""
|
|
78
|
-
if obj is None:
|
|
79
|
-
return None
|
|
80
|
-
|
|
81
|
-
if not isinstance(obj, dict):
|
|
82
|
-
return cls.model_validate(obj)
|
|
83
|
-
|
|
84
|
-
_obj = cls.model_validate({
|
|
85
|
-
"attribute_name": obj.get("attribute_name"),
|
|
86
|
-
"user_id": obj.get("user_id"),
|
|
87
|
-
"limit": obj.get("limit") if obj.get("limit") is not None else 10
|
|
88
|
-
})
|
|
89
|
-
return _obj
|
|
90
|
-
|
|
91
|
-
|