更新AI聊天页面样式
This commit is contained in:
@@ -122,16 +122,38 @@ export const difyClient = {
|
||||
files: files || [],
|
||||
};
|
||||
|
||||
console.log('🌐 [DifyClient] 发送聊天消息:', {
|
||||
queryLength: query.length,
|
||||
queryPreview: query.substring(0, 100) + (query.length > 100 ? '...' : ''),
|
||||
user,
|
||||
responseMode,
|
||||
conversationId,
|
||||
hasInputs: !!inputs && Object.keys(inputs).length > 0,
|
||||
inputsKeys: inputs ? Object.keys(inputs) : [],
|
||||
hasFiles: !!files && files.length > 0,
|
||||
filesCount: files?.length || 0
|
||||
});
|
||||
|
||||
const response = await difyFetch('chat-messages', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
|
||||
console.log('📡 [DifyClient] Dify API响应:', {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
hasBody: !!response.body,
|
||||
contentType: response.headers.get('Content-Type'),
|
||||
responseMode
|
||||
});
|
||||
|
||||
// 对于流式响应,直接返回Response对象
|
||||
if (responseMode === 'streaming') {
|
||||
console.log('🌊 [DifyClient] 返回流式响应对象');
|
||||
return response;
|
||||
}
|
||||
|
||||
console.log('📄 [DifyClient] 解析JSON响应');
|
||||
return response.json();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user