Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

@reactor/ai — aiclient

@reactor/ai


@reactor/ai / AiClient

Defined in: index.ts:189

new AiClient(ctx): AiClient

Defined in: index.ts:190

RequestContext

AiClient

chatCompletion(request): Promise<Result<ChatCompletionResponse>>

Defined in: index.ts:195

Create a chat completion (non-streaming).

Omit<ChatCompletionRequest, "stream"> & object

Promise<Result<ChatCompletionResponse>>


chatCompletionStream(request): Promise<Result<ChatCompletionStream>>

Defined in: index.ts:208

Create a streaming chat completion. Returns an async iterable that yields chunks.

Omit<ChatCompletionRequest, "stream">

Promise<Result<ChatCompletionStream>>


embed(request): Promise<Result<EmbeddingResponse>>

Defined in: index.ts:252

Create embeddings for the given input.

EmbeddingRequest

Promise<Result<EmbeddingResponse>>


listModels(): Promise<Result<ModelsResponse>>

Defined in: index.ts:259

List available models.

Promise<Result<ModelsResponse>>