MCPcopy Create free account
hub / github.com/evilsocket/cake / add_message

Method add_message

cake-core/src/models/gemma3/model.rs:54–67  ·  view source on GitHub ↗
(&mut self, message: Message)

Source from the content-addressed store, hash-verified

52#[async_trait]
53impl TextGenerator for Gemma3 {
54 fn add_message(&mut self, message: Message) -> Result<()> {
55 // Gemma 3 IT has no dedicated system role — the system prompt is injected into
56 // the first user turn. Small models (1B) degrade badly when a system prompt is
57 // present. Warn users so they know to pass --system-prompt "".
58 if message.role == crate::models::chat::MessageRole::System && !message.content.trim().is_empty() {
59 log::warn!(
60 "gemma3: system prompt is injected into the first user turn. \
61 The 1B model may generate incoherent output — pass --system-prompt \"\" \
62 for reliable results."
63 );
64 }
65 self.history.push(message);
66 Ok(())
67 }
68
69 fn reset(&mut self) -> Result<()> {
70 self.history.clear();

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected