İçeriğe geç
Tüm araçlar

recipe_save

Beceriler ve tarifler · macOS · Windows

Etki: yazma. Durum: koşullu kullanılabilir.

“Koşullu kullanılabilirlik”, aracın sürüme, platforma, izinlere, hesaba veya yapılandırmaya bağlı olabileceğini belirtir. Her kurulumda etkin olduğu anlamına gelmez.

macOS

Amaç

Yeniden kullanılabilir bir SKILL'i, yani adlandırılmış bir tarifi (parametreli, sıralı bir LMCP araç çağrıları dizisi), bu Mac'e kaydeder; böylece kullanıcı onu istediği zaman recipe_run ile yeniden çalıştırabilir. Bir kullanıcı bunu, tekrarladığı çok adımlı bir LMCP iş akışını (sabah özeti, gelen kutusu ayıklama, haftalık rapor, veri çekme) tek bir yeniden kullanılabilir komuta çevirmek için kaydeder. Kaydedilen skill'ler recipe_export ile başkalarıyla paylaşılabilir. Manifest bir name ve boş olmayan bir steps dizisi içermelidir. Bir adım kendi kendini onaylayamaz: bir adımın args içindeki `confirm` kaydederken kaldırılır (confirm_removed_steps kaç adımda olduğunu söyler) ve çalıştırırken yok sayılır, bu yüzden aracı onay isteyen bir adım yürütmek yerine önizlemesiyle yanıt verir. Zaten bir tarif olan bir ad recipe_exists ile reddedilir ve hiçbir şey yazılmaz; değiştirmek için overwrite: true iletin. {name} döndürür.

Zorunlu girdiler

Girdi adları aracın istediği biçimde aynen korunur. İngilizce kanonik teknik tanımlar aşağıdaki açılır şemadadır.

İzinler ve onay

Şema açık bir onay parametresi bildirmez. Bu, izinsiz işlem yapma yetkisi vermez; etkiyi inceleyin ve yetki alın.

İngilizce kanonik teknik şema — macOS
{
  "properties": {
    "manifest": {
      "description": "The recipe manifest. Shape: {\"name\": string (required), \"description\": string, \"params\": [{\"name\": string, \"type\": \"string\"|\"int\"|\"bool\", \"default\": any}], \"steps\": [ ... ] (required, non-empty), \"outputs\": [{\"kind\": string}]}. A step is EITHER a tool call {\"tool\": <tool_name>, \"args\": {...}} OR a pause {\"wait\": {\"seconds\": N}} (also {\"wait\": N}). A tool-call step may add \"optional\": true (a boolean; default false): if it fails, recipe_run records {ok:false, error} for it, lists it in skipped_optional and carries on with the next step, instead of stopping — use it for a source the user may not have (an app, a permission). Any arg string may interpolate a declared param with ${name} (e.g. \"limit\": \"${count}\"); an arg that is exactly \"${name}\" keeps the param's type. Steps run in order; a later step can consume an EARLIER step's output with \"${steps[N].result.KEY}\" (0-based; supports .key and [i], e.g. \"account\": \"${steps[0].result.accounts[0].name}\"). A step cannot confirm itself: do not put `confirm` in a step's args (it is removed when saving and ignored when running). recipe_run asks for one confirmation when the recipe has state-changing steps; a step whose tool asks for its own confirmation then answers with its preview and is not executed. A step that names a note should give note_name (the note's title): a note_id only names the note on the Mac that issued it, so a step that gives both is saved with note_name alone.",
      "type": "object"
    },
    "overwrite": {
      "description": "Must be true to replace a recipe that already has this name. Without it, a taken name is refused with recipe_exists and the existing recipe is left as it was.",
      "type": "boolean"
    }
  },
  "required": [
    "manifest"
  ],
  "type": "object"
}

Belge örneği

recipe_save için örnek belge. Bu örneği çalıştırmayın. Gösterilen bağımsız değişkenler kurgusal bir veri kümesine aittir; gerçek bir çağrıdan önce gerçek tanıtıcıları bulun ve izin alın.

{
  "manifest": {
    "description": "Read the local date and time.",
    "name": "Demo morning brief",
    "steps": [
      {
        "args": {},
        "tool": "get_datetime"
      }
    ]
  }
}

Windows

Amaç

Yeniden kullanılabilir bir SKILL'i, yani adlandırılmış bir tarifi (parametreli, sıralı bir LMCP araç çağrıları dizisi), bu makineye kaydeder; böylece kullanıcı onu istediği zaman recipe_run ile yeniden çalıştırabilir. Bir kullanıcı bunu, tekrarladığı çok adımlı bir LMCP iş akışını (sabah özeti, gelen kutusu ayıklama, haftalık rapor, veri çekme) tek bir yeniden kullanılabilir komuta çevirmek için kaydeder. Manifest bir name ve boş olmayan bir steps dizisi içermelidir. Bir adım "optional": true ekleyebilir (boolean; varsayılan false): başarısız olursa recipe_run onun için {ok:false, error} kaydeder, skipped_optional içinde listeler ve durmak yerine sonraki adımla sürer; kullanıcının sahip olmayabileceği bir kaynak (bir uygulama, bir izin) için kullanın. Bir bağımsız değişken dizesi, bildirilmiş bir param'ı ${name} ile ekleyebilir; tam olarak "${name}" olan bir bağımsız değişken param'ın türünü korur. Sonraki bir adım, önceki bir adımın çıktısını "${steps[N].result.KEY}" ile kullanabilir (0 tabanlı; .key ve [i] desteklenir). Bir adım kendi kendini onaylayamaz: bir adımın args içindeki confirm kaldırılır, bu yüzden aracı onay isteyen bir adım (göndermek, silmek, bir dosyayı değiştirmek, bir komut çalıştırmak için) önizlemesini döndürür. Zaten bir tarif olan bir ad recipe_exists ile reddedilir ve hiçbir şey yazılmaz; değiştirmek için overwrite: true iletin. {name, step_count} döndürür.

Zorunlu girdiler

Girdi adları aracın istediği biçimde aynen korunur. İngilizce kanonik teknik tanımlar aşağıdaki açılır şemadadır.

İzinler ve onay

Şema açık bir onay parametresi bildirmez. Bu, izinsiz işlem yapma yetkisi vermez; etkiyi inceleyin ve yetki alın.

İngilizce kanonik teknik şema — Windows
{
  "properties": {
    "manifest": {
      "description": "The recipe manifest. Shape: {\"name\": string (required), \"description\": string, \"schema_version\": int, \"params\": [{\"name\": string, \"type\": string, \"default\": any}], \"steps\": [{\"tool\": string, \"args\": object, \"optional\": bool}] (required, non-empty)}.",
      "type": "object"
    },
    "overwrite": {
      "description": "Must be true to replace a recipe that already has this name. Without it, a taken name is refused with recipe_exists and the existing recipe is left as it was.",
      "type": "boolean"
    }
  },
  "required": [
    "manifest"
  ],
  "type": "object"
}

Belge örneği

recipe_save için örnek belge. Bu örneği çalıştırmayın. Gösterilen bağımsız değişkenler kurgusal bir veri kümesine aittir; gerçek bir çağrıdan önce gerçek tanıtıcıları bulun ve izin alın.

{
  "manifest": {
    "description": "Read the local date and time.",
    "name": "Demo morning brief",
    "steps": [
      {
        "args": {},
        "tool": "get_datetime"
      }
    ]
  }
}