Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/kota_code/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl AgentBuilder {
build_agent!(
openai::Client::new(&self.api_key),
&self.model_name,
&preamble,
preamble,
tools,
OpenAI
)
Expand All @@ -146,7 +146,7 @@ impl AgentBuilder {
build_agent!(
anthropic::Client::new(&self.api_key),
&self.model_name,
&preamble,
preamble,
tools,
Anthropic
)
Expand All @@ -155,7 +155,7 @@ impl AgentBuilder {
build_agent!(
cohere::Client::new(&self.api_key),
&self.model_name,
&preamble,
preamble,
tools,
Cohere
)
Expand All @@ -164,7 +164,7 @@ impl AgentBuilder {
build_agent!(
deepseek::Client::new(&self.api_key),
DEEPSEEK_CHAT,
&preamble,
preamble,
tools,
DeepSeek
)
Expand All @@ -173,7 +173,7 @@ impl AgentBuilder {
build_agent!(
ollama::Client::new(rig::client::Nothing),
&self.model_name,
&preamble,
preamble,
tools,
Ollama
)
Expand Down Expand Up @@ -217,7 +217,7 @@ impl AgentBuilder {
}
}

fn get_preamble(&self) -> String {
fn get_preamble(&self) -> &str {
r#"
Your name is Kato. You are a helpful AI code assistant with comprehensive file system and command execution access.
You can read, write, edit (with patches), and delete files, execute bash commands, scan codebase structures, search text in the codebase and create directories.
Expand All @@ -229,7 +229,7 @@ impl AgentBuilder {
- Track progress and update task status (pending, in_progress, completed, blocked)
- Show current plan and identify next available tasks

Please provide clear and concise responses and be careful when modifying files or executing commands."#.to_string()
Please provide clear and concise responses and be careful when modifying files or executing commands."#
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/kota_code/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ impl ContextManager {
})
}

pub fn with_max_messages(mut self, max_messages: usize) -> Self {
self.max_messages = max_messages;
self
pub fn with_max_messages(self, max_messages: usize) -> Self {
Self {
max_messages,
..self
}
}

pub fn add_message(&mut self, message: Message) {
Expand Down