统一分离提示备注长度限制
复用模型层的重做备注字符上限 导出提示文本清理函数供投影复用
This commit is contained in:
+2
-4
@@ -1,9 +1,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ts_rs::TS;
|
||||
|
||||
const MAX_PROMPT_NOTE_CHARS: usize = 512;
|
||||
|
||||
fn sanitize_prompt_text(value: &str) -> String {
|
||||
pub(crate) fn sanitize_prompt_text(value: &str) -> String {
|
||||
value
|
||||
.chars()
|
||||
.filter_map(|character| {
|
||||
@@ -15,7 +13,7 @@ fn sanitize_prompt_text(value: &str) -> String {
|
||||
Some(character)
|
||||
}
|
||||
})
|
||||
.take(MAX_PROMPT_NOTE_CHARS)
|
||||
.take(super::MAX_REWORK_NOTE_CHARS)
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user