Provider-neutral context management

This commit is contained in:
Aine
2026-06-28 22:31:06 +01:00
committed by Slavi Pantaleev
parent 0be08c0292
commit a445933c0b
13 changed files with 249 additions and 40 deletions

View File

@@ -24,7 +24,7 @@ use crate::{
},
conversation::llm::{
Author as LLMAuthor, Conversation as LLMConversation, Message as LLMMessage,
MessageContent as LLMMessageContent, shorten_messages_list_to_context_size,
MessageContent as LLMMessageContent, TokenEstimate, shorten_messages_list_to_context_size,
},
utils::base64::base64_decode,
};
@@ -117,7 +117,7 @@ impl ControllerTrait for Controller {
tracing::trace!("Shortening messages list to context size");
conversation_messages = shorten_messages_list_to_context_size(
&text_generation_config.model_id,
TokenEstimate::Tiktoken(&text_generation_config.model_id),
&prompt_message,
conversation_messages,
text_generation_config.max_response_tokens,