Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghuyihei committed Oct 29, 2024
1 parent 741d7d1 commit 8049d93
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ async def deep_research_paper_with_chain(self,paper:Result):
current_abstract = paper.abstract
# search after
while len(idea_chain) < self.max_chain_length and len(references) > 0:
search_paper = []
search_papers = []
article = None
print(f"The references find:{references}")
while len(references) > 0 and len(search_paper) == 0:
while len(references) > 0 and len(search_papers) == 0:
reference = references.pop(0)
if reference in self.read_papers:
continue
Expand All @@ -350,7 +350,7 @@ async def deep_research_paper_with_chain(self,paper:Result):

if not article:
rerank_query = f"topic: {self.topic} Title: {current_title} Abstract: {current_abstract}"
search_paper= await self.reader.search_related_paper_async(current_title,need_citation=False,rerank_query = rerank_query,llm=self.llm,paper_list=idea_papers)
search_paper = await self.reader.search_related_paper_async(current_title,need_citation=False,rerank_query = rerank_query,llm=self.llm,paper_list=idea_papers)
if not search_paper:
continue
if len(idea_chain) < self.min_chain_length:
Expand Down
4 changes: 4 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
SEMENTIC_SEARCH_API_KEY: ""

is_azure : True # if false, it is openai

# set it if you set is_azure to True
AZURE_OPENAI_ENDPOINT : ""
AZURE_OPENAI_KEY : ""
AZURE_OPENAI_API_VERSION : ""

# set it if you set is_azure to False
OPENAI_API_KEY: ""
OPENAI_BASE_URL: ""

Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
with open('config.yaml', 'r') as file:
config = yaml.safe_load(file)
for key, value in config.items():
if value == "":
continue
os.environ[key] = str(value)


Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
aiohttp
beautifulsoup4
delft
httpx
lmdb
lxml
Expand Down

0 comments on commit 8049d93

Please sign in to comment.