Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
debianmaster opened this issue Jan 13, 2024 · 3 comments

Comments

@debianmaster
Copy link

debianmaster commented Jan 13, 2024

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 debianmaster changed the title [Bug]: unknown language yaml (EXECUTING CODE BLOCK 0 (inferred language is yaml)) [Bug]: unknown language yaml EXECUTING CODE BLOCK 0 inferred language is yaml Jan 13, 2024
@sonichi
Copy link
Contributor

sonichi commented Jan 13, 2024

Solution provided in #1062

@afourney
Copy link
Member

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

@borisbolliet
Copy link

borisbolliet commented Jun 13, 2024

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!

@microsoft microsoft deleted a comment Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants