From d7e011ad41e5fb8b8b02d211791d2ca5490e0dbe Mon Sep 17 00:00:00 2001 From: linsamtw Date: Mon, 1 Jun 2026 14:13:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(openapi):=20dataset=20=E6=94=B9=E8=87=AA?= =?UTF-8?q?=E7=94=B1=E5=AD=97=E4=B8=B2=EF=BC=8C=E8=A7=A3=E9=99=A4=20GPT=20?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E6=9F=A5=2017=20=E5=80=8B=20dataset=20?= =?UTF-8?q?=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 問題:chatgpt/openapi.yaml 的 queryDataset,dataset 參數寫死成只有 17 個的 enum。ChatGPT 把 enum 當白名單驗證,導致 Custom GPT 實際上只能查這 17 個, 但 FinMind 走 /api/v4/data 的 dataset 有 87 個(datasets.md 共 90,其中 3 個 走專屬 endpoint)。knowledge bundle 已完整列出 90 個含參數/層級,GPT「知道」 卻被 action 擋住。enum 是早期 17 MVP 的殘留,與已擴充到 90 的知識包 drift。 修正:移除 dataset 的 enum,改為自由字串(仍 required),描述指向 knowledge bundle、要求只用 bundle 列出的名稱。87 個 /data dataset 全可查、未來新增 dataset 不需再改 openapi。 註:MCP server 的 query_dataset 工具本來就是自由字串、無此限制,故此修正 僅動 chatgpt/openapi.yaml(GPT-only)。3 個專屬 endpoint dataset 仍未提供 對應 action,本次不在範圍。 驗證:openapi 解析通過(dataset 無 enum、type=string、required)、32 tests passed、build_instructions 7986/8000。 Co-Authored-By: Claude Opus 4.8 (1M context) --- chatgpt/openapi.yaml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/chatgpt/openapi.yaml b/chatgpt/openapi.yaml index ceeb370..6113c72 100644 --- a/chatgpt/openapi.yaml +++ b/chatgpt/openapi.yaml @@ -17,27 +17,13 @@ paths: - name: dataset in: query required: true - description: Dataset 名稱(見 enum) + description: >- + FinMind dataset 名稱(例如 TaiwanStockPrice、TaiwanStockMonthRevenue、 + TaiwanFuturesDaily)。FinMind 支援約 90 個走本通用端點的 dataset; + 完整清單與每個 dataset 的必填參數、會員層級,請參考已上傳的 + knowledge bundle,並只使用其中列出的名稱,不要自行編造。 schema: type: string - enum: - - TaiwanStockPrice - - TaiwanStockMonthRevenue - - TaiwanStockFinancialStatements - - TaiwanStockDividend - - TaiwanStockDividendResult - - TaiwanStockInstitutionalInvestorsBuySell - - TaiwanStockShareholding - - TaiwanStockMarginPurchaseShortSale - - TaiwanStockPER - - TaiwanFuturesDaily - - TaiwanOptionDaily - - TaiwanFuturesInstitutionalInvestors - - TaiwanExchangeRate - - InterestRate - - GoldPrice - - USStockPrice - - TaiwanStockInfo - name: data_id in: query required: false