small tweak to tmp prompting
This commit is contained in:
@@ -718,7 +718,7 @@ IMPORTANT: You must call tools to achieve goals. When you receive a request:
|
|||||||
5. Call the final_output tool with a detailed summary when done.
|
5. Call the final_output tool with a detailed summary when done.
|
||||||
|
|
||||||
For shell commands: Use the shell tool with the exact command needed. Avoid commands that produce a large amount of output, and consider piping those outputs to files. Example: If asked to list files, immediately call the shell tool with command parameter \"ls\".
|
For shell commands: Use the shell tool with the exact command needed. Avoid commands that produce a large amount of output, and consider piping those outputs to files. Example: If asked to list files, immediately call the shell tool with command parameter \"ls\".
|
||||||
If you create temporary files or data for testing, place these in a subdir named 'tmp'. Do NOT pollute the current dir.
|
If you create test or data files temporarily, place these in a subdir named 'tmp'. Do NOT pollute the current dir.
|
||||||
|
|
||||||
IMPORTANT: If the user asks you to just respond with text (like \"just say hello\" or \"tell me about X\"), do NOT use tools. Simply respond with the requested text directly. Only use tools when you need to execute commands or complete tasks that require action.
|
IMPORTANT: If the user asks you to just respond with text (like \"just say hello\" or \"tell me about X\"), do NOT use tools. Simply respond with the requested text directly. Only use tools when you need to execute commands or complete tasks that require action.
|
||||||
|
|
||||||
@@ -1476,7 +1476,8 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
} else {
|
} else {
|
||||||
if s.len() > 100 {
|
if s.len() > 100 {
|
||||||
// Use char_indices to respect UTF-8 boundaries
|
// Use char_indices to respect UTF-8 boundaries
|
||||||
let truncated = s.char_indices()
|
let truncated = s
|
||||||
|
.char_indices()
|
||||||
.take(100)
|
.take(100)
|
||||||
.map(|(_, c)| c)
|
.map(|(_, c)| c)
|
||||||
.collect::<String>();
|
.collect::<String>();
|
||||||
@@ -1517,7 +1518,10 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
if char_count <= max_width {
|
if char_count <= max_width {
|
||||||
line.to_string()
|
line.to_string()
|
||||||
} else {
|
} else {
|
||||||
let truncated: String = line.chars().take(max_width.saturating_sub(3)).collect();
|
let truncated: String = line
|
||||||
|
.chars()
|
||||||
|
.take(max_width.saturating_sub(3))
|
||||||
|
.collect();
|
||||||
format!("{}...", truncated)
|
format!("{}...", truncated)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1696,8 +1700,12 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
let filtered_text = filter_json_tool_calls(&clean_text);
|
let filtered_text = filter_json_tool_calls(&clean_text);
|
||||||
|
|
||||||
// Only use this if we truly have nothing else
|
// Only use this if we truly have nothing else
|
||||||
if !filtered_text.trim().is_empty() && full_response.is_empty() {
|
if !filtered_text.trim().is_empty() && full_response.is_empty()
|
||||||
debug!("Using filtered parser text as last resort: {} chars", filtered_text.len());
|
{
|
||||||
|
debug!(
|
||||||
|
"Using filtered parser text as last resort: {} chars",
|
||||||
|
filtered_text.len()
|
||||||
|
);
|
||||||
current_response = filtered_text;
|
current_response = filtered_text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1874,8 +1882,11 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
// The text has already been displayed during streaming via current_response.
|
// The text has already been displayed during streaming via current_response.
|
||||||
// The parser buffer accumulates ALL text and would cause duplication.
|
// The parser buffer accumulates ALL text and would cause duplication.
|
||||||
debug!("Stream completed without tool execution. Response already displayed during streaming.");
|
debug!("Stream completed without tool execution. Response already displayed during streaming.");
|
||||||
debug!("Current response length: {}, Full response length: {}",
|
debug!(
|
||||||
current_response.len(), full_response.len());
|
"Current response length: {}, Full response length: {}",
|
||||||
|
current_response.len(),
|
||||||
|
full_response.len()
|
||||||
|
);
|
||||||
|
|
||||||
let has_response = !current_response.is_empty() || !full_response.is_empty();
|
let has_response = !current_response.is_empty() || !full_response.is_empty();
|
||||||
|
|
||||||
@@ -1889,7 +1900,10 @@ The tool will execute immediately and you'll receive the result (success or erro
|
|||||||
// This prevents duplication when the agent responds without calling final_output
|
// This prevents duplication when the agent responds without calling final_output
|
||||||
if full_response.is_empty() && !current_response.is_empty() {
|
if full_response.is_empty() && !current_response.is_empty() {
|
||||||
full_response = current_response.clone();
|
full_response = current_response.clone();
|
||||||
debug!("Set full_response from current_response: {} chars", full_response.len());
|
debug!(
|
||||||
|
"Set full_response from current_response: {} chars",
|
||||||
|
full_response.len()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
self.ui_writer.println("");
|
self.ui_writer.println("");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user