(eg:ExecutionGraph,functions,query)
| 43 | |
| 44 | |
| 45 | def generate_init_message_node(eg:ExecutionGraph,functions,query): |
| 46 | init_node = ExecutionNode(role='system', message="You are AutoGPT, you can use many tools(functions) to do the following task.\nFirst I will give you the task description, and your task start.\nAt each step, you need to give your thought to analyze the status now and what to do next, with a function call to actually excute your step.\nAfter the call, you will get the call result, and you are now in a new state.\nThen you will analyze your status now, then decide what to do next...\nAfter many (Thought-call) pairs, you finally perform the task, then you can give your finial answer.\nRemember: \n1.the state change is irreversible, you can't go back to one of the former state, if you want to restart the task, say \"I give up and restart\".\n2.All the thought is short, at most in 5 sentence.\n3.You can do more then one trys, so if your plan is to continusly try some conditions, you can do one of the conditions per try.\nLet's Begin!\nTask description: You should use functions to help handle the real time user querys. Remember to ALWAYS call \"Finish\" function at the end of the task. And the final answer should contain enough information to show to the user.\nSpecifically, you have access to the following functions: " + str(functions)) |
| 47 | eg.set_init_node(init_node) |
| 48 | |
| 49 | node = ExecutionNode(role='user', message=query) |
| 50 | eg.add_node(node) |
| 51 | eg[init_node,node] = None |
| 52 | return node |
| 53 | |
| 54 | def process_valid_data(method,answer_generation): |
| 55 | conversation = answer_generation['train_messages'][-1] |
no test coverage detected