Fix constructing status update strings for intermediate chat steps

This commit is contained in:
Debanjum Singh Solanky 2024-04-11 19:53:09 +05:30
parent d15b9bc272
commit 0819b83d0b
2 changed files with 6 additions and 3 deletions

View file

@ -71,7 +71,8 @@ async def search_online(
if webpage_links: if webpage_links:
logger.info(f"🌐👀 Reading web pages at: {list(webpage_links)}") logger.info(f"🌐👀 Reading web pages at: {list(webpage_links)}")
if send_status_func: if send_status_func:
await send_status_func(f"**📖 Reading web pages**: {'\n- ' + '\n- '.join(list(webpage_links))}") webpage_links_str = "\n- " + "\n- ".join(list(webpage_links))
await send_status_func(f"**📖 Reading web pages**: {webpage_links_str}")
tasks = [read_webpage_and_extract_content(subquery, link) for link, subquery in webpage_links.items()] tasks = [read_webpage_and_extract_content(subquery, link) for link, subquery in webpage_links.items()]
results = await asyncio.gather(*tasks) results = await asyncio.gather(*tasks)
@ -113,7 +114,8 @@ async def read_webpages(
logger.info(f"Reading web pages at: {urls}") logger.info(f"Reading web pages at: {urls}")
if send_status_func: if send_status_func:
await send_status_func(f"**📖 Reading web pages**: {'\n- ' + '\n- '.join(list(urls))}") webpage_links_str = "\n- " + "\n- ".join(list(urls))
await send_status_func(f"**📖 Reading web pages**: {webpage_links_str}")
tasks = [read_webpage_and_extract_content(query, url) for url in urls] tasks = [read_webpage_and_extract_content(query, url) for url in urls]
results = await asyncio.gather(*tasks) results = await asyncio.gather(*tasks)

View file

@ -347,7 +347,8 @@ async def extract_references_and_questions(
result_list = [] result_list = []
logger.info(f"🔍 Searching knowledge base with queries: {inferred_queries}") logger.info(f"🔍 Searching knowledge base with queries: {inferred_queries}")
if send_status_func: if send_status_func:
await send_status_func(f"**🔍 Searching Documents for:** {'\n- ' + '\n- '.join(inferred_queries)}") inferred_queries_str = "\n- " + "\n- ".join(inferred_queries)
await send_status_func(f"**🔍 Searching Documents for:** {inferred_queries_str}")
for query in inferred_queries: for query in inferred_queries:
n_items = min(n, 3) if using_offline_chat else n n_items = min(n, 3) if using_offline_chat else n
result_list.extend( result_list.extend(