Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
v2.3.25
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Feb 7, 2024
1 parent 55683e7 commit 0abed34
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
12 changes: 5 additions & 7 deletions ai/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
from phi.knowledge.pdf import PDFUrlKnowledgeBase, PDFKnowledgeBase
from phi.vectordb.pgvector import PgVector2

from ai.settings import ai_settings
from db.session import db_url

pdf_knowledge_base = CombinedKnowledgeBase(
sources=[
PDFUrlKnowledgeBase(
urls=["https://www.family-action.org.uk/content/uploads/2019/07/meals-more-recipes.pdf"]
),
PDFUrlKnowledgeBase(urls=["https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"]),
PDFKnowledgeBase(path="data/pdfs"),
],
# Store this knowledge base in ai.pdf_documents
vector_db=PgVector2(
schema="ai",
db_url=db_url,
# Store the embeddings in ai.pdf_documents
collection="pdf_documents",
embedder=OpenAIEmbedder(model="text-embedding-3-small"),
embedder=OpenAIEmbedder(model=ai_settings.embedding_model),
),
# 2 references are added to the prompt
num_documents=2,
)
)
2 changes: 1 addition & 1 deletion ai/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AISettings(BaseSettings):
gpt_4: str = "gpt-4-1106-preview"
gpt_4_vision: str = "gpt-4-vision-preview"
gpt_3_5: str = "gpt-3.5-turbo-1106"
embedding_model: str = "text-embedding-ada-002"
embedding_model: str = "text-embedding-3-small"
default_max_tokens: int = 1024
default_temperature: float = 0

Expand Down
1 change: 0 additions & 1 deletion ai/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from db.session import db_url

pdf_assistant_storage = PgAssistantStorage(
schema="ai",
db_url=db_url,
table_name="pdf_assistant",
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies = [
# Linting and Formatting
"ruff",
# phidata
"phidata==2.3.19",
"phidata==2.3.25",
]

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ numpy==1.26.3
openai==1.11.0
packaging==23.2
pgvector==0.2.4
phidata==2.3.19
phidata==2.3.25
pluggy==1.4.0
psycopg[binary]==3.1.17
psycopg-binary==3.1.17
Expand Down

0 comments on commit 0abed34

Please sign in to comment.