健康檢查端點
curl http://localhost:8000/health
獲取提示快取狀態
curl http://localhost:8000/cache/status
強制更新提示快取(從 Google Doc 重新載入)
curl -X POST http://localhost:8000/cache/update
獲取快取內容預覽(前 500 字元)
curl http://localhost:8000/cache/content
下載關鍵字搜尋結果檔案 (keyword.txt)
keywords - 關鍵字列表,用逗號分隔 (必填)curl "http://localhost:8000/download/keywords?keywords=僑委會,日本,華商總會" -o keywords.txt
curl "http://localhost:8000/download/keywords?keywords=泰國,中國華文學校,華文教育團體" -o keywords.txt
注意: 系統會根據關鍵字自動生成對應的檔案供下載
通過 URL 參數查詢問題
q - 問題 (必填)user - 用戶識別 (選填)model - 模型名稱 (選填)topk - 返回結果數量 (選填)provider - 模型提供者 (選填)additional-prompt - 額外提示 (選填)curl "http://localhost:8000/query?q=請問僑委會對於友我「日本華商總會」歷年來辦理活動置入中國元素之掌握?"
通過 JSON 請求體查詢問題
{
"question": "您的問題",
"user": "用戶識別",
"model": "meta-llama/llama-4-maverick",
"topk": 10,
"provider": "openrouter",
"additionalPrompt": "請特別注意時間順序"
}
範例:
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{"question": "請問僑委會對於友我「日本華商總會」歷年來辦理活動置入中國元素之掌握?"}'
{
"question": "使用者問題",
"answer": "生成的答案",
"metadata": {
"processingTime": {
"total": 1234.56,
"keywords": 123.45,
"search": 234.56,
"answer": 876.55
},
"keywords": ["關鍵字1", "關鍵字2"],
"resultsCount": 10,
"confidence": 85,
"timestamp": "2024-01-01T12:00:00.000Z"
}
}