fix: api ergonomics follow-up (#720)
* fix: builder with_* methods take T instead of Option<T> * fix: emit conditional builder calls for optional fields in macros * fix: convert with_task, with_stop_reason, with_logger, with_content to proper builders * fix: update test callers for new builder signatures * fix: simplify make_task helper and remove unused import * fix: update sampling_stdio example for new with_stop_reason signature * fix: make annotations and execution Option<Expr> consistent with other fields * fix: remove unused none_expr import
This commit is contained in:
parent
1fe5d1e1cd
commit
2d90b76501
1 changed files with 81 additions and 99 deletions
|
|
@ -13,7 +13,6 @@ use rmcp::{
|
|||
model::{CallToolRequestParams, ClientInfo, ErrorCode, JsonObject},
|
||||
tool, tool_handler, tool_router,
|
||||
};
|
||||
use serde_json::json;
|
||||
|
||||
/// Server with tools having different task support modes.
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
@ -75,8 +74,8 @@ impl ClientHandler for DummyClientHandler {
|
|||
}
|
||||
|
||||
/// Helper to create a task object for tool calls
|
||||
fn make_task() -> Option<JsonObject> {
|
||||
Some(json!({}).as_object().unwrap().clone())
|
||||
fn make_task() -> JsonObject {
|
||||
serde_json::Map::new()
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue