mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: content parts
This commit is contained in:
parent
37d1d04de6
commit
c551aeec1d
2 changed files with 9 additions and 9 deletions
|
|
@ -120,7 +120,7 @@ export class ChatGLM4Client extends BaseClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let content = partialResponse?.content[0]
|
let content = partialResponse?.content[0]
|
||||||
if (content.type === 'image' && content.status === 'finish') {
|
if (content?.type === 'image' && content?.status === 'finish') {
|
||||||
image = content.image[0].image_url
|
image = content.image[0].image_url
|
||||||
}
|
}
|
||||||
if (convoResponseEvent.status === 'finish') {
|
if (convoResponseEvent.status === 'finish') {
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,16 @@ import { ChatGLM4Client } from '../ChatGLM4Client.js'
|
||||||
|
|
||||||
async function sendMsg () {
|
async function sendMsg () {
|
||||||
const client = new ChatGLM4Client({
|
const client = new ChatGLM4Client({
|
||||||
refreshToken: '',
|
refreshToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTcwNTQ2NjMwMywianRpIjoiOTc2OGVlMzAtNDIxZS00Nzk2LWIxN2UtYjc0MDA3NmFhMGUyIiwidHlwZSI6InJlZnJlc2giLCJzdWIiOiJhNWRiZDcyOTMwYWY0ZWY0YjVjZDBiM2M2YzBkNzRmZiIsIm5iZiI6MTcwNTQ2NjMwMywiZXhwIjoxNzIxMDE4MzAzLCJ1aWQiOiI2NWE3M2ExNmVmNjQ2ZWIxODA2OGY3ODAiLCJ1cGxhdGZvcm0iOiJoNSIsInJvbGVzIjpbInVuYXV0aGVkX3VzZXIiXX0.vlxSwm7pXaFT6v9jNJ0IlTButLx8n4tIkKhF_d7Jvww',
|
||||||
debug: true
|
debug: true
|
||||||
})
|
})
|
||||||
let res = await client.sendMessage('你好啊')
|
let res = await client.sendMessage('你好啊')
|
||||||
console.log(res)
|
console.log(res)
|
||||||
}
|
}
|
||||||
// global.redis = null
|
global.redis = null
|
||||||
// global.logger = {
|
global.logger = {
|
||||||
// info: console.log,
|
info: console.log,
|
||||||
// warn: console.warn,
|
warn: console.warn,
|
||||||
// error: console.error
|
error: console.error
|
||||||
// }
|
}
|
||||||
// sendMsg()
|
sendMsg()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue