MCPcopy Create free account
hub / github.com/microsoft/TypeChat / handle_request

Method handle_request

python/examples/multiSchema/agents.py:108–124  ·  view source on GitHub ↗
(self, line: str)

Source from the content-addressed store, hash-verified

106 self._client_context = await get_client_context(self._authentication_vals)
107
108 async def handle_request(self, line: str):
109 if not self._client_context:
110 await self.authenticate()
111
112 assert self._client_context
113 result = await self._translator.translate(line)
114 if isinstance(result, Failure):
115 print(result.message)
116 else:
117 result = result.value
118 print(json.dumps(result, indent=2))
119
120 try:
121 for action in result["actions"]:
122 await handle_call(action, self._client_context)
123 except Exception as error:
124 print("An exception occurred: ", error)

Callers

nothing calls this directly

Calls 3

authenticateMethod · 0.95
handle_callFunction · 0.90
translateMethod · 0.65

Tested by

no test coverage detected