feat: support user-provided token to bingAI and chatgptBrowser

This commit is contained in:
Wentao Lyu 2023-04-10 00:41:34 +08:00
parent a953fc9f2b
commit bbf2f8a6ca
22 changed files with 309 additions and 86 deletions

View file

@ -79,9 +79,9 @@ const useConversation = () => {
({ snapshot }) =>
async (_conversation, messages = null, preset = null) => {
const prevConversation = await snapshot.getPromise(conversation);
const endpointsFilter = await snapshot.getPromise(endpoints.endpointsFilter);
const endpointsConfig = await snapshot.getPromise(endpoints.endpointsConfig);
_switchToConversation(_conversation, messages, preset, {
endpointsFilter,
endpointsConfig,
prevConversation
});
},
@ -92,7 +92,7 @@ const useConversation = () => {
conversation,
messages = null,
preset = null,
{ endpointsFilter = {}, prevConversation = {} }
{ endpointsConfig = {}, prevConversation = {} }
) => {
let { endpoint = null } = conversation;
@ -100,7 +100,7 @@ const useConversation = () => {
// get the default model
conversation = getDefaultConversation({
conversation,
endpointsFilter,
endpointsConfig,
prevConversation,
preset
});