跳轉到

提示詞自動優化

此 API 用於使用指定的語言模型(model)和原始提示詞(prompt_id),自動產生優化後的提示內容。

系統將依據模型的回應特性和最佳實踐,自動優化語氣、結構和關鍵指令,並將結果儲存為新的 Prompt 版本。

curl -X 'POST' \
  'http://127.0.0.1:8000/v1/prompt/{prompt_id}/optimize/auto?model={model}' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your-api-key>'

Request Headers

Request Method POST
accept application/json
Authorization Bearer

Query Parameters

Field Type Note Required
prompt_id string 提示詞的唯一鍵,uuid true
model string 自訂優化 Prompt 的模型 false

Response Body

{
  "id": "6afecc03-ef73-4aa9-8ea6-88098047f3a2",
  "value": "Antibiotics are medications that target bacterial infections by either eliminating the bacteria or inhibiting their reproduction, but they are ineffective against viral infections and can lead to resistance if used improperly.",
  "name": "derived from dae76e24-ca4b-414f-92be-21abe36a70f7",
  "metadata": {
    "tag": [
      "medication",
      "antibiotics"
    ],
    "derived_from": "2cf86e6f-92a1-4525-8717-2ab149e66c2f"
  },
  "created_at": "2025-06-09T07:33:47.632198Z"
}

Field Explanation

回傳 「提示詞物件」章節內容。

在複製 Fileset 時,系統會自動於 metadata 中加入一筆 derived_from 欄位,記錄來源的提示詞,方便後續追蹤來源關係與管理版本差異。