> ## Documentation Index
> Fetch the complete documentation index at: https://chainlit-5-wd-prompt.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Attachment

An attachement is a file that has been generated or processed by a [Step](/concepts/step).

<Frame caption="Example of a PDF attachement">
  <img src="https://mintlify.s3-us-west-1.amazonaws.com/chainlit-5-wd-prompt/images/attachment.png" alt="An attachment on a step" />
</Frame>

## Create an attachment:

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

  ```typescript TypeScript
  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();
  ```
</CodeGroup>
