UseNextCompletionOptions
Defined in: react-nextjs/src/client.ts:90
Extended options for Next.js useCompletion.
Extends
Section titled “Extends”Properties
Section titled “Properties”
optionalapi:string
Defined in: react-core/dist/types/types.d.ts:208
API endpoint
Inherited from
Section titled “Inherited from”
optionalbody:Record<string,unknown>
Defined in: react-core/dist/types/types.d.ts:212
Request body extras
Inherited from
Section titled “Inherited from”headers?
Section titled “headers?”
optionalheaders:Record<string,string>
Defined in: react-core/dist/types/types.d.ts:210
Request headers
Inherited from
Section titled “Inherited from”
optionalid:string
Defined in: react-core/dist/types/types.d.ts:206
Completion ID
Inherited from
Section titled “Inherited from”initialCompletion?
Section titled “initialCompletion?”
optionalinitialCompletion:string
Defined in: react-core/dist/types/types.d.ts:204
Initial completion
Inherited from
Section titled “Inherited from”UseCompletionOptions.initialCompletion
initialInput?
Section titled “initialInput?”
optionalinitialInput:string
Defined in: react-core/dist/types/types.d.ts:202
Initial prompt
Inherited from
Section titled “Inherited from”UseCompletionOptions.initialInput
onError()?
Section titled “onError()?”
optionalonError: (error) =>void
Defined in: react-core/dist/types/types.d.ts:216
Called on error
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”onFinish()?
Section titled “onFinish()?”
optionalonFinish: (prompt,completion) =>void
Defined in: react-core/dist/types/types.d.ts:214
Called when completion finishes
Parameters
Section titled “Parameters”prompt
Section titled “prompt”string
completion
Section titled “completion”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”onResponse()?
Section titled “onResponse()?”
optionalonResponse: (response) =>void
Defined in: react-core/dist/types/types.d.ts:218
Called for each response chunk
Parameters
Section titled “Parameters”response
Section titled “response”Response
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”UseCompletionOptions.onResponse
serverAction()?
Section titled “serverAction()?”
optionalserverAction: (body) =>Promise<unknown>
Defined in: react-nextjs/src/client.ts:92
Use server action instead of API route
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”Promise<unknown>
streamProtocol?
Section titled “streamProtocol?”
optionalstreamProtocol:"text"|"data"
Defined in: react-core/dist/types/types.d.ts:220
Stream protocol