feat: Implement Pinecone vector store integration
- Update config.py with Pinecone settings and model configurations - Implement VectorStore class with Pinecone backend - Add comprehensive vector operations (add, search, delete) - Set up proper error handling and metadata management - Add .gitignore for Python project
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from typing import Optional
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
class Settings(BaseSettings):
|
||||
# API Keys
|
||||
COHERE_API_KEY: str = os.getenv('COHERE_API_KEY', '')
|
||||
PINECONE_API_KEY: str = os.getenv('PINECONE_API_KEY', '')
|
||||
|
||||
# Model Settings
|
||||
MODEL_NAME: str = "facebook/opt-350m" # Using the finetuned model
|
||||
EMBEDDING_MODEL: str = "embed-english-v3.0"
|
||||
|
||||
# Vector Store Settings
|
||||
VECTOR_DIMENSION: int = 768 # Default dimension for Cohere embeddings
|
||||
MAX_SEARCH_RESULTS: int = 5
|
||||
|
||||
# Pinecone Settings
|
||||
PINECONE_ENVIRONMENT: str = os.getenv('PINECONE_ENVIRONMENT', 'us-west1-gcp')
|
||||
PINECONE_INDEX_NAME: str = os.getenv('PINECONE_INDEX_NAME', 'marketing-assistant')
|
||||
|
||||
# Content Generation Settings
|
||||
MAX_CONTENT_LENGTH: int = 500
|
||||
TEMPERATURE: float = 0.7
|
||||
TOP_P: float = 0.9
|
||||
|
||||
# Brand Style Settings
|
||||
BRAND_GUIDELINES_PATH: str = "data/style_guidelines/brand_guidelines.json"
|
||||
TONE_KEYWORDS_PATH: str = "data/style_guidelines/tone_keywords.json"
|
||||
|
||||
# Storage Settings
|
||||
VECTOR_STORE_PATH: str = "data/vector_store"
|
||||
PAST_CAMPAIGNS_PATH: str = "data/past_campaigns"
|
||||
USER_QUERIES_PATH: str = "data/user_queries"
|
||||
|
||||
# Finetuned Model Settings
|
||||
FINETUNED_MODEL_PATH: str = "../finetuned_model"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
case_sensitive = True
|
||||
|
||||
# Create global settings instance
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user