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 ac1ce55 commit 39d8c10
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
15 changes: 6 additions & 9 deletions ai/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@
from phi.knowledge.website import WebsiteKnowledgeBase
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,
Expand All @@ -29,12 +27,11 @@
# urls=["https://docs.phidata.com/introduction"],
# Number of links to follow from the seed URLs
max_links=15,
# Store this knowledge base in ai.website_documents
vector_db=PgVector2(
schema="ai",
db_url=db_url,
# Store the embeddings in ai.website_documents
collection="website_documents",
embedder=OpenAIEmbedder(model="text-embedding-3-small"),
embedder=OpenAIEmbedder(model=ai_settings.embedding_model),
),
# 3 references are added to the prompt
num_documents=3,
Expand Down
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
3 changes: 0 additions & 3 deletions ai/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
from db.session import db_url

pdf_assistant_storage = PgAssistantStorage(
schema="ai",
db_url=db_url,
table_name="pdf_assistant",
)

image_assistant_storage = PgAssistantStorage(
schema="ai",
db_url=db_url,
table_name="image_assistant",
)

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

[build-system]
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./scripts/upgrade.sh all
# ./scripts/upgrade.sh
#
alembic==1.13.1
altair==5.2.0
Expand Down Expand Up @@ -42,7 +42,7 @@ openai==1.11.0
packaging==23.2
pandas==2.2.0
pgvector==0.2.4
phidata==2.3.19
phidata==2.3.25
pillow==10.2.0
protobuf==4.25.2
psycopg[binary]==3.1.17
Expand Down
4 changes: 2 additions & 2 deletions workspace/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
dev_env="dev",
# -*- Dev Apps
dev_app_enabled=True,
dev_api_enabled=True,
# dev_api_enabled=True,
dev_db_enabled=True,
# dev_jupyter_enabled=True,
# -*- Production settings
prd_env="prd",
# -*- Production Apps
prd_app_enabled=True,
prd_api_enabled=True,
# prd_api_enabled=True,
prd_db_enabled=True,
# -*- AWS settings
# Region for AWS resources
Expand Down

0 comments on commit 39d8c10

Please sign in to comment.