mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: 实现Gemini客户端取代官方版本
This commit is contained in:
parent
6769e9d3f0
commit
bbe769f1aa
9 changed files with 431 additions and 2428 deletions
|
|
@ -14,6 +14,9 @@ export class BaseClient {
|
|||
constructor (props = {}) {
|
||||
this.supportFunction = false
|
||||
this.maxToken = 4096
|
||||
/**
|
||||
* @type {Array<AbstractTool>}
|
||||
*/
|
||||
this.tools = []
|
||||
const {
|
||||
e, getMessageById, upsertMessage, deleteMessageById, userId
|
||||
|
|
@ -38,7 +41,6 @@ export class BaseClient {
|
|||
* insert or update a message with the id
|
||||
*
|
||||
* @type function
|
||||
* @param {string} id
|
||||
* @param {object} message
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
|
|
@ -90,14 +92,18 @@ export class BaseClient {
|
|||
throw new Error('not implemented in abstract client')
|
||||
}
|
||||
|
||||
addTools (...tools) {
|
||||
/**
|
||||
* 增加tools
|
||||
* @param {[AbstractTool]} tools
|
||||
*/
|
||||
addTools (tools) {
|
||||
if (!this.isSupportFunction) {
|
||||
throw new Error('function not supported')
|
||||
}
|
||||
if (!this.tools) {
|
||||
this.tools = []
|
||||
}
|
||||
this.tools.push(tools)
|
||||
this.tools.push(...tools)
|
||||
}
|
||||
|
||||
getTools () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue