Skip to content

ToolAwareLLMProvider

LLM provider with optional tool use support.

Defined in: src/core/types/providers.ts:925

LLM provider with optional tool use support.

Remarks

Extends LLMProvider with an optional generateWithTools method. Providers that don’t support tool use simply don’t implement this method, and the orchestrator falls back to text-only generation.

Extends

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
configpublicLLMProviderConfigundefinedConfiguration for this LLM provider. See LLMProviderConfigLLMProvider.configsrc/core/types/providers.ts:806
rolesreadonlyreadonly ProviderRole[][]Pipeline roles this provider covers. Remarks Each provider declares which stages of the 5-role audio pipeline it can fulfil. Single-role providers list one role (e.g. ['stt']); multi-role providers list every role they handle (e.g. ['input', 'stt'] for NativeSTT, which manages its own microphone access). The provider resolution algorithm reads this property to assign providers to pipeline slots. Base provider classes set sensible defaults: - BaseSTTProvider: ['stt'] - BaseLLMProvider: ['llm'] - BaseTTSProvider: ['tts'] See - ProviderRole for the possible role values - ResolvedPipeline for the resolved pipeline slotsLLMProvider.rolessrc/core/types/providers.ts:166
typereadonlyProviderTypeundefinedThe communication type this provider uses. See ProviderTypeLLMProvider.typesrc/core/types/providers.ts:144

Methods

dispose()

dispose(): Promise<void>;

Defined in: src/core/types/providers.ts:186

Clean up resources and dispose of the provider.

Returns

Promise<void>

Remarks

Called by CompositeVoice during agent shutdown. The provider should close any open connections, clear buffers, and release resources.

Inherited from

LLMProvider.dispose


generate()

generate(prompt, options?): Promise<AsyncIterable<string, any, any>>;

Defined in: src/core/types/providers.ts:823

Generate a response from a single user prompt.

Parameters

ParameterTypeDescription
promptstringThe user’s text input (typically transcribed speech)
options?LLMGenerationOptionsOptional generation parameters that override provider defaults

Returns

Promise<AsyncIterable<string, any, any>>

An async iterable of text chunks

Remarks

Returns an async iterable that yields text chunks. When streaming is enabled, multiple chunks are yielded as tokens arrive. When streaming is disabled, a single chunk containing the full response is yielded.

Throws

Error if the provider is not initialized

Throws

AbortError if the generation is cancelled via options.signal

Inherited from

LLMProvider.generate


generateFromMessages()

generateFromMessages(messages, options?): Promise<AsyncIterable<string, any, any>>;

Defined in: src/core/types/providers.ts:844

Generate a response from a multi-turn conversation.

Parameters

ParameterTypeDescription
messagesLLMMessage[]Array of conversation messages including history
options?LLMGenerationOptionsOptional generation parameters that override provider defaults

Returns

Promise<AsyncIterable<string, any, any>>

An async iterable of text chunks

Remarks

Used when ConversationHistoryConfig is enabled. The messages array includes the system prompt, previous conversation turns, and the latest user input. Returns an async iterable of text chunks, same as generate.

Throws

Error if the provider is not initialized

Throws

AbortError if the generation is cancelled via options.signal

See

Inherited from

LLMProvider.generateFromMessages


generateWithTools()

generateWithTools(messages, options?): Promise<AsyncIterable<LLMStreamChunk, any, any>>;

Defined in: src/core/types/providers.ts:930

Generate with tool support. Returns a richer streaming type that separates text from tool invocations.

Parameters

ParameterType
messagesLLMMessage[]
options?LLMGenerationOptions & { tools?: LLMToolDefinition[]; }

Returns

Promise<AsyncIterable<LLMStreamChunk, any, any>>


initialize()

initialize(): Promise<void>;

Defined in: src/core/types/providers.ts:177

Initialize the provider and allocate any required resources.

Returns

Promise<void>

Remarks

Called by CompositeVoice during agent startup. The provider should be ready to process requests after this method resolves.

Throws

Error if initialization fails (e.g., invalid API key, network error)

Inherited from

LLMProvider.initialize


isReady()

isReady(): boolean;

Defined in: src/core/types/providers.ts:193

Check if the provider is initialized and ready to process requests.

Returns

boolean

true if the provider has been initialized and is operational

Inherited from

LLMProvider.isReady

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency