upload_chat_assets

upload_chat_assets(project_id, chat_asset_creation_config, priority)

Upload chat assets to a project, optionally using a pre-defined conversation file and by integrating with an LLM.

Parameters

  • project_id: string

  • chat_asset_creation_config: ChatAssetCreationConfig Configuration object for uploading chat assets. Includes:

    • number_of_assets: int, default 0

      • Number of assets to create if no conversation file is provided. Ignored if conversation_json field is supplied.

    • storage_id: string, Optional, default None

      • ID of the storage integration to upload assets to. If not provided, assets will be uploaded to iMerit's private S3 bucket.

    • bucket_name: string, Optional, default None

      • The name of the S3 bucket to use for upload.

    • llm_config: LLMConfig, Optional, default None

      • Contains an id field (string) identifying the LLM to use.

      • If not provided, the assets will be static.

    • conversation_json: string, Optional, default None Path to a JSON file containing pre-defined conversation data. If provided, the number of assets will be based on the JSON file's content. For the JSON format please see Importing Existing Conversations via JSON

  • priority: int, Optional, default 0

    • The new priority value to assign to the uploaded assets.

    • Note: The priority value must be between -1000 and 1000. Higher values indicate higher priority.

Returns:

  • output: dict

    • A dictionary containing the result of the operation.

The maximum chat asset upload limit is set to 10,000. Please ensure your uploads do not exceed this limit.

Examples

Uploading static chat assets (pre-defined conversation data)

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.chat_asset_creation_config import ChatAssetCreationConfig

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

config = ChatAssetCreationConfig(conversation_json="<CONVERSATION_JSON_PATH>")
ango_sdk.upload_chat_assets(project_id=project_id, chat_asset_creation_config=config)

Uploading dynamic chat assets (LLM integration + fresh conversation)

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.chat_asset_creation_config import ChatAssetCreationConfig, LLMConfig

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

config = ChatAssetCreationConfig(number_of_assets=10, 
                                 llm_config=LLMConfig(id="<YOUR_LLM_ID>"))

ango_sdk.upload_chat_assets(project_id=project_id, chat_asset_creation_config=config)

Uploading dynamic pre-defined chat assets (LLM integration + pre-defined conversation data)

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.chat_asset_creation_config import ChatAssetCreationConfig, LLMConfig

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

config = ChatAssetCreationConfig(conversation_json="<CONVERSATION_JSON_PATH>",
                                 llm_config=LLMConfig(id="<YOUR_LLM_ID>"))

ango_sdk.upload_chat_assets(project_id=project_id, chat_asset_creation_config=config)

Last updated