feat: 接入FastGPT知识库RAG检索,AI回答前先查医学资料
- 新增 FastGptKnowledgeClient:调用 searchTest 接口检索知识库 - ai_chat_endpoints: 调 DeepSeek 之前先检索,把相关片段拼到 system prompt - 5个智能体(default/consultation/diet/report/unified)启用 RAG - 3个纯工具调用智能体(health/medication/exercise)保持原样 - .env: 新增 FastGPT 配置(API Key、datasetId、相似度等) - api_client: 更新默认 baseUrl 适配新网络环境
This commit is contained in:
@@ -162,6 +162,12 @@ builder.Services.AddHttpClient<VisionClient>(client =>
|
||||
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", builder.Configuration["VLM_API_KEY"] ?? "");
|
||||
client.Timeout = TimeSpan.FromSeconds(120);
|
||||
});
|
||||
builder.Services.AddHttpClient<FastGptKnowledgeClient>(client =>
|
||||
{
|
||||
client.BaseAddress = new Uri((builder.Configuration["FASTGPT_BASE_URL"] ?? "https://cloud.fastgpt.cn/api").TrimEnd('/') + "/");
|
||||
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", builder.Configuration["FASTGPT_API_KEY"] ?? "");
|
||||
client.Timeout = TimeSpan.FromSeconds(15);
|
||||
});
|
||||
|
||||
// ---- 后台服务 ----
|
||||
builder.Services.AddHostedService<MedicationReminderService>();
|
||||
|
||||
Reference in New Issue
Block a user