mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
feat: support system message in api mode
This commit is contained in:
parent
7dbb3ad0b5
commit
17fb123e3b
4 changed files with 137 additions and 157 deletions
|
|
@ -671,21 +671,22 @@ export class chatgpt extends plugin {
|
|||
if (Config.model) {
|
||||
completionParams.model = Config.model
|
||||
}
|
||||
const currentDate = new Date().toISOString().split('T')[0]
|
||||
let promptPrefix = `You are ${Config.assistantLabel}, a large language model trained by OpenAI. ${Config.promptPrefixOverride || defaultPropmtPrefix}
|
||||
Current date: ${currentDate}`
|
||||
this.chatGPTApi = new ChatGPTAPI({
|
||||
apiKey: Config.apiKey,
|
||||
debug: false,
|
||||
upsertMessage,
|
||||
getMessageById,
|
||||
systemMessage: promptPrefix,
|
||||
completionParams,
|
||||
assistantLabel: Config.assistantLabel,
|
||||
fetch
|
||||
})
|
||||
const currentDate = new Date().toISOString().split('T')[0]
|
||||
let promptPrefix = `You are ${Config.assistantLabel}, a large language model trained by OpenAI. ${Config.promptPrefixOverride || defaultPropmtPrefix}
|
||||
Current date: ${currentDate}`
|
||||
let option = {
|
||||
timeoutMs: 120000,
|
||||
promptPrefix
|
||||
systemMessage: promptPrefix
|
||||
}
|
||||
if (conversation) {
|
||||
option = Object.assign(option, conversation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue