auto-coder 0.1.208__tar.gz → 0.1.209__tar.gz
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.208 → auto_coder-0.1.209}/PKG-INFO +3 -2
- {auto_coder-0.1.208 → auto_coder-0.1.209}/README.md +2 -1
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/auto_coder.egg-info/PKG-INFO +3 -2
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/cache/simple_cache.py +8 -2
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/loaders/docx_loader.py +3 -2
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/loaders/pdf_loader.py +3 -1
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/long_context_rag.py +10 -2
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/utils.py +14 -9
- auto_coder-0.1.209/src/autocoder/version.py +1 -0
- auto_coder-0.1.208/src/autocoder/version.py +0 -1
- {auto_coder-0.1.208 → auto_coder-0.1.209}/LICENSE +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/setup.cfg +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/setup.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/auto_coder.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/auto_coder_lang.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/chat_auto_coder.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/index/index.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_planner.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.208 → auto_coder-0.1.209}/tests/test_symbols_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.209
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -69,13 +69,14 @@ Auto-Coder (powered by Byzer-LLM)
|
|
|
69
69
|
</h3>
|
|
70
70
|
|
|
71
71
|
<p align="center">
|
|
72
|
-
|
|
72
|
+
<a href="https://uelng8wukz.feishu.cn/wiki/QIpkwpQo2iSdkwk9nP6cNSPlnPc"><b>中文</b></a> |
|
|
73
73
|
|
|
74
74
|
</p>
|
|
75
75
|
|
|
76
76
|
---
|
|
77
77
|
|
|
78
78
|
*Latest News* 🔥
|
|
79
|
+
- [2025/01] Release Auto-Coder 0.1.208
|
|
79
80
|
- [2024/09] Release Auto-Coder 0.1.163
|
|
80
81
|
- [2024/08] Release Auto-Coder 0.1.143
|
|
81
82
|
- [2024/07] Release Auto-Coder 0.1.115
|
|
@@ -9,13 +9,14 @@ Auto-Coder (powered by Byzer-LLM)
|
|
|
9
9
|
</h3>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
|
|
12
|
+
<a href="https://uelng8wukz.feishu.cn/wiki/QIpkwpQo2iSdkwk9nP6cNSPlnPc"><b>中文</b></a> |
|
|
13
13
|
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
*Latest News* 🔥
|
|
19
|
+
- [2025/01] Release Auto-Coder 0.1.208
|
|
19
20
|
- [2024/09] Release Auto-Coder 0.1.163
|
|
20
21
|
- [2024/08] Release Auto-Coder 0.1.143
|
|
21
22
|
- [2024/07] Release Auto-Coder 0.1.115
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.209
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -69,13 +69,14 @@ Auto-Coder (powered by Byzer-LLM)
|
|
|
69
69
|
</h3>
|
|
70
70
|
|
|
71
71
|
<p align="center">
|
|
72
|
-
|
|
72
|
+
<a href="https://uelng8wukz.feishu.cn/wiki/QIpkwpQo2iSdkwk9nP6cNSPlnPc"><b>中文</b></a> |
|
|
73
73
|
|
|
74
74
|
</p>
|
|
75
75
|
|
|
76
76
|
---
|
|
77
77
|
|
|
78
78
|
*Latest News* 🔥
|
|
79
|
+
- [2025/01] Release Auto-Coder 0.1.208
|
|
79
80
|
- [2024/09] Release Auto-Coder 0.1.163
|
|
80
81
|
- [2024/08] Release Auto-Coder 0.1.143
|
|
81
82
|
- [2024/07] Release Auto-Coder 0.1.115
|
|
@@ -98,7 +98,10 @@ class AutoCoderRAGAsyncUpdateQueue(BaseCacheManager):
|
|
|
98
98
|
process_file_in_multi_process, files_to_process)
|
|
99
99
|
|
|
100
100
|
for file_info, result in zip(files_to_process, results):
|
|
101
|
-
|
|
101
|
+
if result: # 只有当result不为空时才更新缓存
|
|
102
|
+
self.update_cache(file_info, result)
|
|
103
|
+
else:
|
|
104
|
+
logger.warning(f"Empty result for file: {file_info[0]}, skipping cache update")
|
|
102
105
|
|
|
103
106
|
self.write_cache()
|
|
104
107
|
|
|
@@ -138,7 +141,10 @@ class AutoCoderRAGAsyncUpdateQueue(BaseCacheManager):
|
|
|
138
141
|
logger.info(f"{file_info[0]} is detected to be updated")
|
|
139
142
|
try:
|
|
140
143
|
result = process_file_local(file_info[0])
|
|
141
|
-
|
|
144
|
+
if result: # 只有当result不为空时才更新缓存
|
|
145
|
+
self.update_cache(file_info, result)
|
|
146
|
+
else:
|
|
147
|
+
logger.warning(f"Empty result for file: {file_info[0]}, skipping cache update")
|
|
142
148
|
except Exception as e:
|
|
143
149
|
logger.error(
|
|
144
150
|
f"SimpleCache Error in process_queue: {e}")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from io import BytesIO
|
|
2
2
|
import docx2txt
|
|
3
3
|
from autocoder.utils._markitdown import MarkItDown
|
|
4
|
-
|
|
4
|
+
import traceback
|
|
5
5
|
|
|
6
6
|
def extract_text_from_docx_old(docx_path):
|
|
7
7
|
with open(docx_path, "rb") as f:
|
|
@@ -16,5 +16,6 @@ def extract_text_from_docx(docx_path):
|
|
|
16
16
|
md_converter = MarkItDown()
|
|
17
17
|
result = md_converter.convert(docx_path)
|
|
18
18
|
return result.text_content
|
|
19
|
-
except Exception as e:
|
|
19
|
+
except (BaseException, Exception) as e:
|
|
20
|
+
traceback.print_exc()
|
|
20
21
|
return extract_text_from_docx_old(docx_path)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from io import BytesIO
|
|
2
2
|
from pypdf import PdfReader
|
|
3
3
|
from autocoder.utils._markitdown import MarkItDown
|
|
4
|
+
import traceback
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
def extract_text_from_pdf_old(file_path):
|
|
@@ -18,5 +19,6 @@ def extract_text_from_pdf(file_path):
|
|
|
18
19
|
md_converter = MarkItDown()
|
|
19
20
|
result = md_converter.convert(file_path)
|
|
20
21
|
return result.text_content
|
|
21
|
-
except Exception as e:
|
|
22
|
+
except (BaseException, Exception) as e:
|
|
23
|
+
traceback.print_exc()
|
|
22
24
|
return extract_text_from_pdf_old(file_path)
|
|
@@ -182,19 +182,25 @@ class LongContextRAG:
|
|
|
182
182
|
使用以下文档和对话历史来提取相关信息。
|
|
183
183
|
|
|
184
184
|
文档:
|
|
185
|
+
<documents>
|
|
185
186
|
{% for doc in documents %}
|
|
186
187
|
{{ doc }}
|
|
187
188
|
{% endfor %}
|
|
189
|
+
</documents>
|
|
188
190
|
|
|
189
191
|
对话历史:
|
|
192
|
+
<conversations>
|
|
190
193
|
{% for msg in conversations %}
|
|
191
|
-
|
|
194
|
+
[{{ msg.role }}]:
|
|
195
|
+
{{ msg.content }}
|
|
196
|
+
|
|
192
197
|
{% endfor %}
|
|
198
|
+
</conversations>
|
|
193
199
|
|
|
194
200
|
请根据提供的文档内容、用户对话历史以及最后一个问题,提取并总结文档中与问题相关的重要信息。
|
|
195
201
|
如果文档中没有相关信息,请回复"该文档中没有与问题相关的信息"。
|
|
196
202
|
提取的信息尽量保持和原文中的一样,并且只输出这些信息。
|
|
197
|
-
"""
|
|
203
|
+
"""
|
|
198
204
|
|
|
199
205
|
@byzerllm.prompt()
|
|
200
206
|
def _answer_question(
|
|
@@ -202,9 +208,11 @@ class LongContextRAG:
|
|
|
202
208
|
) -> Generator[str, None, None]:
|
|
203
209
|
"""
|
|
204
210
|
文档:
|
|
211
|
+
<documents>
|
|
205
212
|
{% for doc in relevant_docs %}
|
|
206
213
|
{{ doc }}
|
|
207
214
|
{% endfor %}
|
|
215
|
+
</documents>
|
|
208
216
|
|
|
209
217
|
使用以上文档来回答用户的问题。回答要求:
|
|
210
218
|
|
|
@@ -9,13 +9,14 @@ import time
|
|
|
9
9
|
from loguru import logger
|
|
10
10
|
import traceback
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
def process_file_in_multi_process(
|
|
13
14
|
file_info: Tuple[str, str, float]
|
|
14
15
|
) -> List[SourceCode]:
|
|
15
16
|
start_time = time.time()
|
|
16
17
|
file_path, relative_path, _, _ = file_info
|
|
17
18
|
try:
|
|
18
|
-
if file_path.endswith(".pdf"):
|
|
19
|
+
if file_path.endswith(".pdf"):
|
|
19
20
|
content = extract_text_from_pdf(file_path)
|
|
20
21
|
v = [
|
|
21
22
|
SourceCode(
|
|
@@ -24,7 +25,7 @@ def process_file_in_multi_process(
|
|
|
24
25
|
tokens=count_tokens_worker(content),
|
|
25
26
|
)
|
|
26
27
|
]
|
|
27
|
-
elif file_path.endswith(".docx"):
|
|
28
|
+
elif file_path.endswith(".docx"):
|
|
28
29
|
content = extract_text_from_docx(file_path)
|
|
29
30
|
v = [
|
|
30
31
|
SourceCode(
|
|
@@ -45,7 +46,8 @@ def process_file_in_multi_process(
|
|
|
45
46
|
]
|
|
46
47
|
elif file_path.endswith(".pptx"):
|
|
47
48
|
slides = extract_text_from_ppt(file_path)
|
|
48
|
-
content = "".join(
|
|
49
|
+
content = "".join(
|
|
50
|
+
f"#{slide[0]}\n{slide[1]}\n\n" for slide in slides)
|
|
49
51
|
v = [
|
|
50
52
|
SourceCode(
|
|
51
53
|
module_name=f"##File: {file_path}",
|
|
@@ -65,15 +67,16 @@ def process_file_in_multi_process(
|
|
|
65
67
|
]
|
|
66
68
|
logger.info(f"Load file {file_path} in {time.time() - start_time}")
|
|
67
69
|
return v
|
|
68
|
-
except Exception as e:
|
|
70
|
+
except (BaseException, Exception) as e:
|
|
69
71
|
logger.error(f"Error processing file {file_path}: {str(e)}")
|
|
72
|
+
logger.error(f"Error type: {type(e).__name__}")
|
|
70
73
|
return []
|
|
71
74
|
|
|
72
75
|
|
|
73
76
|
def process_file_local(file_path: str) -> List[SourceCode]:
|
|
74
77
|
start_time = time.time()
|
|
75
78
|
try:
|
|
76
|
-
if file_path.endswith(".pdf"):
|
|
79
|
+
if file_path.endswith(".pdf"):
|
|
77
80
|
content = extract_text_from_pdf(file_path)
|
|
78
81
|
v = [
|
|
79
82
|
SourceCode(
|
|
@@ -82,7 +85,7 @@ def process_file_local(file_path: str) -> List[SourceCode]:
|
|
|
82
85
|
tokens=count_tokens(content),
|
|
83
86
|
)
|
|
84
87
|
]
|
|
85
|
-
elif file_path.endswith(".docx"):
|
|
88
|
+
elif file_path.endswith(".docx"):
|
|
86
89
|
content = extract_text_from_docx(file_path)
|
|
87
90
|
v = [
|
|
88
91
|
SourceCode(
|
|
@@ -103,7 +106,8 @@ def process_file_local(file_path: str) -> List[SourceCode]:
|
|
|
103
106
|
]
|
|
104
107
|
elif file_path.endswith(".pptx"):
|
|
105
108
|
slides = extract_text_from_ppt(file_path)
|
|
106
|
-
content = "".join(
|
|
109
|
+
content = "".join(
|
|
110
|
+
f"#{slide[0]}\n{slide[1]}\n\n" for slide in slides)
|
|
107
111
|
v = [
|
|
108
112
|
SourceCode(
|
|
109
113
|
module_name=f"##File: {file_path}",
|
|
@@ -123,7 +127,8 @@ def process_file_local(file_path: str) -> List[SourceCode]:
|
|
|
123
127
|
]
|
|
124
128
|
logger.info(f"Load file {file_path} in {time.time() - start_time}")
|
|
125
129
|
return v
|
|
126
|
-
except Exception as e:
|
|
130
|
+
except (BaseException, Exception) as e:
|
|
127
131
|
logger.error(f"Error processing file {file_path}: {str(e)}")
|
|
132
|
+
logger.error(f"Error type: {type(e).__name__}")
|
|
128
133
|
traceback.print_exc()
|
|
129
|
-
return []
|
|
134
|
+
return []
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.209"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.208"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_generate_editblock.py
RENAMED
|
File without changes
|
{auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_generate_strict_diff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/common/code_auto_merge_strict_diff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.208 → auto_coder-0.1.209}/src/autocoder/dispacher/actions/plugins/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|