kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
chore: moving from im_end to completion params
As we allow the constructor to define completionParams, it would be better to allow devs using the library to use the specified stop token. As of right now, the library allows such stop to be passed but it isn't considered in the class itself.pull/299/head
rodzic
d8072bb3e1
commit
329e076189
|
@ -307,7 +307,7 @@ Current date: ${currentDate}\n\n`
|
||||||
|
|
||||||
const maxNumTokens = this._maxModelTokens - this._maxResponseTokens
|
const maxNumTokens = this._maxModelTokens - this._maxResponseTokens
|
||||||
let { parentMessageId } = opts
|
let { parentMessageId } = opts
|
||||||
let nextPromptBody = `${this._userLabel}:\n\n${message}<|im_end|>`
|
let nextPromptBody = `${this._userLabel}:\n\n${message}${this._completionParams.stop}`
|
||||||
let promptBody = ''
|
let promptBody = ''
|
||||||
let prompt: string
|
let prompt: string
|
||||||
let numTokens: number
|
let numTokens: number
|
||||||
|
@ -343,7 +343,7 @@ Current date: ${currentDate}\n\n`
|
||||||
parentMessageRole === 'user' ? this._userLabel : this._assistantLabel
|
parentMessageRole === 'user' ? this._userLabel : this._assistantLabel
|
||||||
|
|
||||||
// TODO: differentiate between assistant and user messages
|
// TODO: differentiate between assistant and user messages
|
||||||
const parentMessageString = `${parentMessageRoleDesc}:\n\n${parentMessage.text}<|im_end|>\n\n`
|
const parentMessageString = `${parentMessageRoleDesc}:\n\n${parentMessage.text}${this._completionParams.stop}\n\n`
|
||||||
nextPromptBody = `${parentMessageString}${promptBody}`
|
nextPromptBody = `${parentMessageString}${promptBody}`
|
||||||
parentMessageId = parentMessage.parentMessageId
|
parentMessageId = parentMessage.parentMessageId
|
||||||
} while (true)
|
} while (true)
|
||||||
|
|
Ładowanie…
Reference in New Issue