chore: fix unnecessary string concatation in single line (#8311)
This commit is contained in:
parent
08c486452f
commit
6613b8f2e0
30 changed files with 46 additions and 49 deletions
|
|
@ -51,7 +51,7 @@ class PubMedAPIWrapper(BaseModel):
|
|||
try:
|
||||
# Retrieve the top-k results for the query
|
||||
docs = [
|
||||
f"Published: {result['pub_date']}\nTitle: {result['title']}\n" f"Summary: {result['summary']}"
|
||||
f"Published: {result['pub_date']}\nTitle: {result['title']}\nSummary: {result['summary']}"
|
||||
for result in self.load(query[: self.ARXIV_MAX_QUERY_LENGTH])
|
||||
]
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ class PubMedAPIWrapper(BaseModel):
|
|||
if e.code == 429 and retry < self.max_retry:
|
||||
# Too Many Requests error
|
||||
# wait for an exponentially increasing amount of time
|
||||
print(f"Too Many Requests, " f"waiting for {self.sleep_time:.2f} seconds...")
|
||||
print(f"Too Many Requests, waiting for {self.sleep_time:.2f} seconds...")
|
||||
time.sleep(self.sleep_time)
|
||||
self.sleep_time *= 2
|
||||
retry += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue