Skip to content

UseCompletionOptions

Defined in: types.ts:250

Completion hook options.

optional api: string

Defined in: types.ts:258

API endpoint


optional body: Record<string, unknown>

Defined in: types.ts:262

Request body extras


optional headers: Record<string, string>

Defined in: types.ts:260

Request headers


optional id: string

Defined in: types.ts:256

Completion ID


optional initialCompletion: string

Defined in: types.ts:254

Initial completion


optional initialInput: string

Defined in: types.ts:252

Initial prompt


optional onError: (error) => void

Defined in: types.ts:266

Called on error

Error

void


optional onFinish: (prompt, completion) => void

Defined in: types.ts:264

Called when completion finishes

string

string

void


optional onResponse: (response) => void

Defined in: types.ts:268

Called for each response chunk

Response

void


optional streamProtocol: "text" | "data"

Defined in: types.ts:270

Stream protocol