安裝
用戶端設定
工具執行
execute_tool
以別名執行 MCP 工具。
回傳: 工具執行結果(型別依工具而定)。
例外:
DatagenAuthError、DatagenToolError、DatagenHttpError
自訂工具部署
deploy_custom_tool
將 Python 工作流程部署為 API 端點。
回傳: 含
deployment_uuid 與部署細節的 Dict。
例外: DatagenDeploymentError
update_custom_tool
更新既有的自訂工具。只會更新有提供的欄位。
回傳: 含更新後部署細節的
Dict。
例外: DatagenDeploymentError
get_custom_tool
取得自訂工具的細節。
list_custom_tools
列出所有自訂工具。
自訂工具執行
run_custom_tool
以同步方式執行自訂工具(會等待執行完成)。
回傳: 含
run_uuid、status 與 output_vars 的 Dict。
例外: DatagenDeploymentError
run_custom_tool_async
以非同步方式執行自訂工具(立即回傳)。
run_custom_tool 相同。
回傳: 含 run_uuid 與 status: "pending" 的 Dict。
例外: DatagenDeploymentError
check_run_status
檢查自訂工具執行的狀態。
run_uuid 與 status("pending"、"running"、"completed" 或 "failed")的 Dict。
get_run
取得自訂工具執行的完整細節,包含輸出。
output_vars)的 Dict。
wait_for_run
持續輪詢,直到非同步執行完成或失敗。
回傳: 含
output_vars 的最終執行結果。
例外: 執行失敗或逾時時拋出 DatagenDeploymentError。
Secret 管理
list_secrets
列出所有 secret(不會回傳值)。
name、masked_value、provider 等)。
set_secret
建立或更新 secret。
例外: secret 已存在且
force=False 時拋出 DatagenSecretError。
錯誤類型
所有例外都繼承自DatagenError。