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

Function request_handler

python/examples/healthData/demo.py:28–43  ·  view source on GitHub ↗
(message: str)

Source from the content-addressed store, hash-verified

26 )
27
28 async def request_handler(message: str):
29 result = await translator.translate(message)
30 if isinstance(result, Failure):
31 print(result.message)
32 else:
33 result = result.value
34 print(json.dumps(result, indent=2))
35
36 agent_message = result.get("message", "None")
37 not_translated = result.get("notTranslated", None)
38
39 if agent_message:
40 print(f"\n📝: {agent_message}")
41
42 if not_translated:
43 print(f"\n🤔: I did not understand\n {not_translated}")
44
45
46 file_path = sys.argv[1] if len(sys.argv) == 2 else None

Callers

nothing calls this directly

Calls 1

translateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…