This React hook creates a change instance used to interact with the LLM. The result object contains functions and state enabling you to send and recieve messages and monitor the state of the chat.
API
export declare function useCompletion<Input, State = unknown>(
options: UseCompletionOptions <Input, State>,
): UseCompletionResult <State>;useCompletion
UseCompletionResult<State>Examples
const { output } = useCompletion({
input: firstName,
system: `Help the user generate a last name for the given first name.`,
});