forestav commited on
Commit
e372c76
·
1 Parent(s): 6e54bce
Files changed (3) hide show
  1. .gitignore +2 -1
  2. pinecone_handler.py +7 -1
  3. settings.py +0 -1
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  venv
2
- __pycache__
 
 
1
  venv
2
+ __pycache__
3
+ .env
pinecone_handler.py CHANGED
@@ -4,12 +4,18 @@ import logging
4
  from pinecone import Pinecone, ServerlessSpec
5
  from sentence_transformers import SentenceTransformer
6
  from typing import List, Dict, Any
 
 
 
 
 
 
 
7
 
8
  from settings import (
9
  LOG_LEVEL,
10
  LOG_DATE_FORMAT,
11
  LOG_FORMAT,
12
- PINECONE_API_KEY,
13
  PINECONE_ENVIRONMENT,
14
  PINECONE_INDEX_NAME
15
  )
 
4
  from pinecone import Pinecone, ServerlessSpec
5
  from sentence_transformers import SentenceTransformer
6
  from typing import List, Dict, Any
7
+ import os
8
+ from dotenv import load_dotenv
9
+
10
+ load_dotenv()
11
+ PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
12
+ if not PINECONE_API_KEY:
13
+ raise ValueError("PINECONE_API_KEY is not set. Please check your environment or secrets configuration.")
14
 
15
  from settings import (
16
  LOG_LEVEL,
17
  LOG_DATE_FORMAT,
18
  LOG_FORMAT,
 
19
  PINECONE_ENVIRONMENT,
20
  PINECONE_INDEX_NAME
21
  )
settings.py CHANGED
@@ -1,6 +1,5 @@
1
  import logging
2
 
3
- PINECONE_API_KEY = "pcsk_3nKkDX_K2CLsXYCkmJwP2gkv2HtCEe3ksJ7J3uQgx9ajAG63BFezrQUC5jFZVjadte4Sh8"
4
  PINECONE_ENVIRONMENT = "gcp-starter"
5
  PINECONE_INDEX_NAME = "jobads-index"
6
 
 
1
  import logging
2
 
 
3
  PINECONE_ENVIRONMENT = "gcp-starter"
4
  PINECONE_INDEX_NAME = "jobads-index"
5