shaped 2.0.2__py3-none-any.whl → 2.0.5__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 +47 -42
- shaped/autogen/__init__.py +41 -56
- shaped/autogen/api/engine_api.py +5 -6
- shaped/autogen/api/query_api.py +12 -73
- shaped/autogen/api/table_api.py +5 -6
- shaped/autogen/api/view_api.py +5 -6
- shaped/autogen/api_client.py +8 -9
- shaped/autogen/configuration.py +9 -8
- shaped/autogen/exceptions.py +11 -9
- shaped/autogen/models/__init__.py +23 -31
- shaped/autogen/models/ai_enrichment_view_config.py +5 -6
- shaped/autogen/models/algorithm.py +5 -6
- shaped/autogen/models/amplitude_table_config.py +5 -6
- shaped/autogen/models/attn_dropout_prob.py +5 -6
- shaped/autogen/models/attribute_journey.py +5 -6
- shaped/autogen/models/attribute_value.py +5 -6
- shaped/autogen/models/autoscaling_config.py +5 -6
- shaped/autogen/models/aws_pinpoint_table_config.py +5 -6
- shaped/autogen/models/batch_size.py +5 -6
- shaped/autogen/models/batch_size1.py +5 -6
- shaped/autogen/models/batch_size2.py +5 -6
- shaped/autogen/models/big_query_table_config.py +5 -6
- shaped/autogen/models/bm25.py +5 -6
- shaped/autogen/models/boosted_reorder_step.py +5 -6
- shaped/autogen/models/canary_rollout.py +5 -6
- shaped/autogen/models/candidate_attributes_retrieve_step.py +5 -19
- shaped/autogen/models/candidate_ids_retrieve_step.py +5 -6
- shaped/autogen/models/candidate_retrieval_strategy.py +5 -6
- shaped/autogen/models/clickhouse_table_config.py +5 -6
- shaped/autogen/models/column_order_retrieve_step.py +5 -6
- shaped/autogen/models/column_ordering.py +5 -6
- shaped/autogen/models/create_table_response.py +5 -6
- shaped/autogen/models/create_view_response.py +5 -6
- shaped/autogen/models/custom_table_config.py +5 -6
- shaped/autogen/models/data_compute_config.py +5 -6
- shaped/autogen/models/data_config.py +5 -6
- shaped/autogen/models/data_config_interaction_table.py +5 -6
- shaped/autogen/models/data_split_config.py +5 -6
- shaped/autogen/models/data_split_strategy.py +5 -6
- shaped/autogen/models/data_tier.py +5 -6
- shaped/autogen/models/default.py +5 -6
- shaped/autogen/models/delete_engine_response.py +5 -6
- shaped/autogen/models/delete_table_response.py +5 -6
- shaped/autogen/models/delete_view_response.py +5 -6
- shaped/autogen/models/deployment_config.py +6 -13
- shaped/autogen/models/diversity_reorder_step.py +5 -6
- shaped/autogen/models/dropout_rate.py +5 -6
- shaped/autogen/models/dynamo_db_table_config.py +5 -6
- shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +5 -6
- shaped/autogen/models/embedder_batch_size.py +5 -6
- shaped/autogen/models/embedding_config.py +5 -6
- shaped/autogen/models/embedding_dim.py +5 -6
- shaped/autogen/models/embedding_dims.py +5 -6
- shaped/autogen/models/embedding_size.py +5 -6
- shaped/autogen/models/encoder.py +5 -6
- shaped/autogen/models/engine.py +5 -6
- shaped/autogen/models/engine_config_v2.py +5 -6
- shaped/autogen/models/engine_details_response.py +5 -6
- shaped/autogen/models/engine_schema.py +12 -13
- shaped/autogen/models/entity_config.py +5 -6
- shaped/autogen/models/entity_journey.py +32 -24
- shaped/autogen/models/entity_type.py +5 -6
- shaped/autogen/models/evaluation_config.py +5 -6
- shaped/autogen/models/exploration_reorder_step.py +5 -6
- shaped/autogen/models/expression_filter_step.py +5 -6
- shaped/autogen/models/factors.py +5 -6
- shaped/autogen/models/factors1.py +5 -6
- shaped/autogen/models/feature.py +5 -6
- shaped/autogen/models/feature_type.py +5 -6
- shaped/autogen/models/file_table_config.py +5 -6
- shaped/autogen/models/filter_config.py +18 -19
- shaped/autogen/models/filter_index_type.py +5 -6
- shaped/autogen/models/filter_retrieve_step.py +5 -6
- shaped/autogen/models/filter_step_explanation.py +164 -0
- shaped/autogen/models/{filter_dataset.py → filter_table.py} +12 -13
- shaped/autogen/models/{type.py → filter_type.py} +10 -11
- shaped/autogen/models/global_filter.py +5 -6
- shaped/autogen/models/hidden_dropout_prob.py +5 -6
- shaped/autogen/models/hidden_size.py +5 -6
- shaped/autogen/models/hidden_size1.py +5 -6
- shaped/autogen/models/http_problem_response.py +5 -6
- shaped/autogen/models/http_validation_error.py +5 -6
- shaped/autogen/models/hugging_face_encoder.py +10 -9
- shaped/autogen/models/iceberg_table_config.py +5 -6
- shaped/autogen/models/index_config.py +5 -6
- shaped/autogen/models/{time_window_in_days.py → inner_entity_id.py} +27 -26
- shaped/autogen/models/inner_size.py +5 -6
- shaped/autogen/models/inner_size1.py +5 -6
- shaped/autogen/models/{mode2.py → inner_uid.py} +37 -30
- shaped/autogen/models/interaction_config.py +5 -6
- shaped/autogen/models/interaction_pooling_encoder.py +5 -6
- shaped/autogen/models/interaction_round_robin_encoder.py +5 -6
- shaped/autogen/models/item_attribute_pooling_encoder.py +5 -19
- shaped/autogen/models/journey.py +5 -6
- shaped/autogen/models/kafka_table_config.py +5 -6
- shaped/autogen/models/kinesis_table_config.py +5 -6
- shaped/autogen/models/kinesis_table_config_column_schema_value.py +5 -6
- shaped/autogen/models/label.py +5 -6
- shaped/autogen/models/label_type.py +5 -7
- shaped/autogen/models/laplace_smoothing.py +5 -6
- shaped/autogen/models/latency_scaling_policy.py +5 -6
- shaped/autogen/models/learning_rate.py +5 -6
- shaped/autogen/models/learning_rate1.py +5 -6
- shaped/autogen/models/learning_rate2.py +5 -6
- shaped/autogen/models/learning_rate3.py +5 -6
- shaped/autogen/models/lexical_search_mode.py +7 -8
- shaped/autogen/models/list_engines_response.py +5 -6
- shaped/autogen/models/list_tables_response.py +5 -6
- shaped/autogen/models/list_views_response.py +5 -6
- shaped/autogen/models/{validation_error_loc_inner.py → location_inner.py} +11 -12
- shaped/autogen/models/loss_types.py +5 -6
- shaped/autogen/models/lr.py +5 -6
- shaped/autogen/models/lr1.py +5 -6
- shaped/autogen/models/lr2.py +5 -6
- shaped/autogen/models/max_depth.py +5 -6
- shaped/autogen/models/max_leaves.py +5 -6
- shaped/autogen/models/max_seq_length.py +5 -6
- shaped/autogen/models/max_seq_length1.py +5 -6
- shaped/autogen/models/max_seq_length2.py +5 -6
- shaped/autogen/models/mode.py +5 -6
- shaped/autogen/models/mode1.py +24 -23
- shaped/autogen/models/{training_config_models_inner.py → models_inner.py} +13 -14
- shaped/autogen/models/mongo_db_table_config.py +5 -6
- shaped/autogen/models/mssql_table_config.py +5 -6
- shaped/autogen/models/my_sql_table_config.py +5 -6
- shaped/autogen/models/n_epochs.py +5 -6
- shaped/autogen/models/n_epochs1.py +5 -6
- shaped/autogen/models/n_epochs2.py +5 -6
- shaped/autogen/models/n_estimators.py +5 -6
- shaped/autogen/models/n_heads.py +5 -6
- shaped/autogen/models/n_layers.py +5 -6
- shaped/autogen/models/neg_per_positive.py +5 -6
- shaped/autogen/models/negative_samples_count.py +5 -6
- shaped/autogen/models/ngram_tokenizer.py +5 -6
- shaped/autogen/models/no_op_config.py +5 -6
- shaped/autogen/models/num_blocks.py +5 -6
- shaped/autogen/models/num_heads.py +5 -6
- shaped/autogen/models/num_leaves.py +5 -6
- shaped/autogen/models/objective.py +5 -6
- shaped/autogen/models/objective1.py +5 -6
- shaped/autogen/models/online_store_config.py +5 -6
- shaped/autogen/models/pagination_config.py +5 -6
- shaped/autogen/models/parameter_definition.py +5 -6
- shaped/autogen/models/parameters_value.py +5 -6
- shaped/autogen/models/passthrough_score.py +5 -6
- shaped/autogen/models/personal_filter.py +5 -6
- shaped/autogen/models/pipeline_stage_explanation.py +8 -9
- shaped/autogen/models/policy.py +5 -6
- shaped/autogen/models/pooling_function.py +5 -6
- shaped/autogen/models/postgres_table_config.py +5 -6
- shaped/autogen/models/posthog_table_config.py +5 -6
- shaped/autogen/models/prebuilt_filter_step.py +5 -6
- shaped/autogen/models/precomputed_item_embedding.py +5 -6
- shaped/autogen/models/precomputed_user_embedding.py +5 -6
- shaped/autogen/models/query.py +19 -20
- shaped/autogen/models/query1.py +19 -20
- shaped/autogen/models/{query_any_of.py → query_config.py} +13 -14
- shaped/autogen/models/query_definition.py +5 -6
- shaped/autogen/models/query_encoder.py +5 -6
- shaped/autogen/models/query_explanation.py +11 -8
- shaped/autogen/models/query_request.py +5 -6
- shaped/autogen/models/query_result.py +5 -6
- shaped/autogen/models/query_table_config.py +5 -6
- shaped/autogen/models/rank_item_attribute_values_query_config.py +5 -6
- shaped/autogen/models/rank_query_config.py +11 -12
- shaped/autogen/models/rank_query_config_filter_inner.py +5 -6
- shaped/autogen/models/recreate_rollout.py +5 -6
- shaped/autogen/models/redshift_table_config.py +5 -6
- shaped/autogen/models/reference_table_config.py +5 -6
- shaped/autogen/models/regularization.py +5 -6
- shaped/autogen/models/{rank_query_config_reorder_inner.py → reorder_inner.py} +11 -12
- shaped/autogen/models/reorder_step_explanation.py +206 -0
- shaped/autogen/models/request.py +5 -6
- shaped/autogen/models/request1.py +5 -6
- shaped/autogen/models/requests_per_second_scaling_policy.py +5 -6
- shaped/autogen/models/resource_config.py +99 -0
- shaped/autogen/models/response_get_view_details_views_view_name_get.py +5 -6
- shaped/autogen/models/result.py +5 -19
- shaped/autogen/models/result_embeddings_value.py +5 -6
- shaped/autogen/models/{ascending.py → retrieval_scores_value.py} +26 -36
- shaped/autogen/models/{rank_query_config_retrieve_inner.py → retrieve_inner.py} +13 -14
- shaped/autogen/models/retrieve_step_explanation.py +171 -0
- shaped/autogen/models/retriever.py +5 -6
- shaped/autogen/models/retriever1.py +5 -6
- shaped/autogen/models/rollout_config.py +5 -6
- shaped/autogen/models/rudderstack_table_config.py +5 -6
- shaped/autogen/models/sampling_strategy.py +5 -6
- shaped/autogen/models/saved_query_info_response.py +22 -9
- shaped/autogen/models/saved_query_list_response.py +5 -6
- shaped/autogen/models/saved_query_request.py +5 -6
- shaped/autogen/models/schema_config.py +5 -6
- shaped/autogen/models/score.py +5 -6
- shaped/autogen/models/score_ensemble.py +5 -19
- shaped/autogen/models/score_step_explanation.py +223 -0
- shaped/autogen/models/search_config.py +5 -6
- shaped/autogen/models/segment_table_config.py +5 -6
- shaped/autogen/models/sequence_length.py +5 -6
- shaped/autogen/models/server_config.py +18 -6
- shaped/autogen/models/setup_engine_response.py +5 -6
- shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +13 -8
- shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +13 -8
- shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +14 -9
- shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +10 -9
- shaped/autogen/models/shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config.py +13 -8
- shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +5 -6
- shaped/autogen/models/shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config.py +13 -8
- shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +5 -6
- shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +5 -6
- shaped/autogen/models/shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config.py +13 -8
- shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +5 -6
- shaped/autogen/models/shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config.py +13 -8
- shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +14 -9
- shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +16 -11
- shaped/autogen/models/shopify_table_config.py +5 -6
- shaped/autogen/models/similarity_retrieve_step.py +10 -9
- shaped/autogen/models/snowflake_table_config.py +5 -6
- shaped/autogen/models/sql_transform_type.py +5 -6
- shaped/autogen/models/sql_view_config.py +5 -6
- shaped/autogen/models/stemmer_tokenizer.py +5 -6
- shaped/autogen/models/step_explanation.py +5 -6
- shaped/autogen/models/steps_inner.py +178 -0
- shaped/autogen/models/strategy.py +5 -6
- shaped/autogen/models/table.py +5 -6
- shaped/autogen/models/table_deployment_type.py +5 -6
- shaped/autogen/models/table_insert_arguments.py +7 -8
- shaped/autogen/models/table_insert_response.py +5 -6
- shaped/autogen/models/text_search_retrieve_step.py +5 -6
- shaped/autogen/models/time_frequency.py +5 -6
- shaped/autogen/models/time_window.py +5 -6
- shaped/autogen/models/tokenizer.py +5 -6
- shaped/autogen/models/trained_model_encoder.py +5 -6
- shaped/autogen/models/training_compute_config.py +8 -9
- shaped/autogen/models/training_config.py +8 -9
- shaped/autogen/models/training_strategy.py +5 -6
- shaped/autogen/models/transform_status.py +40 -0
- shaped/autogen/models/truncate_filter_step.py +5 -6
- shaped/autogen/models/tunable_bool.py +5 -6
- shaped/autogen/models/tunable_float.py +5 -6
- shaped/autogen/models/tunable_int.py +5 -6
- shaped/autogen/models/tunable_int_categorical.py +5 -6
- shaped/autogen/models/tunable_string.py +5 -6
- shaped/autogen/models/tuning_config.py +5 -6
- shaped/autogen/models/update_table_response.py +5 -6
- shaped/autogen/models/update_view_response.py +5 -6
- shaped/autogen/models/user_attribute_pooling_encoder.py +5 -6
- shaped/autogen/models/{engine_schema_user_inner.py → user_inner.py} +11 -12
- shaped/autogen/models/val_split.py +5 -6
- shaped/autogen/models/validation_error.py +8 -9
- shaped/autogen/models/value_type.py +5 -6
- shaped/autogen/models/vector_search_mode.py +10 -9
- shaped/autogen/models/view.py +8 -9
- shaped/autogen/models/view_details_ai.py +10 -11
- shaped/autogen/models/view_details_ai_schema_value.py +5 -6
- shaped/autogen/models/view_details_sql.py +10 -11
- shaped/autogen/models/weight_decay.py +5 -6
- shaped/autogen/models/whitespace_tokenizer.py +5 -6
- shaped/autogen/models/window_size.py +5 -6
- shaped/autogen/rest.py +13 -14
- shaped/cli/shaped_cli.py +152 -29
- shaped/client.py +50 -43
- shaped/config_builders.py +110 -100
- shaped/query_builder.py +56 -49
- {shaped-2.0.2.dist-info → shaped-2.0.5.dist-info}/METADATA +2 -2
- shaped-2.0.5.dist-info/RECORD +271 -0
- {shaped-2.0.2.dist-info → shaped-2.0.5.dist-info}/WHEEL +1 -1
- shaped/autogen/models/distance_function.py +0 -38
- shaped/autogen/models/encoding_pooling_strategy.py +0 -38
- shaped/autogen/models/pool_fn.py +0 -134
- shaped/autogen/models/score_ensemble_policy_config.py +0 -141
- shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +0 -422
- shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +0 -137
- shaped/autogen/models/shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config.py +0 -152
- shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +0 -137
- shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +0 -104
- shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +0 -130
- shaped/autogen/models/shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config.py +0 -131
- shaped/autogen/models/text_encoding.py +0 -136
- shaped/autogen/models/trending_mode.py +0 -37
- shaped/autogen/models/view_status.py +0 -41
- shaped-2.0.2.dist-info/RECORD +0 -278
- {shaped-2.0.2.dist-info → shaped-2.0.5.dist-info}/entry_points.txt +0 -0
- {shaped-2.0.2.dist-info → shaped-2.0.5.dist-info}/top_level.txt +0 -0
- {shaped-2.0.2.dist-info → shaped-2.0.5.dist-info}/zip-safe +0 -0
|
@@ -1,422 +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. The Shaped API has four main endpoints: **Tables** - Provision and manage batch and real-time data connectors. **Views** - Configure SQL transformations and AI enrichment on your input data. Use SQL to combine multiple data sources or use an LLM to add new categories, extract specific attributes from descriptions, etc. **Engines** - Deploy and manage your relevance engines. The Engine API exposes configuration for indexing logic, input datasets, externam embeddings, and more. **Query** - Execute queries against your engines, to return data based on an input query or rerank an existing list. The Query API exposes the retrieve, filter, score, and ranking steps of the 4-stage ranking architecture. The base URL for each endpoint is: `https://api.shaped.ai/v2`
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 2.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import json
|
|
17
|
-
import pprint
|
|
18
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
-
from typing import Any, List, Optional
|
|
20
|
-
from shaped.autogen.models.no_op_config import NoOpConfig
|
|
21
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_als_model_policy_als_model_policy_config import ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig
|
|
22
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config import ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig
|
|
23
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config import ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig
|
|
24
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config import ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig
|
|
25
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config import ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig
|
|
26
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config import ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig
|
|
27
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config import ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig
|
|
28
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config import ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig
|
|
29
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config import ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig
|
|
30
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config import ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig
|
|
31
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config import ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig
|
|
32
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_random_model_policy_random_model_policy_config import ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig
|
|
33
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config import ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig
|
|
34
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config import ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig
|
|
35
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config import ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig
|
|
36
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config import ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig
|
|
37
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config import ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig
|
|
38
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config import ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig
|
|
39
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config import ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig
|
|
40
|
-
from shaped.autogen.models.shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config import ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig
|
|
41
|
-
from pydantic import StrictStr, Field
|
|
42
|
-
from typing import Union, List, Set, Optional, Dict
|
|
43
|
-
from typing_extensions import Literal, Self
|
|
44
|
-
|
|
45
|
-
SCOREENSEMBLEPOLICYCONFIGPOLICIESINNER_ONE_OF_SCHEMAS = ["NoOpConfig", "ScoreEnsemblePolicyConfig", "ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig", "ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig", "ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig", "ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig", "ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig", "ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig", "ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig", "ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig", "ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig", "ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig", "ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig", "ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig", "ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig", "ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig", "ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig", "ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig", "ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig", "ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig", "ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig", "ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig"]
|
|
46
|
-
|
|
47
|
-
class ScoreEnsemblePolicyConfigPoliciesInner(BaseModel):
|
|
48
|
-
"""
|
|
49
|
-
ScoreEnsemblePolicyConfigPoliciesInner
|
|
50
|
-
"""
|
|
51
|
-
# data type: ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig
|
|
52
|
-
oneof_schema_1_validator: Optional[ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig] = None
|
|
53
|
-
# data type: ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig
|
|
54
|
-
oneof_schema_2_validator: Optional[ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig] = None
|
|
55
|
-
# data type: ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig
|
|
56
|
-
oneof_schema_3_validator: Optional[ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig] = None
|
|
57
|
-
# data type: ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig
|
|
58
|
-
oneof_schema_4_validator: Optional[ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig] = None
|
|
59
|
-
# data type: ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig
|
|
60
|
-
oneof_schema_5_validator: Optional[ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig] = None
|
|
61
|
-
# data type: ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig
|
|
62
|
-
oneof_schema_6_validator: Optional[ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig] = None
|
|
63
|
-
# data type: ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig
|
|
64
|
-
oneof_schema_7_validator: Optional[ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig] = None
|
|
65
|
-
# data type: ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig
|
|
66
|
-
oneof_schema_8_validator: Optional[ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig] = None
|
|
67
|
-
# data type: ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig
|
|
68
|
-
oneof_schema_9_validator: Optional[ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig] = None
|
|
69
|
-
# data type: ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig
|
|
70
|
-
oneof_schema_10_validator: Optional[ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig] = None
|
|
71
|
-
# data type: ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig
|
|
72
|
-
oneof_schema_11_validator: Optional[ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig] = None
|
|
73
|
-
# data type: ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig
|
|
74
|
-
oneof_schema_12_validator: Optional[ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig] = None
|
|
75
|
-
# data type: ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig
|
|
76
|
-
oneof_schema_13_validator: Optional[ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig] = None
|
|
77
|
-
# data type: ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig
|
|
78
|
-
oneof_schema_14_validator: Optional[ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig] = None
|
|
79
|
-
# data type: ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig
|
|
80
|
-
oneof_schema_15_validator: Optional[ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig] = None
|
|
81
|
-
# data type: ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig
|
|
82
|
-
oneof_schema_16_validator: Optional[ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig] = None
|
|
83
|
-
# data type: ScoreEnsemblePolicyConfig
|
|
84
|
-
oneof_schema_17_validator: Optional[ScoreEnsemblePolicyConfig] = None
|
|
85
|
-
# data type: ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig
|
|
86
|
-
oneof_schema_18_validator: Optional[ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig] = None
|
|
87
|
-
# data type: ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig
|
|
88
|
-
oneof_schema_19_validator: Optional[ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig] = None
|
|
89
|
-
# data type: ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig
|
|
90
|
-
oneof_schema_20_validator: Optional[ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig] = None
|
|
91
|
-
# data type: NoOpConfig
|
|
92
|
-
oneof_schema_21_validator: Optional[NoOpConfig] = None
|
|
93
|
-
# data type: ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig
|
|
94
|
-
oneof_schema_22_validator: Optional[ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig] = None
|
|
95
|
-
actual_instance: Optional[Union[NoOpConfig, ScoreEnsemblePolicyConfig, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig]] = None
|
|
96
|
-
one_of_schemas: Set[str] = { "NoOpConfig", "ScoreEnsemblePolicyConfig", "ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig", "ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig", "ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig", "ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig", "ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig", "ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig", "ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig", "ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig", "ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig", "ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig", "ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig", "ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig", "ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig", "ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig", "ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig", "ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig", "ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig", "ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig", "ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig", "ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig" }
|
|
97
|
-
|
|
98
|
-
model_config = ConfigDict(
|
|
99
|
-
validate_assignment=True,
|
|
100
|
-
protected_namespaces=(),
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
discriminator_value_class_map: Dict[str, str] = {
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
108
|
-
if args:
|
|
109
|
-
if len(args) > 1:
|
|
110
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
111
|
-
if kwargs:
|
|
112
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
113
|
-
super().__init__(actual_instance=args[0])
|
|
114
|
-
else:
|
|
115
|
-
super().__init__(**kwargs)
|
|
116
|
-
|
|
117
|
-
@field_validator('actual_instance')
|
|
118
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
119
|
-
instance = ScoreEnsemblePolicyConfigPoliciesInner.model_construct()
|
|
120
|
-
error_messages = []
|
|
121
|
-
match = 0
|
|
122
|
-
# validate data type: ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig
|
|
123
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig):
|
|
124
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig`")
|
|
125
|
-
else:
|
|
126
|
-
match += 1
|
|
127
|
-
# validate data type: ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig
|
|
128
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig):
|
|
129
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig`")
|
|
130
|
-
else:
|
|
131
|
-
match += 1
|
|
132
|
-
# validate data type: ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig
|
|
133
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig):
|
|
134
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig`")
|
|
135
|
-
else:
|
|
136
|
-
match += 1
|
|
137
|
-
# validate data type: ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig
|
|
138
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig):
|
|
139
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig`")
|
|
140
|
-
else:
|
|
141
|
-
match += 1
|
|
142
|
-
# validate data type: ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig
|
|
143
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig):
|
|
144
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig`")
|
|
145
|
-
else:
|
|
146
|
-
match += 1
|
|
147
|
-
# validate data type: ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig
|
|
148
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig):
|
|
149
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig`")
|
|
150
|
-
else:
|
|
151
|
-
match += 1
|
|
152
|
-
# validate data type: ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig
|
|
153
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig):
|
|
154
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig`")
|
|
155
|
-
else:
|
|
156
|
-
match += 1
|
|
157
|
-
# validate data type: ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig
|
|
158
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig):
|
|
159
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig`")
|
|
160
|
-
else:
|
|
161
|
-
match += 1
|
|
162
|
-
# validate data type: ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig
|
|
163
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig):
|
|
164
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig`")
|
|
165
|
-
else:
|
|
166
|
-
match += 1
|
|
167
|
-
# validate data type: ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig
|
|
168
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig):
|
|
169
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig`")
|
|
170
|
-
else:
|
|
171
|
-
match += 1
|
|
172
|
-
# validate data type: ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig
|
|
173
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig):
|
|
174
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig`")
|
|
175
|
-
else:
|
|
176
|
-
match += 1
|
|
177
|
-
# validate data type: ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig
|
|
178
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig):
|
|
179
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig`")
|
|
180
|
-
else:
|
|
181
|
-
match += 1
|
|
182
|
-
# validate data type: ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig
|
|
183
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig):
|
|
184
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig`")
|
|
185
|
-
else:
|
|
186
|
-
match += 1
|
|
187
|
-
# validate data type: ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig
|
|
188
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig):
|
|
189
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig`")
|
|
190
|
-
else:
|
|
191
|
-
match += 1
|
|
192
|
-
# validate data type: ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig
|
|
193
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig):
|
|
194
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig`")
|
|
195
|
-
else:
|
|
196
|
-
match += 1
|
|
197
|
-
# validate data type: ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig
|
|
198
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig):
|
|
199
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig`")
|
|
200
|
-
else:
|
|
201
|
-
match += 1
|
|
202
|
-
# validate data type: ScoreEnsemblePolicyConfig
|
|
203
|
-
if not isinstance(v, ScoreEnsemblePolicyConfig):
|
|
204
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreEnsemblePolicyConfig`")
|
|
205
|
-
else:
|
|
206
|
-
match += 1
|
|
207
|
-
# validate data type: ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig
|
|
208
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig):
|
|
209
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig`")
|
|
210
|
-
else:
|
|
211
|
-
match += 1
|
|
212
|
-
# validate data type: ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig
|
|
213
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig):
|
|
214
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig`")
|
|
215
|
-
else:
|
|
216
|
-
match += 1
|
|
217
|
-
# validate data type: ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig
|
|
218
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig):
|
|
219
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig`")
|
|
220
|
-
else:
|
|
221
|
-
match += 1
|
|
222
|
-
# validate data type: NoOpConfig
|
|
223
|
-
if not isinstance(v, NoOpConfig):
|
|
224
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `NoOpConfig`")
|
|
225
|
-
else:
|
|
226
|
-
match += 1
|
|
227
|
-
# validate data type: ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig
|
|
228
|
-
if not isinstance(v, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig):
|
|
229
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig`")
|
|
230
|
-
else:
|
|
231
|
-
match += 1
|
|
232
|
-
if match > 1:
|
|
233
|
-
# more than 1 match
|
|
234
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in ScoreEnsemblePolicyConfigPoliciesInner with oneOf schemas: NoOpConfig, ScoreEnsemblePolicyConfig, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig. Details: " + ", ".join(error_messages))
|
|
235
|
-
elif match == 0:
|
|
236
|
-
# no match
|
|
237
|
-
raise ValueError("No match found when setting `actual_instance` in ScoreEnsemblePolicyConfigPoliciesInner with oneOf schemas: NoOpConfig, ScoreEnsemblePolicyConfig, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig. Details: " + ", ".join(error_messages))
|
|
238
|
-
else:
|
|
239
|
-
return v
|
|
240
|
-
|
|
241
|
-
@classmethod
|
|
242
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
243
|
-
return cls.from_json(json.dumps(obj))
|
|
244
|
-
|
|
245
|
-
@classmethod
|
|
246
|
-
def from_json(cls, json_str: str) -> Self:
|
|
247
|
-
"""Returns the object represented by the json string"""
|
|
248
|
-
instance = cls.model_construct()
|
|
249
|
-
error_messages = []
|
|
250
|
-
match = 0
|
|
251
|
-
|
|
252
|
-
# deserialize data into ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig
|
|
253
|
-
try:
|
|
254
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig.from_json(json_str)
|
|
255
|
-
match += 1
|
|
256
|
-
except (ValidationError, ValueError) as e:
|
|
257
|
-
error_messages.append(str(e))
|
|
258
|
-
# deserialize data into ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig
|
|
259
|
-
try:
|
|
260
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig.from_json(json_str)
|
|
261
|
-
match += 1
|
|
262
|
-
except (ValidationError, ValueError) as e:
|
|
263
|
-
error_messages.append(str(e))
|
|
264
|
-
# deserialize data into ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig
|
|
265
|
-
try:
|
|
266
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig.from_json(json_str)
|
|
267
|
-
match += 1
|
|
268
|
-
except (ValidationError, ValueError) as e:
|
|
269
|
-
error_messages.append(str(e))
|
|
270
|
-
# deserialize data into ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig
|
|
271
|
-
try:
|
|
272
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig.from_json(json_str)
|
|
273
|
-
match += 1
|
|
274
|
-
except (ValidationError, ValueError) as e:
|
|
275
|
-
error_messages.append(str(e))
|
|
276
|
-
# deserialize data into ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig
|
|
277
|
-
try:
|
|
278
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig.from_json(json_str)
|
|
279
|
-
match += 1
|
|
280
|
-
except (ValidationError, ValueError) as e:
|
|
281
|
-
error_messages.append(str(e))
|
|
282
|
-
# deserialize data into ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig
|
|
283
|
-
try:
|
|
284
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig.from_json(json_str)
|
|
285
|
-
match += 1
|
|
286
|
-
except (ValidationError, ValueError) as e:
|
|
287
|
-
error_messages.append(str(e))
|
|
288
|
-
# deserialize data into ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig
|
|
289
|
-
try:
|
|
290
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig.from_json(json_str)
|
|
291
|
-
match += 1
|
|
292
|
-
except (ValidationError, ValueError) as e:
|
|
293
|
-
error_messages.append(str(e))
|
|
294
|
-
# deserialize data into ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig
|
|
295
|
-
try:
|
|
296
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig.from_json(json_str)
|
|
297
|
-
match += 1
|
|
298
|
-
except (ValidationError, ValueError) as e:
|
|
299
|
-
error_messages.append(str(e))
|
|
300
|
-
# deserialize data into ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig
|
|
301
|
-
try:
|
|
302
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig.from_json(json_str)
|
|
303
|
-
match += 1
|
|
304
|
-
except (ValidationError, ValueError) as e:
|
|
305
|
-
error_messages.append(str(e))
|
|
306
|
-
# deserialize data into ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig
|
|
307
|
-
try:
|
|
308
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig.from_json(json_str)
|
|
309
|
-
match += 1
|
|
310
|
-
except (ValidationError, ValueError) as e:
|
|
311
|
-
error_messages.append(str(e))
|
|
312
|
-
# deserialize data into ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig
|
|
313
|
-
try:
|
|
314
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig.from_json(json_str)
|
|
315
|
-
match += 1
|
|
316
|
-
except (ValidationError, ValueError) as e:
|
|
317
|
-
error_messages.append(str(e))
|
|
318
|
-
# deserialize data into ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig
|
|
319
|
-
try:
|
|
320
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig.from_json(json_str)
|
|
321
|
-
match += 1
|
|
322
|
-
except (ValidationError, ValueError) as e:
|
|
323
|
-
error_messages.append(str(e))
|
|
324
|
-
# deserialize data into ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig
|
|
325
|
-
try:
|
|
326
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig.from_json(json_str)
|
|
327
|
-
match += 1
|
|
328
|
-
except (ValidationError, ValueError) as e:
|
|
329
|
-
error_messages.append(str(e))
|
|
330
|
-
# deserialize data into ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig
|
|
331
|
-
try:
|
|
332
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig.from_json(json_str)
|
|
333
|
-
match += 1
|
|
334
|
-
except (ValidationError, ValueError) as e:
|
|
335
|
-
error_messages.append(str(e))
|
|
336
|
-
# deserialize data into ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig
|
|
337
|
-
try:
|
|
338
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig.from_json(json_str)
|
|
339
|
-
match += 1
|
|
340
|
-
except (ValidationError, ValueError) as e:
|
|
341
|
-
error_messages.append(str(e))
|
|
342
|
-
# deserialize data into ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig
|
|
343
|
-
try:
|
|
344
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig.from_json(json_str)
|
|
345
|
-
match += 1
|
|
346
|
-
except (ValidationError, ValueError) as e:
|
|
347
|
-
error_messages.append(str(e))
|
|
348
|
-
# deserialize data into ScoreEnsemblePolicyConfig
|
|
349
|
-
try:
|
|
350
|
-
instance.actual_instance = ScoreEnsemblePolicyConfig.from_json(json_str)
|
|
351
|
-
match += 1
|
|
352
|
-
except (ValidationError, ValueError) as e:
|
|
353
|
-
error_messages.append(str(e))
|
|
354
|
-
# deserialize data into ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig
|
|
355
|
-
try:
|
|
356
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig.from_json(json_str)
|
|
357
|
-
match += 1
|
|
358
|
-
except (ValidationError, ValueError) as e:
|
|
359
|
-
error_messages.append(str(e))
|
|
360
|
-
# deserialize data into ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig
|
|
361
|
-
try:
|
|
362
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig.from_json(json_str)
|
|
363
|
-
match += 1
|
|
364
|
-
except (ValidationError, ValueError) as e:
|
|
365
|
-
error_messages.append(str(e))
|
|
366
|
-
# deserialize data into ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig
|
|
367
|
-
try:
|
|
368
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig.from_json(json_str)
|
|
369
|
-
match += 1
|
|
370
|
-
except (ValidationError, ValueError) as e:
|
|
371
|
-
error_messages.append(str(e))
|
|
372
|
-
# deserialize data into NoOpConfig
|
|
373
|
-
try:
|
|
374
|
-
instance.actual_instance = NoOpConfig.from_json(json_str)
|
|
375
|
-
match += 1
|
|
376
|
-
except (ValidationError, ValueError) as e:
|
|
377
|
-
error_messages.append(str(e))
|
|
378
|
-
# deserialize data into ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig
|
|
379
|
-
try:
|
|
380
|
-
instance.actual_instance = ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig.from_json(json_str)
|
|
381
|
-
match += 1
|
|
382
|
-
except (ValidationError, ValueError) as e:
|
|
383
|
-
error_messages.append(str(e))
|
|
384
|
-
|
|
385
|
-
if match > 1:
|
|
386
|
-
# more than 1 match
|
|
387
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into ScoreEnsemblePolicyConfigPoliciesInner with oneOf schemas: NoOpConfig, ScoreEnsemblePolicyConfig, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig. Details: " + ", ".join(error_messages))
|
|
388
|
-
elif match == 0:
|
|
389
|
-
# no match
|
|
390
|
-
raise ValueError("No match found when deserializing the JSON string into ScoreEnsemblePolicyConfigPoliciesInner with oneOf schemas: NoOpConfig, ScoreEnsemblePolicyConfig, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig. Details: " + ", ".join(error_messages))
|
|
391
|
-
else:
|
|
392
|
-
return instance
|
|
393
|
-
|
|
394
|
-
def to_json(self) -> str:
|
|
395
|
-
"""Returns the JSON representation of the actual instance"""
|
|
396
|
-
if self.actual_instance is None:
|
|
397
|
-
return "null"
|
|
398
|
-
|
|
399
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
400
|
-
return self.actual_instance.to_json()
|
|
401
|
-
else:
|
|
402
|
-
return json.dumps(self.actual_instance)
|
|
403
|
-
|
|
404
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], NoOpConfig, ScoreEnsemblePolicyConfig, ShapedInternalRecsysPoliciesAlsModelPolicyALSModelPolicyConfig, ShapedInternalRecsysPoliciesBeeformerModelPolicyBeeformerModelPolicyBeeformerModelPolicyConfig, ShapedInternalRecsysPoliciesBertModelPolicyBertModelPolicyBERTModelPolicyConfig, ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig, ShapedInternalRecsysPoliciesElsaModelPolicyElsaModelPolicyELSAModelPolicyConfig, ShapedInternalRecsysPoliciesGsasrecModelPolicyGsasrecModelPolicyGSASRecModelPolicyConfig, ShapedInternalRecsysPoliciesItem2vecModelPolicyItem2VecModelPolicyConfig, ShapedInternalRecsysPoliciesItemContentSimilarityModelPolicyItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesLightgbmModelPolicyLightgbmModelPolicyLightGBMModelPolicyConfig, ShapedInternalRecsysPoliciesNgramModelPolicyNgramModelPolicyConfig, ShapedInternalRecsysPoliciesPopularModelPolicyPopularModelPolicyConfig, ShapedInternalRecsysPoliciesRandomModelPolicyRandomModelPolicyConfig, ShapedInternalRecsysPoliciesRecentlyPopularPolicyRecentlyPopularPolicyConfig, ShapedInternalRecsysPoliciesRisingPopularPolicyRisingPopularPolicyConfig, ShapedInternalRecsysPoliciesSasrecModelPolicySasrecModelPolicySASRecModelPolicyConfig, ShapedInternalRecsysPoliciesSvdModelPolicySVDModelPolicyConfig, ShapedInternalRecsysPoliciesTwoTowerModelPolicyTwoTowerModelPolicyTwoTowerModelPolicyConfig, ShapedInternalRecsysPoliciesUserItemContentSimilarityModelPolicyUserItemContentSimilarityModelPolicyConfig, ShapedInternalRecsysPoliciesWidedeepModelPolicyWideDeepModelPolicyConfig, ShapedInternalRecsysPoliciesXgboostModelPolicyXGBoostModelPolicyConfig]]:
|
|
405
|
-
"""Returns the dict representation of the actual instance"""
|
|
406
|
-
if self.actual_instance is None:
|
|
407
|
-
return None
|
|
408
|
-
|
|
409
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
410
|
-
return self.actual_instance.to_dict()
|
|
411
|
-
else:
|
|
412
|
-
# primitive type
|
|
413
|
-
return self.actual_instance
|
|
414
|
-
|
|
415
|
-
def to_str(self) -> str:
|
|
416
|
-
"""Returns the string representation of the actual instance"""
|
|
417
|
-
return pprint.pformat(self.model_dump())
|
|
418
|
-
|
|
419
|
-
from shaped.autogen.models.score_ensemble_policy_config import ScoreEnsemblePolicyConfig
|
|
420
|
-
# TODO: Rewrite to not use raise_errors
|
|
421
|
-
ScoreEnsemblePolicyConfigPoliciesInner.model_rebuild(raise_errors=False)
|
|
422
|
-
|
|
@@ -1,137 +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. The Shaped API has four main endpoints: **Tables** - Provision and manage batch and real-time data connectors. **Views** - Configure SQL transformations and AI enrichment on your input data. Use SQL to combine multiple data sources or use an LLM to add new categories, extract specific attributes from descriptions, etc. **Engines** - Deploy and manage your relevance engines. The Engine API exposes configuration for indexing logic, input datasets, externam embeddings, and more. **Query** - Execute queries against your engines, to return data based on an input query or rerank an existing list. The Query API exposes the retrieve, filter, score, and ranking steps of the 4-stage ranking architecture. The base URL for each endpoint is: `https://api.shaped.ai/v2`
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 2.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from shaped.autogen.models.ascending import Ascending
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
policy_type: Optional[StrictStr] = 'chronological'
|
|
31
|
-
name: Optional[StrictStr] = None
|
|
32
|
-
event_values: Optional[List[StrictStr]] = None
|
|
33
|
-
time_col: Optional[StrictStr] = None
|
|
34
|
-
ascending: Optional[Ascending] = None
|
|
35
|
-
additional_properties: Dict[str, Any] = {}
|
|
36
|
-
__properties: ClassVar[List[str]] = ["policy_type", "name", "event_values", "time_col", "ascending"]
|
|
37
|
-
|
|
38
|
-
@field_validator('policy_type')
|
|
39
|
-
def policy_type_validate_enum(cls, value):
|
|
40
|
-
"""Validates the enum"""
|
|
41
|
-
if value is None:
|
|
42
|
-
return value
|
|
43
|
-
|
|
44
|
-
if value not in set(['chronological']):
|
|
45
|
-
raise ValueError("must be one of enum values ('chronological')")
|
|
46
|
-
return value
|
|
47
|
-
|
|
48
|
-
model_config = ConfigDict(
|
|
49
|
-
populate_by_name=True,
|
|
50
|
-
validate_assignment=True,
|
|
51
|
-
protected_namespaces=(),
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def to_str(self) -> str:
|
|
56
|
-
"""Returns the string representation of the model using alias"""
|
|
57
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
-
|
|
59
|
-
def to_json(self) -> str:
|
|
60
|
-
"""Returns the JSON representation of the model using alias"""
|
|
61
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
-
return json.dumps(self.to_dict())
|
|
63
|
-
|
|
64
|
-
@classmethod
|
|
65
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
-
"""Create an instance of ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig from a JSON string"""
|
|
67
|
-
return cls.from_dict(json.loads(json_str))
|
|
68
|
-
|
|
69
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
-
"""Return the dictionary representation of the model using alias.
|
|
71
|
-
|
|
72
|
-
This has the following differences from calling pydantic's
|
|
73
|
-
`self.model_dump(by_alias=True)`:
|
|
74
|
-
|
|
75
|
-
* `None` is only added to the output dict for nullable fields that
|
|
76
|
-
were set at model initialization. Other fields with value `None`
|
|
77
|
-
are ignored.
|
|
78
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
79
|
-
"""
|
|
80
|
-
excluded_fields: Set[str] = set([
|
|
81
|
-
"additional_properties",
|
|
82
|
-
])
|
|
83
|
-
|
|
84
|
-
_dict = self.model_dump(
|
|
85
|
-
by_alias=True,
|
|
86
|
-
exclude=excluded_fields,
|
|
87
|
-
exclude_none=True,
|
|
88
|
-
)
|
|
89
|
-
# override the default output from pydantic by calling `to_dict()` of ascending
|
|
90
|
-
if self.ascending:
|
|
91
|
-
_dict['ascending'] = self.ascending.to_dict()
|
|
92
|
-
# puts key-value pairs in additional_properties in the top level
|
|
93
|
-
if self.additional_properties is not None:
|
|
94
|
-
for _key, _value in self.additional_properties.items():
|
|
95
|
-
_dict[_key] = _value
|
|
96
|
-
|
|
97
|
-
# set to None if name (nullable) is None
|
|
98
|
-
# and model_fields_set contains the field
|
|
99
|
-
if self.name is None and "name" in self.model_fields_set:
|
|
100
|
-
_dict['name'] = None
|
|
101
|
-
|
|
102
|
-
# set to None if event_values (nullable) is None
|
|
103
|
-
# and model_fields_set contains the field
|
|
104
|
-
if self.event_values is None and "event_values" in self.model_fields_set:
|
|
105
|
-
_dict['event_values'] = None
|
|
106
|
-
|
|
107
|
-
# set to None if time_col (nullable) is None
|
|
108
|
-
# and model_fields_set contains the field
|
|
109
|
-
if self.time_col is None and "time_col" in self.model_fields_set:
|
|
110
|
-
_dict['time_col'] = None
|
|
111
|
-
|
|
112
|
-
return _dict
|
|
113
|
-
|
|
114
|
-
@classmethod
|
|
115
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
116
|
-
"""Create an instance of ShapedInternalRecsysPoliciesChronologicalModelPolicyChronologicalModelPolicyConfig from a dict"""
|
|
117
|
-
if obj is None:
|
|
118
|
-
return None
|
|
119
|
-
|
|
120
|
-
if not isinstance(obj, dict):
|
|
121
|
-
return cls.model_validate(obj)
|
|
122
|
-
|
|
123
|
-
_obj = cls.model_validate({
|
|
124
|
-
"policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'chronological',
|
|
125
|
-
"name": obj.get("name"),
|
|
126
|
-
"event_values": obj.get("event_values"),
|
|
127
|
-
"time_col": obj.get("time_col"),
|
|
128
|
-
"ascending": Ascending.from_dict(obj["ascending"]) if obj.get("ascending") is not None else None
|
|
129
|
-
})
|
|
130
|
-
# store additional fields in additional_properties
|
|
131
|
-
for _key in obj.keys():
|
|
132
|
-
if _key not in cls.__properties:
|
|
133
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
134
|
-
|
|
135
|
-
return _obj
|
|
136
|
-
|
|
137
|
-
|