Skip to content

Commit

Permalink
修复API联网 & 系统提示词无效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
renqabs committed Apr 6, 2024
1 parent f1906be commit f2cd82f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/lib/bots/bing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr
'h3imaginative',
'clgalileo',
'gencontentv3',
'nojbfedge',
],
[BingConversationStyle.Balanced]: [
'deepleo',
Expand All @@ -42,7 +43,8 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr
'iyxapbing',
'iycapbing',
'galileo',
'saharagenconv5'
'saharagenconv5',
'nojbfedge',
],
[BingConversationStyle.Precise]: [
'deepleo',
Expand All @@ -54,6 +56,7 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr
'h3precise',
'clgalileo',
'gencontentv3',
'nojbfedge',
],
[BingConversationStyle.Base]: [
'deepleo',
Expand All @@ -69,7 +72,6 @@ const getOptionSets = (conversationStyle: BingConversationStyle, allowSeach = tr
}[conversationStyle]
if (allowSeach === false) {
results.push('nosearchall')
//results.push('gpt4tmncnp')
}
return results
}
Expand Down Expand Up @@ -130,7 +132,7 @@ export class BingWebBot {
}

const argument = {
optionsSets: getOptionSets(useBaseSets ? BingConversationStyle.Base : conversation.conversationStyle, conversation.allowSearch),
optionsSets: getOptionSets(conversation.conversationStyle, conversation.allowSearch),
sliceIds: [],
message,
source: 'cib',
Expand Down Expand Up @@ -163,7 +165,7 @@ export class BingWebBot {
gptId: "copilot",
previousMessages: conversation.context?.length ? [{
author: 'system',
description: conversation.context,
description: conversation.context.replace('[system](#message)','[system](#additional_instructions)'),
contextType: 'WebPage',
messageType: 'Context',
sourceName: '',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/openai/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function parseOpenAIMessage(request: APIRequest) {
prompt,
context,
stream: request.stream,
allowSearch: !/Creative|Balanced|Precise/i.test(request.model),
allowSearch: /Creative|Balanced|Precise/i.test(request.model),
model: /Creative|gpt-?4/i.test(request.model) ? 'Creative' : request.model,
};
}
Expand Down

0 comments on commit f2cd82f

Please sign in to comment.