Python type plugin, 是針對比較複雜需求而設計, 例如您希望plugin可以先去arxiv, github 查詢最新的資訊, 再來請DaVinci幫忙摘要,或是希望plugin 可以使用自己設計的程式運算, python plugin 會先運行您提供的python code, 之後再丟給DaVinci 進行回答.
Python Type Plugin example:
{ "id": "ScholarChat", "schema_version": "v2.0", "name_for_human": "ScholarChat", "name_for_model": "ScholarChat", "description_for_human": "ScholarChat", "description_for_model": "You can reach out to this tool to seach for any acadamically related information on the web.", "auth": { "type": "none" }, "api": { "type": "python", "python": { "source": "import json\nimport asyncio\nimport re\nfrom pyodide.http import pyfetch\nimport xml.etree.ElementTree as ET\nfrom urllib.parse ...{python code here}" } } }
可以發現 在api 部分, 跟OpenAPI Type 的內容不同, type 是 python, source的部分則是您設計的python 代碼.