@molroo-ai/sdk
    Preparing search index...

    Interface LLMAdapter

    LLM Adapter interface for molroo SDK.

    Abstracts text generation so consumers can:

    • Use the built-in adapter (Vercel AI SDK: OpenAI/Anthropic/Vertex)
    • Bring their own LLM integration (Ollama, vLLM, custom pipeline)
    • Skip LLM entirely (emotion-only usage)
    interface LLMAdapter {
        generate(
            prompt: LLMPrompt,
            schema: object,
            message: string,
        ): Promise<any>;
        generateText(prompt: LLMPrompt, message: string): Promise<string>;
    }
    Index

    Methods

    • Generate structured output from a prompt. Used by chat() for response+appraisal extraction, and by generatePersona().

      Parameters

      • prompt: LLMPrompt

        System prompt, context, and history

      • schema: object

        JSON Schema or Zod schema for structured output

      • message: string

        User message

      Returns Promise<any>

      Parsed structured output matching the schema

    • Generate plain text from a prompt. Used for reflection and other free-form text generation.

      Parameters

      • prompt: LLMPrompt

        System prompt and context

      • message: string

        User prompt text

      Returns Promise<string>

      Generated text string