pub struct FocusExtractor;Expand description
AI 聚焦点提取器
负责:
- 从对话历史中提取聚焦点
- 判断用户输入属于哪个聚焦点
- 创建新聚焦点
- 更新聚焦点状态
Implementations§
Source§impl FocusExtractor
impl FocusExtractor
Sourcepub fn extract_from_memory(memory: &MemoryEntry) -> Option<FocusPoint>
pub fn extract_from_memory(memory: &MemoryEntry) -> Option<FocusPoint>
从记忆条目中提取聚焦点
AI 在提取记忆时,同时提取聚焦点信息
Sourcepub fn create_extraction_prompt(messages: &[Message]) -> String
pub fn create_extraction_prompt(messages: &[Message]) -> String
从对话历史提取聚焦点(AI 分析)
返回 JSON 格式的聚焦点信息,供 AI 模型解析
Sourcepub fn create_classification_prompt(
user_input: &str,
existing_foci: &[FocusPoint],
) -> String
pub fn create_classification_prompt( user_input: &str, existing_foci: &[FocusPoint], ) -> String
从用户输入判断聚焦点归属
Sourcepub fn parse_focus_response(response: &str) -> Result<Vec<FocusPoint>, String>
pub fn parse_focus_response(response: &str) -> Result<Vec<FocusPoint>, String>
解析 AI 返回的聚焦点 JSON
Sourcepub fn parse_classification_response(
response: &str,
) -> Result<ClassificationResult, String>
pub fn parse_classification_response( response: &str, ) -> Result<ClassificationResult, String>
解析分类响应
Auto Trait Implementations§
impl Freeze for FocusExtractor
impl RefUnwindSafe for FocusExtractor
impl Send for FocusExtractor
impl Sync for FocusExtractor
impl Unpin for FocusExtractor
impl UnsafeUnpin for FocusExtractor
impl UnwindSafe for FocusExtractor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more