Marcelle/verbose tool output (#1230)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use bat::WrappingMode;
|
||||
use console::style;
|
||||
use goose::config::Config;
|
||||
use goose::message::{Message, MessageContent, ToolRequest, ToolResponse};
|
||||
use mcp_core::tool::ToolCall;
|
||||
use serde_json::Value;
|
||||
@@ -113,6 +114,8 @@ fn render_tool_request(req: &ToolRequest, theme: Theme) {
|
||||
}
|
||||
|
||||
fn render_tool_response(resp: &ToolResponse, theme: Theme) {
|
||||
let config = Config::global();
|
||||
|
||||
match &resp.tool_result {
|
||||
Ok(contents) => {
|
||||
for content in contents {
|
||||
@@ -122,14 +125,14 @@ fn render_tool_response(resp: &ToolResponse, theme: Theme) {
|
||||
}
|
||||
}
|
||||
|
||||
let min_priority = std::env::var("GOOSE_CLI_MIN_PRIORITY")
|
||||
let min_priority = config
|
||||
.get::<f32>("GOOSE_CLI_MIN_PRIORITY")
|
||||
.ok()
|
||||
.and_then(|val| val.parse::<f32>().ok())
|
||||
.unwrap_or(0.0);
|
||||
|
||||
if content
|
||||
.priority()
|
||||
.is_some_and(|priority| priority <= min_priority)
|
||||
.is_some_and(|priority| priority < min_priority)
|
||||
|| content.priority().is_none()
|
||||
{
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user