Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghuyihei committed Nov 11, 2024
1 parent b22a282 commit 041b4a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ async def deep_research_paper_with_chain(self,paper:Result):
current_title = paper.title
current_abstract = paper.abstract

# search before
# Forward search: search future papers (citations)
while len(idea_chain)<self.max_chain_length:
rerank_query = f"{self.topic} {current_title} {current_abstract}"
citation_paper = await self.reader.search_related_paper_async(current_title,need_reference=False,rerank_query=rerank_query,llm=self.llm,paper_list=idea_papers)
Expand Down Expand Up @@ -326,7 +326,8 @@ async def deep_research_paper_with_chain(self,paper:Result):

current_title = paper.title
current_abstract = paper.abstract
# search after

# Backward search: search past papers (references)
while len(idea_chain) < self.max_chain_length and len(references) > 0:
article = None
print(f"The references find:{references}")
Expand Down
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import argparse
import yaml
import os
import nest_asyncio

nest_asyncio.apply()
with open('config.yaml', 'r') as file:
config = yaml.safe_load(file)
for key, value in config.items():
Expand Down
4 changes: 2 additions & 2 deletions prompts/deep_research_agent_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ def get_deep_generate_future_direciton_prompt(idea_chains,trend,topic,entities)
Based on previous research, analyze how human experts think and transition from previous methods to subsequent approaches. Focus on their reasoning logic and the sources of their thought processes. Learn to emulate their reasoning patterns to further develop and guide your own research direction in a natural and coherent manner.
Additionally, you are encouraged to adopt the following three modes of thinking:
You are encouraged to adopt the following four modes of thinking:
1. Reflection: Reflect on scenarios where a specific method encounters significant challenges. Consider potential solutions that could effectively address these issues, make the solutions sounds reasonable, novel and amazing.
2. Analogy: Identify a specific problem you are currently facing. Analyze whether similar issues exist in other fields and how those areas have addressed these problems. Consider if their solutions can be adapted and applied to resolve your current challenge.
3. Deep Dive: Some methods may present specific approaches to addressing a particular problem. Consider whether there are aspects that could be modified to enhance their rationale and effectiveness.
4. Imitate: Analyze the research approaches from previous studies, reflecting on how they progressively advanced their investigations. Learn from their methodologies and propose your next steps.
4. Imitate: Analyze the research methods used in previous studies and reflect on how they have progressively advanced the research. Identify common strategies or particularly useful approaches, and use these insights to guide the direction of your next research step. (Most recommended)
Note:Each article's limitations are specific to that particular piece and should not be applied to others. Carefully consider the task at hand and analyze the potential issues you might encounter if you proceed with your original approach, reflecting on the challenges previously faced. Then, think critically about how to address these issues effectively.
Expand Down
2 changes: 1 addition & 1 deletion searcher/sementic_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def search_papers_async(self, query, limit=5, offset=0, fields=["title", "
response_data = response.json()
return response_data
elif response.status_code == 429:
await asyncio.sleep(0.5)
await asyncio.sleep(5)
print(f"Request failed with status code {response.status_code}: begin to retry")
return await self.search_papers_async(query, limit, offset, fields, publicationDate, minCitationCount, year, publicationTypes, fieldsOfStudy)
else:
Expand Down

0 comments on commit 041b4a5

Please sign in to comment.