Skip to content

UseCompletionReturn

Defined in: types.ts:276

Completion hook return value.

complete: (prompt, options?) => Promise<string | null | undefined>

Defined in: types.ts:288

Complete programmatically

string

CompletionRequestOptions

Promise<string | null | undefined>


completion: string

Defined in: types.ts:278

Current completion


optional data: unknown[]

Defined in: types.ts:301

Data from API


error: Error | undefined

Defined in: types.ts:299

Error if any


handleInputChange: (e) => void

Defined in: types.ts:284

Handle input change

ChangeEvent<HTMLInputElement | HTMLTextAreaElement>

void


handleSubmit: (e?) => void

Defined in: types.ts:286

Handle form submit

FormEvent<HTMLFormElement>

void


input: string

Defined in: types.ts:280

Current input


isLoading: boolean

Defined in: types.ts:297

Whether currently loading


setCompletion: (completion) => void

Defined in: types.ts:295

Set completion

string

void


setInput: (input) => void

Defined in: types.ts:282

Set input

string

void


stop: () => void

Defined in: types.ts:293

Stop streaming

void