@assistant-ui/react
Version:
React components for AI chat.
143 lines • 4.05 kB
TypeScript
import { ComponentType, FC, PropsWithChildren, ReactNode } from "react";
import { AssistantRuntime } from "../api/AssistantRuntime";
import { AvatarProps } from "./base/avatar";
import { TextContentPartComponent, ToolCallContentPartProps } from "../types";
import { AssistantToolUI } from "../model-config";
export type SuggestionConfig = {
text?: ReactNode | undefined;
prompt: string;
};
export type ThreadWelcomeConfig = {
message?: string | null | undefined;
suggestions?: SuggestionConfig[] | undefined;
};
export type UserMessageConfig = {
allowEdit?: boolean | undefined;
};
export type AssistantMessageConfig = {
allowReload?: boolean | undefined;
allowCopy?: boolean | undefined;
allowSpeak?: boolean | undefined;
allowFeedbackPositive?: boolean | undefined;
allowFeedbackNegative?: boolean | undefined;
components?: {
Text?: TextContentPartComponent | undefined;
ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;
} | undefined;
};
export type BranchPickerConfig = {
allowBranchPicker?: boolean | undefined;
};
export type ComposerConfig = {
allowAttachments?: boolean | undefined;
};
export type StringsConfig = {
assistantModal?: {
open: {
button: {
tooltip?: string | undefined;
};
};
closed: {
button: {
tooltip?: string | undefined;
};
};
};
thread?: {
scrollToBottom?: {
tooltip?: string | undefined;
};
};
welcome?: {
message?: string | undefined;
};
userMessage?: {
edit?: {
tooltip?: string | undefined;
};
};
assistantMessage?: {
reload?: {
tooltip?: string | undefined;
};
copy?: {
tooltip?: string | undefined;
};
speak?: {
tooltip?: string | undefined;
stop?: {
tooltip?: string | undefined;
};
};
feedback?: {
positive?: {
tooltip?: string | undefined;
};
negative?: {
tooltip?: string | undefined;
};
};
};
branchPicker?: {
previous?: {
tooltip?: string | undefined;
};
next?: {
tooltip?: string | undefined;
};
};
composer?: {
send?: {
tooltip?: string | undefined;
} | undefined;
cancel?: {
tooltip?: string | undefined;
} | undefined;
addAttachment?: {
tooltip?: string | undefined;
} | undefined;
removeAttachment?: {
tooltip?: string | undefined;
};
input?: {
placeholder?: string | undefined;
};
};
editComposer?: {
send?: {
label?: string | undefined;
};
cancel?: {
label?: string | undefined;
};
};
code?: {
header?: {
copy?: {
tooltip?: string | undefined;
};
};
};
};
export type ThreadConfig = {
runtime?: AssistantRuntime | undefined;
assistantAvatar?: AvatarProps | undefined;
welcome?: ThreadWelcomeConfig | undefined;
assistantMessage?: AssistantMessageConfig | undefined;
userMessage?: UserMessageConfig | undefined;
branchPicker?: BranchPickerConfig | undefined;
composer?: ComposerConfig | undefined;
strings?: StringsConfig | undefined;
tools?: AssistantToolUI[] | undefined;
components?: {
Composer?: ComponentType | undefined;
ThreadWelcome?: ComponentType | undefined;
} | undefined;
};
export declare const useThreadConfig: () => Omit<ThreadConfig, "runtime">;
export type ThreadConfigProviderProps = PropsWithChildren<{
config?: ThreadConfig | undefined;
}>;
export declare const ThreadConfigProvider: FC<ThreadConfigProviderProps>;
//# sourceMappingURL=thread-config.d.ts.map