mock_lm
langroid/language_models/mock_lm.py
Mock Language Model for testing
MockLMConfig
¶
Bases: LLMConfig
Mock Language Model Configuration.
Attributes:
Name | Type | Description |
---|---|---|
response_dict |
Dict[str, str]
|
A "response rule-book", in the form of a dictionary; if last msg in dialog is x,then respond with response_dict[x] |
MockLM(config=MockLMConfig())
¶
Bases: LanguageModel
Source code in langroid/language_models/mock_lm.py
chat(messages, max_tokens=200, tools=None, tool_choice='auto', functions=None, function_call='auto', response_format=None)
¶
Mock chat function for testing
Source code in langroid/language_models/mock_lm.py
achat(messages, max_tokens=200, tools=None, tool_choice='auto', functions=None, function_call='auto', response_format=None)
async
¶
Mock chat function for testing