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

Function apply_edit

skillopt/optimizer/skill.py:148–162  ·  view source on GitHub ↗

Apply a single edit operation to the skill document. Parameters ---------- skill : str Current skill document content. edit : Edit | dict An :class:`~skillopt.types.Edit` instance or a plain dict with keys ``op``, ``content``, ``target``. Edits targeting

(skill: str, edit: EditType | dict)

Source from the content-addressed store, hash-verified

146
147
148def apply_edit(skill: str, edit: EditType | dict) -> str:
149 """Apply a single edit operation to the skill document.
150
151 Parameters
152 ----------
153 skill : str
154 Current skill document content.
155 edit : Edit | dict
156 An :class:`~skillopt.types.Edit` instance or a plain dict with
157 keys ``op``, ``content``, ``target``.
158
159 Edits targeting the protected slow-update region are silently skipped.
160 """
161 updated_skill, _ = _apply_edit_with_report(skill, edit)
162 return updated_skill
163
164
165def apply_patch_with_report(

Callers

nothing calls this directly

Calls 1

_apply_edit_with_reportFunction · 0.85

Tested by

no test coverage detected