Spaces:
Sleeping
Sleeping
| # llm.py | |
| import os | |
| from dotenv import load_dotenv | |
| from langchain_google_genai import ChatGoogleGenerativeAI | |
| load_dotenv() | |
| GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") | |
| MODEL_NAME = os.getenv("GEMINI_MODEL", "gemini-1.5-pro") | |
| llm = ChatGoogleGenerativeAI( | |
| model=MODEL_NAME, | |
| temperature=0, | |
| top_k=1, | |
| top_p=1.0, | |
| max_output_tokens=None, # max_tokens trong langchain_google_genai là max_output_tokens | |
| timeout=None, | |
| max_retries=2, | |
| google_api_key=GEMINI_API_KEY, | |
| ) | |