agent: Use Markdown to render tool input and output content (#28127)
Release Notes: - agent: Tool call's input and output content are now rendered with Markdown, which allows them to be selected and copied. --------- Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
parent
b8d05bb641
commit
288da0f072
2 changed files with 161 additions and 37 deletions
|
@ -35,6 +35,18 @@ pub enum ToolUseStatus {
|
|||
Error(SharedString),
|
||||
}
|
||||
|
||||
impl ToolUseStatus {
|
||||
pub fn text(&self) -> SharedString {
|
||||
match self {
|
||||
ToolUseStatus::NeedsConfirmation => "".into(),
|
||||
ToolUseStatus::Pending => "".into(),
|
||||
ToolUseStatus::Running => "".into(),
|
||||
ToolUseStatus::Finished(out) => out.clone(),
|
||||
ToolUseStatus::Error(out) => out.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ToolUseState {
|
||||
tools: Arc<ToolWorkingSet>,
|
||||
tool_uses_by_assistant_message: HashMap<MessageId, Vec<LanguageModelToolUse>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue