forked from kent/consciousness
WIP: Rename context_new → context, delete old files, fix UI layer
Renamed context_new.rs to context.rs, deleted context_old.rs, types.rs, openai.rs, parsing.rs. Updated all imports. Rewrote user/context.rs and user/widgets.rs for new types. Stubbed working_stack tool. Killed tokenize_conv_entry. Remaining: mind/mod.rs, mind/dmn.rs, learn.rs, chat.rs, subconscious.rs, oneshot.rs. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
22146156d4
commit
bf3e2a9b73
9 changed files with 1063 additions and 1636 deletions
|
|
@ -75,15 +75,3 @@ pub fn is_initialized() -> bool {
|
|||
TOKENIZER.get().is_some()
|
||||
}
|
||||
|
||||
/// Tokenize a ConversationEntry with its role and content.
|
||||
pub fn tokenize_conv_entry(entry: &super::context::ConversationEntry) -> Vec<u32> {
|
||||
use super::context::ConversationEntry;
|
||||
match entry {
|
||||
ConversationEntry::System(m) => tokenize_entry("system", m.content_text()),
|
||||
ConversationEntry::Message(m) => tokenize_entry(m.role_str(), m.content_text()),
|
||||
ConversationEntry::Memory { message, .. } => tokenize_entry("memory", message.content_text()),
|
||||
ConversationEntry::Dmn(m) => tokenize_entry("dmn", m.content_text()),
|
||||
ConversationEntry::Thinking(text) => tokenize_entry("thinking", text),
|
||||
ConversationEntry::Log(_) => vec![], // logs don't consume tokens
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue