abacusai.streaming_client
Classes
Abstract Base API Client |
|
Options for configuring the ApiClient |
|
Abacus.AI Streaming API Client. Does not utilize authentication and only contains public streaming methods |
Module Contents
- class abacusai.streaming_client.BaseApiClient(api_key=None, server=None, client_options=None, skip_version_check=False)
Abstract Base API Client
- Parameters:
api_key (str) – The api key to use as authentication to the server
server (str) – The base server url to use to send API requets to
client_options (ClientOptions) – Optional API client configurations
skip_version_check (bool) – If true, will skip checking the server’s current API version on initializing the client
- client_version = '1.3.2'
- _get_prediction_endpoint(deployment_id, deployment_token)
- _get_proxy_endpoint(deployment_id, deployment_token)
- _get_streaming_endpoint(streaming_token, model_id=None, feature_group_id=None)
- _clean_api_objects(obj)
- _call_api(action, method, query_params=None, body=None, files=None, parse_type=None, streamable_response=False, server_override=None, timeout=None, retry_500=False, data=None)
- Parameters:
retry_500 (bool)
- _proxy_request(name, method='POST', query_params=None, body=None, files=None, parse_type=None, is_sync=False, streamable_response=False)
- _build_class(return_class, values)
- _request(url, method, query_params=None, headers=None, body=None, files=None, stream=False, timeout=None, retry_500=False, data=None)
- Parameters:
retry_500 (bool)
- _poll(obj, wait_states, delay=15, timeout=300, poll_args={}, status_field=None)
- _upload_from_pandas(upload, df, clean_column_names=False)
- Return type:
- _upload_from_spark(upload, df)
- Return type:
- class abacusai.streaming_client.ClientOptions(exception_on_404=True, server=DEFAULT_SERVER)
Options for configuring the ApiClient
- class abacusai.streaming_client.StreamingClient(client_options=None)
Bases:
abacusai.client.BaseApiClientAbacus.AI Streaming API Client. Does not utilize authentication and only contains public streaming methods
- Parameters:
client_options (ClientOptions) – Optional API client configurations
- upsert_item_embeddings(streaming_token, model_id, item_id, vector, catalog_id=None)
Upserts an embedding vector for an item id for a model_id.
- Parameters:
streaming_token (str) – The streaming token for authenticating requests to the model.
model_id (str) – A unique string identifier for the model to upsert item embeddings to.
item_id (str) – The item id for which its embeddings will be upserted.
vector (list) – The embedding vector.
catalog_id (str) – The name of the catalog in the model to update.
- delete_item_embeddings(streaming_token, model_id, item_ids, catalog_id=None)
Deletes KNN embeddings for a list of item IDs for a given model ID.
- Parameters:
streaming_token (str) – The streaming token for authenticating requests to the model.
model_id (str) – A unique string identifier for the model from which to delete item embeddings.
item_ids (list) – A list of item IDs whose embeddings will be deleted.
catalog_id (str) – An optional name to specify which catalog in a model to update.
- upsert_multiple_item_embeddings(streaming_token, model_id, upserts, catalog_id=None)
Upserts a knn embedding for multiple item ids for a model_id.
- Parameters:
streaming_token (str) – The streaming token for authenticating requests to the model.
model_id (str) – The unique string identifier of the model to upsert item embeddings to.
upserts (list) – A list of dictionaries of the form {‘itemId’: …, ‘vector’: […]} for each upsert.
catalog_id (str) – Name of the catalog in the model to update.
- append_data(feature_group_id, streaming_token, data)
Appends new data into the feature group for a given lookup key recordId.
- append_multiple_data(feature_group_id, streaming_token, data)
Appends new data into the feature group for a given lookup key recordId.