upload_chat_assets
upload_chat_assets(chat_asset_creation_config)
Upload chat assets to a project, optionally using a pre-defined conversation file and by integrating with an LLM.
Parameters
chat_asset_creation_config: ChatAssetCreationConfig Configuration object for uploading chat assets. Includes:
project_id: str
The unique identifier for the project.
number_of_assets: int
Number of assets to create if no conversation file is provided. Ignored if
conversation_json
field is supplied.
storage_id: Optional[str]
ID of the storage integration to upload assets to. If not provided, assets will be uploaded to iMerit's private S3 bucket.
bucket_name: Optional[str]
The name of the S3 bucket to use for upload.
llm_config: Optional[LLMConfig]
Contains an
id
field (string) identifying the LLM to use.If not provided, the assets will be static.
conversation_json: Optional[str] 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
Returns:
output: dict
A dictionary containing the result of the operation.
Examples
Uploading static chat assets (pre-defined conversation data)
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')
sdk = SDK(api_key)
chat_asset_creation_config = ChatAssetCreationConfig(project_id=project_id,
conversation_json="<CONVERSATION_JSON_PATH>")
sdk.upload_chat_assets(chat_asset_creation_config)
Uploading dynamic chat assets (LLM integration + fresh conversation)
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')
sdk = SDK(api_key)
chat_asset_creation_config = ChatAssetCreationConfig(
project_id=project_id,
number_of_assets=<NUMBER_OF_ASSETS>,
llm_config=LLMConfig(
id="<YOUR_LLM_ID>"
),
)
sdk.upload_chat_assets(chat_asset_creation_config)
Uploading dynamic pre-defined chat assets (LLM integration + pre-defined conversation data)
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')
sdk = SDK(api_key)
chat_asset_creation_config = ChatAssetCreationConfig(
project_id=project_id,
conversation_json="<PATH_TO_YOUR_CONVERSATION_JSON_FILE>",
llm_config=LLMConfig(
id="<YOUR_LLM_ID>"
),
)
sdk.upload_chat_assets(chat_asset_creation_config)
Last updated