MCPcopy Create free account
hub / github.com/OpenBMB/ChatDev / _build_single_edit

Function _build_single_edit

functions/function_calling/file.py:937–948  ·  view source on GitHub ↗
(
    start_line: int,
    end_line: Optional[int],
    replacement: Optional[str],
)

Source from the content-addressed store, hash-verified

935
936
937def _build_single_edit(
938 start_line: int,
939 end_line: Optional[int],
940 replacement: Optional[str],
941) -> List[Mapping[str, Any]]:
942 effective_end = end_line if end_line is not None else start_line
943 payload = {
944 "start_line": start_line,
945 "end_line": effective_end,
946 "replacement": replacement if replacement is not None else "",
947 }
948 return [payload]
949
950
951def _validate_edit_ranges(edits: Sequence[TextEdit]) -> None:

Callers 1

apply_text_editsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected