> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/upload_chat_assets.md).

# upload\_chat\_assets

## upload\_chat\_assets(project\_id, chat\_asset\_creation\_config, priority)

Upload chat assets to your project.

{% hint style="info" %}
In private cloud and on-premise deployments, only static (offline) chat assets are supported. To import existing conversations for annotation, provide `conversation_json` and leave `llm_config` unset, as shown in the [static chat asset example](#uploading-static-chat-assets-pre-defined-conversation-data).

Live LLM conversations, including the dynamic examples below, are not available in these deployments.
{% endhint %}

### Parameters

* **project\_id:** string
  * The unique identifier for the project. You can find the project ID in [the user interface](/sdk/sdk-documentation.md#project-ids) or retrieve it using the [`list_projects`](/sdk/sdk-documentation/project-level-sdk-functions/list_projects.md) function.
* **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 storage bucket, or Azure container, 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 [Creating and Importing LLM Chat Assets](/data/importing-assets/creating-and-importing-llm-chat-assets.md#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.

```python
from imerit_ango.models.chat_asset_creation_config import ChatAssetCreationConfig
from imerit_ango.models.chat_asset_creation_config import LLMConfig
```

Returns:

* **output**: dict
  * A dictionary containing the result of the operation.
  * Including a `status` field indicating whether the request was successful and a `data` field containing the response payload with updated resources produced by the operation.

{% hint style="info" %}
The maximum chat asset upload limit is set to 10,000. Please ensure your uploads do not exceed this limit.
{% endhint %}

<details open>

<summary><strong>How to verify in Ango Hub?</strong></summary>

After successfully executing the `upload_chat_assets` function, you can validate the changes directly in Ango Hub.

Navigate to: **Projects → \[Your Project] → Asset**

* Ensure that all assets have been successfully imported and are visible in the project.

{% hint style="info" %}
Changes made via the SDK are reflected in Ango Hub in near real-time. If updates are not immediately visible, please refresh the page.
{% endhint %}

</details>

### Examples

#### Uploading static chat assets (pre-defined conversation data)

For private cloud and on-premise deployments, set the SDK's `host` parameter to your deployment's API host when initializing `SDK`. See [Host and Base URL](/sdk/sdk-documentation.md#host-and-base-url).

{% tabs %}
{% tab title="python" %}

```python
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)
```

{% endtab %}
{% endtabs %}

#### Uploading dynamic chat assets (LLM integration + fresh conversation)

This example is not supported in private cloud or on-premise deployments. Use the [static chat asset example](#uploading-static-chat-assets-pre-defined-conversation-data) to import existing offline conversations instead.

{% tabs %}
{% tab title="python" %}

```python
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)
```

{% endtab %}
{% endtabs %}

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

This example is not supported in private cloud or on-premise deployments. Use the [static chat asset example](#uploading-static-chat-assets-pre-defined-conversation-data) without `llm_config` to import existing offline conversations instead.

{% tabs %}
{% tab title="python" %}

```python
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)
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**See also**

[upload\_files\_cloud](/sdk/sdk-documentation/project-level-sdk-functions/upload_files_cloud.md), [Import LLM Chat Assets](/data/importing-assets/creating-and-importing-llm-chat-assets.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/upload_chat_assets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
