Skip to main content
Variables on spans aren’t limited to plain text. You can attach images, PDFs, and large text summaries as variable values, making them available in the Playground, in datasets, and for continuous evaluations.

URL vs base64

Attachments support two modes — URL and base64 — and the distinction matters:
ModeWhat happensUsable in Playground & datasets
URLAdaline stores the link. The file must remain publicly accessible.Only while the URL is live.
base64Adaline receives the raw data and hosts it in its own storage.Yes — fully persisted and self-contained.

Images

Attach images to spans as variables with modality: "image". The detail field controls resolution processing (auto, low, medium, high).

Base64

import { readFileSync } from "fs";

const imageBase64 = readFileSync("./product-screenshot.png").toString("base64");

const span = trace.logSpan({
  name: "analyze-image",
  variables: {
    product_image: {
      modality: "image",
      detail: "auto",
      value: { type: "base64", base64: imageBase64, mediaType: "png" },
    },
  },
});
Supported media types: png, jpeg, webp, gif.

URL

When the image is already hosted publicly, you can pass a URL. Adaline stores the link but does not download or host the file.
const span = trace.logSpan({
  name: "analyze-image",
  variables: {
    product_image: {
      modality: "image",
      detail: "auto",
      value: { type: "url", url: "https://cdn.example.com/product.png" },
    },
  },
});

PDFs

Attach PDF documents with modality: "pdf". PDFs include a file object with metadata (name, id, and optionally size).

Base64

import { readFileSync } from "fs";

const pdfBase64 = readFileSync("./invoice.pdf").toString("base64");

const span = trace.logSpan({
  name: "process-document",
  variables: {
    invoice: {
      modality: "pdf",
      value: { type: "base64", base64: pdfBase64 },
      file: { name: "invoice.pdf", id: "doc-001" },
    },
  },
});

URL

const span = trace.logSpan({
  name: "process-document",
  variables: {
    invoice: {
      modality: "pdf",
      value: { type: "url", url: "https://cdn.example.com/invoice.pdf" },
      file: { name: "invoice.pdf", id: "doc-001" },
    },
  },
});

Text

For large text — retrieved context, summaries, full documents — use text variables or attributes. Variables are the better choice when the text needs to flow into datasets and evaluations. Attributes work well for shorter metadata you want to filter and search by in the Monitor.

Via variables

const span = trace.logSpan({
  name: "rag-response",
  variables: {
    user_question: { modality: "text", value: userQuery },
    retrieved_context: { modality: "text", value: longContextString },
    system_prompt: { modality: "text", value: systemPromptText },
  },
});

Via attributes

const span = trace.logSpan({
  name: "rag-response",
  attributes: {
    user_question: userQuery,
    retrieved_context: longContextString,
    summary: documentSummary,
  },
});

Proxy headers

When using the Proxy, pass variables (including attachments) via the adaline-span-variables header:
headers["adaline-span-variables"] = json.dumps({
    "product_image": {
        "modality": "image",
        "detail": "auto",
        "value": {"type": "base64", "base64": image_base64, "mediaType": "png"},
    },
    "user_question": {
        "modality": "text",
        "value": "What color options are available?",
    },
})

Limits

Attachment typeMax size
Image (base64)10 MB
PDF (base64)10 MB
Request body (total)32 MB
See Limits for full payload constraints. Requests exceeding these limits receive a 413 Payload Too Large response.
If your files exceed these limits, you can either self-host the media and use URL referencing instead of base64, or contact support@adaline.ai to discuss higher limits for your workspace.

Next steps

Analyze Log Traces

Filter and search traces using your attached data.

Build Datasets from Logs

Capture variable-enriched spans into evaluation datasets.