Skip to content

Commit

Permalink
maybe faster, maybe broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jul 6, 2024
1 parent 4d1ef80 commit 3cd8456
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions agixt/Websearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ async def get_web_content(
if not str(pick_a_link).lower().startswith("none"):
logging.info(f"AI has decided to click: {pick_a_link}")
task = asyncio.create_task(
self.recursive_browsing(
Websearch(
collection_number=self.collection_number,
agent=self.agent,
user=self.user,
ApiClient=self.ApiClient,
).recursive_browsing(
user_input=user_input,
links=pick_a_link,
conversation_name=conversation_name,
Expand Down Expand Up @@ -353,7 +358,12 @@ async def recursive_browsing(
message=f"[SUBACTIVITY][{activity_id}] Browsing [{url}]({url}).",
)
task = asyncio.create_task(
self.get_web_content(
Websearch(
collection_number=self.collection_number,
agent=self.agent,
user=self.user,
ApiClient=self.ApiClient,
).get_web_content(
url=url,
conversation_id=conversation_id,
agent_browsing=agent_browsing,
Expand Down Expand Up @@ -399,9 +409,12 @@ async def scrape_websites(
message=f"[SUBACTIVITY][{activity_id}] Browsing [{link}]({link}).",
)
task = asyncio.create_task(
self.get_web_content(
url=link, summarize_content=summarize_content
)
Websearch(
collection_number=self.collection_number,
agent=self.agent,
user=self.user,
ApiClient=self.ApiClient,
).get_web_content(url=link, summarize_content=summarize_content)
)
tasks.append(task)
scraped_links.append(link)
Expand Down Expand Up @@ -598,7 +611,12 @@ async def websearch_agent(
links = links[:websearch_depth]
if links is not None and len(links) > 0:
task = asyncio.create_task(
self.recursive_browsing(
Websearch(
collection_number=self.collection_number,
agent=self.agent,
user=self.user,
ApiClient=self.ApiClient,
).recursive_browsing(
user_input=user_input,
links=links,
conversation_name=conversation_name,
Expand Down

0 comments on commit 3cd8456

Please sign in to comment.