MCPcopy
hub / github.com/langroid/langroid / MessageHandlingAgent

Class MessageHandlingAgent

tests/main/test_tool_messages_async.py:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76
77class MessageHandlingAgent(ChatAgent):
78 def file_exists(self, message: FileExistsMessage) -> str:
79 return "yes" if message.filename == "requirements.txt" else "no"
80
81 def tool_handler(self, message: ToolMessage) -> str:
82 if message.request == "python_version":
83 return DEFAULT_PY_VERSION
84 else:
85 return "invalid tool name"
86
87 async def country_capital_async(self, message: CountryCapitalMessage) -> str:
88 await asyncio.sleep(1)
89 return (
90 "yes" if (message.city == "Paris" and message.country == "France") else "no"
91 )
92
93
94cfg = ChatAgentConfig(

Callers 2

test_llm_tool_messageFunction · 0.70

Calls

no outgoing calls

Tested by 1

test_llm_tool_messageFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…