feat(model): add ServerConfig and ClientConfig (#1266)
This commit is contained in:
parent
fbfc5cc96e
commit
165ff92df1
2 changed files with 331 additions and 303 deletions
|
|
@ -2,7 +2,7 @@
|
|||
use rmcp::{
|
||||
ServerHandler,
|
||||
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
|
||||
model::{InitializeResult, ServerCapabilities},
|
||||
model::{ServerCapabilities, ServerConfig},
|
||||
schemars, tool, tool_router,
|
||||
};
|
||||
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
|
||||
|
|
@ -52,8 +52,8 @@ impl Calculator {
|
|||
}
|
||||
|
||||
impl ServerHandler for Calculator {
|
||||
fn get_info(&self) -> InitializeResult {
|
||||
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
|
||||
fn get_info(&self) -> ServerConfig {
|
||||
ServerConfig::new(ServerCapabilities::builder().enable_tools().build())
|
||||
.with_instructions("A simple calculator")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ impl TestServer {
|
|||
|
||||
impl ServerHandler for TestServer {
|
||||
#[allow(deprecated)]
|
||||
fn get_info(&self) -> InitializeResult {
|
||||
InitializeResult::new(ServerCapabilities::builder().enable_logging().build())
|
||||
fn get_info(&self) -> ServerConfig {
|
||||
ServerConfig::new(ServerCapabilities::builder().enable_logging().build())
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue