...
OpenAPI Type 的Plugin,使用符合OpenAPI 格式的yaml檔,只要在 Plugin 中,指定你的yaml 的位置,DaVinci 會去這個 url 下載 yaml 檔案,並且依照裡面的 API format 進行 API 的資訊檢索,OpenAPI Type Plugin example:
程式碼區塊 | ||
---|---|---|
| ||
{ "id": "Weather_API", "schema_version": "v1", "name_for_human": "Weather_API", "name_for_model": "Weather_API", "description_for_human": "Weather_API", "description_for_model": "當你需要查詢未來天氣的相關資料, 請使用這個API, 並且整理相關資訊以表格輸出", "api": { "type": "openapi", "url": "https://example.com/weather.yaml" } } |
...
根據氣象資料開放平台的API範例,將各 API 的 url 以及參數,轉換成 yaml 檔案,並且存放到您的伺服器中。
plugin json 檔裡面,修改這兩個地方:
程式碼區塊 | ||
---|---|---|
| ||
"api": { "type": "openapi", "url": "https://example.com/weather.yaml" } |
即可完成Plugin 的製作
註記:為了運作穩定,目前 OpenAPI Plugin 只能運作在 GPT4-Turbo 上,無法在其他 Model 上使用。
OpenAPI Plugin 如何撈取 user_id?
您可以在 Server 端獲得來自 MediaTek DaVinci 發出的 request 之後,從 header 拿到 “Davinci-Cookie”,並透過 userinfo 的 api 撈取到 user_id。
...
註記:openapi plugin 目前僅能在 gpt-4o 的模型做使用。