mirror of
https://github.com/aljazceru/IngestRSS.git
synced 2025-12-18 22:44:27 +01:00
fixing issue with embedding model initialization.
This commit is contained in:
@@ -28,7 +28,7 @@ Resources:
|
||||
Properties:
|
||||
Name: rss-feed-processor-schedule
|
||||
Description: Runs the RSS Feed Processor Lambda function every hour
|
||||
ScheduleExpression: rate(5 minutes)
|
||||
ScheduleExpression: rate(30 minutes)
|
||||
FlexibleTimeWindow:
|
||||
Mode: FLEXIBLE
|
||||
MaximumWindowInMinutes: 1
|
||||
|
||||
@@ -11,8 +11,7 @@ embedding_dim = os.getenv("VECTOR_EMBEDDING_DIM")
|
||||
vector_search_metric = os.getenv("VECTOR_SEARCH_METRIC")
|
||||
index_name = os.getenv("PINECONE_DB_NAME")
|
||||
|
||||
client = OpenAI()
|
||||
|
||||
client = OpenAI() # For Embedding Models, Not LLMs
|
||||
pc = Pinecone(api_key=api_key)
|
||||
|
||||
def get_index():
|
||||
|
||||
@@ -36,7 +36,6 @@ def lambda_handler(event, context):
|
||||
|
||||
# Process the feed
|
||||
result = extract_feed(feed)
|
||||
print(type(result))
|
||||
logger.info("Process Feed Result Dictionary: ", result)
|
||||
last_pub_dt = result['max_date']
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ def update_env_vars(function_name):
|
||||
'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')
|
||||
'PINECONE_DB_NAME': os.environ.get('PINECONE_DB_NAME'),
|
||||
'OPENAI_API_KEY': os.environ.get('OPENAI_API_KEY')
|
||||
}
|
||||
|
||||
return lambda_client.update_function_configuration(
|
||||
|
||||
Reference in New Issue
Block a user