diff --git a/src/lib/bots/bing/index.ts b/src/lib/bots/bing/index.ts index 278db711..772eb373 100644 --- a/src/lib/bots/bing/index.ts +++ b/src/lib/bots/bing/index.ts @@ -30,29 +30,16 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr 'responsible_ai_policy_235', 'enablemm', 'dv3sugg', - 'machine_affinity', 'autosave', 'iyxapbing', 'iycapbing', 'h3imaginative', - 'uquopt', - 'gcccomp', - 'utildv3tosah', - 'cpcandi', - 'cpcatral3', - 'cpcatro50', - 'cpcfmql', - 'cpcgnddi', - 'cpcmattr2', - 'cpcmcit1', - 'e2ecacheread', - 'nocitpass', - 'iypapyrus', - 'hlthcndans', - 'dv3suggtrim', + 'gptvprvc', + 'fluxpcalc', 'eredirecturl', 'clgalileo', - 'gencontentv3' + 'gencontentv3', + 'fluxv14l' ], [BingConversationStyle.Balanced]: [ 'nlu_direct_response_filter', @@ -61,28 +48,14 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr 'responsible_ai_policy_235', 'enablemm', 'dv3sugg', - 'machine_affinity', 'autosave', 'iyxapbing', 'iycapbing', 'galileo', - 'saharagenconv5', - 'uquopt', - 'gcccomp', - 'utildv3tosah', - 'cpcandi', - 'cpcatral3', - 'cpcatro50', - 'cpcfmql', - 'cpcgnddi', - 'cpcmattr2', - 'cpcmcit1', - 'e2ecacheread', - 'nocitpass', - 'iypapyrus', - 'hlthcndans', - 'dv3suggtrim', - 'eredirecturl' + 'gptvprvc', + 'fluxpcalc', + 'eredirecturl', + 'saharagenconv5' ], [BingConversationStyle.Precise]: [ 'nlu_direct_response_filter', @@ -91,41 +64,33 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr 'responsible_ai_policy_235', 'enablemm', 'dv3sugg', - 'machine_affinity', 'autosave', 'iyxapbing', 'iycapbing', 'h3precise', + 'gptvprvc', + 'fluxpcalc', + 'eredirecturl', 'clgalileo', 'gencontentv3', - 'uquopt', - 'gcccomp', - 'utildv3tosah', - 'cpcandi', - 'cpcatral3', - 'cpcatro50', - 'cpcfmql', - 'cpcgnddi', - 'cpcmattr2', - 'cpcmcit1', - 'e2ecacheread', - 'nocitpass', - 'iypapyrus', - 'hlthcndans', - 'dv3suggtrim', - 'eredirecturl' + 'fluxv14l' ], [BingConversationStyle.Base]: [ - 'saharasugg', - 'enablenewsfc', - 'gencontentv3', 'deepleo', 'disable_emoji_spoken_text', + 'responsible_ai_policy_235', 'enablemm', - 'h3precisedtappid', - 'cricinfo', - 'cricinfov2', 'dv3sugg', + 'autosave', + 'iyxapbing', + 'iycapbing', + 'h3imaginative', + 'gptvprvc', + 'fluxpcalc', + 'eredirecturl', + 'clgalileo', + 'gencontentv3', + 'fluxv14l', 'nojbfedge', ] }[conversationStyle] diff --git a/src/pages/api/openai/chat/completions.ts b/src/pages/api/openai/chat/completions.ts index 27eacba2..1d2ed908 100644 --- a/src/pages/api/openai/chat/completions.ts +++ b/src/pages/api/openai/chat/completions.ts @@ -33,8 +33,8 @@ function parseOpenAIMessage(request: APIRequest) { prompt, context, stream: request.stream, - allowSearch: /gpt-?4/i.test(request.model), - model: /Creative|gpt-?4/i.test(request.model) ? 'Creative' : 'Balanced', + allowSearch: !/Creative|Balanced|Precise/i.test(request.model), + model: /Creative|gpt-?4/i.test(request.model) ? 'Creative' : request.model, }; } @@ -72,7 +72,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) req.socket.once('close', () => { abortController.abort() }) - const { prompt, stream, model, context } = parseOpenAIMessage(req.body); + const { prompt, stream, model, allowSearch, context } = parseOpenAIMessage(req.body); let lastLength = 0 let lastText = '' try { @@ -92,6 +92,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) prompt, context, options: { + allowSearch, bingConversationStyle: Object.values(BingConversationStyle) .includes(toneType) ? toneType : BingConversationStyle.Creative, },