Compare commits

...

2 Commits

Author SHA1 Message Date
Aherobo Ovie Victor e63bf2d8c7 Update README with correct Pinecone index naming convention
Change PINECONE_INDEX_NAME example from 'specscomply_documents' to 'specscomply-documents'
to reflect Pinecone's naming requirements (lowercase alphanumeric characters and hyphens only)
2025-07-18 00:53:38 +01:00
Aherobo Ovie Victor c7caf06db5 Fix Pinecone API compatibility for v6.x
Update embedding service to use new Pinecone API syntax:
- Import ServerlessSpec from pinecone package
- Add spec parameter to create_index() call with AWS serverless configuration
- Resolves TypeError: missing required positional argument 'spec'
- Maintains existing functionality with updated API requirements
2025-07-18 00:52:51 +01:00
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ COHERE_API_KEY=your_cohere_api_key
VECTOR_DB=pinecone VECTOR_DB=pinecone
PINECONE_API_KEY=your_pinecone_api_key PINECONE_API_KEY=your_pinecone_api_key
PINECONE_ENVIRONMENT=your_pinecone_environment #us-east-1 PINECONE_ENVIRONMENT=your_pinecone_environment #us-east-1
PINECONE_INDEX_NAME=specscomply_documents PINECONE_INDEX_NAME=specscomply-documents
# Or for Weaviate: # Or for Weaviate:
# VECTOR_DB=weaviate # VECTOR_DB=weaviate
+6 -2
View File
@@ -1,7 +1,7 @@
import cohere import cohere
from typing import List, Dict, Any, Optional from typing import List, Dict, Any, Optional
import uuid import uuid
from pinecone import Pinecone from pinecone import Pinecone, ServerlessSpec
import weaviate import weaviate
from loguru import logger from loguru import logger
@@ -31,7 +31,11 @@ class EmbeddingService:
pc.create_index( pc.create_index(
name=settings.PINECONE_INDEX_NAME, name=settings.PINECONE_INDEX_NAME,
dimension=1024, # Cohere embed-english-v3.0 dimension dimension=1024, # Cohere embed-english-v3.0 dimension
metric="cosine" metric="cosine",
spec=ServerlessSpec(
cloud='aws',
region='us-east-1'
)
) )
# Return the index # Return the index