From 8d2cc6e3fce591fcb0f23feba614c259339dbb21 Mon Sep 17 00:00:00 2001 From: Andres Date: Thu, 9 Nov 2023 19:44:41 +0100 Subject: [PATCH] new version working fine in Py3.8 --- chemcrow/tools/search.py | 6 +++--- chemcrow/version.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chemcrow/tools/search.py b/chemcrow/tools/search.py index 50dc758..3a76578 100644 --- a/chemcrow/tools/search.py +++ b/chemcrow/tools/search.py @@ -2,7 +2,6 @@ import re import paperqa import langchain -import paperscraper from langchain import SerpAPIWrapper from pypdf.errors import PdfReadError from langchain.tools import BaseTool @@ -11,8 +10,9 @@ def paper_search(search, pdir="query"): try: + import paperscraper return paperscraper.search_papers(search, pdir=pdir) - except KeyError: + except (KeyError, ModuleNotFoundError): return {} def partial(func, *args, **kwargs): @@ -88,4 +88,4 @@ class WebSearch(BaseTool): def _run(self, query: str) -> str: return web_search(query) async def _arun(self, query: str) -> str: - raise NotImplementedError("Async not implemented") \ No newline at end of file + raise NotImplementedError("Async not implemented") diff --git a/chemcrow/version.py b/chemcrow/version.py index 4ad67eb..771bc6e 100644 --- a/chemcrow/version.py +++ b/chemcrow/version.py @@ -1 +1 @@ -__version__ = "0.3.8" +__version__ = "0.3.9"