langchain.js
    Preparing search index...

    Interface StandardMessageStructure

    Standard message structured used to define the most basic message structure that's used throughout the library.

    This is also the message structure that's used when a message structure is not provided.

    interface StandardMessageStructure {
        content: { ai: Text; human: Text; system: Text; tool: Text };
        outputVersion?: MessageOutputVersion;
        properties: {
            ai: {
                response_metadata: ResponseMetadata;
                usage_metadata: UsageMetadata;
            };
            human: { response_metadata: Record<string, unknown> };
            system: { response_metadata: Record<string, unknown> };
            tool: { response_metadata: Record<string, unknown> };
        };
        tools?: MessageToolSet;
    }

    Hierarchy (View Summary)

    Index

    Properties

    content: { ai: Text; human: Text; system: Text; tool: Text }

    Optional mapping of message types to their allowed content blocks. Each message type can specify what content block types it supports (text, images, etc).

    Type Declaration

    • ai: Text

      Text content for AI messages

    • human: Text

      Text content for human messages

    • system: Text

      Text content for system messages

    • tool: Text

      Text content for tool messages

    outputVersion?: MessageOutputVersion

    Optional output version for the message structure. If not provided, defaults to "v0".

    properties: {
        ai: {
            response_metadata: ResponseMetadata;
            usage_metadata: UsageMetadata;
        };
        human: { response_metadata: Record<string, unknown> };
        system: { response_metadata: Record<string, unknown> };
        tool: { response_metadata: Record<string, unknown> };
    }

    Optional mapping of message types to arbitrary property objects. Allows attaching custom metadata or other information to specific message types.

    Type Declaration

    • ai: { response_metadata: ResponseMetadata; usage_metadata: UsageMetadata }

      Properties specific to AI messages

    • human: { response_metadata: Record<string, unknown> }
      • response_metadata: Record<string, unknown>

        Metadata about the human message

    • system: { response_metadata: Record<string, unknown> }
      • response_metadata: Record<string, unknown>

        Metadata about the system message

    • tool: { response_metadata: Record<string, unknown> }
      • response_metadata: Record<string, unknown>

        Metadata about the tool message

    Optional set of tool definitions that can be used in messages. Each tool is defined with input/output types and can be referenced in tool messages.