Create attachment

attachment = await client.api.create_attachment(
    thread_id="<THREAD_UUID>",
    step_id="<STEP_UUID>"
    name="my_attachment",
    content_type="text/plain",
    content="Hello world",
)
thread_id
uuid
required

Thread id in string format

step_id
uuid
required

Step id in string format

id
uuid

Id in string format

metadata
Dict

Metadata in dictionary format

mime
string

Mime in string format

name
string

Name in string format

object_key
string

Object key in string format

url
string

Url in string format

content
Union[bytes, str]

Content that can be either of bytes or string format

path
string

Path in string format

Return type

attachment
Attachment

Return an Attachment

Update attachment

attachment = await client.api.update_attachment(
    id="<ATTACHMENT_UUID>",
    update_params={
        "name": "my_attachment",
        "content_type": "text/plain",
        "content": "Hello world",
    },
)
id
uuid
required

Id in string format

metadata
Dict

Metadata in dictionary format

mime
string

Mime in string format

name
string

Name in string format

objectKey
string

Object key in string format

url
string

Url in string format

Return type

attachment
Attachment

Return an Attachment

Get attachment

attachment = await client.api.get_attachment(id="<ATTACHMENT_UUID>")
id
uuid
required

Id in string format

Return type

attachment
Attachment

Return an Attachment, can be None if the attachment is not found

Delete attachment

attachment = await client.api.delete_attachment(id="<ATTACHMENT_UUID>")
id
uuid
required

Id in string format