abacusai.streaming_client

Classes

StreamingClient

Abacus.AI Streaming API Client. Does not utilize authentication and only contains public streaming methods

Module Contents

class abacusai.streaming_client.StreamingClient(client_options=None)

Bases: abacusai.client.BaseApiClient

Abacus.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.

Parameters:
  • feature_group_id (str) – Unique string identifier for the streaming feature group to record data to.

  • streaming_token (str) – The streaming token for authenticating requests.

  • data (dict) – The data to record as a JSON object.

append_multiple_data(feature_group_id, streaming_token, data)

Appends new data into the feature group for a given lookup key recordId.

Parameters:
  • feature_group_id (str) – Unique string identifier of the streaming feature group to record data to.

  • streaming_token (str) – Streaming token for authenticating requests.

  • data (list) – Data to record, as a list of JSON objects.