Add persistent local agent tools
This commit is contained in:
@@ -132,7 +132,11 @@ impl ToolProjector {
|
||||
self.state = ToolProjectionState::Failed;
|
||||
break;
|
||||
};
|
||||
let id = random_tool_id(prefix);
|
||||
let id = if prefix.is_empty() {
|
||||
String::new()
|
||||
} else {
|
||||
random_tool_id(prefix)
|
||||
};
|
||||
self.ids.push(id.clone());
|
||||
events.push(ToolProjectionEvent::Start {
|
||||
index: self.index,
|
||||
@@ -370,6 +374,7 @@ pub(super) fn render_messages(
|
||||
}
|
||||
"user" => turns.push(ChatTurn {
|
||||
user: true,
|
||||
tool: false,
|
||||
skip_previous_eos: false,
|
||||
reasoning: None,
|
||||
reasoning_complete: true,
|
||||
@@ -388,6 +393,7 @@ pub(super) fn render_messages(
|
||||
} else {
|
||||
turns.push(ChatTurn {
|
||||
user: true,
|
||||
tool: false,
|
||||
skip_previous_eos: protocol == Protocol::Responses,
|
||||
reasoning: None,
|
||||
reasoning_complete: true,
|
||||
@@ -403,6 +409,7 @@ pub(super) fn render_messages(
|
||||
let reasoning = content_text(&message.reasoning_content);
|
||||
turns.push(ChatTurn {
|
||||
user: false,
|
||||
tool: false,
|
||||
skip_previous_eos: false,
|
||||
reasoning: (preserve_reasoning && !reasoning.is_empty()).then_some(reasoning),
|
||||
reasoning_complete: true,
|
||||
|
||||
Reference in New Issue
Block a user