chat: PartialEq on ConversationEntry for proper diff
Add PartialEq to Message, FunctionCall, ToolCall, ContentPart, ImageUrl, MessageContent, ConversationEntry. Sync now compares entries directly instead of content lengths. Phase 1 pops mismatched tail entries using PartialEq comparison. Phase 2 pushes new entries with clone into last_entries buffer. TODO: route_entry needs to handle multiple tool calls per entry. Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ca9f2b2b9a
commit
222b2cbeb2
3 changed files with 64 additions and 74 deletions
|
|
@ -149,7 +149,7 @@ pub fn is_stream_error(err: &anyhow::Error) -> bool {
|
|||
|
||||
/// Conversation entry — either a regular message or memory content.
|
||||
/// Memory entries preserve the original message for KV cache round-tripping.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum ConversationEntry {
|
||||
Message(Message),
|
||||
Memory { key: String, message: Message },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue