assistant2: More improvement to prompt building efficiency (#22941)
Release Notes: - N/A
This commit is contained in:
parent
ec4c6744d6
commit
0d6a549950
2 changed files with 54 additions and 35 deletions
|
@ -462,13 +462,12 @@ fn to_fenced_codeblock(path: &Path, content: Rope) -> SharedString {
|
|||
|
||||
buffer.push_str("```\n");
|
||||
|
||||
if buffer.len() > capacity {
|
||||
log::error!(
|
||||
"to_fenced_codeblock calculated capacity {} but length was {}",
|
||||
capacity,
|
||||
buffer.len()
|
||||
);
|
||||
}
|
||||
debug_assert!(
|
||||
buffer.len() == capacity - 1 || buffer.len() == capacity,
|
||||
"to_fenced_codeblock calculated capacity of {}, but length was {}",
|
||||
capacity,
|
||||
buffer.len(),
|
||||
);
|
||||
|
||||
buffer.into()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue