From c26bd98f0cf99319ea30299731ad0f395e7e71ce Mon Sep 17 00:00:00 2001 From: shadrach-tayo Date: Mon, 24 Jun 2024 22:29:32 +0200 Subject: [PATCH] update prompt and use env for ipfs gateway url --- app/langchain_orcid2.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/langchain_orcid2.py b/app/langchain_orcid2.py index 398ceaf..fc8d395 100644 --- a/app/langchain_orcid2.py +++ b/app/langchain_orcid2.py @@ -46,9 +46,10 @@ return num_tokens""" def get_pdf_text(pdf_url): - ipfs_gateway_url = os.environ.get("IPFS_GATEWAY_URL", "https://ipfs.desci.com/ipfs/") + ipfs_gateway_url = os.getenv("IPFS_GATEWAY_URL", "https://ipfs.desci.com/ipfs/") print(ipfs_gateway_url) - ipfs= ipfs_gateway_url + pdf_url + print(pdf_url) + ipfs = ipfs_gateway_url + pdf_url response = requests.get(ipfs) @@ -394,8 +395,8 @@ async def langchain_paper_search(pdf_CID): queries_schemas_docs = [ ("Tell me who all the authors of this paper are. Your response should be a comma separated list of the authors of the paper, \ looking like 'first author name, second author name", document), - ("Tell me the title of this paper", document), - ("Tell me the abstract of this paper, do not change any of the words only return the abstract as it is written", document) + ("Tell me the title of this paper well formatted with no suffix or prefix or unncessary descriptions", document), + ("Tell me the abstract of this paper, do not change any of the words only return the abstract as it is written, if paper has no abstract return and empy string", document) ] tasks = []