diff --git a/research_town/agents/agent_base.py b/research_town/agents/agent_base.py index 06b1ee8b..230cc765 100644 --- a/research_town/agents/agent_base.py +++ b/research_town/agents/agent_base.py @@ -15,7 +15,6 @@ from ..utils.author_collector import bfs from ..utils.paper_collector import get_paper_list -ATOM_NAMESPACE = "{http://www.w3.org/2005/Atom}" class BaseResearchAgent(object): def __init__(self, name: str) -> None: diff --git a/research_town/utils/agent_prompter.py b/research_town/utils/agent_prompter.py index f6a9b328..ea6e4915 100644 --- a/research_town/utils/agent_prompter.py +++ b/research_town/utils/agent_prompter.py @@ -41,7 +41,10 @@ def summarize_research_field_prompting( "Here is my profile: {profile}" "Here are the keywords: {keywords}" ) - template_input = {"profile": profile, "keywords": keywords} + template_input = { + "profile": profile, + "keywords": "; ".join(keywords) + } query = query_template.format_map(template_input) corpus = [abstract for papers in papers.values() @@ -49,8 +52,18 @@ def summarize_research_field_prompting( related_papers = get_related_papers(corpus, query, num=10) - template_input["papers"] = "; ".join(related_papers) - prompt = query_template.format_map(template_input) + template_input = { + "profile": profile, + "keywords": keywords, + "papers": "; ".join(related_papers) + } + prompt_template = ( + "Given the profile of me, keywords, some recent paper titles and abstracts. Could you summarize the keywords of high level research backgrounds and trends in this field (related to my profile if possible)." + "Here is my profile: {profile}" + "Here are the keywords: {keywords}" + "Here are some recent paper titles and abstracts: {papers}" + ) + prompt = prompt_template.format_map(template_input) return openai_prompting(llm_model, prompt)