• Adds an advisor schema to the system. Registers the advisor with validation and schema services, making it available for chat operations.

    Type Parameters

    • T = string

      The type of message content the advisor accepts (defaults to string). Can be a custom object, Blob, or string.

    Parameters

    • advisorSchema: IAdvisorSchema<T>

      The schema definition for advisor, including name, chat handler, and optional callbacks.

    Returns string

    The advisorName that was registered.

    addAdvisor

    // Using default string message type
    addAdvisor({
    advisorName: "TextAdvisor",
    getChat: async (args) => `Response to: ${args.message}`
    });
    // Using custom message type
    interface CustomMessage { text: string; metadata: Record<string, any> }
    addAdvisor<CustomMessage>({
    advisorName: "StructuredAdvisor",
    getChat: async (args) => `Processing: ${args.message.text}`
    });
    // Using Blob message type
    addAdvisor<Blob>({
    advisorName: "BlobAdvisor",
    getChat: async (args) => `Received blob of size: ${args.message.size}`
    });