autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Bug]: unknown language yaml EXECUTING CODE BLOCK 0 inferred language is yaml

Open debianmaster opened this issue 2 years ago • 2 comments

Describe the bug

assistent is generating a yaml file but user proxy is unable to create yaml file, instead i see following error

>>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is yaml)...
user_proxy (to assistant):

exitcode: 1 (execution failed)
Code output:
unknown language yaml

Steps to reproduce

Simple user proxy setup with code assistant

You are a experts devops pipeline creater, you will be provided with a github repo url which you need to inspect based on the criteria below.
    You MUST follow all the steps provided below carefully.
    RULES:
    1. Clone to the github repository [email protected]:zelarhq/welcome-example.git.
    2. Inspect contents of the repo.
    3. Generate Dockerfile based on the contents of the repo, Do NOT build docker image.
    4. Generate kubernetes  based on the contents of the repo, Do NOT deploy the application.
    5. Generate a Github Actions  based on the contents of the repo          
    6. Push the generated files back to github        
    Send Terminate once you achieve all the above

Expected Behavior

A yaml file should be create instead of throwing error

Screenshots and logs

Screenshot 2024-01-14 at 12 30 21 AM

Additional Information

No response

debianmaster avatar Jan 13 '24 19:01 debianmaster

Solution provided in #1062

sonichi avatar Jan 13 '24 19:01 sonichi

Typically the way to get it to create a file is to ask it to include the following comment, or otherwise ask the assistant to write it to a file:

# filename: my_file_name.py

If it sees a code block without a filename comment, then it just tries to immediately execute it... and it's not clear what that means for yaml

afourney avatar Jan 15 '24 04:01 afourney

I solved this issue by adding:

To save the yaml file use yaml.dump() from a python script.

in my prompt/agent instructions.

Thanks for a great code!

borisbolliet avatar Jun 13 '24 16:06 borisbolliet