feat(core): conversation history with bounded length
split llm.rs into a module with separate client and history submodules. ConversationHistory holds an optional system prompt plus a FIFO of user/ assistant turns capped at max_turns; oldest turns evict on overflow, system prompt is preserved across truncation and clear().
This commit is contained in:
parent
23c57b855b
commit
40f2f8b5f9
3 changed files with 123 additions and 0 deletions
8
crates/jarvis-core/src/llm/mod.rs
Normal file
8
crates/jarvis-core/src/llm/mod.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
mod client;
|
||||
mod history;
|
||||
|
||||
pub use client::{
|
||||
ChatMessage, ConfigError, LlmClient, LlmError,
|
||||
DEFAULT_BASE_URL, DEFAULT_MODEL, ENV_BASE_URL, ENV_MODEL, ENV_TOKEN,
|
||||
};
|
||||
pub use history::ConversationHistory;
|
||||
Loading…
Add table
Add a link
Reference in a new issue