MCPcopy
hub / github.com/langroid/langroid / _response

Method _response

langroid/language_models/mock_lm.py:45–56  ·  view source on GitHub ↗
(self, msg: str)

Source from the content-addressed store, hash-verified

43 self.config: MockLMConfig = config
44
45 def _response(self, msg: str) -> LLMResponse:
46 # response is based on this fallback order:
47 # - response_dict
48 # - response_fn
49 # - default_response
50 mapped_response = self.config.response_dict.get(
51 msg, self.config.response_fn(msg) or self.config.default_response
52 )
53 return lm.LLMResponse(
54 message=to_string(mapped_response),
55 cached=False,
56 )
57
58 async def _response_async(self, msg: str) -> LLMResponse:
59 # response is based on this fallback order:

Callers 2

chatMethod · 0.95
generateMethod · 0.95

Calls 2

to_stringFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected