Commit bd287386 authored by Wade's avatar Wade

summary ok

parent afaa731b
{"level":"info","pid":48106,"time":1749131682,"caller":"/Users/wade/project/wuban/agentchat/log.go:69","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":48106,"method":"DeepSeek.Init","time":1749131682,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":48106,"method":"DeepSeek.Init","time":1749131682,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":48106,"method":"Milvus.Init","time":1749131682,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":48106,"method":"Milvus.Init","time":1749131683,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":48106,"method":"GraphKnowledge.Init","time":1749131683,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":48106,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749131683,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":48106,"method":"GraphKnowledge.Init","time":1749131683,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":48106,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749131683,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":48106,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749131683,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":48106,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749131684,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":48106,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749131684,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":48106,"method":"DefineIndexerAndRetriever","time":1749131684,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":48106,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749131684,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":48106,"method":"GraphKnowledge.newDocStore","time":1749131684,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":48106,"method":"DefineIndexerAndRetriever","time":1749131684,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":48106,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749131685,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":48106,"method":"KnowledgeClient.Init","time":1749131685,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"error","pid":48106,"method":"KnowledgeClient.Init","time":1749131685,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:79","message":"SecretID and SecretKey are required"}
{"level":"fatal","pid":48106,"time":1749131685,"caller":"/Users/wade/project/wuban/agentchat/main.go:261","message":"Failed to initialize KnowledgeClient: knowledge: SecretID and SecretKey are required"}
{"level":"info","pid":48510,"time":1749131759,"caller":"/Users/wade/project/wuban/agentchat/log.go:69","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":48510,"method":"DeepSeek.Init","time":1749131759,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":48510,"method":"DeepSeek.Init","time":1749131759,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":48510,"method":"Milvus.Init","time":1749131759,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":48510,"method":"Milvus.Init","time":1749131760,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":48510,"method":"GraphKnowledge.Init","time":1749131760,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":48510,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749131760,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":48510,"method":"GraphKnowledge.Init","time":1749131760,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":48510,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749131760,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":48510,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749131760,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":48510,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749131761,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":48510,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749131761,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":48510,"method":"DefineIndexerAndRetriever","time":1749131761,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":48510,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749131761,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":48510,"method":"GraphKnowledge.newDocStore","time":1749131761,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":48510,"method":"DefineIndexerAndRetriever","time":1749131761,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":48510,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749131763,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":48510,"method":"KnowledgeClient.Init","time":1749131763,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":48510,"method":"KnowledgeClient.Init","time":1749131763,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":48510,"time":1749131763,"caller":"/Users/wade/project/wuban/agentchat/main.go:267","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":48510,"time":1749131772,"caller":"/Users/wade/project/wuban/agentchat/main.go:281","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":48510,"time":1749131772,"caller":"/Users/wade/project/wuban/agentchat/main.go:307","message":"qaAsJson--------{\"ID\":35,\"CreatedAt\":\"2025-06-05T10:48:41.391675Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":48510,"method":"docStore.Retrieve","collection":"chatRag1","time":1749131772,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":48510,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749131774,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":48510,"time":1749131774,"caller":"/Users/wade/project/wuban/agentchat/main.go:333","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":48510,"method":"docStore.Retrieve","space_id":"","time":1749131774,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":48510,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749131782,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":48510,"time":1749131782,"caller":"/Users/wade/project/wuban/agentchat/main.go:349","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":48980,"time":1749131845,"caller":"/Users/wade/project/wuban/agentchat/log.go:69","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":48980,"method":"DeepSeek.Init","time":1749131845,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":48980,"method":"DeepSeek.Init","time":1749131845,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":48980,"method":"Milvus.Init","time":1749131845,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":48980,"method":"Milvus.Init","time":1749131846,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":48980,"method":"GraphKnowledge.Init","time":1749131846,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":48980,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749131846,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":48980,"method":"GraphKnowledge.Init","time":1749131846,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":48980,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749131846,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":48980,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749131846,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":48980,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749131847,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":48980,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749131847,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":48980,"method":"DefineIndexerAndRetriever","time":1749131847,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":48980,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749131847,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":48980,"method":"GraphKnowledge.newDocStore","time":1749131847,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":48980,"method":"DefineIndexerAndRetriever","time":1749131847,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":48980,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749131848,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":48980,"method":"KnowledgeClient.Init","time":1749131848,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":48980,"method":"KnowledgeClient.Init","time":1749131848,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":48980,"time":1749131848,"caller":"/Users/wade/project/wuban/agentchat/main.go:267","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":48980,"time":1749131855,"caller":"/Users/wade/project/wuban/agentchat/main.go:281","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":48980,"time":1749131855,"caller":"/Users/wade/project/wuban/agentchat/main.go:307","message":"qaAsJson--------{\"ID\":36,\"CreatedAt\":\"2025-06-05T13:56:12.838893Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":48980,"method":"docStore.Retrieve","collection":"chatRag1","time":1749131855,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":48980,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749131858,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":48980,"time":1749131858,"caller":"/Users/wade/project/wuban/agentchat/main.go:333","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":48980,"method":"docStore.Retrieve","space_id":"","time":1749131858,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":48980,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749131868,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":48980,"time":1749131868,"caller":"/Users/wade/project/wuban/agentchat/main.go:349","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":49330,"time":1749131919,"caller":"/Users/wade/project/wuban/agentchat/log.go:68","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":49330,"method":"DeepSeek.Init","time":1749131919,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":49330,"method":"DeepSeek.Init","time":1749131919,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":49330,"method":"Milvus.Init","time":1749131919,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":49330,"method":"Milvus.Init","time":1749131920,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":49330,"method":"GraphKnowledge.Init","time":1749131920,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":49330,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749131920,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":49330,"method":"GraphKnowledge.Init","time":1749131920,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":49330,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749131920,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":49330,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749131920,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":49330,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749131921,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":49330,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749131921,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":49330,"method":"DefineIndexerAndRetriever","time":1749131921,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":49330,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749131921,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":49330,"method":"GraphKnowledge.newDocStore","time":1749131921,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":49330,"method":"DefineIndexerAndRetriever","time":1749131921,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":49330,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749131922,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":49330,"method":"KnowledgeClient.Init","time":1749131922,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":49330,"method":"KnowledgeClient.Init","time":1749131922,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":49330,"time":1749131922,"caller":"/Users/wade/project/wuban/agentchat/main.go:263","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":49330,"time":1749131926,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":49330,"time":1749131926,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":37,\"CreatedAt\":\"2025-06-05T13:57:36.176828Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","collection":"chatRag1","time":1749131926,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749131929,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":49330,"time":1749131929,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","space_id":"","time":1749131929,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749131935,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":49330,"time":1749131935,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":49330,"time":1749135401,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":49330,"time":1749135428,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":38,\"CreatedAt\":\"2025-06-05T13:58:47.372064Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","collection":"chatRag1","time":1749135428,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749135433,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":49330,"time":1749135433,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","space_id":"","time":1749135433,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":49330,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749135440,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":49330,"time":1749135440,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":3634,"time":1749179323,"caller":"/Users/wade/project/wuban/agentchat/log.go:68","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":3634,"method":"DeepSeek.Init","time":1749179323,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":3634,"method":"DeepSeek.Init","time":1749179323,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":3634,"method":"Milvus.Init","time":1749179323,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":3634,"method":"Milvus.Init","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":3634,"method":"GraphKnowledge.Init","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":3634,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":3634,"method":"GraphKnowledge.Init","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":3634,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":3634,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":3634,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":3634,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":3634,"method":"DefineIndexerAndRetriever","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":3634,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":3634,"method":"GraphKnowledge.newDocStore","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":3634,"method":"DefineIndexerAndRetriever","time":1749179324,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":3634,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749179325,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":3634,"method":"KnowledgeClient.Init","time":1749179325,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":3634,"method":"KnowledgeClient.Init","time":1749179325,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":3634,"time":1749179325,"caller":"/Users/wade/project/wuban/agentchat/main.go:263","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":3634,"time":1749179345,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":3634,"time":1749179346,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":39,\"CreatedAt\":\"2025-06-05T14:57:08.59507Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","collection":"chatRag1","time":1749179346,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"error","pid":3634,"error":"doRequest: error sending request: Post \"https://generativelanguage.googleapis.com//v1beta/models/embedding-001:batchEmbedContents\": dial tcp 74.125.135.95:443: i/o timeout","method":"docStore.Retrieve","collection":"chatRag1","time":1749179376,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:508","message":"Embedding failed"}
{"level":"error","pid":3634,"time":1749179376,"caller":"/Users/wade/project/wuban/agentchat/main.go:320","message":"milvus Retrieve err.Error() milvus retrieve embedding failed: doRequest: error sending request: Post \"https://generativelanguage.googleapis.com//v1beta/models/embedding-001:batchEmbedContents\": dial tcp 74.125.135.95:443: i/o timeout"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","space_id":"","time":1749179376,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749179384,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":3634,"time":1749179384,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":3634,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"What is the capital of UK?","assistant_answer":"The graph context indicates that the knowledge base does not have the answer to your question. I do not have the information to answer your question about the capital of the UK.\n","history_summary":"","time":1749179395,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":3634,"method":"KnowledgeClient.QueryRewrite","message_count":2,"model":"lke-query-rewrite-base","time":1749179395,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"error","pid":3634,"error":"[TencentCloudSDKError] Code=InvalidParameter, Message=20024-invalid params, RequestId=bca5a1f8-7d20-4313-a59a-66f8e25c2825","method":"KnowledgeClient.QueryRewrite","time":1749179400,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:206","message":"Tencent Cloud API error"}
{"level":"error","pid":3634,"time":1749179400,"caller":"/Users/wade/project/wuban/agentchat/main.go:364","message":"tencent cloud api error: [TencentCloudSDKError] Code=InvalidParameter, Message=20024-invalid params, RequestId=bca5a1f8-7d20-4313-a59a-66f8e25c2825"}
{"level":"info","pid":3634,"question":"What is the capital of UK?","context":"","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"","answer":"The graph context indicates that the knowledge base does not have the answer to your question. I do not have the information to answer your question about the capital of the UK.\n","time":1749179400,"caller":"/Users/wade/project/wuban/agentchat/main.go:380","message":"Question and answer pair recorded"}
{"level":"info","pid":3634,"time":1749179415,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":3634,"time":1749179415,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":40,\"CreatedAt\":\"2025-06-06T03:09:06.196118Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","collection":"chatRag1","time":1749179415,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749179417,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":3634,"time":1749179417,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","space_id":"","time":1749179417,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":3634,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749179422,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":3634,"time":1749179422,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":3634,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"What is the capital of UK?","assistant_answer":"The provided context doesn't contain the answer to your question. The capital of the UK is London.\n","history_summary":"","time":1749179423,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":3634,"method":"KnowledgeClient.QueryRewrite","message_count":2,"model":"lke-query-rewrite-base","time":1749179423,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"error","pid":3634,"error":"[TencentCloudSDKError] Code=InvalidParameter, Message=20024-invalid params, RequestId=5063326c-2f74-4f7d-9890-771587cde628","method":"KnowledgeClient.QueryRewrite","time":1749179423,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:206","message":"Tencent Cloud API error"}
{"level":"error","pid":3634,"time":1749179423,"caller":"/Users/wade/project/wuban/agentchat/main.go:364","message":"tencent cloud api error: [TencentCloudSDKError] Code=InvalidParameter, Message=20024-invalid params, RequestId=5063326c-2f74-4f7d-9890-771587cde628"}
{"level":"info","pid":3634,"question":"What is the capital of UK?","context":"Paris is the capital of France?\nUSA is the largest importer of coffee?\n","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"","answer":"The provided context doesn't contain the answer to your question. The capital of the UK is London.\n","time":1749179423,"caller":"/Users/wade/project/wuban/agentchat/main.go:380","message":"Question and answer pair recorded"}
{"level":"info","pid":4733,"time":1749180547,"caller":"/Users/wade/project/wuban/agentchat/log.go:68","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":4733,"method":"DeepSeek.Init","time":1749180547,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":4733,"method":"DeepSeek.Init","time":1749180547,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":4733,"method":"Milvus.Init","time":1749180547,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":4733,"method":"Milvus.Init","time":1749180548,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":4733,"method":"GraphKnowledge.Init","time":1749180548,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":4733,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749180548,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":4733,"method":"GraphKnowledge.Init","time":1749180548,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":4733,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749180548,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":4733,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749180548,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":4733,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749180549,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":4733,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749180549,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":4733,"method":"DefineIndexerAndRetriever","time":1749180549,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":4733,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749180549,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":4733,"method":"GraphKnowledge.newDocStore","time":1749180549,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":4733,"method":"DefineIndexerAndRetriever","time":1749180549,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":4733,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749180550,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":4733,"method":"KnowledgeClient.Init","time":1749180550,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":4733,"method":"KnowledgeClient.Init","time":1749180550,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":4733,"time":1749180550,"caller":"/Users/wade/project/wuban/agentchat/main.go:263","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":4733,"time":1749180554,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":4733,"time":1749180554,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":41,\"CreatedAt\":\"2025-06-06T03:10:15.510778Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":4733,"method":"docStore.Retrieve","collection":"chatRag1","time":1749180554,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":4733,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749180556,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":4733,"time":1749180556,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":4733,"method":"docStore.Retrieve","space_id":"","time":1749180556,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":4733,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749180561,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":4733,"time":1749180561,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":4733,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"What is the capital of UK?","assistant_answer":"I am sorry, but the provided context does not contain the answer to your question about the capital of the UK.\n","history_summary":"","time":1749180562,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":4733,"method":"KnowledgeClient.QueryRewrite","message_count":2,"model":"lke-query-rewrite-base","time":1749180562,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"error","pid":4733,"error":"[TencentCloudSDKError] Code=InvalidParameter, Message=20024-invalid params, RequestId=51b1a188-a8c9-4956-839a-bc3f83ace3e5","method":"KnowledgeClient.QueryRewrite","time":1749180563,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:206","message":"Tencent Cloud API error"}
{"level":"error","pid":4733,"time":1749180563,"caller":"/Users/wade/project/wuban/agentchat/main.go:367","message":"tencent cloud api error: [TencentCloudSDKError] Code=InvalidParameter, Message=20024-invalid params, RequestId=51b1a188-a8c9-4956-839a-bc3f83ace3e5"}
{"level":"info","pid":4733,"question":"What is the capital of UK?","context":"Paris is the capital of France?\nUSA is the largest importer of coffee?\n","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"","answer":"I am sorry, but the provided context does not contain the answer to your question about the capital of the UK.\n","time":1749180563,"caller":"/Users/wade/project/wuban/agentchat/main.go:383","message":"Question and answer pair recorded"}
{"level":"info","pid":6105,"time":1749180845,"caller":"/Users/wade/project/wuban/agentchat/log.go:68","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":6105,"method":"DeepSeek.Init","time":1749180845,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":6105,"method":"DeepSeek.Init","time":1749180845,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":6105,"method":"Milvus.Init","time":1749180845,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":6105,"method":"Milvus.Init","time":1749180846,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":6105,"method":"GraphKnowledge.Init","time":1749180846,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":6105,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749180846,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":6105,"method":"GraphKnowledge.Init","time":1749180846,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":6105,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749180846,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":6105,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749180846,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":6105,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749180848,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":6105,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749180848,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":6105,"method":"DefineIndexerAndRetriever","time":1749180848,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":6105,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749180848,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":6105,"method":"GraphKnowledge.newDocStore","time":1749180848,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":6105,"method":"DefineIndexerAndRetriever","time":1749180848,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":6105,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749180849,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":6105,"method":"KnowledgeClient.Init","time":1749180849,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":6105,"method":"KnowledgeClient.Init","time":1749180849,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":6105,"time":1749180849,"caller":"/Users/wade/project/wuban/agentchat/main.go:263","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":6105,"time":1749180858,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":6105,"time":1749180859,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":42,\"CreatedAt\":\"2025-06-06T03:29:14.509175Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":null,\"Summary\":null,\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":6105,"method":"docStore.Retrieve","collection":"chatRag1","time":1749180859,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":6105,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749180861,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6105,"time":1749180861,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":6105,"method":"docStore.Retrieve","space_id":"","time":1749180861,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":6105,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749180867,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6105,"time":1749180867,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":6105,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"What is the capital of UK?","assistant_answer":"The available knowledge base does not contain information about the capital of the UK.\n","history_summary":"The available knowledge base does not contain information about the capital of the UK.\n","time":1749180868,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":6105,"method":"KnowledgeClient.QueryRewrite","message_count":3,"model":"lke-query-rewrite-base","time":1749180868,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"info","pid":6105,"method":"KnowledgeClient.QueryRewrite","rewritten_query":"Conversation summary: The available knowledge base does not contain information about the capital of the UK.","request_id":"15f1ce0c-a83f-4d95-af22-33a3bd829e8d","usage":{"InputTokens":74,"OutputTokens":19,"TotalTokens":93},"raw_response":"{\"Response\":{\"Content\":\"Conversation summary: The available knowledge base does not contain information about the capital of the UK.\",\"Usage\":{\"InputTokens\":74,\"OutputTokens\":19,\"TotalTokens\":93},\"RequestId\":\"15f1ce0c-a83f-4d95-af22-33a3bd829e8d\"}}","time":1749180870,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:237","message":"Query rewrite operation completed successfully"}
{"level":"info","pid":6105,"question":"What is the capital of UK?","context":"Paris is the capital of France?\nUSA is the largest importer of coffee?\n","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"The available knowledge base does not contain information about the capital of the UK.\n","answer":"The available knowledge base does not contain information about the capital of the UK.\n","time":1749180870,"caller":"/Users/wade/project/wuban/agentchat/main.go:387","message":"Question and answer pair recorded"}
{"level":"info","pid":6250,"time":1749181044,"caller":"/Users/wade/project/wuban/agentchat/log.go:68","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":6250,"method":"DeepSeek.Init","time":1749181044,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":6250,"method":"DeepSeek.Init","time":1749181044,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":6250,"method":"Milvus.Init","time":1749181044,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":6250,"method":"Milvus.Init","time":1749181045,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":6250,"method":"GraphKnowledge.Init","time":1749181045,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":6250,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749181045,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":6250,"method":"GraphKnowledge.Init","time":1749181045,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":6250,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749181045,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":6250,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749181045,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":6250,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749181046,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":6250,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749181046,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":6250,"method":"DefineIndexerAndRetriever","time":1749181046,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":6250,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749181046,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":6250,"method":"GraphKnowledge.newDocStore","time":1749181046,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":6250,"method":"DefineIndexerAndRetriever","time":1749181046,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":6250,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749181047,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":6250,"method":"KnowledgeClient.Init","time":1749181047,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":6250,"method":"KnowledgeClient.Init","time":1749181047,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":6250,"time":1749181047,"caller":"/Users/wade/project/wuban/agentchat/main.go:263","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":6250,"time":1749181055,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"What is the capital of UK?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":6250,"time":1749181055,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":43,\"CreatedAt\":\"2025-06-06T03:34:19.041174Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":\"The available knowledge base does not contain information about the capital of the UK.\\n\",\"Summary\":\"\",\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","collection":"chatRag1","time":1749181055,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749181058,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6250,"time":1749181058,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","space_id":"","time":1749181058,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749181065,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6250,"time":1749181065,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":6250,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"What is the capital of UK?","assistant_answer":"The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\n","history_summary":"The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\n","time":1749181066,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":6250,"method":"KnowledgeClient.QueryRewrite","message_count":3,"model":"lke-query-rewrite-base","time":1749181066,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"info","pid":6250,"method":"KnowledgeClient.QueryRewrite","rewritten_query":"Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","request_id":"e8ef75a3-6f35-4766-8eea-b8a7d3506c84","usage":{"InputTokens":154,"OutputTokens":59,"TotalTokens":213},"raw_response":"{\"Response\":{\"Content\":\"Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\",\"Usage\":{\"InputTokens\":154,\"OutputTokens\":59,\"TotalTokens\":213},\"RequestId\":\"e8ef75a3-6f35-4766-8eea-b8a7d3506c84\"}}","time":1749181069,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:237","message":"Query rewrite operation completed successfully"}
{"level":"info","pid":6250,"question":"What is the capital of UK?","context":"Paris is the capital of France?\nUSA is the largest importer of coffee?\n","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\n","answer":"The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\n","time":1749181069,"caller":"/Users/wade/project/wuban/agentchat/main.go:398","message":"Question and answer pair recorded"}
{"level":"info","pid":6250,"time":1749181117,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"你是谁?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":6250,"time":1749181118,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":44,\"CreatedAt\":\"2025-06-06T03:37:35.757771Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"What is the capital of UK?\",\"Answer\":\"The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\\n\",\"Summary\":\"Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\",\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","collection":"chatRag1","time":1749181118,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749181118,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6250,"time":1749181118,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","space_id":"","time":1749181118,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":6250,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749181123,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6250,"time":1749181123,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":6250,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"你是谁?","assistant_answer":"我是一个基于Milvus的AI助手。知识库中提供的内容不足以回答你是谁这个问题。\n","history_summary":"Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","time":1749181124,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":6250,"method":"KnowledgeClient.QueryRewrite","message_count":3,"model":"lke-query-rewrite-base","time":1749181124,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"info","pid":6250,"method":"KnowledgeClient.QueryRewrite","rewritten_query":"Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","request_id":"6b4d918c-5e65-4fd8-b1b3-52b961b8170a","usage":{"InputTokens":119,"OutputTokens":62,"TotalTokens":181},"raw_response":"{\"Response\":{\"Content\":\"Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\",\"Usage\":{\"InputTokens\":119,\"OutputTokens\":62,\"TotalTokens\":181},\"RequestId\":\"6b4d918c-5e65-4fd8-b1b3-52b961b8170a\"}}","time":1749181126,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:237","message":"Query rewrite operation completed successfully"}
{"level":"info","pid":6250,"question":"你是谁?","context":"Paris is the capital of France?\nUSA is the largest importer of coffee?\n","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","answer":"我是一个基于Milvus的AI助手。知识库中提供的内容不足以回答你是谁这个问题。\n","time":1749181126,"caller":"/Users/wade/project/wuban/agentchat/main.go:398","message":"Question and answer pair recorded"}
{"level":"info","pid":6592,"time":1749181440,"caller":"/Users/wade/project/wuban/agentchat/log.go:68","message":"This message appears when log level set to Debug or Info"}
{"level":"info","pid":6592,"method":"DeepSeek.Init","time":1749181440,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:91","message":"Initializing DeepSeek plugin"}
{"level":"info","pid":6592,"method":"DeepSeek.Init","time":1749181440,"caller":"/Users/wade/project/wuban/agentchat/plugins/deepseek/deepseek.go:104","message":"Initialization successful"}
{"level":"info","pid":6592,"method":"Milvus.Init","time":1749181440,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:75","message":"Initializing Milvus plugin"}
{"level":"info","pid":6592,"method":"Milvus.Init","time":1749181441,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:87","message":"Initialization successful"}
{"level":"info","pid":6592,"method":"GraphKnowledge.Init","time":1749181441,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:299","message":"Initializing GraphKnowledge plugin"}
{"level":"info","pid":6592,"method":"NewClient","ip":"54.92.111.204","port":5670,"time":1749181441,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:93","message":"Creating new GraphRAG client"}
{"level":"info","pid":6592,"method":"GraphKnowledge.Init","time":1749181441,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:311","message":"Initialization successful"}
{"level":"info","pid":6592,"method":"DefineIndexerAndRetriever","collection":"chatRag1","dimension":768,"time":1749181441,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:152","message":"Defining indexer and retriever"}
{"level":"info","pid":6592,"method":"Milvus.newDocStore","collection":"chatRag1","dimension":768,"time":1749181441,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:201","message":"Creating new doc store"}
{"level":"info","pid":6592,"method":"Milvus.newDocStore","collection":"chatRag1","time":1749181442,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:302","message":"Doc store created successfully"}
{"level":"info","pid":6592,"method":"DefineIndexerAndRetriever","collection":"chatRag1","time":1749181442,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:182","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":6592,"method":"DefineIndexerAndRetriever","time":1749181442,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:357","message":"Defining indexer and retriever"}
{"level":"info","pid":6592,"method":"GraphKnowledge.newDocStore","space_id":"","model_name":"Qwen/Qwen2.5-Coder-32B-Instruct","time":1749181442,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:393","message":"Creating new doc store"}
{"level":"info","pid":6592,"method":"GraphKnowledge.newDocStore","time":1749181442,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:399","message":"Doc store created successfully"}
{"level":"info","pid":6592,"method":"DefineIndexerAndRetriever","time":1749181442,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:376","message":"Indexer and retriever defined successfully"}
{"level":"info","pid":6592,"method":"NewKnowledgeClient","endpoint":"lkeap.tencentcloudapi.com","region":"ap-guangzhou","secret_id":"","token":"","time":1749181443,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:43","message":"Creating new KnowledgeClient"}
{"level":"info","pid":6592,"method":"KnowledgeClient.Init","time":1749181443,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:51","message":"Initializing KnowledgeClient"}
{"level":"info","pid":6592,"method":"KnowledgeClient.Init","time":1749181443,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:109","message":"Initialization successful"}
{"level":"info","pid":6592,"time":1749181443,"caller":"/Users/wade/project/wuban/agentchat/main.go:263","message":"KnowledgeClient initialized successfully"}
{"level":"info","pid":6592,"time":1749181451,"caller":"/Users/wade/project/wuban/agentchat/main.go:277","message":"input--------{\"content\":\"你是谁?\",\"model\":\"gpt-3.5-turbo\",\"apiKey\":\"sk-1234567890abcdef\",\"from\":\"Alice\",\"from_id\":\"user123\",\"to\":\"Bob\",\"to_id\":\"user456\"}"}
{"level":"info","pid":6592,"time":1749181451,"caller":"/Users/wade/project/wuban/agentchat/main.go:303","message":"qaAsJson--------{\"ID\":45,\"CreatedAt\":\"2025-06-06T03:38:38.177331Z\",\"FromID\":\"user123\",\"From\":\"Alice\",\"Question\":\"你是谁?\",\"Answer\":\"我是一个基于Milvus的AI助手。知识库中提供的内容不足以回答你是谁这个问题。\\n\",\"Summary\":\"Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\",\"To\":\"Bob\",\"ToID\":\"user456\"}"}
{"level":"info","pid":6592,"method":"docStore.Retrieve","collection":"chatRag1","time":1749181451,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:450","message":"Starting retrieve operation"}
{"level":"info","pid":6592,"method":"docStore.Retrieve","collection":"chatRag1","documents":2,"time":1749181454,"caller":"/Users/wade/project/wuban/agentchat/plugins/milvus/milvus.go:640","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6592,"time":1749181454,"caller":"/Users/wade/project/wuban/agentchat/main.go:329","message":"promptInput.Context: Paris is the capital of France?\nUSA is the largest importer of coffee?\n"}
{"level":"info","pid":6592,"method":"docStore.Retrieve","space_id":"","time":1749181454,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:755","message":"Starting retrieve operation"}
{"level":"info","pid":6592,"method":"docStore.Retrieve","space_id":"","documents":1,"time":1749181460,"caller":"/Users/wade/project/wuban/agentchat/plugins/graphrag/graph.go:892","message":"Retrieve operation completed successfully"}
{"level":"info","pid":6592,"time":1749181460,"caller":"/Users/wade/project/wuban/agentchat/main.go:344","message":"promptInput.Graph : 知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n"}
{"level":"info","pid":6592,"from":"Alice","from_id":"user123","to":"Bob","to_id":"user456","promptInput.Query":"你是谁?","resp.Text()":"我是一个基于Milvus的助手,但我能提供的信息有限。目前我只知道巴黎是法国的首都,美国是最大的咖啡进口国。知识库的信息不足以回答“你是谁”这个问题。\n","promptInput.Summary":"Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","time":1749181461,"caller":"/Users/wade/project/wuban/agentchat/main.go:371","message":"QueryRewriteWithSummary"}
{"level":"info","pid":6592,"method":"KnowledgeClient.QueryRewriteWithSummary","user_question":"你是谁?","assistant_answer":"我是一个基于Milvus的助手,但我能提供的信息有限。目前我只知道巴黎是法国的首都,美国是最大的咖啡进口国。知识库的信息不足以回答“你是谁”这个问题。\n","history_summary":"Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","time":1749181461,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:256","message":"Starting query rewrite with summary operation"}
{"level":"info","pid":6592,"method":"KnowledgeClient.QueryRewrite","message_count":3,"model":"lke-query-rewrite-base","time":1749181461,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:131","message":"Starting query rewrite operation"}
{"level":"info","pid":6592,"method":"KnowledgeClient.QueryRewrite","rewritten_query":"Conversation summary: Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","request_id":"01a825ea-5033-4bba-b62b-8597c780167d","usage":{"InputTokens":143,"OutputTokens":65,"TotalTokens":208},"raw_response":"{\"Response\":{\"Content\":\"Conversation summary: Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.\",\"Usage\":{\"InputTokens\":143,\"OutputTokens\":65,\"TotalTokens\":208},\"RequestId\":\"01a825ea-5033-4bba-b62b-8597c780167d\"}}","time":1749181464,"caller":"/Users/wade/project/wuban/agentchat/plugins/knowledge/knowledge.go:237","message":"Query rewrite operation completed successfully"}
{"level":"info","pid":6592,"from":"Alice","from_id":"user123","to":"Bob","to_id":"user456","question":"你是谁?","context":"Paris is the capital of France?\nUSA is the largest importer of coffee?\n","graph":"知识库中提供的内容不足以回答此问题\n\n<references title=\"References\" references=\"[]\" />\n","last summary":"Conversation summary: Conversation summary: The provided context does not contain the answer to your question. The context mentions Paris is the capital of France and the USA is the largest importer of coffee. The graph context also indicates a lack of information. Therefore, I cannot answer your question about the capital of the UK.","answer":"我是一个基于Milvus的助手,但我能提供的信息有限。目前我只知道巴黎是法国的首都,美国是最大的咖啡进口国。知识库的信息不足以回答“你是谁”这个问题。\n","time":1749181464,"caller":"/Users/wade/project/wuban/agentchat/main.go:397","message":"Question and answer pair recorded"}
...@@ -23,7 +23,6 @@ func getPackageName() string { ...@@ -23,7 +23,6 @@ func getPackageName() string {
return pkg return pkg
} }
func loggingInit() { func loggingInit() {
// debug := flag.Bool("debug", false, "sets log level to debug") // debug := flag.Bool("debug", false, "sets log level to debug")
......
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"net/http" "net/http"
"os"
"strings" "strings"
"time" "time"
...@@ -14,6 +15,7 @@ import ( ...@@ -14,6 +15,7 @@ import (
"github.com/rs/zerolog" "github.com/rs/zerolog"
"github.com/wade-liwei/agentchat/plugins/deepseek" "github.com/wade-liwei/agentchat/plugins/deepseek"
"github.com/wade-liwei/agentchat/plugins/graphrag" "github.com/wade-liwei/agentchat/plugins/graphrag"
"github.com/wade-liwei/agentchat/plugins/knowledge" // Import knowledge package
"github.com/wade-liwei/agentchat/plugins/milvus" "github.com/wade-liwei/agentchat/plugins/milvus"
"github.com/firebase/genkit/go/plugins/evaluators" "github.com/firebase/genkit/go/plugins/evaluators"
...@@ -76,7 +78,6 @@ type simpleQaPromptInput struct { ...@@ -76,7 +78,6 @@ type simpleQaPromptInput struct {
// Please provide a response that aligns with the given personality while leveraging the provided context, graph, and conversation summary. // Please provide a response that aligns with the given personality while leveraging the provided context, graph, and conversation summary.
// ` // `
const simpleQaPromptTemplate = ` const simpleQaPromptTemplate = `
You're a helpful agent that answers the user's questions based on the provided context. You're a helpful agent that answers the user's questions based on the provided context.
...@@ -94,10 +95,8 @@ Instructions: ...@@ -94,10 +95,8 @@ Instructions:
- Ensure responses leverage the Previous conversation summary when relevant. - Ensure responses leverage the Previous conversation summary when relevant.
` `
func main() { func main() {
// Define command-line flags with hardcoded values as defaults // Define command-line flags with hardcoded values as defaults
deepseekAPIKey := flag.String("deepseek-api-key", "sk-9f70df871a7c4b8aa566a3c7a0603706", "DeepSeek API key") deepseekAPIKey := flag.String("deepseek-api-key", "sk-9f70df871a7c4b8aa566a3c7a0603706", "DeepSeek API key")
milvusAddr := flag.String("milvus-addr", "54.92.111.204:19530", "Milvus server address") milvusAddr := flag.String("milvus-addr", "54.92.111.204:19530", "Milvus server address")
...@@ -113,6 +112,9 @@ func main() { ...@@ -113,6 +112,9 @@ func main() {
zerolog.SetGlobalLevel(zerolog.DebugLevel) zerolog.SetGlobalLevel(zerolog.DebugLevel)
} }
os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF")
os.Setenv("TENCENTCLOUD_SECRET_KEY", "rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd")
ctx := context.Background() ctx := context.Background()
metrics := []evaluators.MetricConfig{ metrics := []evaluators.MetricConfig{
{ {
...@@ -250,6 +252,16 @@ func main() { ...@@ -250,6 +252,16 @@ func main() {
log.Fatal().Msgf("InitQAStore failed: %v", err) log.Fatal().Msgf("InitQAStore failed: %v", err)
} }
// Initialize KnowledgeClient with test parameters
kc := knowledge.NewKnowledgeClient(knowledge.ClientConfig{
Endpoint: "lkeap.tencentcloudapi.com",
Region: "ap-guangzhou",
})
if err := kc.Init(ctx); err != nil {
log.Fatal().Msgf("Failed to initialize KnowledgeClient: %v", err)
}
log.Info().Msg("KnowledgeClient initialized successfully")
// Define a simple flow that generates jokes about a given topic // Define a simple flow that generates jokes about a given topic
genkit.DefineFlow(g, "chat", func(ctx context.Context, input *ChatInput) (Response, error) { genkit.DefineFlow(g, "chat", func(ctx context.Context, input *ChatInput) (Response, error) {
...@@ -319,7 +331,6 @@ func main() { ...@@ -319,7 +331,6 @@ func main() {
begin := time.Now() begin := time.Now()
graphResponse, err := ai.Retrieve(ctx, graphRetriever, ai.WithDocs(dRequest)) graphResponse, err := ai.Retrieve(ctx, graphRetriever, ai.WithDocs(dRequest))
if err != nil { if err != nil {
log.Error().Msgf("graph Retrieve err.Error() %s", err.Error()) log.Error().Msgf("graph Retrieve err.Error() %s", err.Error())
...@@ -333,10 +344,7 @@ func main() { ...@@ -333,10 +344,7 @@ func main() {
log.Info().Msgf("promptInput.Graph : %s", promptInput.Graph) log.Info().Msgf("promptInput.Graph : %s", promptInput.Graph)
} }
fmt.Println("graph time", time.Since(begin).Seconds())
fmt.Println("graph time",time.Since(begin).Seconds())
resp, err := simpleQaPrompt.Execute(ctx, ai.WithInput(promptInput)) resp, err := simpleQaPrompt.Execute(ctx, ai.WithInput(promptInput))
...@@ -347,16 +355,44 @@ func main() { ...@@ -347,16 +355,44 @@ func main() {
}, nil }, nil
} }
if lastok {
if promptInput.Summary == ""{
promptInput.Summary = resp.Text()
}
qa.UpdateQAFields(context.Background(), idx, "", resp.Text()) log.Info().
Str("from",input.From).
Str("from_id",input.FromID).
Str("to",input.To).
Str("to_id",input.ToID).
Str("promptInput.Query",promptInput.Query).
Str("resp.Text()",resp.Text()).
Str("promptInput.Summary",promptInput.Summary).Msg("QueryRewriteWithSummary")
res, err := kc.QueryRewriteWithSummary(context.Background(), promptInput.Query, resp.Text(), promptInput.Summary)
if err != nil {
log.Error().Msg(err.Error())
} else {
qa.UpdateQAFields(context.Background(), idx, res.RewrittenQuery, resp.Text())
/*
{"RewrittenQuery":"Conversation summary: The available knowledge base does not contain information about the capital of the UK.","RawResponse":{"Response":{"Content":"Conversation summary: The available knowledge base does not contain information about the capital of the UK.","Usage":{"InputTokens":74,"OutputTokens":19,"TotalTokens":93},"RequestId":"15f1ce0c-a83f-4d95-af22-33a3bd829e8d"}}}
*/
}
} else {
qa.UpdateQAFields(context.Background(), idx, "", resp.Text())
}
log.Info(). log.Info().
Str("question",promptInput.Query). Str("from",input.From).
Str("context",promptInput.Context). Str("from_id",input.FromID).
Str("graph",promptInput.Graph). Str("to",input.To).
Str("last summary",promptInput.Summary). Str("to_id",input.ToID).
Str("question", promptInput.Query).
Str("context", promptInput.Context).
Str("graph", promptInput.Graph).
Str("last summary", promptInput.Summary).
Str("answer", resp.Text()). Str("answer", resp.Text()).
Msg("Question and answer pair recorded") Msg("Question and answer pair recorded")
...@@ -392,7 +428,6 @@ func main() { ...@@ -392,7 +428,6 @@ func main() {
} }
} }
type Response struct { type Response struct {
Data string `json:"data"` Data string `json:"data"`
Code int `json:"code"` Code int `json:"code"`
......
...@@ -220,27 +220,6 @@ func concatMessageParts(parts []*ai.Part) string { ...@@ -220,27 +220,6 @@ func concatMessageParts(parts []*ai.Part) string {
return result return result
} }
// package deepseek // package deepseek
// import ( // import (
......
...@@ -895,24 +895,6 @@ func (ds *docStore) Retrieve(ctx context.Context, req *ai.RetrieverRequest) (*ai ...@@ -895,24 +895,6 @@ func (ds *docStore) Retrieve(ctx context.Context, req *ai.RetrieverRequest) (*ai
}, nil }, nil
} }
// // Copyright 2025 Google LLC // // Copyright 2025 Google LLC
// // // //
// // Licensed under the Apache License, Version 2.0 (the "License"); // // Licensed under the Apache License, Version 2.0 (the "License");
......
...@@ -16,7 +16,6 @@ func main() { ...@@ -16,7 +16,6 @@ func main() {
// 请参见:https://cloud.tencent.com/document/product/1278/85305 // 请参见:https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 // 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
//os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF") //os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF")
//os.Setenv("TENCENTCLOUD_SECRET_KEY", "rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd") //os.Setenv("TENCENTCLOUD_SECRET_KEY", "rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd")
......
// // Copyright 2025
// //
// // Licensed under the Apache License, Version 2.0 (the "License");
// // you may not use this file except in compliance with the License.
// // You may obtain a copy of the License at
// //
// // http://www.apache.org/licenses/LICENSE-2.0
// //
// // Unless required by applicable law or agreed to in writing, software
// // distributed under the License is distributed on an "AS IS" BASIS,
// // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// // See the License for the specific language governing permissions and
// // limitations under the License.
// //
// // SPDX-License-Identifier: Apache-2.0
// package knowledge
// import (
// "context"
// "encoding/json"
// "fmt"
// "os"
// "strings"
// "sync"
// "github.com/rs/zerolog/log"
// "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
// "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
// "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
// lkeap "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lkeap/v20240522"
// )
// // ClientConfig holds configuration options for the Tencent Cloud LKEAP client.
// type ClientConfig struct {
// SecretID string // Tencent Cloud Secret ID
// SecretKey string // Tencent Cloud Secret Key
// Token string // Optional: Temporary token for authentication
// Endpoint string // API endpoint (default: lkeap.tencentcloudapi.com)
// Region string // Tencent Cloud region (optional)
// }
// // KnowledgeClient manages interactions with the Tencent Cloud LKEAP API.
// type KnowledgeClient struct {
// client *lkeap.Client
// config ClientConfig
// mu sync.Mutex
// initted bool
// }
// // NewKnowledgeClient creates a new KnowledgeClient with the given configuration.
// func NewKnowledgeClient(config ClientConfig) *KnowledgeClient {
// log.Info().
// Str("method", "NewKnowledgeClient").
// Str("endpoint", config.Endpoint).
// Str("region", config.Region).
// Str("secret_id", maskCredential(config.SecretID)).
// Str("token", maskCredential(config.Token)).
// Msg("Creating new KnowledgeClient")
// return &KnowledgeClient{
// config: config,
// }
// }
// // Init initializes the KnowledgeClient.
// func (kc *KnowledgeClient) Init(ctx context.Context) error {
// log.Info().Str("method", "KnowledgeClient.Init").Msg("Initializing KnowledgeClient")
// kc.mu.Lock()
// defer kc.mu.Unlock()
// if kc.initted {
// log.Error().Str("method", "KnowledgeClient.Init").Msg("Client already initialized")
// return fmt.Errorf("knowledge client already initialized")
// }
// // Load configuration from environment variables if not set
// if kc.config.SecretID == "" {
// kc.config.SecretID = os.Getenv("TENCENTCLOUD_SECRET_ID")
// }
// if kc.config.SecretKey == "" {
// kc.config.SecretKey = os.Getenv("TENCENTCLOUD_SECRET_KEY")
// }
// if kc.config.Token == "" {
// kc.config.Token = os.Getenv("TENCENTCLOUD_TOKEN")
// }
// if kc.config.Endpoint == "" {
// kc.config.Endpoint = "lkeap.tencentcloudapi.com"
// }
// if kc.config.Region == "" {
// kc.config.Region = "ap-guangzhou"
// }
// // Validate configuration
// if kc.config.SecretID == "" || kc.config.SecretKey == "" {
// log.Error().Str("method", "KnowledgeClient.Init").Msg("SecretID and SecretKey are required")
// return fmt.Errorf("knowledge: SecretID and SecretKey are required")
// }
// // Create credential
// var credential *common.Credential
// if kc.config.Token != "" {
// credential = common.NewTokenCredential(kc.config.SecretID, kc.config.SecretKey, kc.config.Token)
// log.Debug().Str("method", "KnowledgeClient.Init").Msg("Using temporary token credential")
// } else {
// credential = common.NewCredential(kc.config.SecretID, kc.config.SecretKey)
// log.Debug().Str("method", "KnowledgeClient.Init").Msg("Using standard credential")
// }
// // Create client profile
// cpf := profile.NewClientProfile()
// cpf.HttpProfile.Endpoint = kc.config.Endpoint
// // Initialize client
// client, err := lkeap.NewClient(credential, kc.config.Region, cpf)
// if err != nil {
// log.Error().
// Err(err).
// Str("method", "KnowledgeClient.Init").
// Msg("Failed to create LKEAP client")
// return err
// }
// kc.client = client
// kc.initted = true
// log.Info().Str("method", "KnowledgeClient.Init").Msg("Initialization successful")
// return nil
// }
// // QueryRewriteRequest defines the input for a query rewrite operation.
// type QueryRewriteRequest struct {
// Messages []*lkeap.Message // Multi-turn conversation history (up to 4 turns)
// Model string // Model name for query rewriting
// }
// // QueryRewriteResponse defines the output of a query rewrite operation.
// type QueryRewriteResponse struct {
// RewrittenQuery string // The rewritten query
// RawResponse *lkeap.QueryRewriteResponse
// }
// // QueryRewrite performs a query rewrite using the Tencent Cloud LKEAP API.
// func (kc *KnowledgeClient) QueryRewrite(ctx context.Context, req QueryRewriteRequest) (*QueryRewriteResponse, error) {
// log.Info().
// Str("method", "KnowledgeClient.QueryRewrite").
// Int("message_count", len(req.Messages)).
// Str("model", req.Model).
// Msg("Starting query rewrite operation")
// if !kc.initted {
// log.Error().Str("method", "KnowledgeClient.QueryRewrite").Msg("Client not initialized")
// return nil, fmt.Errorf("knowledge client not initialized; call Init first")
// }
// // Validate input
// if len(req.Messages) == 0 {
// log.Error().Str("method", "KnowledgeClient.QueryRewrite").Msg("At least one message is required")
// return nil, fmt.Errorf("at least one message is required")
// }
// if len(req.Messages) > 4 {
// log.Warn().
// Str("method", "KnowledgeClient.QueryRewrite").
// Int("message_count", len(req.Messages)).
// Msg("Message count exceeds 4, truncating to 4")
// req.Messages = req.Messages[:4]
// }
// for i, msg := range req.Messages {
// if msg.Role == nil || *msg.Role == "" {
// log.Error().
// Str("method", "KnowledgeClient.QueryRewrite").
// Int("index", i).
// Msg("Role is required in each message")
// return nil, fmt.Errorf("message at index %d missing role", i)
// }
// if *msg.Role != "user" && *msg.Role != "assistant" {
// log.Error().
// Str("method", "KnowledgeClient.QueryRewrite").
// Int("index", i).
// Str("role", *msg.Role).
// Msg("Invalid role; must be 'user' or 'assistant'")
// return nil, fmt.Errorf("invalid role '%s' at index %d", *msg.Role, i)
// }
// if msg.Content == nil || *msg.Content == "" {
// log.Error().
// Str("method", "KnowledgeClient.QueryRewrite").
// Int("index", i).
// Msg("Content is required in each message")
// return nil, fmt.Errorf("message at index %d missing content", i)
// }
// log.Debug().
// Str("method", "KnowledgeClient.QueryRewrite").
// Int("index", i).
// Str("role", *msg.Role).
// Str("content", *msg.Content).
// Msg("Validated message")
// }
// if req.Model == "" {
// log.Warn().Str("method", "KnowledgeClient.QueryRewrite").Msg("Model not specified, using default")
// req.Model = "lke-query-rewrite-base"
// }
// // Create Tencent Cloud request
// tencentReq := lkeap.NewQueryRewriteRequest()
// tencentReq.Messages = req.Messages
// if req.Model != "" {
// tencentReq.Model = common.StringPtr(req.Model)
// }
// // Debug request
// tencentReqAsJson, _ := json.Marshal(tencentReq)
// log.Debug().
// Str("method", "KnowledgeClient.QueryRewrite").
// Str("request_json", string(tencentReqAsJson)).
// Msg("Prepared Tencent Cloud request")
// // Perform request
// response, err := kc.client.QueryRewriteWithContext(ctx, tencentReq)
// if err != nil {
// if _, ok := err.(*errors.TencentCloudSDKError); ok {
// log.Error().
// Err(err).
// Str("method", "KnowledgeClient.QueryRewrite").
// Msg("Tencent Cloud API error")
// return nil, fmt.Errorf("tencent cloud api error: %w", err)
// }
// log.Error().
// Err(err).
// Str("method", "KnowledgeClient.QueryRewrite").
// Msg("Failed to perform query rewrite")
// return nil, fmt.Errorf("query rewrite failed: %w", err)
// }
// // Extract response fields
// var rewrittenQuery string
// var requestId string
// if response.Response.Content != nil {
// rewrittenQuery = *response.Response.Content
// }
// if response.Response.RequestId != nil {
// requestId = *response.Response.RequestId
// }
// result := &QueryRewriteResponse{
// RewrittenQuery: rewrittenQuery,
// RawResponse: response,
// }
// log.Info().
// Str("method", "KnowledgeClient.QueryRewrite").
// Str("rewritten_query", rewrittenQuery).
// Str("request_id", requestId).
// Interface("usage", response.Response.Usage).
// Str("raw_response", response.ToJsonString()).
// Msg("Query rewrite operation completed successfully")
// return result, nil
// }
// // QueryRewriteWithSummary wraps QueryRewrite to handle a user question, assistant answer, and history summary.
// func (kc *KnowledgeClient) QueryRewriteWithSummary(ctx context.Context, userQuestion, assistantAnswer, historySummary string) (*QueryRewriteResponse, error) {
// log.Info().
// Str("method", "KnowledgeClient.QueryRewriteWithSummary").
// Str("user_question", userQuestion).
// Str("assistant_answer", assistantAnswer).
// Str("history_summary", historySummary).
// Msg("Starting query rewrite with summary operation")
// if userQuestion == "" || assistantAnswer == "" {
// log.Error().Str("method", "KnowledgeClient.QueryRewriteWithSummary").Msg("User question and assistant answer are required")
// return nil, fmt.Errorf("user question and assistant answer are required")
// }
// // Construct messages
// messages := []*lkeap.Message{
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr(userQuestion),
// },
// {
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr(assistantAnswer),
// },
// }
// // Append history summary as an assistant message if provided
// if historySummary != "" {
// messages = append(messages, &lkeap.Message{
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr(fmt.Sprintf("Conversation summary: %s", historySummary)),
// })
// }
// // Create request
// req := QueryRewriteRequest{
// Messages: messages,
// Model: "lke-query-rewrite-base",
// }
// // Call QueryRewrite
// return kc.QueryRewrite(ctx, req)
// }
// // maskCredential masks sensitive credentials for logging
// func maskCredential(cred string) string {
// if len(cred) <= 8 {
// return strings.Repeat("*", len(cred))
// }
// return cred[:4] + strings.Repeat("*", len(cred)-8) + cred[len(cred)-4:]
// }
// Copyright 2025
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
package knowledge package knowledge
import ( import (
...@@ -570,9 +246,6 @@ func maskCredential(cred string) string { ...@@ -570,9 +246,6 @@ func maskCredential(cred string) string {
return cred[:4] + strings.Repeat("*", len(cred)-8) + cred[len(cred)-4:] return cred[:4] + strings.Repeat("*", len(cred)-8) + cred[len(cred)-4:]
} }
// QueryRewriteWithSummary wraps QueryRewrite to handle a user question, assistant answer, and history summary. // QueryRewriteWithSummary wraps QueryRewrite to handle a user question, assistant answer, and history summary.
func (kc *KnowledgeClient) QueryRewriteWithSummary(ctx context.Context, userQuestion, assistantAnswer, historySummary string) (*QueryRewriteResponse, error) { func (kc *KnowledgeClient) QueryRewriteWithSummary(ctx context.Context, userQuestion, assistantAnswer, historySummary string) (*QueryRewriteResponse, error) {
log.Info(). log.Info().
......
// // Copyright 2025
// //
// // Licensed under the Apache License, Version 2.0 (the "License");
// // you may not use this file except in compliance with the License.
// // You may obtain a copy of the License at
// //
// // http://www.apache.org/licenses/LICENSE-2.0
// //
// // Unless required by applicable law or agreed to in writing, software
// // distributed under the License is distributed on an "AS IS" BASIS,
// // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// // See the License for the specific language governing permissions and
// // limitations under the License.
// //
// // SPDX-License-Identifier: Apache-2.0
// package knowledge
// import (
// "context"
// "os"
// "testing"
// "github.com/rs/zerolog"
// "github.com/rs/zerolog/log"
// "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
// lkeap "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lkeap/v20240522"
// )
// func TestMain(m *testing.M) {
// // Configure zerolog for human-readable console output during tests
// zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
// log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
// // Run tests
// os.Exit(m.Run())
// }
// func TestKnowledgeClient_QueryRewrite(t *testing.T) {
// // Warning: Do not hardcode credentials in production code. Use environment variables or a secure vault.
// os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF")
// os.Setenv("TENCENTCLOUD_SECRET_KEY", "rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd")
// defer func() {
// os.Unsetenv("TENCENTCLOUD_SECRET_ID")
// os.Unsetenv("TENCENTCLOUD_SECRET_KEY")
// }()
// // Create client configuration
// config := ClientConfig{
// Endpoint: "lkeap.tencentcloudapi.com",
// Region: "ap-guangzhou",
// }
// // Initialize client
// client := NewKnowledgeClient(config)
// ctx := context.Background()
// // Test cases
// tests := []struct {
// name string
// messages []*lkeap.Message
// model string
// expectError bool
// }{
// {
// name: "CurlPayload",
// messages: []*lkeap.Message{
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr("你的家在哪里"),
// },
// {
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr("国内"),
// },
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr("国内哪里"),
// },
// },
// model: "lke-query-rewrite-base",
// expectError: true,
// },
// {
// name: "ValidMultiTurnConversation",
// messages: []*lkeap.Message{
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr("What is the capital of France?"),
// },
// {
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr("The capital of France is Paris."),
// },
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr("Tell me more about Paris."),
// },
// {
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr("Paris is known for its art, culture, and landmarks like the Eiffel Tower."),
// },
// },
// model: "",
// expectError: true,
// },
// {
// name: "EmptyMessages",
// messages: []*lkeap.Message{},
// model: "",
// expectError: true,
// },
// {
// name: "InvalidRole",
// messages: []*lkeap.Message{
// {
// Role: common.StringPtr("invalid-role"),
// Content: common.StringPtr("Test query"),
// },
// },
// model: "",
// expectError: true,
// },
// }
// for _, tt := range tests {
// t.Run(tt.name, func(t *testing.T) {
// // Initialize client for each test
// if err := client.Init(ctx); err != nil {
// t.Fatalf("Failed to initialize KnowledgeClient: %v", err)
// }
// // Perform query rewrite
// req := QueryRewriteRequest{
// Messages: tt.messages,
// Model: tt.model,
// }
// resp, err := client.QueryRewrite(ctx, req)
// // Check error expectation
// if tt.expectError {
// if err == nil {
// t.Error("Expected error, got none")
// } else {
// log.Debug().
// Str("method", "TestKnowledgeClient_QueryRewrite").
// Str("test_name", tt.name).
// Err(err).
// Msg("Received expected error")
// }
// return
// }
// // Check response
// if err != nil {
// t.Errorf("QueryRewrite failed: %v", err)
// }
// if resp.RewrittenQuery == "" {
// t.Error("Expected non-empty rewritten query")
// }
// log.Info().
// Str("method", "TestKnowledgeClient_QueryRewrite").
// Str("test_name", tt.name).
// Str("rewritten_query", resp.RewrittenQuery).
// Msg("Query rewrite successful")
// })
// }
// }
// func TestKnowledgeClient_QueryRewriteWithSummary(t *testing.T) {
// // Warning: Do not hardcode credentials in production code. Use environment variables or a secure vault.
// os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF")
// os.Setenv("TENCENTCLOUD_SECRET_KEY", "rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd")
// defer func() {
// os.Unsetenv("TENCENTCLOUD_SECRET_ID")
// os.Unsetenv("TENCENTCLOUD_SECRET_KEY")
// }()
// // Create client configuration
// config := ClientConfig{
// Endpoint: "lkeap.tencentcloudapi.com",
// Region: "ap-guangzhou",
// }
// // Initialize client
// client := NewKnowledgeClient(config)
// ctx := context.Background()
// // Test cases
// tests := []struct {
// name string
// userQuestion string
// assistantAnswer string
// historySummary string
// expectError bool
// }{
// {
// name: "ValidWithSummary",
// userQuestion: "你的家在哪里",
// assistantAnswer: "国内",
// historySummary: "User asked about location preferences earlier.",
// expectError: true, // Expect error due to potentially invalid credentials
// },
// {
// name: "ValidWithoutSummary",
// userQuestion: "你的家在哪里",
// assistantAnswer: "国内",
// historySummary: "",
// expectError: true,
// },
// {
// name: "EmptyQuestion",
// userQuestion: "",
// assistantAnswer: "国内",
// historySummary: "Summary",
// expectError: true,
// },
// {
// name: "EmptyAnswer",
// userQuestion: "你的家在哪里",
// assistantAnswer: "",
// historySummary: "Summary",
// expectError: true,
// },
// }
// for _, tt := range tests {
// t.Run(tt.name, func(t *testing.T) {
// // Initialize client for each test
// if err := client.Init(ctx); err != nil {
// t.Fatalf("Failed to initialize KnowledgeClient: %v", err)
// }
// // Perform query rewrite with summary
// resp, err := client.QueryRewriteWithSummary(ctx, tt.userQuestion, tt.assistantAnswer, tt.historySummary)
// // Check error expectation
// if tt.expectError {
// if err == nil {
// t.Error("Expected error, got none")
// } else {
// log.Debug().
// Str("method", "TestKnowledgeClient_QueryWithSummary").
// Str("test_name", tt.name).
// Str("error", err.Error()).
// Msg("Received expected error")
// }
// return
// }
// // Check response
// if err != nil {
// t.Errorf("QueryRewriteWithSummary failed: %v", err)
// }
// if resp.RewrittenQuery == "" {
// t.Error("Expected non-empty rewritten query")
// }
// log.Info().
// Str("method", "TestKnowledgeClient_QueryWithSummary").
// Str("test_name", tt.name).
// Str("rewritten_query", resp.RewrittenQuery).
// Msg("Query rewrite with summary successful")
// })
// }
// }
// Copyright 2025
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
package knowledge package knowledge
import ( import (
...@@ -350,46 +66,6 @@ func TestKnowledgeClient_QueryRewrite(t *testing.T) { ...@@ -350,46 +66,6 @@ func TestKnowledgeClient_QueryRewrite(t *testing.T) {
model: "lke-query-rewrite-base", model: "lke-query-rewrite-base",
expectError: true, // Expect error due to potentially invalid credentials expectError: true, // Expect error due to potentially invalid credentials
}, },
// {
// name: "ValidMultiTurnConversation",
// messages: []*lkeap.Message{
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr("What is the capital of France?"),
// },
// {
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr("The capital of France is Paris."),
// },
// {
// Role: common.StringPtr("user"),
// Content: common.StringPtr("Tell me more about Paris."),
// },
// {
// Role: common.StringPtr("assistant"),
// Content: common.StringPtr("Paris is known for its art, culture, and landmarks like the Eiffel Tower."),
// },
// },
// model: "",
// expectError: true,
// },
// {
// name: "EmptyMessages",
// messages: []*lkeap.Message{},
// model: "",
// expectError: true,
// },
// {
// name: "InvalidRole",
// messages: []*lkeap.Message{
// {
// Role: common.StringPtr("invalid-role"),
// Content: common.StringPtr("Test query"),
// },
// },
// model: "",
// expectError: true,
// },
} }
for _, tt := range tests { for _, tt := range tests {
...@@ -437,7 +113,6 @@ func TestKnowledgeClient_QueryRewrite(t *testing.T) { ...@@ -437,7 +113,6 @@ func TestKnowledgeClient_QueryRewrite(t *testing.T) {
} }
} }
func TestKnowledgeClient_QueryRewriteWithSummary(t *testing.T) { func TestKnowledgeClient_QueryRewriteWithSummary(t *testing.T) {
// Warning: Do not hardcode credentials in production code. Use environment variables or a secure vault. // Warning: Do not hardcode credentials in production code. Use environment variables or a secure vault.
os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF") os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF")
...@@ -469,7 +144,7 @@ func TestKnowledgeClient_QueryRewriteWithSummary(t *testing.T) { ...@@ -469,7 +144,7 @@ func TestKnowledgeClient_QueryRewriteWithSummary(t *testing.T) {
name: "ValidWithSummary", name: "ValidWithSummary",
userQuestion: "你的家在哪里", userQuestion: "你的家在哪里",
assistantAnswer: "国内", assistantAnswer: "国内",
historySummary: "User asked about location preferences earlier.", historySummary: "null", //"User asked about location preferences earlier.",
expectError: true, // Expect error due to potentially invalid credentials expectError: true, // Expect error due to potentially invalid credentials
}, },
} }
......
...@@ -271,7 +271,7 @@ func (m *Milvus) newDocStore(ctx context.Context, cfg *CollectionConfig) (*docSt ...@@ -271,7 +271,7 @@ func (m *Milvus) newDocStore(ctx context.Context, cfg *CollectionConfig) (*docSt
err = m.client.CreateIndex(ctx, cfg.Collection, vectorField, index, false) err = m.client.CreateIndex(ctx, cfg.Collection, vectorField, index, false)
if err != nil { if err != nil {
log.Error().Str("method", "Milvus.newDocStore").Str("collection", cfg.Collection).Msgf("Failed to create index: %s",err.Error()) log.Error().Str("method", "Milvus.newDocStore").Str("collection", cfg.Collection).Msgf("Failed to create index: %s", err.Error())
return nil, fmt.Errorf("failed to create index: %v", err) return nil, fmt.Errorf("failed to create index: %v", err)
} }
} }
...@@ -644,35 +644,6 @@ func (ds *docStore) Retrieve(ctx context.Context, req *ai.RetrieverRequest) (*ai ...@@ -644,35 +644,6 @@ func (ds *docStore) Retrieve(ctx context.Context, req *ai.RetrieverRequest) (*ai
}, nil }, nil
} }
// // Copyright 2025 Google LLC // // Copyright 2025 Google LLC
// // // //
// // Licensed under the Apache License, Version 2.0 (the "License"); // // Licensed under the Apache License, Version 2.0 (the "License");
......
...@@ -9,7 +9,6 @@ import ( ...@@ -9,7 +9,6 @@ import (
_ "github.com/lib/pq" _ "github.com/lib/pq"
) )
type QA struct { type QA struct {
ID int64 // 主键 ID int64 // 主键
CreatedAt time.Time // 创建时间 CreatedAt time.Time // 创建时间
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment