-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.py
More file actions
36 lines (28 loc) · 933 Bytes
/
model.py
File metadata and controls
36 lines (28 loc) · 933 Bytes
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
29
30
31
32
33
34
35
36
import json, os, requests
from langchain_openai import ChatOpenAI
class GPT4o:
def __init__(self):
super().__init__()
self.api_key = 'YOUR-OPENAI-API-KEY'
self.model = 'gpt-4o'
def getLLM(self) -> ChatOpenAI:
os.environ["OPENAI_API_KEY"] = self.api_key
client = ChatOpenAI(model=self.model)
return client
class QWen:
def __init__(self):
super(self, QWen).__init__()
def getLLM(self):
pass
class DeepSeek_R1:
def __init__(self):
super().__init__()
self.url = 'https://api.deepseek.com/v1'
self.api_key = 'YOUR-DEEPSEEK-API-KEY'
self.model = 'deepseek-chat'
def getLLM(self) -> ChatOpenAI:
os.environ["OPENAI_API_KEY"] = self.api_key
client = ChatOpenAI(model=self.model,
base_url=self.url,
api_key=self.api_key)
return client