Interface ICompletionSchema<Message, Args>

Interface representing the schema for configuring a completion mechanism. Defines how completions are generated within the swarm.

interface ICompletionSchema<
    Message extends IBaseMessage<string> = IBaseMessage<any>,
    Args extends
        IBaseCompletionArgs<IBaseMessage<string>> = IBaseCompletionArgs<
        Message,
    >,
> {
    callbacks?: Partial<ICompletionCallbacks<Message, Args>>;
    completionName: string;
    flags?: string[];
    getCompletion(args: Args): Promise<Message>;
    json?: boolean;
}

Type Parameters

Properties

callbacks?: Partial<ICompletionCallbacks<Message, Args>>

Optional partial set of callbacks for completion events, allowing customization of post-completion behavior.

completionName: string

The unique name of the completion mechanism within the swarm.

flags?: string[]

List of flags for llm model. As example, /no_think for lmstudio-community/Qwen3-32B-GGUF

json?: boolean

Methods

  • Retrieves a completion based on the provided arguments. Generates a model response using the given context and tools.

    Parameters

    Returns Promise<Message>

    If completion generation fails (e.g., due to invalid arguments, model errors, or tool issues).