Skip to content

Commit

Permalink
fix: content parts
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Jan 17, 2024
1 parent 37d1d04 commit c551aee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/ChatGLM4Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class ChatGLM4Client extends BaseClient {
}
}
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
}
if (convoResponseEvent.status === 'finish') {
Expand Down
16 changes: 8 additions & 8 deletions client/test/ChatGLM4ClientTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { ChatGLM4Client } from '../ChatGLM4Client.js'

async function sendMsg () {
const client = new ChatGLM4Client({
refreshToken: '',
refreshToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTcwNTQ2NjMwMywianRpIjoiOTc2OGVlMzAtNDIxZS00Nzk2LWIxN2UtYjc0MDA3NmFhMGUyIiwidHlwZSI6InJlZnJlc2giLCJzdWIiOiJhNWRiZDcyOTMwYWY0ZWY0YjVjZDBiM2M2YzBkNzRmZiIsIm5iZiI6MTcwNTQ2NjMwMywiZXhwIjoxNzIxMDE4MzAzLCJ1aWQiOiI2NWE3M2ExNmVmNjQ2ZWIxODA2OGY3ODAiLCJ1cGxhdGZvcm0iOiJoNSIsInJvbGVzIjpbInVuYXV0aGVkX3VzZXIiXX0.vlxSwm7pXaFT6v9jNJ0IlTButLx8n4tIkKhF_d7Jvww',
debug: true
})
let res = await client.sendMessage('你好啊')
console.log(res)
}
// global.redis = null
// global.logger = {
// info: console.log,
// warn: console.warn,
// error: console.error
// }
// sendMsg()
global.redis = null
global.logger = {
info: console.log,
warn: console.warn,
error: console.error
}
sendMsg()

0 comments on commit c551aee

Please sign in to comment.