| 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 |
no outgoing calls
searching dependent graphs…