UseCompletionOptions
Defined in: types.ts:250
Completion hook options.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”
optionalapi:string
Defined in: types.ts:258
API endpoint
optionalbody:Record<string,unknown>
Defined in: types.ts:262
Request body extras
headers?
Section titled “headers?”
optionalheaders:Record<string,string>
Defined in: types.ts:260
Request headers
optionalid:string
Defined in: types.ts:256
Completion ID
initialCompletion?
Section titled “initialCompletion?”
optionalinitialCompletion:string
Defined in: types.ts:254
Initial completion
initialInput?
Section titled “initialInput?”
optionalinitialInput:string
Defined in: types.ts:252
Initial prompt
onError()?
Section titled “onError()?”
optionalonError: (error) =>void
Defined in: types.ts:266
Called on error
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void
onFinish()?
Section titled “onFinish()?”
optionalonFinish: (prompt,completion) =>void
Defined in: types.ts:264
Called when completion finishes
Parameters
Section titled “Parameters”prompt
Section titled “prompt”string
completion
Section titled “completion”string
Returns
Section titled “Returns”void
onResponse()?
Section titled “onResponse()?”
optionalonResponse: (response) =>void
Defined in: types.ts:268
Called for each response chunk
Parameters
Section titled “Parameters”response
Section titled “response”Response
Returns
Section titled “Returns”void
streamProtocol?
Section titled “streamProtocol?”
optionalstreamProtocol:"text"|"data"
Defined in: types.ts:270
Stream protocol