langchain.js
    Preparing search index...

    Type Alias MessageOutputVersion

    MessageOutputVersion: "v0" | "v1"

    Represents the output version format for message content.

    This type determines how the content field is structured in a message:

    • "v0": Content is represented as a simple string or array of content blocks
      • provides backward compatibility with simpler content representations
    • "v1": Content follows the structured ContentBlock format with typed discriminated unions
      • enables full type safety and structured content block handling
    // v0 format - simple content representation
    const v0Message: Message<{ outputVersion: "v0", content: ... }> = {
    type: "human",
    content: "Hello world" // string | Array<ContentBlock | ContentBlock.Text>
    };

    // v1 format - structured content blocks
    const v1Message: Message<{ outputVersion: "v1", content: ... }> = {
    type: "human",
    content: [
    { type: "text", text: "Hello world" },
    { type: "image", image_url: "..." }
    ] // Array<ContentBlock | ...> (determined by the structure)
    };