fix: 优化界面展 及引用关系
This commit is contained in:
@@ -92,7 +92,6 @@ export async function testConfig(): Promise<boolean> {
|
||||
*/
|
||||
export async function testSimpleQuery(): Promise<boolean> {
|
||||
try {
|
||||
console.log('🔍 测试简单查询...');
|
||||
const result = await queryRagGrounding('你好,请介绍一下自己', {
|
||||
sessionId: 'test-session',
|
||||
includeMetadata: true,
|
||||
@@ -100,26 +99,6 @@ export async function testSimpleQuery(): Promise<boolean> {
|
||||
});
|
||||
|
||||
if (result.success && result.data) {
|
||||
console.group('✅ 简单查询测试成功');
|
||||
console.log('💬 AI 回答:', result.data.answer);
|
||||
console.log('⏱️ 响应时间:', result.data.response_time_ms + 'ms');
|
||||
console.log('🤖 使用模型:', result.data.model_used);
|
||||
console.log('🕐 总耗时:', result.totalTime + 'ms');
|
||||
|
||||
if (result.data.grounding_metadata?.sources) {
|
||||
console.log('📚 参考来源数量:', result.data.grounding_metadata.sources.length);
|
||||
result.data.grounding_metadata.sources.forEach((source, index) => {
|
||||
const contentPreview = source.content
|
||||
? (typeof source.content === 'string' ? source.content.substring(0, 50) : JSON.stringify(source.content).substring(0, 50))
|
||||
: '无内容';
|
||||
console.log(` ${index + 1}. ${source.title}: ${contentPreview}...`);
|
||||
});
|
||||
}
|
||||
|
||||
if (result.data.grounding_metadata?.search_queries) {
|
||||
console.log('🔍 搜索查询:', result.data.grounding_metadata.search_queries);
|
||||
}
|
||||
console.groupEnd();
|
||||
return true;
|
||||
} else {
|
||||
console.error('❌ 查询失败:', result.error);
|
||||
|
||||
Reference in New Issue
Block a user