Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodacus committed Jun 13, 2023
1 parent 6365904 commit f4dd95d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lazydev/modules/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ def write_file_content(self, file_path, review_iteration: int = 1):
)
response = self.brain_storm(
review_prompt, f'code-{file_path.split("/")[-1]}')
response = response.strip('"\'`-\n')
if (response.strip('"\'`-\n') == "NONE"):
response = response.strip('."\'`-\n')
nonecheck_response = response.split("\n")[0].split(" ")[0]
if (nonecheck_response.strip('."\'`-\n') == "NONE"):
break
code = response

Expand Down
6 changes: 5 additions & 1 deletion lazydev/modules/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,15 @@ def get_code_feedback(draft: str, question, clarifications: str, plan: str, file
your job is to find problems with the code and refine it.
As your response will go to an automated parser, things to keep in mind all the time:
* if no refinement is required then just say NONE, and nothing else
* if no refinement is required then just say "NONE", and nothing else
* only write the file content, no expiation, no pretext as this will directly go as code.
* if the language support, add comments at steps, which expains what you are about to do, dont add comment if comment is not supported by the file type example json file
* keep in mind there wont be any additional files other then the full files list given above, only use files that are mentioned in that list
Begin!
File: {file_path_to_write}
Refined code:
"""

def get_compressed_code(code: str):
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="lazydev",
version='0.0.8',
version='0.0.9',
packages=find_packages(),
install_requires=[
"langchain>=0.0.188",
Expand Down Expand Up @@ -46,3 +46,8 @@
# ],

)

# steps to build and publish
# source .venv/bin/activate
# python -m bild
# twine upload dist/*

0 comments on commit f4dd95d

Please sign in to comment.