improve system prompt handling

This commit is contained in:
kwaroran
2024-03-05 02:37:11 +09:00
parent a57399dda3
commit a15c10763d

View File

@@ -1437,7 +1437,6 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
claudeChat.push(chat) claudeChat.push(chat)
} }
} }
for(const chat of formated){ for(const chat of formated){
switch(chat.role){ switch(chat.role){
case 'user':{ case 'user':{
@@ -1456,7 +1455,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
} }
case 'system':{ case 'system':{
if(claudeChat.length === 0){ if(claudeChat.length === 0){
systemPrompt = chat.content systemPrompt += '\n\n' + chat.content
} }
else{ else{
addClaudeChat({ addClaudeChat({
@@ -1492,11 +1491,10 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
content: 'Start' content: 'Start'
}) })
} }
console.log(claudeChat, formated)
let body = { let body = {
model: raiModel, model: raiModel,
messages: claudeChat, messages: claudeChat,
system: systemPrompt, system: systemPrompt.trim(),
max_tokens: maxTokens, max_tokens: maxTokens,
temperature: temperature, temperature: temperature,
top_p: db.top_p, top_p: db.top_p,