properly loading .env file with dotenv
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import os
|
||||
from typing import List, Dict, Any, Optional, Tuple
|
||||
from dotenv import load_dotenv
|
||||
from langchain_core.tools import BaseTool, tool
|
||||
from langchain_core.runnables import RunnableConfig
|
||||
from langchain_core.messages import HumanMessage, AIMessage, BaseMessage
|
||||
@@ -15,6 +16,9 @@ from loguru import logger
|
||||
from retrieval import create_retriever
|
||||
from vector_storage import initialize_vector_store
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
|
||||
def get_llm_model_info(llm_model: str = None) -> Tuple[str, str, str, str, str]:
|
||||
"""
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import click
|
||||
from loguru import logger
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
|
||||
# Configure logging to output to both file and stdout as specified in requirements
|
||||
def setup_logging():
|
||||
|
||||
@@ -4,6 +4,7 @@ import os
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
from typing import List, Dict, Any
|
||||
from dotenv import load_dotenv
|
||||
from langchain_core.documents import Document
|
||||
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
||||
from langchain_community.document_loaders import PyPDFLoader
|
||||
@@ -38,6 +39,9 @@ from sqlalchemy.orm import sessionmaker
|
||||
from loguru import logger
|
||||
import sqlite3
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
|
||||
# Define the path to the data directory
|
||||
DATA_DIR = Path("../../../data").resolve()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import os
|
||||
from typing import List, Optional
|
||||
from dotenv import load_dotenv
|
||||
from langchain_core.retrievers import BaseRetriever
|
||||
from langchain_core.callbacks import CallbackManagerForRetrieverRun
|
||||
from langchain_core.documents import Document
|
||||
@@ -9,6 +10,9 @@ from loguru import logger
|
||||
|
||||
from vector_storage import initialize_vector_store
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class VectorStoreRetriever(BaseRetriever):
|
||||
"""
|
||||
|
||||
@@ -4,6 +4,7 @@ import json
|
||||
import os
|
||||
from contextlib import asynccontextmanager
|
||||
from typing import Any, Dict
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@@ -12,6 +13,9 @@ from pydantic import BaseModel
|
||||
|
||||
from agent import chat_with_agent, get_llm_model_info
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class QueryRequest(BaseModel):
|
||||
"""Request model for the query endpoint."""
|
||||
|
||||
Reference in New Issue
Block a user