MCPcopy
hub / github.com/langroid/langroid / AliceAgent

Class AliceAgent

tests/main/test_msg_routing.py:65–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 )
64
65 class AliceAgent(ChatAgent):
66 def llm_response(
67 self, message: Optional[str | ChatDocument] = None
68 ) -> Optional[ChatDocument]:
69 # message.content will either be just an an int-string "5"
70 # (if prefix != "") or Bob's entire msg otherwise (and hence not an int)
71 try:
72 y = int(message.content.strip())
73 except ValueError:
74 return None
75 answer = y * y
76 return self.create_llm_response(f"{DONE} {answer}")
77
78 bob_config = ChatAgentConfig(name="Bob")
79

Callers 1

test_addressingFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_addressingFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…