Render whole-file patches from change metadata
This commit is contained in:
1 parent
06bf1c8f81
commit
3d1b1e304d
4 files changed
+57
-18
No files matched your search
@@ -470,6 +470,18 @@ pub(super) fn patch_start(id: String, diff: String) -> Event {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn prefixed_lines(prefix: char, text: &str) -> String {
|
||||
text.split_inclusive('\n')
|
||||
.map(|line| {
|
||||
if line.ends_with('\n') {
|
||||
format!("{prefix}{line}")
|
||||
} else {
|
||||
format!("{prefix}{line}\n")
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// How much the model was holding, from the three figures a turn reports:
|
||||
/// the input side only, prompt plus both cache figures. A cached token is
|
||||
/// cheaper but it is still one the model was given; output is what the turn
|
||||
|
||||
Reference in new issue
Block a user