MCPcopy
hub / github.com/langroid/langroid / user_response

Method user_response

tests/main/test_msg_routing.py:101–112  ·  view source on GitHub ↗

Mock user_response method for testing

(
        self,
        msg: Optional[str | ChatDocument] = None,
    )

Source from the content-addressed store, hash-verified

99
100class MockAgent(ChatAgent):
101 def user_response(
102 self,
103 msg: Optional[str | ChatDocument] = None,
104 ) -> Optional[ChatDocument]:
105 """
106 Mock user_response method for testing
107 """
108 txt = msg if isinstance(msg, str) else msg.content
109 map = dict([("2", "3"), ("3", "5")])
110 response = map.get(txt)
111 # return the increment of input number
112 return self.create_user_response(response)
113
114
115@pytest.mark.parametrize("interactive", [True, False])

Callers 2

test_responsesFunction · 0.45
test_async_user_responseFunction · 0.45

Calls 2

getMethod · 0.80
create_user_responseMethod · 0.80

Tested by

no test coverage detected