Make reply use the API (#5389)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-28 15:27:28 -04:00
committed by GitHub
parent 35f286a9d1
commit 4034f3fcef
7 changed files with 248 additions and 142 deletions
+2 -2
View File
@@ -27,6 +27,7 @@ use goose_bench::runners::metric_aggregator::MetricAggregator;
use goose_bench::runners::model_runner::ModelRunner;
use std::io::Read;
use std::path::PathBuf;
use tracing::warn;
#[derive(Parser)]
#[command(author, version, display_name = "", about, long_about = None)]
@@ -820,9 +821,8 @@ pub struct RecipeInfo {
pub async fn cli() -> Result<()> {
let cli = Cli::parse();
// Track the current directory in projects.json
if let Err(e) = crate::project_tracker::update_project_tracker(None, None) {
eprintln!("Warning: Failed to update project tracker: {}", e);
warn!("Warning: Failed to update project tracker: {}", e);
}
let command_name = match &cli.command {
+2
View File
@@ -23,6 +23,7 @@ use goose::conversation::message::{
ToolRequest, ToolResponse,
};
use crate::routes::reply::MessageEvent;
use utoipa::openapi::schema::{
AdditionalProperties, AnyOfBuilder, ArrayBuilder, ObjectBuilder, OneOfBuilder, Schema,
SchemaFormat, SchemaType,
@@ -420,6 +421,7 @@ derive_utoipa!(Icon as IconSchema);
ResourceContentsSchema,
SystemNotificationType,
SystemNotificationContent,
MessageEvent,
JsonObjectSchema,
RoleSchema,
ProviderMetadata,
+4 -1
View File
@@ -139,6 +139,7 @@ pub enum MessageEvent {
},
Notification {
request_id: String,
#[schema(value_type = Object)]
message: ServerNotification,
},
UpdateConversation {
@@ -170,7 +171,9 @@ async fn stream_event(
path = "/reply",
request_body = ChatRequest,
responses(
(status = 200, description = "Streaming response initiated", content_type = "text/event-stream"),
(status = 200, description = "Streaming response initiated",
body = MessageEvent,
content_type = "text/event-stream"),
(status = 424, description = "Agent not initialized"),
(status = 500, description = "Internal server error")
)