Sending attachments is particularly useful if you want your agent backend to send some images or any other files to your users.
AgentLabs SDK allows you to effortlessly send attachments along with your messages.
Some attachments like Images will be displayed with a lightbox preview, others like zip files will be displayed as simple downloadable files.
Example of 3 attachments sent in a message
Example of zip files

How to send an attachment

Sending attachments is super easy. You only have to instantiate an Attachment and then pass it to the send method as an argument.
from agentlabs.attachment import Attachment
attachment = Attachment.from_local_file("path-to-your-file")
text="Here is your zip file",
import {Attachment} from "@agentlabs/node-sdk";
const attachment = Attachment.fromLocalFile('path-to-your-file')
await agent.send({
text: 'Here is an image for you...',
conversationId: '<your-conversation-id>',
attachments: [attachment],
You can pass as many attachments as you want. We also support all mime types as long as each file does not exceed 10MB.

Going further

If you want to go further with attachments, you can check this example where we show you how to create a basic midjourney clone.
Here's the result:
A basic midjourney clone