@assistant-ui/react
Version:
TypeScript/React library for AI Chat
51 lines • 2.19 kB
TypeScript
import { ActionButtonElement, ActionButtonProps } from "../../utils/createActionButton";
declare const useThreadSuggestion: ({ prompt, send, clearComposer, autoSend, method: _method, }: {
/** The suggestion prompt. */
prompt: string;
/**
* When true, automatically sends the message.
* When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`.
*/
send?: boolean | undefined;
/**
* Whether to clear the composer after sending.
* When send is set to false, determines if composer text is replaced with suggestion (true, default),
* or if it's appended to the composer text (false).
*
* @default true
*/
clearComposer?: boolean | undefined;
/** @deprecated Use `send` instead. */
autoSend?: boolean | undefined;
/** @deprecated Use `clearComposer` instead. */
method?: "replace";
}) => (() => void) | null;
export declare namespace ThreadPrimitiveSuggestion {
type Element = ActionButtonElement;
type Props = ActionButtonProps<typeof useThreadSuggestion>;
}
export declare const ThreadPrimitiveSuggestion: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
asChild?: boolean;
}, "ref"> & {
/** The suggestion prompt. */
prompt: string;
/**
* When true, automatically sends the message.
* When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`.
*/
send?: boolean | undefined;
/**
* Whether to clear the composer after sending.
* When send is set to false, determines if composer text is replaced with suggestion (true, default),
* or if it's appended to the composer text (false).
*
* @default true
*/
clearComposer?: boolean | undefined;
/** @deprecated Use `send` instead. */
autoSend?: boolean | undefined;
/** @deprecated Use `clearComposer` instead. */
method?: "replace";
} & import("react").RefAttributes<HTMLButtonElement>>;
export {};
//# sourceMappingURL=ThreadSuggestion.d.ts.map