mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: try to add required token
This commit is contained in:
parent
53ad413f52
commit
dd249615e4
2 changed files with 7 additions and 2 deletions
|
|
@ -446,6 +446,12 @@ export class ChatGPTAPI {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (func.parameters.required) {
|
||||
for (let string of func.parameters.required) {
|
||||
functionToken += 2
|
||||
functionToken += await this._getTokenCount(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
do {
|
||||
const prompt = nextMessages
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { AbstractTool } from './AbstractTool.js'
|
||||
import cfg from '../../../../lib/config/config.js'
|
||||
|
||||
export class EditCardTool extends AbstractTool {
|
||||
name = 'editCard'
|
||||
|
|
@ -41,4 +40,4 @@ export class EditCardTool extends AbstractTool {
|
|||
await group.setCard(qq, card)
|
||||
return `the user ${qq}'s card has been changed into ${card}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue