chore: update pom.xml Lombok config and deploy settings
- Update Maven compiler plugin to support Lombok annotation processing - Add deploy.conf for automated deployment - Update backend models and controllers - Update frontend pages and API
This commit is contained in:
@@ -610,10 +610,20 @@ export default {
|
||||
this.scrollToBottom();
|
||||
},
|
||||
|
||||
/** 从 Gemini 响应 message.content 提取展示文本(支持 string 或 parts 数组) */
|
||||
extractReplyContent(content) {
|
||||
if (content == null) return '';
|
||||
if (typeof content === 'string') return content;
|
||||
if (Array.isArray(content)) {
|
||||
return content.map(part => (part && part.text) ? part.text : '').filter(Boolean).join('');
|
||||
}
|
||||
return String(content);
|
||||
},
|
||||
|
||||
async sendToAI(content, type) {
|
||||
this.isLoading = true;
|
||||
|
||||
// 纯文字 / 多模态均走 KieAI Gemini:POST /api/front/kieai/gemini/chat,回复仅来自 data.choices[0].message.content
|
||||
// 文本对话必须走 KieAI Gemini:POST /api/front/kieai/gemini/chat,请求体 { messages: [{ role: 'user', content }], stream: false }
|
||||
if (type === 'text' || type === 'multimodal') {
|
||||
try {
|
||||
const messages = [{ role: 'user', content: content }];
|
||||
@@ -623,11 +633,9 @@ export default {
|
||||
const data = response.data;
|
||||
const choice = data.choices && data.choices[0];
|
||||
const msgObj = choice && choice.message;
|
||||
// 仅使用接口返回的 content,禁止固定话术
|
||||
const reply = (msgObj && msgObj.content != null)
|
||||
? (typeof msgObj.content === 'string' ? msgObj.content : String(msgObj.content))
|
||||
: '未能获取到有效回复。';
|
||||
this.messageList.push({ role: 'ai', content: reply });
|
||||
const rawContent = msgObj && msgObj.content;
|
||||
const reply = rawContent != null ? this.extractReplyContent(rawContent) : '';
|
||||
this.messageList.push({ role: 'ai', content: reply || '未能获取到有效回复。' });
|
||||
} else {
|
||||
const msg = (response && response.message) || '发起对话失败';
|
||||
this.messageList.push({ role: 'ai', content: '请求失败:' + msg });
|
||||
|
||||
Reference in New Issue
Block a user