mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
feat(bingai.js): add context and systemMessage parameters to askBing function
feat(conversationPreset.js): add context and systemMessage fields to conversation preset schema feat(askBingAI.js): pass context and systemMessage parameters to ask function feat(Settings.jsx): add toneStyle prop to BingAISettings component feat(BingAIOptions/index.jsx): add useEffect to check if advanced mode is needed feat(cleanupPreset.js): add context and systemMessage fields to cleaned up preset object feat(getDefaultConversation.js): add context and systemMessage fields to default conversation object feat(handleSubmit.js): add context and systemMessage fields to message object
This commit is contained in:
parent
3484ff687d
commit
bb75b6df3b
9 changed files with 37 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useRecoilValue, useRecoilState } from 'recoil';
|
||||
import { cn } from '~/utils';
|
||||
import { Button } from '../../ui/Button.tsx';
|
||||
|
|
@ -15,7 +15,15 @@ function BingAIOptions() {
|
|||
const [advancedMode, setAdvancedMode] = useState(false);
|
||||
const [saveAsDialogShow, setSaveAsDialogShow] = useState(false);
|
||||
const { endpoint, conversationId } = conversation;
|
||||
const { context, systemMessage, jailbreak } = conversation;
|
||||
const { toneStyle, context, systemMessage, jailbreak } = conversation;
|
||||
|
||||
useEffect(() => {
|
||||
if (endpoint !== 'bingAI') return;
|
||||
|
||||
const mustInAdvancedMode = context !== null || systemMessage !== null;
|
||||
|
||||
if (mustInAdvancedMode && !advancedMode) setAdvancedMode(true);
|
||||
}, [conversation, advancedMode]);
|
||||
|
||||
if (endpoint !== 'bingAI') return null;
|
||||
if (conversationId !== 'new') return null;
|
||||
|
|
@ -49,8 +57,6 @@ function BingAIOptions() {
|
|||
}));
|
||||
};
|
||||
|
||||
const { toneStyle } = conversation;
|
||||
|
||||
const cardStyle =
|
||||
'transition-colors shadow-md rounded-md min-w-[75px] font-normal bg-white border-black/10 hover:border-black/10 focus:border-black/10 dark:border-black/10 dark:hover:border-black/10 dark:focus:border-black/10 border dark:bg-gray-700 text-black dark:text-white';
|
||||
const defaultClasses =
|
||||
|
|
@ -114,7 +120,7 @@ function BingAIOptions() {
|
|||
</div>
|
||||
<EndpointOptionsPopover
|
||||
content={
|
||||
<div className="px-4 py-4 z-50">
|
||||
<div className="z-50 px-4 py-4">
|
||||
<Settings
|
||||
context={context}
|
||||
systemMessage={systemMessage}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue