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

# Metadata

Metadata serves as a powerful tool for enriching objects with additional context, details, or configuration that can be instrumental in customizing and enhancing the functionality of each object. Specifically, the metadata field is available on Thread, Step, User, and Generation objects within the platform.

## How to add metadata to a Run or a Step

<CodeGroup>
  ```python Python
  import os, asyncio
  from literalai import LiteralClient

  from dotenv import load_dotenv
  load_dotenv()

  import os
  from literalai import LiteralClient
  literal_client = LiteralClient(api_key=os.getenv("LITERAL_API_KEY"))

  @literal_client.step(type="run", name="my_step")
  def my_step(input_message=None):
      current_step = literal_client.get_current_step()
      # some code, llm call, tool call, etc.
      current_step.metadata = {"region": "europe"}
      answer = "answer"
      return answer

  my_step("Hello")

  literal_client.flush_and_stop()
  ```

  ```typescript TypeScript
  import { LiteralClient, Thread } from "@literalai/client";

  const client = new LiteralClient(process.env["LITERAL_API_KEY"]);

  // The Assistant could have intermediary steps
  async function myFunction(question:string) {
    const run = client.run({
      name: "My Assistant Run",
      input: { content: question },
      metadata: { region: "europe" },
    });

    // Implement your assistant logic here
    await new Promise((r) => setTimeout(r, 1000));
    const response = { content: "My assistant response" };

    run.output = response;
    await run.send();

    return response;
  }

  myFunction("hello")
    .then(() => process.exit(0))
    .catch((error) => console.error(error));
  ```
</CodeGroup>
