import os | |
from dotenv import load_dotenv | |
from langchain_google_genai import ChatGoogleGenerativeAI | |
from langchain_openai import ChatOpenAI | |
from langchain_ollama import ChatOllama | |
def get_llm(): | |
# Load environment variables from .env file | |
load_dotenv() | |
# Get the API key | |
# google_api_key = os.getenv("GOOGLE_API_KEY") | |
# llm = ChatOpenAI(temperature=0) | |
# llm = ChatOllama(model="llama3.2:latest", temperature=0) | |
"""llm = ChatOpenAI( | |
api_key="ollama", | |
model="llama3.2:latest", | |
base_url="http://141.211.127.171/", | |
)""" | |
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash-latest") | |
return llm |