MCPcopy Create free account
hub / github.com/microsoft/SkillOpt / apply_patch

Function apply_patch

skillopt/optimizer/skill.py:189–201  ·  view source on GitHub ↗

Apply a patch (list of edits) to the skill document sequentially. Parameters ---------- skill : str Current skill document content. patch : Patch | dict A :class:`~skillopt.types.Patch` instance or a plain dict with key ``edits`` containing a list of edit ope

(skill: str, patch: PatchType | dict)

Source from the content-addressed store, hash-verified

187
188
189def apply_patch(skill: str, patch: PatchType | dict) -> str:
190 """Apply a patch (list of edits) to the skill document sequentially.
191
192 Parameters
193 ----------
194 skill : str
195 Current skill document content.
196 patch : Patch | dict
197 A :class:`~skillopt.types.Patch` instance or a plain dict with
198 key ``edits`` containing a list of edit operations.
199 """
200 updated_skill, _ = apply_patch_with_report(skill, patch)
201 return updated_skill

Callers

nothing calls this directly

Calls 1

apply_patch_with_reportFunction · 0.85

Tested by

no test coverage detected