-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Right now, vyb only supports fully replacing the content of a file that needs to be changed, but this is not cost efficient. It is also difficult to ensure the LLM will understand that, and oftentimes it will return only a diff following whatever diffing format it decides to use.
It would be better if the workspace_change_proposal schema supported diffs in a way that is unambiguous to the LLM.
Structured output feature is still recent for most LLM providers, and schema parsing capabilities vary from provider to provider, so the solution should avoid using any advanced json schema feature.
A possible implementation could be to for the change schema to look as follows (pseudo json schema code):
{
"file_name": string
"change": {
"start": string // last set of unique lines of the original file before the change should be applied. Empty if change starts at the beginning of the file, or if the change is replacing the entire file's content, or if this file should be deleted;
"content": string // the new content to be inserted in the file. Empty if this change is just removing content between "start" and "end", or if the file should be deleted;
"end": string // first set of unique lines of the original file after the change. Empty if the change should be appended at the end of the original file, or if the change is replacing the entire file's content, or if the file should be deleted;
}
}
This avoids using oneOf/anyOf keywords, while still supporting the following cases:
- file deletion: if all fields in the change object are empty;
- full content replacement: if start and end are empty;
- patch: if content is set, and at least one of start and/or end are set;
This change should be applied to all supported LLM providers.