-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* just create a structure * pass all tests
- Loading branch information
Showing
7 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import List, Tuple, Dict | ||
|
||
|
||
class BaseResearchAgent(object): | ||
def __init__(self, name: str) -> None: | ||
self.profile = self.get_profile(name) | ||
self.memory: Dict[str, str] = {} | ||
|
||
def get_profile(self, name: str) -> Dict[str, str]: | ||
return {'name': 'John Doe', 'age': '25', 'location': 'New York'} | ||
|
||
def communicate(self, message: Dict[str, str]) -> str: | ||
return 'hello' | ||
|
||
def read_paper(self, input: Dict[str, str], external_data: Dict[str, str]) -> str: | ||
return 'reading paper' | ||
|
||
def find_collaborators(self, input: Dict[str, str]) -> List[str]: | ||
return ['Alice', 'Bob', 'Charlie'] | ||
|
||
def generate_idea(self, input: Dict[str, str], external_data: Dict[str, str]) -> str: | ||
return 'idea' | ||
|
||
def write_paper(self, input: Dict[str, str], external_data: Dict[str, str]) -> str: | ||
return 'writing paper' | ||
|
||
def review_paper(self, input: Dict[str, str], external_data: Dict[str, str]) -> str: | ||
return 'review comments' | ||
|
||
def make_review_decision(self, input: Dict[str, str], external_data: Dict[str, str]) -> str: | ||
return 'accept' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import List, Tuple, Dict | ||
from .agent_base import BaseResearchAgent | ||
|
||
|
||
class BaseMultiAgentEnv(object): | ||
def __init__(self, agent_dict: Dict[str, str]) -> None: | ||
self.agents: Dict[str, BaseResearchAgent] = {} | ||
for agent_name, agent in agent_dict.items(): | ||
self.agents[agent_name] = BaseResearchAgent(agent) | ||
|
||
def step(self) -> None: | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from typing import List, Tuple, Dict | ||
from .agent_base import BaseResearchAgent | ||
from .env_base import BaseMultiAgentEnv | ||
|
||
class PaperRebuttalMultiAgentEnv(BaseMultiAgentEnv): | ||
def __init__(self, agent_dict: Dict[str, str]) -> None: | ||
super().__init__(agent_dict) | ||
|
||
def step(self) -> None: | ||
for agent_name, agent in self.agents.items(): | ||
paper_summary = agent.read_paper({}, {}) | ||
paper_review = agent.review_paper({}, {}) | ||
review_decision = agent.make_review_decision({}, {}) | ||
|
||
self.submit_rebuttal() | ||
|
||
def submit_rebuttal(self) -> None: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import List, Tuple, Dict | ||
from .agent_base import BaseResearchAgent | ||
from .env_base import BaseMultiAgentEnv | ||
|
||
class PaperSubmissionMultiAgentEnvironment(BaseMultiAgentEnv): | ||
def __init__(self, agent_dict: Dict[str, str]) -> None: | ||
super(PaperSubmissionMultiAgentEnvironment, self).__init__(agent_dict) | ||
|
||
def step(self) -> None: | ||
for agent_name, agent in self.agents.items(): | ||
agent.read_paper({}, {}) | ||
agent.find_collaborators({}) | ||
agent.generate_idea({}, {}) | ||
agent.write_paper({}, {}) | ||
|
||
self.submit_paper() | ||
|
||
def submit_paper(self) -> None: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import List, Tuple, Dict | ||
|
||
class BaseKnowledgeBase(object): | ||
def __init__(self) -> None: | ||
self.data: Dict[str, str] = {} | ||
|
||
def update_kb(self, data: Dict[str, str]) -> None: | ||
self.data.update(data) | ||
|
||
def add_data(self, data: Dict[str, str]) -> None: | ||
self.data.update(data) | ||
|
||
def get_data(self, key: str) -> str: | ||
return self.data[key] |