File size: 513 Bytes
aa37f44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from langchain_openai import ChatOpenAI
import os

try:
    from dotenv import load_dotenv
    load_dotenv()
except Exception:
    pass

def get_llm(model="gpt-3.5-turbo-0125",max_tokens=1024, temperature=0.0, streaming=True,timeout=30, **kwargs):
    
    llm = ChatOpenAI(
        model=model,
        api_key=os.environ.get("THEO_API_KEY", None),
        max_tokens = max_tokens,
        streaming = streaming,
        temperature=temperature,
        timeout = timeout,
        **kwargs,
    )

    return llm