summaryrefslogtreecommitdiff
path: root/rag/generator/__init__.py
blob: a776231fa0ac0b692426518067755e60c483f3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from typing import Type

from .abstract import AbstractGenerator
from .cohere import Cohere
from .ollama import Ollama

MODELS = ["local", "cohere"]

def get_generator(model: str) -> Type[AbstractGenerator]:
    match model:
        case "local":
            return Ollama()
        case "cohere":
            return Cohere()
        case _:
            exit(1)