Repository navigation
feat: 新增 get_pricing tool 與方案價格知識包,修正失效的升級連結 - #24
Merged
Merged
Conversation
AI 透過 MCP/Custom GPT 被問到 FinMind 價格時沒有任何資料可答; 且 402/429 錯誤訊息的升級連結 #/account/pricing 在官網不存在。 修改檔案: - knowledge/pricing.md(新增):四個方案月繳/年繳(TWD)、API 上限、 資料集數、付款與升級規則、各方案新增重點、授權規則、購買連結 https://finmindtrade.com/analysis/#/Sponsor/sponsor - src/finmind_mcp/tools.py:新增第 5 個 tool get_pricing(讀 pricing.md); dispatch 讓離線 tool(list_datasets、get_pricing)在建立 client 前處理, 沒有 FINMIND_TOKEN 也能查價格與 dataset 清單 - src/finmind_mcp/knowledge.py:註冊 finmind://pricing resource; fallback 模板升級連結改為 #/Sponsor/sponsor - knowledge/errors.md:402/429 升級連結改為 #/Sponsor/sponsor; Free 上限改為 300(註冊帶 token 600);429 觸發條件刪除重複的上限清單 (GPT instructions 8000 字上限,現 7942) - knowledge/datasets.md:Tier 說明加指向 pricing.md/get_pricing - chatgpt/build_instructions.py:knowledge_bundle.md 附上 pricing.md - skills/finmind/SKILL.md、docs/spec.md、docs/mcp-original-readme.md:tool 清單加 get_pricing - src/finmind_mcp/server.py、smoke.py:tool 數 4 → 5 - tests/test_tools.py:tool 清單改 5 個;新增 get_pricing、無 token 離線 tool 測試; 402 測試改驗新連結 - tests/test_knowledge.py:新增 pricing resource 可讀、知識包無失效連結測試 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
https://finmindtrade.com/analysis/#/account/pricing在官網路由不存在,正確的是#/Sponsor/sponsor。修改
knowledge/pricing.md:四個方案的月繳/年繳(TWD)、API 上限、付款與升級規則、各方案新增重點、授權規則。內容與 FinMind-Doc #220 的價格頁一致。get_pricing:讀pricing.md,不需連線、不需 token。同一份檔案也註冊成finmind://pricingresource。dispatch讓list_datasets、get_pricing在建立 client 之前就處理。原本沒設FINMIND_TOKEN時,連 dataset 清單都會回授權錯誤。errors.md和knowledge.py的 fallback 模板改成#/Sponsor/sponsor。errors.md:Free 上限改為「300(註冊帶 token 600)」;刪掉 429 觸發條件裡重複的上限清單,讓 GPT instructions 回到 8,000 字以內(現 7,942)。knowledge_bundle.md附上pricing.md。get_pricing;smoke 改成 5 個 tool。驗證
pytest:36 passed(新增 get_pricing、無 token 離線 tool、pricing resource、知識包無失效連結等測試)smoke.py:SMOKE OK,列出 5 個 toolbuild_instructions.py:7,942/8,000;bundle 已含價格,instructions 與 bundle 都沒有account/pricingmerge 後
get_pricing