[
  {
    "type": "function",
    "function": {
      "name": "upload_reference",
      "description": "上传 Agent 可读取的本地 PNG/JPEG 至 Llmer 管理的 MinIO，自动申请授权、直传、完成校验；返回 ready 资产 id、sha256、expires_at。无需用户提供 OSS 地址或 MinIO 凭据，不生成视频。 429 按 Retry-After 自动等待，缺失时等 60 秒；单步骤最多尝试 5 次。超过等待上限或重试次数时报错，不提交生成。",
      "parameters": {
        "type": "object",
        "properties": {
          "local_path": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "local_path"
        ],
        "additionalProperties": false
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "prepare_h3",
      "description": "从本地首帧/尾帧或 1–4 张有序参考图自动上传至 MinIO，返回待提交的 H3 请求对象；不生成、不自动提交。first/last 与 references 互斥；默认 8 步 768P、5 秒；1080P 为超分。已有 asset ID 可直接构造 submit_once 的 body，无需重复上传。 429 按 Retry-After 自动等待，缺失时等 60 秒；单步骤最多尝试 5 次。超过等待上限或重试次数时报错，不提交生成。",
      "parameters": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1
          },
          "first": {
            "type": "string",
            "minLength": 1
          },
          "last": {
            "type": "string",
            "minLength": 1
          },
          "references": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1,
            "maxItems": 4
          },
          "resolution": {
            "type": "string",
            "enum": [
              "480P",
              "768P",
              "1080P"
            ],
            "default": "768P"
          }
        },
        "required": [
          "prompt"
        ],
        "additionalProperties": false
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "submit_once",
      "description": "按用户已授权的生成意图提交 prepare_h3 返回的 body，创建计费视频任务；receipt 为本地尚不存在的凭据文件。返回任务 id。超时或未取得 id 时先核对记录，不自动重发。此工具只提供 5 秒、8 步的 H3 示例配方。 包括 429、503 和超时在内，任何错误均不自动重发；保留 receipt 并核对任务记录。",
      "parameters": {
        "type": "object",
        "properties": {
          "body": {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "enum": [
                  "minimax-h3-local/image-to-video",
                  "minimax-h3-local/text-to-video"
                ]
              },
              "prompt": {
                "type": "string",
                "minLength": 1
              },
              "seconds": {
                "type": "integer",
                "enum": [
                  5
                ]
              },
              "steps": {
                "type": "integer",
                "enum": [
                  8
                ]
              },
              "resolution": {
                "type": "string",
                "enum": [
                  "480P",
                  "768P",
                  "1080P"
                ]
              },
              "first_frame_asset_id": {
                "type": "string",
                "minLength": 1
              },
              "last_frame_asset_id": {
                "type": "string",
                "minLength": 1
              },
              "reference_asset_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1,
                "maxItems": 4
              }
            },
            "required": [
              "model",
              "prompt",
              "seconds",
              "steps",
              "resolution"
            ],
            "additionalProperties": false
          },
          "receipt": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "body",
          "receipt"
        ],
        "additionalProperties": false
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "get_video_status",
      "description": "查询已有视频任务状态；直到 completed 或 failed。查询不创建任务。 429 按 Retry-After 自动等待，缺失时等 60 秒；单步骤最多尝试 5 次。超过等待上限或重试次数时报错，不提交生成。",
      "parameters": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "task_id"
        ],
        "additionalProperties": false
      }
    }
  },
  {
    "type": "function",
    "function": {
      "name": "download",
      "description": "下载已有任务 artifact 到 Agent 本地 output，自动获取 MinIO 短期授权并断点续传；返回本地路径、字节数、SHA-256。默认 artifact=video；图片 key 从 GET /v1/tasks/{id}/artifacts 获取。遇 publishing 稍后重试下载，不重新生成。 429 按 Retry-After 自动等待，缺失时等 60 秒；下载授权及媒体读取分别有限重试，单步骤最多 5 次。失败保留断点，仅重试同一结果，绝不提交生成。",
      "parameters": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1
          },
          "output": {
            "type": "string",
            "minLength": 1
          },
          "artifact": {
            "type": "string",
            "default": "video",
            "minLength": 1
          }
        },
        "required": [
          "task_id",
          "output"
        ],
        "additionalProperties": false
      }
    }
  }
]
