DocUA's picture
refactoring
4d466aa
raw
history blame contribute delete
742 Bytes
import os
import google.generativeai as genai
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.core import (
StorageContext,
ServiceContext,
VectorStoreIndex,
Settings,
load_index_from_storage
)
from dotenv import load_dotenv
load_dotenv()
aws_access_key_id = os.getenv("AWS_ACCESS_KEY_ID")
aws_secret_access_key = os.getenv("AWS_SECRET_ACCESS_KEY")
openai_api_key = os.getenv("OPENAI_API_KEY")
anthropic_api_key=os.getenv("ANTHROPIC_API_KEY")
genai.configure(api_key=os.environ["GOOGLE_API_KEY"])
embed_model = OpenAIEmbedding(model_name="text-embedding-3-small")
Settings.embed_model = embed_model
Settings.context_window = 20000
Settings.chunk_size = 2048
Settings.similarity_top_k = 20