GithubHelp home page GithubHelp logo

Comments (1)

xxx1099836595 avatar xxx1099836595 commented on August 15, 2024

经过我测试发现

openai functions 和 function_call 将要废弃,指定function_call,返回然是messages响应.
{'model': 'gpt-3.5-turbo-16k', 'messages': [{'role': 'system', 'content': 'You are an efficient plan-generation agent, your task is to decompose a query into several subtasks that describe must achieved goals for the query.\n--- Background Information ---\nPLAN AND SUBTASK:\nA plan has a tree manner of subtasks: task 1 contatins subtasks task 1.1, task 1.2, task 1.3, ... and task 1.2 contains subtasks 1.2.1, 1.2.2, ...\n\nA subtask-structure has the following json component:\n{\n"subtask name": string, name of the subtask\n"goal.goal": string, the main purpose of the subtask, and what will you do to reach this goal?\n"goal.criticism": string, what potential problems may the current subtask and goal have?\n"milestones": list[string]. what milestones should be achieved to ensure the subtask is done? Make it detailed and specific.\n}\nSUBTASK HANDLE:\nA task-handling agent will handle all the subtasks as the inorder-traversal. For example:\n1. it will handle subtask 1 first.\n2. if solved, handle subtask 2. If failed, split subtask 1 as subtask 1.1 1.2 1.3... Then handle subtask 1.1 1.2 1.3...\n3. Handle subtasks recurrsively, until all subtasks are soloved. Do not make the task queue too complex, make it efficiently solve the original task.\n4. It is powered by a state-of-the-art LLM, so it can handle many subtasks without using external tools or execute codes.\n\nRESOURCES:\n1. Internet access for searches and information gathering, search engine and web browsing.\n2. A FileSystemEnv to read and write files (txt, code, markdown, latex...)\n3. A python notebook to execute python code. Always follow python coding rules.\n4. A ShellEnv to execute bash or zsh command to further achieve complex goals. \n--- Task Description ---\nGenerate the plan for query with operation SUBTASK_SPLIT, make sure all must reach goals are included in the plan.\n\n*** Important Notice ***\n- Always make feasible and efficient plans that can lead to successful task solving. Never create new subtasks that similar or same as the existing subtasks.\n- For subtasks with similar goals, try to do them together in one subtask with a list of subgoals, rather than split them into multiple subtasks.\n- Do not waste time on making irrelevant or unnecessary plans.\n- The task handler is powered by sota LLM, which can directly answer many questions. So make sure your plan can fully utilize its ability and reduce the complexity of the subtasks tree.\n- You can plan multiple subtasks if you want.\n- Minimize the number of subtasks, but make sure all must reach goals are included in the plan.\n'}, {'role': 'user', 'content': 'This is not the first time you are handling the task, so you should give a initial plan. Here is the query:\n"""\n{\n "name": "act as Assistant",\n "goal": "帮我生成一些数字",\n "prior_plan_criticsim": "",\n "milestones": [],\n "exceute_status": "TODO"\n}\n"""\nYou will use operation SUBTASK_SPLIT to split the query into 2-4 subtasks and then commit.'}], 'functions': [{'name': 'subtask_split_operation', 'description': 'further split the target subtask into subtasks. You can only split a status==FAIL task', 'parameters': {'type': 'object', 'properties': {'target_subtask_id': {'type': 'string', 'description': "Which subtask do you want to modify. This must be a inter split by '.', like '1.2' '2.3.3' or '4'. You must ensure this subtask exists and is a FAIL task"}, 'subtasks': {'type': 'array', 'description': 'Max 3 items, min 1 items. Array of the splited subtasks, length of 1-3', 'items': {'type': 'object', 'properties': {'subtask name': {'type': 'string'}, 'goal': {'type': 'object', 'properties': {'goal': {'type': 'string', 'description': 'the main purpose of what the sub-task should handle, and what will you do(tool calls) to reach this goal'}, 'criticism': {'type': 'string', 'description': 'What problems may the current subtask and goal have?'}}}, 'milestones': {'type': 'array', 'description': 'How to automatically check the subtask is done? The subtasks after this subtask will consider all the milestones are done.', 'items': {'type': 'string'}}}, 'required': ['subtask name', 'goal', 'milestones']}}, 'thought': {'description': 'Why you choose this operation, and what you want to do next?', 'type': 'string'}}, 'required': ['target_subtask_id', 'subtasks', 'thought']}}], 'function_call': {'name': 'subtask_split_operation'}}
使用 openai

tools
tools_call

不会出现这种情况

{ 'model': 'gpt-3.5-turbo-16k', 'messages': [ { 'role': 'system', 'content': 'You are an efficient plan-generation agent, your task is to decompose a query into several subtasks that describe must achieved goals for the query.\n--- Background Information ---\nPLAN AND SUBTASK:\nA plan has a tree manner of subtasks: task 1 contatins subtasks task 1.1, task 1.2, task 1.3, ... and task 1.2 contains subtasks 1.2.1, 1.2.2, ...\n\nA subtask-structure has the following json component:\n{\n"subtask name": string, name of the subtask\n"goal.goal": string, the main purpose of the subtask, and what will you do to reach this goal?\n"goal.criticism": string, what potential problems may the current subtask and goal have?\n"milestones": list[string]. what milestones should be achieved to ensure the subtask is done? Make it detailed and specific.\n}\nSUBTASK HANDLE:\nA task-handling agent will handle all the subtasks as the inorder-traversal. For example:\n1. it will handle subtask 1 first.\n2. if solved, handle subtask 2. If failed, split subtask 1 as subtask 1.1 1.2 1.3... Then handle subtask 1.1 1.2 1.3...\n3. Handle subtasks recurrsively, until all subtasks are soloved. Do not make the task queue too complex, make it efficiently solve the original task.\n4. It is powered by a state-of-the-art LLM, so it can handle many subtasks without using external tools or execute codes.\n\nRESOURCES:\n1. Internet access for searches and information gathering, search engine and web browsing.\n2. A FileSystemEnv to read and write files (txt, code, markdown, latex...)\n3. A python notebook to execute python code. Always follow python coding rules.\n4. A ShellEnv to execute bash or zsh command to further achieve complex goals. \n--- Task Description ---\nGenerate the plan for query with operation SUBTASK_SPLIT, make sure all must reach goals are included in the plan.\n\n*** Important Notice ***\n- Always make feasible and efficient plans that can lead to successful task solving. Never create new subtasks that similar or same as the existing subtasks.\n- For subtasks with similar goals, try to do them together in one subtask with a list of subgoals, rather than split them into multiple subtasks.\n- Do not waste time on making irrelevant or unnecessary plans.\n- The task handler is powered by sota LLM, which can directly answer many questions. So make sure your plan can fully utilize its ability and reduce the complexity of the subtasks tree.\n- You can plan multiple subtasks if you want.\n- Minimize the number of subtasks, but make sure all must reach goals are included in the plan.\n' }, { 'role': 'user', 'content': 'This is not the first time you are handling the task, so you should give a initial plan. Here is the query:\n"""\n{\n "name": "act as Assistant",\n "goal": "tel me 1+1",\n "prior_plan_criticsim": "",\n "milestones": [],\n "exceute_status": "TODO"\n}\n"""\nYou will use operation SUBTASK_SPLIT to split the query into 2-4 subtasks and then commit.'} ], 'tools': [ { "type": "function", "function": { 'name': 'subtask_split_operation', 'description': 'further split the target subtask into subtasks. You can only split a status==FAIL task', 'parameters': { 'type': 'object', 'properties': { 'target_subtask_id': { 'type': 'string', 'description': "Which subtask do you want to modify. This must be a inter split by '.', like '1.2' '2.3.3' or '4'. You must ensure this subtask exists and is a FAIL task" }, 'subtasks': { 'type': 'array', 'description': 'Max 3 items, min 1 items. Array of the splited subtasks, length of 1-3', 'items': { 'type': 'object', 'properties': { 'subtask name': { 'type': 'string' }, 'goal': { 'type': 'object', 'properties': { 'goal': { 'type': 'string', 'description': 'the main purpose of what the sub-task should handle, and what will you do(tool calls) to reach this goal' }, 'criticism': { 'type': 'string', 'description': 'What problems may the current subtask and goal have?' } } }, 'milestones': { 'type': 'array', 'description': 'How to automatically check the subtask is done? The subtasks after this subtask will consider all the milestones are done.', 'items': {'type': 'string'} } }, 'required': ['subtask name', 'goal', 'milestones'] } }, 'thought': { 'description': 'Why you choose this operation, and what you want to do next?', 'type': 'string' } }, 'required': ['target_subtask_id', 'subtasks', 'thought'] } } } ], 'tool_choice': {"type": "function", "function": {"name": "subtask_split_operation"}} }

from xagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.