env vars and no more dotenv variable

This commit is contained in:
Charles E. Gormley
2024-09-28 14:35:21 -04:00
parent c98cfc51aa
commit bfb9ecdf32
3 changed files with 10 additions and 8 deletions

View File

@@ -1,11 +1,7 @@
from pinecone import Pinecone
import os
from dotenv import load_dotenv
from openai import OpenAI
load_dotenv()
from pinecone import Pinecone
from openai import OpenAI
# Set up Pinecone client
api_key = os.getenv("PINCEONE_API_KEY")

View File

@@ -6,7 +6,7 @@ from random import randint
# TODO: Move this article storage logic to a separate module inside of lambda.
# TODO: Get better at handling loading local moduels insdie of the lambdda.
from infra.lambdas.RSSFeedProcessorLambda.src.analytics.embeddings.vector_db import get_index, upsert_vectors, vectorize
from analytics.embeddings.vector_db import get_index, upsert_vectors, vectorize
logger = logging.getLogger()

View File

@@ -14,7 +14,13 @@ def update_env_vars(function_name):
'S3_BUCKET_NAME': os.environ.get('S3_BUCKET_NAME'),
'DYNAMODB_TABLE_NAME': os.environ.get('DYNAMODB_TABLE_NAME'),
'LOG_LEVEL': os.environ.get('LOG_LEVEL', 'INFO'),
'STORAGE_STRATEGY': os.environ.get('STORAGE_STRATEGY')
'STORAGE_STRATEGY': os.environ.get('STORAGE_STRATEGY'),
'PINECONE_API_KEY': os.environ.get('PINECONE_API_KEY'),
'PINECONE_SHARDS': os.environ.get('PINECONE_SHARDS'),
'VECTOR_EMBEDDING_MODEL': os.environ.get('VECTOR_EMBEDDING_MODEL'),
'VECTOR_EMBEDDING_DIM': os.environ.get('VECTOR_EMBEDDING_DIM'),
'VECTOR_SEARCH_METRIC': os.environ.get('VECTOR_SEARCH_METRIC'),
'PINECONE_DB_NAME': os.environ.get('PINECONE_DB_NAME')
}
return lambda_client.update_function_configuration(