File size: 569 Bytes
c69cba4
 
 
 
 
 
 
 
cf57696
c69cba4
 
 
cf57696
c69cba4
cf57696
c69cba4
 
 
 
 
 
 
cf57696
c69cba4
 
 
cf57696
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
from typing import Mapping, Optional, Any

from langchain.llms.base import LLM


class MockLocalBinaryModel(LLM):
    """
    Mock Local Binary Model class.
    """

    model_path: str = None
    llm: str = 'Mocked Response'

    def __init__(self):
        super().__init__()

    def _call(self, prompt: str, stop: Optional[list[str]] = None) -> str:
        return self.llm

    @property
    def _identifying_params(self) -> Mapping[str, Any]:
        return {'name_of_model': 'mock'}

    @property
    def _llm_type(self) -> str:
        return 'mock'