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

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Feb 12, 2024
1 parent a67803b commit a9a53ff
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions arxiv_ai/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def get_document_contents(self, document_name: str, limit: int = 5000) -> Option

return document_content[:limit]

def get_document_names(self, limit: int = 20) -> Optional[str]:
def get_document_names(self, limit: int = 20) -> str:
"""Use this function to get the names of the documents uploaded from ArXiv.
Args:
Expand All @@ -300,7 +300,7 @@ def get_document_names(self, limit: int = 20) -> Optional[str]:

logger.debug("Getting all document names")
if self.knowledge_base.vector_db is None or not isinstance(self.knowledge_base.vector_db, PgVector2):
return None
return "No documents found in the knowledge base."

vector_db: PgVector2 = self.knowledge_base.vector_db
table = vector_db.table
Expand All @@ -321,4 +321,4 @@ def get_document_names(self, limit: int = 20) -> Optional[str]:
return json.dumps(document_names)
except Exception as e:
logger.error(f"Error getting document names: {e}")
return None
return "No documents found in the knowledge base."
File renamed without changes.
4 changes: 1 addition & 3 deletions recipe/recipe_assistant_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
from phi.assistant.openai.tool import Retrieval

# Load the recipe book from s3
recipe_book_s3 = UrlFile(
url="https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"
).get_or_create()
recipe_book_s3 = UrlFile(url="https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf").get_or_create()
# Load the recipe book locally
# recipe_book_local = LocalFile(path="data/pdfs/meals-more-recipes.pdf").get_or_create()

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
#
aiohttp==3.9.3
aiosignal==1.3.1
Expand Down Expand Up @@ -56,7 +56,7 @@ packaging==23.2
pandas==2.2.0
pandas-stubs==2.1.4.231227
pgvector==0.2.4
phidata==2.3.19
phidata==2.3.35
pillow==10.2.0
plotly==5.18.0
pluggy==1.4.0
Expand Down

0 comments on commit a9a53ff

Please sign in to comment.