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: 14 additions & 0 deletions crates/tinytools-agent/src/dialect/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,3 +835,17 @@ fn json_call_rendering_round_trips_through_the_parser() {
assert_eq!(calls[0].arguments["path"], "a.txt");
assert_eq!(calls[1].arguments, serde_json::json!({}));
}

#[test]
fn native_instructions_allow_a_lead_in_but_require_the_call_in_the_same_message() {
let text = crate::render::native_instructions();
assert!(text.contains("same message"), "{text}");
assert!(
text.contains("never end a turn on an announcement"),
"{text}"
);
// The old wording read as a ban on any lead-in text, which stopped models
// from streaming a one-line "looking that up" before their tool calls.
assert!(!text.contains("Let me check"), "{text}");
assert!(!text.contains("narrate intent"), "{text}");
}
6 changes: 3 additions & 3 deletions crates/tinytools-agent/src/render/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ pub fn native_instructions() -> String {
[
"## Tool Use Protocol",
"",
"When a tool is needed, emit tool calls directly via the model's native tool-calling output.",
"Do not only narrate intent (for example, avoid \"Let me check...\") without emitting the tool call.",
"After tool results are provided, continue reasoning and then produce the final answer.",
"When you need a tool, call it in this response through native tool-calling.",
"A short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.",
"After the results arrive, keep going until you can give the final answer.",
"",
]
.join("\n")
Expand Down
Loading