Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ backend/app.log
backend/Downloads
backend/.ipynb_checkpoints
backend/.venv
.idea
.idea
qdrant_storage/
4 changes: 3 additions & 1 deletion backend/app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")

# Frontend Config
FRONTEND_URL: str

Expand Down
5 changes: 3 additions & 2 deletions backend/app/services/knowledge_base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def create_knowledge_base_collection_if_not_exists():
collection_names = [col.name for col in collections.collections]

if KB_COLLECTION_NAME not in collection_names:
# Create collection with 1536 dimensions (Azure OpenAI text-embedding-ada-002)
# Create collection with Azure OpenAI text-embedding-ada-002 = 1536 / nomic-embed-text (Ollama) = 768
vector_size = 768 if settings.PROVIDER == "local" else 1536
result = create_qdrant_collection(
collection_name=KB_COLLECTION_NAME, vector_size=1536, distance="cosine"
collection_name=KB_COLLECTION_NAME, vector_size=vector_size, distance="cosine"
)
return {"status": "success", "message": result}
else:
Expand Down