update summary op

This commit is contained in:
jinli.yl 2025-07-10 21:03:54 +08:00
parent c66ace1e3a
commit c987ceecb2
5 changed files with 43 additions and 23 deletions

View file

@ -33,7 +33,8 @@ class BaseOp(PromptMixin, ABC):
if self.op_config.prompt_file_path:
prompt_file_path = self.op_config.prompt_file_path
else:
prompt_file_path = Path(__file__).parent / f"{self.simple_name}_prompt.yaml"
prompt_name = self.simple_name.replace("op", "").strip("_") + "_prompt.yaml"
prompt_file_path = Path(__file__).parent / prompt_name
# Load custom prompts from prompt file
self.load_prompt_by_file(prompt_file_path=prompt_file_path)

View file

@ -1,22 +0,0 @@
summary_prompt: |
# Role
You are a helpful assistant named BeyondAgent.
# User Question
{query}
# Execution Process
{execution_process}
# Answer
{answer}
# Task
Reflect on the strengths and weaknesses of the **Execution Process** and the **Answer** based on the **User Question**.
Finally, summarize generalized experience from handling such problems to accumulate experience for future similar tasks.
The experience should be broadly applicable, such as how to use tools effectively or approaches to solving certain types of problems.
Also, specify the conditions or scenarios in which these experience are applicable.
# Output Format
<condition> Output the scenarios or conditions in which applying this experience would be particularly effective... </condition>
<experience> Output generalized experience, concise content is required... </experience>

View file

@ -0,0 +1,41 @@
summary_prompt: |
# Role
You are a helpful assistant.
# User Question
{query}
# Execution Process
{execution_process}
# Answer
{answer}
# Task
Reflect on what went well and what did not go well in the execution path based on the user's question.
The summarized experiences should be generalizable, providing assistance in solving similar types of problems in the future.
They can include good suggestions or highlight areas to avoid and potential pitfalls.
The type of experience can be plain text or a piece of code that solves a specific problem.
If there are no experiences to summarize, output an empty list [].
For each experience, first state the scenario when it is applicable (when to use), then provide the experience itself, with a maximum of three experiences summarized.
# Output Format
{summary_example}
summary_example: |
``` json
[
{
"when_to_use": "...",
"experience": "..."
},
{
"when_to_use": "...",
"experience": "..."
},
{
"when_to_use": "...",
"experience": "..."
}
]
```