Skip to content

Commit

Permalink
update prompt and use env for ipfs gateway url
Browse files Browse the repository at this point in the history
  • Loading branch information
shadrach-tayo committed Jun 24, 2024
1 parent 200fb3b commit c26bd98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/langchain_orcid2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit c26bd98

Please sign in to comment.