LibreChat/client/src/components/Endpoints/Settings.jsx
Danny Avila bb75b6df3b 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
2023-04-04 12:53:41 -04:00

40 lines
1.1 KiB
JavaScript

import React from 'react';
import OpenAISettings from './OpenAI/Settings.jsx';
import BingAISettings from './BingAI/Settings.jsx';
// A preset dialog to show readonly preset values.
const Settings = ({ preset, ...props }) => {
const renderSettings = () => {
const { endpoint } = preset || {};
if (endpoint === 'openAI')
return (
<OpenAISettings
model={preset?.model}
chatGptLabel={preset?.chatGptLabel}
promptPrefix={preset?.promptPrefix}
temperature={preset?.temperature}
topP={preset?.top_p}
freqP={preset?.presence_penalty}
presP={preset?.frequency_penalty}
{...props}
/>
);
else if (endpoint === 'bingAI')
return (
<BingAISettings
toneStyle={preset?.toneStyle}
context={preset?.context}
systemMessage={preset?.systemMessage}
jailbreak={preset?.jailbreak}
{...props}
/>
);
else return <div className="text-black dark:text-white">Not implemented</div>;
};
return renderSettings();
};
export default Settings;