LocalLm types documentation
    Preparing search index...

    Interface InferenceOptions

    Options for inference requests.

    InferenceOptions

    const inferenceOptions: InferenceOptions = {
    debug: true,
    verbose: true,
    tools: [weatherTool],
    history: [
    { user: "Hello", assistant: "Hi there!" }
    ],
    system: "You are a helpful assistant.",
    assistant: "How can I help you today?",
    onToolCall: (toolCall) => console.log('Tool called:', toolCall),
    onToolCallEnd: (result) => console.log('Tool call completed:', result),
    onToolsTurnStart: (toolCalls) => console.log('Tools turn started:', toolCalls),
    onToolsTurnEnd: (toolResults) => console.log('Tools turn completed:', toolResults)
    };
    interface InferenceOptions {
        assistant?: string;
        debug?: boolean;
        history?: HistoryTurn[];
        isToolsRouter?: boolean;
        onAssistant?: (txt: string) => void;
        onToolCall?: (tc: ToolCallSpec) => void;
        onToolCallEnd?: (id: string, tr: any) => void;
        onToolsTurnEnd?: (tt: ToolTurn[]) => void;
        onToolsTurnStart?: (tc: ToolCallSpec[]) => void;
        onTurnEnd?: (ht: HistoryTurn) => void;
        system?: string;
        tools?: ToolSpec[];
        verbose?: boolean;
    }
    Index

    Properties

    assistant?: string

    Assistant message to include in the context.

    debug?: boolean

    Enable debug mode for detailed logging.

    history?: HistoryTurn[]

    Conversation history to include in the inference.

    isToolsRouter?: boolean

    Use this call as a tools router not an agent

    onAssistant?: (txt: string) => void
    onToolCall?: (tc: ToolCallSpec) => void

    Callback function to handle tool calls.

    onToolCallEnd?: (id: string, tr: any) => void

    Callback function to handle tool call completion.

    onToolsTurnEnd?: (tt: ToolTurn[]) => void

    Callback function to handle the end of a tools turn.

    onToolsTurnStart?: (tc: ToolCallSpec[]) => void

    Callback function to handle the start of a tools turn.

    onTurnEnd?: (ht: HistoryTurn) => void
    system?: string

    System message to set the context for the conversation.

    tools?: ToolSpec[]

    Array of available tools for the conversation.

    verbose?: boolean

    Enable verbose output.