fix(examples): Prevent transport from closing due to premature client drop (#324)
This commit is contained in:
parent
f1000930b6
commit
8967daf87f
1 changed files with 9 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ async fn main() -> Result<()> {
|
|||
if config.mcp.is_some() {
|
||||
let mcp_clients = config.create_mcp_clients().await?;
|
||||
|
||||
for (name, client) in mcp_clients {
|
||||
for (name, client) in mcp_clients.iter() {
|
||||
println!("load MCP tool: {}", name);
|
||||
let server = client.peer().clone();
|
||||
let tools = get_mcp_tools(server).await?;
|
||||
|
|
@ -84,6 +84,7 @@ async fn main() -> Result<()> {
|
|||
tool_set.add_tool(tool);
|
||||
}
|
||||
}
|
||||
tool_set.set_clients(mcp_clients);
|
||||
}
|
||||
|
||||
// create chat session
|
||||
|
|
|
|||
Loading…
Reference in a new issue