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.
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/METADATA +2 -2
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/RECORD +27 -57
- autocoder/agent/base_agentic/base_agent.py +202 -52
- autocoder/agent/base_agentic/default_tools.py +38 -6
- autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +83 -43
- autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +88 -25
- autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +171 -62
- autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +101 -56
- autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +5 -0
- autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +5 -0
- autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +145 -32
- autocoder/auto_coder_rag.py +80 -11
- autocoder/models.py +2 -2
- autocoder/rag/agentic_rag.py +217 -0
- autocoder/rag/cache/local_duckdb_storage_cache.py +63 -33
- autocoder/rag/conversation_to_queries.py +37 -5
- autocoder/rag/long_context_rag.py +161 -41
- autocoder/rag/tools/__init__.py +10 -0
- autocoder/rag/tools/recall_tool.py +163 -0
- autocoder/rag/tools/search_tool.py +126 -0
- autocoder/rag/types.py +36 -0
- autocoder/utils/_markitdown.py +59 -13
- autocoder/version.py +1 -1
- autocoder/agent/agentic_edit.py +0 -833
- autocoder/agent/agentic_edit_tools/__init__.py +0 -28
- autocoder/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +0 -32
- autocoder/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +0 -29
- autocoder/agent/agentic_edit_tools/base_tool_resolver.py +0 -29
- autocoder/agent/agentic_edit_tools/execute_command_tool_resolver.py +0 -84
- autocoder/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +0 -75
- autocoder/agent/agentic_edit_tools/list_files_tool_resolver.py +0 -62
- autocoder/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +0 -30
- autocoder/agent/agentic_edit_tools/read_file_tool_resolver.py +0 -36
- autocoder/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +0 -95
- autocoder/agent/agentic_edit_tools/search_files_tool_resolver.py +0 -70
- autocoder/agent/agentic_edit_tools/use_mcp_tool_resolver.py +0 -55
- autocoder/agent/agentic_edit_tools/write_to_file_tool_resolver.py +0 -98
- autocoder/agent/agentic_edit_types.py +0 -124
- autocoder/auto_coder_lang.py +0 -60
- autocoder/auto_coder_rag_client_mcp.py +0 -170
- autocoder/auto_coder_rag_mcp.py +0 -193
- autocoder/common/llm_rerank.py +0 -84
- autocoder/common/model_speed_test.py +0 -392
- autocoder/common/v2/agent/agentic_edit_conversation.py +0 -188
- autocoder/common/v2/agent/ignore_utils.py +0 -50
- autocoder/dispacher/actions/plugins/action_translate.py +0 -214
- autocoder/ignorefiles/__init__.py +0 -4
- autocoder/ignorefiles/ignore_file_utils.py +0 -63
- autocoder/ignorefiles/test_ignore_file_utils.py +0 -91
- autocoder/linters/code_linter.py +0 -588
- autocoder/rag/loaders/test_image_loader.py +0 -209
- autocoder/rag/raw_rag.py +0 -96
- autocoder/rag/simple_directory_reader.py +0 -646
- autocoder/rag/simple_rag.py +0 -404
- autocoder/regex_project/__init__.py +0 -162
- autocoder/utils/coder.py +0 -125
- autocoder/utils/tests.py +0 -37
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/top_level.txt +0 -0
autocoder/utils/_markitdown.py
CHANGED
|
@@ -151,7 +151,31 @@ class _CustomMarkdownify(markdownify.MarkdownConverter):
|
|
|
151
151
|
return "" % (alt, src, title_part)
|
|
152
152
|
|
|
153
153
|
def convert_soup(self, soup: Any) -> str:
|
|
154
|
-
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
260
|
+
assert isinstance(webpage_text, str)
|
|
236
261
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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.
|
|
2
|
+
__version__ = "0.1.376"
|