提交 d39b74c7 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 ba40826a
...@@ -303,9 +303,14 @@ export function useAI(config) { ...@@ -303,9 +303,14 @@ export function useAI(config) {
const ai = createAIService('volcano') const ai = createAIService('volcano')
isLoading.value = true isLoading.value = true
try { try {
const res = await ai.generateImage({ prompt: data.content, watermark: false }) const res = await ai.generateImage({ prompt: data.content, watermark: false, response_format: 'b64_json' })
if (res.url) { if (res.url) {
messages.value.push({ type: 'image', role: 'assistant', image_url: res.url, content: data.content }) messages.value.push({
type: 'image',
role: 'assistant',
image_url: `data:image/jpeg;base64,${res.url}`,
content: data.content,
})
} else { } else {
ElMessage.error(res.error) ElMessage.error(res.error)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论