Skip to content

Commit

Permalink
fix: arrange output parser classes
Browse files Browse the repository at this point in the history
Put all the output parser classes in one place.
Remove redundant output parser classes.
Reuse output parser classes with the same functionality.
  • Loading branch information
minleminzui committed Oct 11, 2023
1 parent 0208699 commit 8afc498
Show file tree
Hide file tree
Showing 22 changed files with 608 additions and 1,281 deletions.
602 changes: 602 additions & 0 deletions agentverse/output_parser/output_parser.py

Large diffs are not rendered by default.

28 changes: 1 addition & 27 deletions agentverse/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
import os
import yaml

from .simulation.math_problem_2players_tools.output_parser import (
MathProblem2PlayersToolsParser,
)
from .simulation.nlp_classroom_3players.output_parser import NlpClassroom3PlayersParser
from .simulation.nlp_classroom_9players.output_parser import NlpClassroom9PlayersParser
from .simulation.nlp_classroom_3players_withtool.output_parser import (
NlpClassroom3PlayersWithtoolParser,
)
from .simulation.nlp_classroom_9players_group.output_parser import (
NlpClassroom9PlayersGroupParser,
)
from .simulation.db_diag.output_parser import DBDiag

from .simulation.prisoner_dilemma.output_parser import PrisonerDilemmaParser

from .simulation.pokemon.output_parser import PokemonParser
from .simulation.sde_team.sde_team_3players.output_parser import SdeTeamParser
from .simulation.sde_team.sde_team_2players.output_parser import SdeTeamGivenTestsParser

from .tasksolving.pythoncalculator.output_parser import PipelinePythoncalculatorParser
from .tasksolving.brainstorming.output_parser import *
from .tasksolving.humaneval.output_parser import *
from .tasksolving.tool_using.output_parser import *
from .tasksolving.mgsm.output_parser import *
from .tasksolving.responsegen.output_parser import *
from .tasksolving.logic_grid.output_parser import *
from .tasksolving.commongen.output_parser import *
from agentverse.output_parser import *
29 changes: 0 additions & 29 deletions agentverse/tasks/simulation/alice_home/output_parser.py

This file was deleted.

40 changes: 0 additions & 40 deletions agentverse/tasks/simulation/db_diag/output_parser.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ prompts:
When responding, please use the following two-line format:

[Option 1]: When you need to use a tool, output in the following format (omit the "[]" bracket when responding)
ACTION: (a tool name, it can be one of [${tool_names}])
ACTION INPUT: (input arguments for the tool)
Action: (a tool name, it can be one of [${tool_names}])
Action Input: (input arguments for the tool)

[Option 2]: When you want to speak, you can use the following format:
ACTION: Speak
ACTION INPUT: (what you want to say in a single line)
Action: Speak
Action Input: (what you want to say in a single line)

Here is the conversation history
${chat_history}

Here is the observations from tool execution:
${tool_observation}

Now the game starts! ${role_description} You should give your action based on the above history. Remember, you should ALWAYS give your response STRICTLY in the above response format with the TWO lines start with "ACTION:" and "ACTION INPUT:" respectively!
Now the game starts! ${role_description} You should give your action based on the above history. Remember, you should ALWAYS give your response STRICTLY in the above response format with the TWO lines start with "Action:" and "Action Input:" respectively!

summary_prompt: &summary_prompt |
Progressively summarize the lines of a record that you uses tools, which contains inputs for certain tools and the results returned by these tools. Based on the current summary, you need to summarize from the record the goals that the you intended to solve with each call to the tool, add it onto the previous summary, and eventually return a new summary.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

36 changes: 0 additions & 36 deletions agentverse/tasks/simulation/pokemon/output_parser.py

This file was deleted.

Loading

0 comments on commit 8afc498

Please sign in to comment.