(self)
| 7 | |
| 8 | class Ollama: |
| 9 | def __init__(self): |
| 10 | try: |
| 11 | self.client = ollama.Client(Config().get_ollama_api_endpoint()) |
| 12 | self.models = self.client.list()["models"] |
| 13 | log.info("Ollama available") |
| 14 | except: |
| 15 | self.client = None |
| 16 | log.warning("Ollama not available") |
| 17 | log.warning("run ollama server to use ollama models otherwise use API models") |
| 18 | |
| 19 | def inference(self, model_id: str, prompt: str) -> str: |
| 20 | response = self.client.generate( |
nothing calls this directly
no test coverage detected