How to implement regenerate-code #942
-
I noticed that if I give a task about generate Python Script, if execute the generated code will have some bug, the agent will solve the code automatically. I want to ask how to implement this in the framework? Since I read the source code but I cannot find when the code run fail, how to give the error msg for the agent to improve it. |
Beta Was this translation helpful? Give feedback.
Answered by
rickyloynd-microsoft
Dec 11, 2023
Replies: 1 comment 3 replies
-
Are you referring to the type of example shown on the README? (plot NVDA vs. TESLA) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you're on the right track. For instance, if a user asks chatgpt to write some code, it's expected that the user will then run the code themselves. And if an error message is produced, the user can paste that error message into the chat window. Then chatgpt will often rewrite the code to resolve the error. Similarly, in autogen, the UserProxyAgent has the ability to execute code and send error messages back to the AssistantAgent that wrote the code, so that the assistant can reply with a (hopefully) corrected version of the code to be tried next. Does that answer your question, or is there some part of it that you would like to understand better?