feat(model): add ServerConfig and ClientConfig (#1266)
This commit is contained in:
parent
fbfc5cc96e
commit
165ff92df1
1 changed files with 331 additions and 303 deletions
|
|
@ -10,7 +10,7 @@ use std::sync::Arc;
|
|||
use rmcp::{
|
||||
ClientHandler, ServerHandler, ServiceExt,
|
||||
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
|
||||
model::{CallToolRequestParams, InitializeRequestParams, InitializeResult, ServerCapabilities},
|
||||
model::{CallToolRequestParams, ClientConfig, ServerCapabilities, ServerConfig},
|
||||
tool, tool_handler, tool_router,
|
||||
};
|
||||
use schemars::JsonSchema;
|
||||
|
|
@ -287,8 +287,8 @@ fn test_optional_field_schema_generation_via_macro() {
|
|||
struct DummyClientHandler {}
|
||||
|
||||
impl ClientHandler for DummyClientHandler {
|
||||
fn get_info(&self) -> InitializeRequestParams {
|
||||
InitializeRequestParams::default()
|
||||
fn get_info(&self) -> ClientConfig {
|
||||
ClientConfig::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -549,8 +549,8 @@ impl ManualInfoServer {
|
|||
|
||||
#[tool_handler]
|
||||
impl ServerHandler for ManualInfoServer {
|
||||
fn get_info(&self) -> InitializeResult {
|
||||
InitializeResult::new(
|
||||
fn get_info(&self) -> ServerConfig {
|
||||
ServerConfig::new(
|
||||
ServerCapabilities::builder()
|
||||
.enable_tools()
|
||||
.enable_resources()
|
||||
|
|
|
|||
Loading…
Reference in a new issue