Skip to content

Commit

Permalink
Change logic on arxiv reader for article id inputs (#1044)
Browse files Browse the repository at this point in the history
* Chagne logic on arxiv reader for article ID inputs

* v1.4.15
  • Loading branch information
Josh-XT authored Oct 10, 2023
1 parent 1c4eba9 commit b78ae02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions agixt/readers/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ async def write_arxiv_articles_to_memory(
results = arxiv.Search(
id_list=articles, query=query, max_results=max_articles
)
if article_ids and not query: # Comma separated list of article IDs
elif article_ids != None and article_ids != "":
# Comma separated list of article IDs
articles = article_ids.split(",") if "," in article_ids else [article_ids]
articles = [article.strip() for article in articles]
results = arxiv.Search(id_list=articles)
if query and not article_ids: # Search query
elif query != None and query != "": # Search query
results = arxiv.Search(query=query, max_results=max_articles)
else:
return False
if results:
base_path = os.path.join(os.getcwd(), "WORKSPACE")
for result in results.results():
Expand Down
2 changes: 1 addition & 1 deletion agixt/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.14
v1.4.15

0 comments on commit b78ae02

Please sign in to comment.