auto-coder 0.1.374__py3-none-any.whl → 0.1.376__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 (61) hide show
  1. {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/METADATA +2 -2
  2. {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/RECORD +27 -57
  3. autocoder/agent/base_agentic/base_agent.py +202 -52
  4. autocoder/agent/base_agentic/default_tools.py +38 -6
  5. autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +83 -43
  6. autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +88 -25
  7. autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +171 -62
  8. autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +101 -56
  9. autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +5 -0
  10. autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +5 -0
  11. autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +145 -32
  12. autocoder/auto_coder_rag.py +80 -11
  13. autocoder/models.py +2 -2
  14. autocoder/rag/agentic_rag.py +217 -0
  15. autocoder/rag/cache/local_duckdb_storage_cache.py +63 -33
  16. autocoder/rag/conversation_to_queries.py +37 -5
  17. autocoder/rag/long_context_rag.py +161 -41
  18. autocoder/rag/tools/__init__.py +10 -0
  19. autocoder/rag/tools/recall_tool.py +163 -0
  20. autocoder/rag/tools/search_tool.py +126 -0
  21. autocoder/rag/types.py +36 -0
  22. autocoder/utils/_markitdown.py +59 -13
  23. autocoder/version.py +1 -1
  24. autocoder/agent/agentic_edit.py +0 -833
  25. autocoder/agent/agentic_edit_tools/__init__.py +0 -28
  26. autocoder/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +0 -32
  27. autocoder/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +0 -29
  28. autocoder/agent/agentic_edit_tools/base_tool_resolver.py +0 -29
  29. autocoder/agent/agentic_edit_tools/execute_command_tool_resolver.py +0 -84
  30. autocoder/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +0 -75
  31. autocoder/agent/agentic_edit_tools/list_files_tool_resolver.py +0 -62
  32. autocoder/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +0 -30
  33. autocoder/agent/agentic_edit_tools/read_file_tool_resolver.py +0 -36
  34. autocoder/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +0 -95
  35. autocoder/agent/agentic_edit_tools/search_files_tool_resolver.py +0 -70
  36. autocoder/agent/agentic_edit_tools/use_mcp_tool_resolver.py +0 -55
  37. autocoder/agent/agentic_edit_tools/write_to_file_tool_resolver.py +0 -98
  38. autocoder/agent/agentic_edit_types.py +0 -124
  39. autocoder/auto_coder_lang.py +0 -60
  40. autocoder/auto_coder_rag_client_mcp.py +0 -170
  41. autocoder/auto_coder_rag_mcp.py +0 -193
  42. autocoder/common/llm_rerank.py +0 -84
  43. autocoder/common/model_speed_test.py +0 -392
  44. autocoder/common/v2/agent/agentic_edit_conversation.py +0 -188
  45. autocoder/common/v2/agent/ignore_utils.py +0 -50
  46. autocoder/dispacher/actions/plugins/action_translate.py +0 -214
  47. autocoder/ignorefiles/__init__.py +0 -4
  48. autocoder/ignorefiles/ignore_file_utils.py +0 -63
  49. autocoder/ignorefiles/test_ignore_file_utils.py +0 -91
  50. autocoder/linters/code_linter.py +0 -588
  51. autocoder/rag/loaders/test_image_loader.py +0 -209
  52. autocoder/rag/raw_rag.py +0 -96
  53. autocoder/rag/simple_directory_reader.py +0 -646
  54. autocoder/rag/simple_rag.py +0 -404
  55. autocoder/regex_project/__init__.py +0 -162
  56. autocoder/utils/coder.py +0 -125
  57. autocoder/utils/tests.py +0 -37
  58. {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/LICENSE +0 -0
  59. {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/WHEEL +0 -0
  60. {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/entry_points.txt +0 -0
  61. {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/top_level.txt +0 -0
@@ -151,7 +151,31 @@ class _CustomMarkdownify(markdownify.MarkdownConverter):
151
151
  return "![%s](%s%s)" % (alt, src, title_part)
152
152
 
153
153
  def convert_soup(self, soup: Any) -> str:
154
- return super().convert_soup(soup) # type: ignore
154
+ try:
155
+ # 设置递归深度限制,避免复杂文档导致的递归错误
156
+ import sys
157
+ original_limit = sys.getrecursionlimit()
158
+ try:
159
+ # 增加递归深度限制
160
+ sys.setrecursionlimit(10000) # 设置更高的递归限制
161
+ return super().convert_soup(soup) # type: ignore
162
+ finally:
163
+ # 恢复原始递归深度限制
164
+ sys.setrecursionlimit(original_limit)
165
+ except RecursionError:
166
+ # 处理递归错误,尝试简化处理
167
+ logger.warning("RecursionError in convert_soup, falling back to simplified conversion")
168
+ # 返回简化的文本内容
169
+ return self._simplified_convert(soup)
170
+
171
+ def _simplified_convert(self, soup: Any) -> str:
172
+ """简化的转换方法,用于处理复杂文档时的回退方案"""
173
+ # 提取纯文本内容
174
+ text = soup.get_text(separator="\n", strip=True)
175
+ # 基本清理
176
+ text = re.sub(r'\s+', ' ', text)
177
+ text = re.sub(r'\n{3,}', '\n\n', text)
178
+ return text
155
179
 
156
180
 
157
181
  class DocumentConverterResult:
@@ -224,20 +248,42 @@ class HtmlConverter(DocumentConverter):
224
248
  for script in soup(["script", "style"]):
225
249
  script.extract()
226
250
 
227
- # Print only the main content
228
- body_elm = soup.find("body")
229
- webpage_text = ""
230
- if body_elm:
231
- webpage_text = _CustomMarkdownify().convert_soup(body_elm)
232
- else:
233
- webpage_text = _CustomMarkdownify().convert_soup(soup)
251
+ try:
252
+ # Print only the main content
253
+ body_elm = soup.find("body")
254
+ webpage_text = ""
255
+ if body_elm:
256
+ webpage_text = _CustomMarkdownify().convert_soup(body_elm)
257
+ else:
258
+ webpage_text = _CustomMarkdownify().convert_soup(soup)
234
259
 
235
- assert isinstance(webpage_text, str)
260
+ assert isinstance(webpage_text, str)
236
261
 
237
- return DocumentConverterResult(
238
- title=None if soup.title is None else soup.title.string,
239
- text_content=webpage_text,
240
- )
262
+ return DocumentConverterResult(
263
+ title=None if soup.title is None else soup.title.string,
264
+ text_content=webpage_text,
265
+ )
266
+ except Exception as e:
267
+ # 如果转换过程中出现任何错误,尝试使用简化的方法提取文本
268
+ logger.warning(f"Error in HTML conversion: {str(e)}. Falling back to simplified text extraction.")
269
+ try:
270
+ # 简化的文本提取
271
+ text = soup.get_text(separator="\n", strip=True)
272
+ # 基本清理
273
+ text = re.sub(r'\s+', ' ', text)
274
+ text = re.sub(r'\n{3,}', '\n\n', text)
275
+
276
+ return DocumentConverterResult(
277
+ title=None if soup.title is None else soup.title.string,
278
+ text_content=text,
279
+ )
280
+ except Exception as inner_e:
281
+ # 如果简化提取也失败,记录错误并返回空结果
282
+ logger.error(f"Failed to extract text with simplified method: {str(inner_e)}")
283
+ return DocumentConverterResult(
284
+ title=None,
285
+ text_content=f"[文档转换失败] 无法提取内容: {str(e)}",
286
+ )
241
287
 
242
288
 
243
289
  class WikipediaConverter(DocumentConverter):
autocoder/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- __version__ = "0.1.374"
2
+ __version__ = "0.1.376"