
Example of a PDF attachement
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.

Example of a PDF attachement
attachment = await client.api.create_attachment(
thread_id="<THREAD_UUID>",
step_id="<STEP_UUID>"
name="my_attachment",
content_type="text/plain",
content="Hello world",
)
const thread = await client.thread().upsert();
const fileStream = createReadStream('PATH_TO_FILE');
const mime = 'image/png';
const { objectKey } = await client.api.uploadFile({
threadId: thread.id,
content: fileStream,
mime
});
const attachment = new Attachment({
name: 'test',
objectKey,
mime
});
const finalStep = await thread
.step({
name: 'Assistant',
type: 'assistant_message',
output: "Here is the generated image!",
attachments: [attachment]
})
.send();
Was this page helpful?