-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
fix: artifacts content indentation #951
base: main
Are you sure you want to change the base?
fix: artifacts content indentation #951
Conversation
hey thanks for this PR. need to test this with python code. does this work if the indentation is already correct? |
Hey thank your for the review. This happens with any generated code not just python. It should work for any code not just python just mentioned as I read someone had the same problem, what I found out it's related to the artifact indentation. Code here // <- generated code keeps indentation from the llmThe PR has a fix that takes into account the indentation in general so for code that is not it should work as it leaves the code as is. |
As far as Python goes, we do not have support for python anyways no? |
sorry miss clicked on close |
I will test this PR with different model outputs and see if it works for all |
I wanted to have a different approach on this. the root cause of llm putting an extra indentation on files was due to system prompt having such indentation in its examples. I have modified the examples best represent the expected outputs |
This fixes an issue with indentation of the files content.
It works with python, etc
this is an example of how indentation is broken
![image](https://private-user-images.githubusercontent.com/10489372/399385582-51dc075f-7837-44dc-a20e-a269c9f4fd03.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDQwOTksIm5iZiI6MTczOTI0Mzc5OSwicGF0aCI6Ii8xMDQ4OTM3Mi8zOTkzODU1ODItNTFkYzA3NWYtNzgzNy00NGRjLWEyMGUtYTI2OWM5ZjRmZDAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAzMTYzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3MzdjZjM5MjAxNDc0MGY5OGM4M2VkYjk1NDY5ZmM4M2I0MjI4YTFkZWZmYmFlN2Q0N2E4NjUyNzViZTg0YjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0LSDuy1tLbvFISS_rN7nr9LS0vCzYI4uJo5iMWsPqRM)
this is how it gets fixed
![Captura de pantalla 2024-12-30 a la(s) 5 32 23 p m](https://private-user-images.githubusercontent.com/10489372/399385484-42780926-979a-4115-b60d-699e948f569e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDQwOTksIm5iZiI6MTczOTI0Mzc5OSwicGF0aCI6Ii8xMDQ4OTM3Mi8zOTkzODU0ODQtNDI3ODA5MjYtOTc5YS00MTE1LWI2MGQtNjk5ZTk0OGY1NjllLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAzMTYzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmMGE3NjFiYzYxOTI3NTA3NzlhOWNjNjE5M2EzZDlhZmEyMGEzNzExZTMyNGNlNzMzYWY5MThmZTMxM2NkNGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.rTbT-moJIPAYMkjFvyQ6zBOHeZwylBaOl4PWArq65i8)