diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 7daffb6dd9..1f65a032a7 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -29,6 +29,7 @@ import { SupabaseChatAlert } from '~/components/chat/SupabaseAlert'; import { expoUrlAtom } from '~/lib/stores/qrCodeStore'; import { useStore } from '@nanostores/react'; import { StickToBottom, useStickToBottomContext } from '~/lib/hooks'; +import { WebSearch } from './WebSearch.client'; import { ChatBox } from './ChatBox'; import type { DesignScheme } from '~/types/design-scheme'; import type { ElementInfo } from '~/components/workbench/Inspector'; @@ -73,6 +74,8 @@ interface BaseChatProps { llmErrorAlert?: LlmErrorAlertType; clearLlmErrorAlert?: () => void; data?: JSONValue[] | undefined; + actionRunner?: ActionRunner; + onWebSearchResult?: (result: string) => void; chatMode?: 'discuss' | 'build'; setChatMode?: (mode: 'discuss' | 'build') => void; append?: (message: Message) => void; @@ -120,6 +123,8 @@ export const BaseChat = React.forwardRef( llmErrorAlert, clearLlmErrorAlert, data, + actionRunner, + onWebSearchResult, chatMode, setChatMode, append, @@ -424,6 +429,248 @@ export const BaseChat = React.forwardRef( {llmErrorAlert && clearLlmErrorAlert?.()} />} {progressAnnotations && } +
+ + + + + + + + + + + + + + + + + + +
+ + {() => ( +
+ + {(providerList || []).length > 0 && + provider && + (!LOCAL_PROVIDERS.includes(provider.name) || 'OpenAILike') && ( + { + onApiKeysChange(provider.name, key); + }} + /> + )} +
+ )} +
+
+ { + setUploadedFiles?.(uploadedFiles.filter((_, i) => i !== index)); + setImageDataList?.(imageDataList.filter((_, i) => i !== index)); + }} + /> + + {() => ( + + )} + +
+