Skip to content

Commit

Permalink
feat: added openai provider
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrump committed Oct 14, 2024
1 parent e97996b commit e755746
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/crllm/model/provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
from crllm.model.provider.dryrun import DryRunModel
from crllm.model.provider.ollama import OllamaModel
from crllm.model.provider.huggingface import HuggingFaceModel
from crllm.model.provider.openai import OpenAIModel


providers = {
"ollama": OllamaModel,
"azure": AzureModel,
"huggingface": HuggingFaceModel,
"openai": OpenAIModel,
"dryrun": DryRunModel,
}
11 changes: 11 additions & 0 deletions src/crllm/model/provider/openai.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from langchain_openai import ChatOpenAI
from crllm.model.model import Model


class OpenAIModel(Model):
def _get_model(self, model_config):
return ChatOpenAI(**model_config)

@staticmethod
def get_required_config():
return ["model"]

0 comments on commit e755746

Please sign in to comment.