auto-coder 0.1.226__py3-none-any.whl → 0.1.228__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of auto-coder might be problematic. Click here for more details.

Files changed (30) hide show
  1. {auto_coder-0.1.226.dist-info → auto_coder-0.1.228.dist-info}/METADATA +2 -2
  2. {auto_coder-0.1.226.dist-info → auto_coder-0.1.228.dist-info}/RECORD +30 -27
  3. autocoder/auto_coder.py +424 -131
  4. autocoder/chat_auto_coder.py +267 -143
  5. autocoder/chat_auto_coder_lang.py +30 -1
  6. autocoder/common/__init__.py +2 -1
  7. autocoder/common/code_auto_generate.py +23 -9
  8. autocoder/common/code_auto_generate_diff.py +23 -9
  9. autocoder/common/code_auto_generate_editblock.py +23 -9
  10. autocoder/common/code_auto_generate_strict_diff.py +23 -9
  11. autocoder/common/code_auto_merge.py +3 -3
  12. autocoder/common/code_auto_merge_diff.py +3 -4
  13. autocoder/common/code_auto_merge_editblock.py +3 -7
  14. autocoder/common/command_completer.py +6 -0
  15. autocoder/common/files.py +26 -0
  16. autocoder/common/types.py +1 -0
  17. autocoder/common/utils_code_auto_generate.py +38 -0
  18. autocoder/dispacher/actions/action.py +4 -4
  19. autocoder/dispacher/actions/plugins/action_regex_project.py +6 -2
  20. autocoder/models.py +158 -0
  21. autocoder/pyproject/__init__.py +5 -8
  22. autocoder/regexproject/__init__.py +2 -3
  23. autocoder/suffixproject/__init__.py +2 -3
  24. autocoder/tsproject/__init__.py +2 -2
  25. autocoder/utils/rest.py +3 -2
  26. autocoder/version.py +1 -1
  27. {auto_coder-0.1.226.dist-info → auto_coder-0.1.228.dist-info}/LICENSE +0 -0
  28. {auto_coder-0.1.226.dist-info → auto_coder-0.1.228.dist-info}/WHEEL +0 -0
  29. {auto_coder-0.1.226.dist-info → auto_coder-0.1.228.dist-info}/entry_points.txt +0 -0
  30. {auto_coder-0.1.226.dist-info → auto_coder-0.1.228.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,7 @@ from pydantic import BaseModel, Field
12
12
  from rich.console import Console
13
13
  import json
14
14
  from autocoder.utils.queue_communicate import queue_communicate, CommunicateEvent, CommunicateEventType
15
-
15
+ from autocoder.common import files as FileUtils
16
16
 
17
17
  class RegPattern(BaseModel):
18
18
  pattern: str = Field(
@@ -120,8 +120,7 @@ class SuffixProject:
120
120
  return any([file_path.endswith(suffix) for suffix in self.suffixs])
121
121
 
122
122
  def read_file_content(self, file_path):
123
- with open(file_path, "r") as file:
124
- return file.read()
123
+ return FileUtils.read_file(file_path)
125
124
 
126
125
  def convert_to_source_code(self, file_path):
127
126
  module_name = file_path
@@ -14,6 +14,7 @@ from pydantic import BaseModel, Field
14
14
  from rich.console import Console
15
15
  import json
16
16
  from autocoder.utils.queue_communicate import queue_communicate, CommunicateEvent, CommunicateEventType
17
+ from autocoder.common import files as FileUtils
17
18
 
18
19
 
19
20
  class RegPattern(BaseModel):
@@ -107,8 +108,7 @@ class TSProject:
107
108
  return open(self.target_file, "r").read()
108
109
 
109
110
  def read_file_content(self, file_path):
110
- with open(file_path, "r") as file:
111
- return file.read()
111
+ return FileUtils.read_file(file_path)
112
112
 
113
113
  def is_likely_useful_file(self, file_path):
114
114
  # Ignore common build output, dependency and configuration directories
autocoder/utils/rest.py CHANGED
@@ -7,6 +7,7 @@ from bs4 import BeautifulSoup
7
7
  from loguru import logger
8
8
  import os
9
9
  from pathlib import Path
10
+ from autocoder.common import files as FileUtils
10
11
 
11
12
  class HttpDoc:
12
13
  def __init__(self, args, llm: byzerllm.ByzerLLM,urls:Optional[List[str]]=None):
@@ -112,7 +113,7 @@ class HttpDoc:
112
113
  return temp_documents
113
114
 
114
115
  if ext not in exts.keys():
115
- main_content = open(file_path, "r").read()
116
+ main_content = FileUtils.read_file(file_path)
116
117
  source_code = SourceCode(module_name=file_path, source_code=main_content)
117
118
  source_codes.append(source_code)
118
119
  else:
@@ -135,7 +136,7 @@ class HttpDoc:
135
136
 
136
137
  except ImportError as e:
137
138
  logger.warning(f"Failed to import llama_index. Please install it using 'pip install llama_index' {e}")
138
- main_content = open(url, "r").read()
139
+ main_content = FileUtils.read_file(url)
139
140
  source_code = SourceCode(module_name=url, source_code=main_content)
140
141
  source_codes.append(source_code)
141
142
  else:
autocoder/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.226"
1
+ __version__ = "0.1.228"