devika icon indicating copy to clipboard operation
devika copied to clipboard

Strange created filenames.

Open kgott opened this issue 1 year ago • 6 comments

I am using devika on an ubuntu 22.04 LTS machine with a local running ollama with various models. In principle it is creating files, but the file names are strange like: tom@tomHome test2 $ ls 'main.py' Where can I fix that, so the filename would be main.py?

Originally posted by @tblock-zz in https://github.com/stitionai/devika/discussions/564

kgott avatar May 17 '24 02:05 kgott

Works great with the models I've tried.

dagelf avatar May 26 '24 19:05 dagelf

I can confirm that the ticks are being created on my windows install.

Files created in one of the projects folders:

`main.py`
`requirements.txt`

My setup: Windows 10, Python 3.11.12, running 4a62feb782accb1b2f67c387e73f7c80672529bb

steinhaug avatar May 30 '24 00:05 steinhaug

Just replace this line in. Validate response function of coder agent current_file = line.split(":")[1].strip() To current_file = line.split("`")[1].strip()

darrassi1 avatar May 30 '24 19:05 darrassi1

In

Just replace this line in. Validate response function of coder agent current_file = line.split(":")[1].strip() To current_file = line.split("`")[1].strip()

In which file? I have the same Problem.

GaryCooper23 avatar Jun 03 '24 10:06 GaryCooper23

Found it under "devika\src\agents\coder\coder.py"

GaryCooper23 avatar Jun 03 '24 10:06 GaryCooper23

Hi all, I already made a fix for this on PR #567 over 2 weeks ago:

current_file = line.split(":")[1].replace("`", "").strip()

We can't just change it back to split on the backtick, as I've seen it where the backticks are not always generated, so it would kick an "index out of range" error. So my solution was to keep the split on the colon, but replace the backticks with empty spaces. Can someone approve PR #567?

kgott avatar Jun 03 '24 14:06 kgott