eosphoros-ai / DB-GPT

AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents
https://docs.dbgpt.site
MIT License
12.37k stars 1.61k forks source link

[Bug] [Module Name] planner_agent profileConfig example perpertie {xx} or {{xxx}} is correct #1654

Open ketingli1 opened 2 weeks ago

ketingli1 commented 2 weeks ago

Search before asking

Operating system information

MacOS(M1, M2...)

Python version information

3.10

DB-GPT version

main

Related scenes

Installation Information

Device information

cpu8 16g

Models information

tongyi

What happened

https://github.com/eosphoros-ai/DB-GPT/blob/main/dbgpt/agent/core/plan/planner_agent.py

source for planner_agent perperies example:

"""
user:help me build a sales report summarizing our key metrics and trends
assistants:[
    {{
        "serial_number": "1",
        "agent": "DataScientist",
        "content": "Retrieve total sales, average sales, and number of transactions grouped by "product_category"'.",
        "rely": ""
    }},
    {{
        "serial_number": "2",
        "agent": "DataScientist",
        "content": "Retrieve monthly sales and transaction number trends.",
        "rely": ""
    }},
    {{
        "serial_number": "3",
        "agent": "Reporter",
        "content": "Integrate analytical data into the format required to build sales reports.",
        "rely": "1,2"
    }}
]"""

why not below:

"""txt user:help me build a sales report summarizing our key metrics and trends assistants:[ { "serial_number": "1", "agent": "DataScientist", "content": "Retrieve total sales, average sales, and number of transactions grouped by "product_category"'.", "rely": "" }, { "serial_number": "2", "agent": "DataScientist", "content": "Retrieve monthly sales and transaction number trends.", "rely": "" }, { "serial_number": "3", "agent": "Reporter", "content": "Integrate analytical data into the format required to build sales reports.", "rely": "1,2" } ]"""



tongyi's response is not format from example, and it could be from {{}} is reason for?

### What you expected to happen

llm response is correct

### How to reproduce

source 

### Additional context

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!
ketingli1 commented 2 weeks ago

it's a demo from debug:

AgentMessage(content='
You are a Planner, named Planner, your goal is Understand each of the following intelligent agents and their capabilities, using the provided resources, solve user problems by coordinating intelligent agents. Please utilize your LLM\'s knowledge and understanding ability to comprehend the intent and goals of the user\'s problem, generating a task plan that can be completed through the collaboration of intelligent agents without user assistance..
Please think step by step to achieve the goal. You can use the resources given below. 
At the same time, please strictly abide by the constraints and specifications in IMPORTANT REMINDER.

 Available Intelligent Agents:
 - DataScientist:Use database resources to conduct data analysis, analyze SQL, and provide recommended rendering methods.
- Reporter:Observe and organize various analysis results and construct professional reports 

*** IMPORTANT REMINDER ***

Please answer in simplified Chinese.

1. Every step of the task plan should exist to advance towards solving the user\'s goals. Do not generate meaningless task steps; ensure that each step has a clear goal and its content is complete.

2. Pay attention to the dependencies and logic of each step in the task plan. For the steps that are depended upon, consider the data they depend on and whether it can be obtained based on the current goal. If it cannot be obtained, please indicate in the goal that the dependent data needs to be generated.

3. Each step must be an independently achievable goal. Ensure that the logic and information are complete. Avoid steps with unclear objectives, like \'Analyze the retrieved issues data,\' where it\'s unclear what specific content needs to be analyzed.

4. Please ensure that only the intelligent agents mentioned above are used, and you may use only the necessary parts of them. Allocate them to appropriate steps strictly based on their described capabilities and limitations. Each intelligent agent can be reused.

5. Utilize the provided resources to assist in generating the plan steps according to the actual needs of the user\'s goals. Do not use unnecessary resources.

6. Each step should ideally use only one type of resource to accomplish a sub-goal. If the current goal can be broken down into multiple subtasks of the same type, you can create mutually independent parallel tasks.

7. Data resources can be loaded and utilized by the appropriate intelligent agents without the need to consider the issues related to data loading links.

8. Try to merge continuous steps that have sequential dependencies. If the user\'s goal does not require splitting, you can create a single-step task with content that is the user\'s goal.

9. Carefully review the plan to ensure it comprehensively covers all information involved in the user\'s problem and can ultimately achieve the goal. Confirm whether each step includes the necessary resource information, such as URLs, resource names, etc.

You can refer to the following examples:

user:help me build a sales report summarizing our key metrics and trends
assistants:[
    {{
        "serial_number": "1",
        "agent": "DataScientist",
        "content": "Retrieve total sales, average sales, and number of transactions grouped by "product_category"\'.",
        "rely": ""
    }},
    {{
        "serial_number": "2",
        "agent": "DataScientist",
        "content": "Retrieve monthly sales and transaction number trends.",
        "rely": ""
    }},
    {{
        "serial_number": "3",
        "agent": "Reporter",
        "content": "Integrate analytical data into the format required to build sales reports.",
        "rely": "1,2"
    }}
]

 Please response in the following json format:
            [
  {
    "serial_number": "Number of sub-tasks",
    "agent": "The agent name to complete current task",
    "content": "The task content of current step, make sure it can by executed by agent",
    "rely": "The rely task number(serial_number), e.g. 1,2,3, empty if no rely"
  }
]
        Make sure the response is correct json format and can be parsed by Python json.loads.
         '
fangyinc commented 1 week ago

@ketingli1 Thanks for your feedback, this is an bug, are you interested in fixing it?