| 4 | from typing import Optional, List, Mapping, Any |
| 5 | |
| 6 | class CustomLLM(LLM): |
| 7 | |
| 8 | n: int = 0 |
| 9 | |
| 10 | @property |
| 11 | def _llm_type(self) -> str: |
| 12 | return "custom" |
| 13 | |
| 14 | def _call(self, prompt: str, stop: Optional[List[str]] = None) -> str: |
| 15 | output = "your customized response" |
| 16 | |
| 17 | return output |
| 18 | |
| 19 | @property |
| 20 | def _identifying_params(self) -> Mapping[str, Any]: |
| 21 | """Get the identifying parameters.""" |
| 22 | return {"n": self.n} |
| 23 | |
| 24 | if __name__ == "__main__": |
| 25 | llm = CustomLLM() |
no outgoing calls
no test coverage detected