Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
fix babana bot to use new mcp proto
Antonio Ojea74f8f7a27bb8
diff --git a/site/content/docs/snippets/banana_bot_playground.py b/site/content/docs/snippets/banana_bot_playground.pyindex 639f4c48..1b54f001 100644--- a/site/content/docs/snippets/banana_bot_playground.py+++ b/site/content/docs/snippets/banana_bot_playground.py@@ -6,7 +6,7 @@ import randomimport httpxfrom typing import Optional, Dict, Any, Listfrom mcp import ClientSession-from mcp.client.sse import sse_client+from mcp.client.streamable_http import streamablehttp_clientclass SamClient:"""Inlined SAM Client for self-contained execution."""@@ -25,8 +25,8 @@ class SamClient:headers = {"Accept": "application/json, text/event-stream"}if self.token:headers["Authorization"] = f"Bearer {self.token}"- self._sse_cm = sse_client(self.server_url, headers=headers)- read_stream, write_stream = await self._sse_cm.__aenter__()+ self._sse_cm = streamablehttp_client(self.server_url, headers=headers)+ read_stream, write_stream, _ = await self._sse_cm.__aenter__()self.session = ClientSession(read_stream, write_stream)await self.session.__aenter__()await self.session.initialize()@@ -104,7 +104,7 @@ class FallbackAgent:self.client = clientself.api_key = api_keyself.token = token- self.base_url = local_node_url.rsplit("/mcp/", 1)[0]+ self.base_url = local_node_url.rsplit("/mcp", 1)[0]self.current_model = Noneself.mesh_history = []self.gemini_history = []