diff --git a/api/models/schema/convoSchema.js b/api/models/schema/convoSchema.js index 7e11088e2d..9cb13ebc0b 100644 --- a/api/models/schema/convoSchema.js +++ b/api/models/schema/convoSchema.js @@ -9,10 +9,6 @@ const convoSchema = mongoose.Schema( index: true, meiliIndex: true }, - parentMessageId: { - type: String, - required: true - }, title: { type: String, default: 'New Chat', diff --git a/client/package.json b/client/package.json index 13610d2f23..69296c91b8 100644 --- a/client/package.json +++ b/client/package.json @@ -33,6 +33,7 @@ "axios": "^1.3.4", "class-variance-authority": "^0.4.0", "clsx": "^1.2.1", + "copy-to-clipboard": "^3.3.3", "crypto-browserify": "^3.12.0", "lodash": "^4.17.21", "lucide-react": "^0.113.0", diff --git a/client/src/components/Input/BingAIOptions/index.jsx b/client/src/components/Input/BingAIOptions/index.jsx new file mode 100644 index 0000000000..b1f5783455 --- /dev/null +++ b/client/src/components/Input/BingAIOptions/index.jsx @@ -0,0 +1,69 @@ +import React from 'react'; +import { useRecoilValue, useRecoilState } from 'recoil'; +import { cn } from '~/utils'; +import { Tabs, TabsList, TabsTrigger } from '../../ui/Tabs.tsx'; + +import store from '~/store'; + +function BingAIOptions() { + const [conversation, setConversation] = useRecoilState(store.conversation) || {}; + const { endpoint, conversationId } = conversation; + + if (endpoint !== 'bingAI') return null; + if (conversationId !== 'new') return null; + + const changeHandler = value => { + setConversation(prevState => ({ ...prevState, toneStyle: value })); + }; + + const { toneStyle } = conversation; + + const cardStyle = + 'shadow-md rounded-md min-w-[75px] font-normal bg-white border-black/10 border dark:bg-gray-700 text-black dark:text-white'; + const defaultClasses = + 'p-2 rounded-md min-w-[75px] font-normal bg-white/[.60] dark:bg-gray-700 text-black text-xs'; + const defaultSelected = cn(defaultClasses, 'font-medium data-[state=active]:text-white text-xs text-white'); + const selectedClass = val => val + '-tab ' + defaultSelected; + + return ( +