Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change logic on arxiv reader for article id inputs #1044

Merged
merged 2 commits into from
Oct 10, 2023
Merged
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
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
Loading