auto-coder 0.1.208__py3-none-any.whl → 0.1.209__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: auto-coder
3
- Version: 0.1.208
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
- | <a href="./docs/en"><b>English</b></a> | <a href="https://uelng8wukz.feishu.cn/wiki/QIpkwpQo2iSdkwk9nP6cNSPlnPc"><b>中文</b></a> |
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
@@ -8,7 +8,7 @@ autocoder/chat_auto_coder.py,sha256=zWmkG6b3-18unROg2u7cEkziJlyKIoDYIclW0fWDbCQ,
8
8
  autocoder/chat_auto_coder_lang.py,sha256=zU9VRY-l80fZnLJ0Op8A3wq27UhQHh9WcpSYU4SmnqU,8708
9
9
  autocoder/command_args.py,sha256=BpMbPceBzjCftPB0yOVsSmTmt61xS3gtc1WGKtcDHQs,30449
10
10
  autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
11
- autocoder/version.py,sha256=yqXFcZxOknaPmV5zVkh1GSc1MbMk5M2DKocsUSSTP7M,24
11
+ autocoder/version.py,sha256=MoW2qh2N2F6fwWURhZTEXjwmdvPGpyt7_C-0W39jD7A,24
12
12
  autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  autocoder/agent/auto_demand_organizer.py,sha256=NWSAEsEk94vT3lGjfo25kKLMwYdPcpy9e-i21txPasQ,6942
14
14
  autocoder/agent/auto_filegroup.py,sha256=CW7bqp0FW1GIEMnl-blyAc2UGT7O9Mom0q66ITz1ckM,6635
@@ -71,7 +71,7 @@ autocoder/rag/api_server.py,sha256=dRbhAZVRAOlZ64Cnxf4_rKb4iJwHnrWS9Zr67IVORw0,7
71
71
  autocoder/rag/doc_filter.py,sha256=H0g4s-Q8gJDUbYk9b1qkEyl7RgNzLbRF4UWELVKPDwk,9865
72
72
  autocoder/rag/document_retriever.py,sha256=5oThtxukGuRFF96o3pHKsk306a8diXbhgSrbqyU2BvM,8894
73
73
  autocoder/rag/llm_wrapper.py,sha256=sbDxCANiZyWb_ocqNgqu2oy3c2t8orPNRGleEs-Uwl8,2649
74
- autocoder/rag/long_context_rag.py,sha256=5XWXqjIr2z1FNQdQ6BeVAp7VllIHN9V19QuuuNjyFpM,24764
74
+ autocoder/rag/long_context_rag.py,sha256=x8ZPg9cwTdFmz6CIzjA1ZPX7_5k3G-ZleL6v3B9CO6Y,24921
75
75
  autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
76
76
  autocoder/rag/rag_entry.py,sha256=6TKtErZ0Us9XSV6HgRKXA6yR3SiZGPHpynOKSaR1wgE,2463
77
77
  autocoder/rag/raw_rag.py,sha256=yS2Ur6kG0IRjhCj2_VonwxjY_xls_E62jO5Gz5j2nqE,2952
@@ -82,17 +82,17 @@ autocoder/rag/token_checker.py,sha256=jc76x6KWmvVxds6W8juZfQGaoErudc2HenG3sNQfSL
82
82
  autocoder/rag/token_counter.py,sha256=C-Lwc4oIjJpZDEqp9WLHGOe6hb4yhrdJpMtkrtp_1qc,2125
83
83
  autocoder/rag/token_limiter.py,sha256=dtIxCtHswZ2ut-XKbx8_SiWyv-xqnR1WAIcmh6f8Ktw,11137
84
84
  autocoder/rag/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
- autocoder/rag/utils.py,sha256=MOMy0l2_YQ8foWnQQSvYmYAwghAWJ8_wVrdZh5DSaTg,4822
85
+ autocoder/rag/utils.py,sha256=x5L8gskxUUGkVEP5K-0C-iYntE84asuDXOCqdzdNUoA,4956
86
86
  autocoder/rag/variable_holder.py,sha256=PFvBjFcR7-fNDD4Vcsc8CpH2Te057vcpwJMxtrfUgKI,75
87
87
  autocoder/rag/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  autocoder/rag/cache/base_cache.py,sha256=KxrPKP-PunL7reXh5txT97DYLzGKm9M5O4CnOLDyX-c,403
89
89
  autocoder/rag/cache/byzer_storage_cache.py,sha256=LS-Z8x5HBL5u8Zrn0kniFX-tdR1ZsMp8fKoKFluSwuU,15375
90
90
  autocoder/rag/cache/file_monitor_cache.py,sha256=ZfWFEzhanwM78sj87dnDWS_mj1SjvK4U_-XdqMZOnhM,4947
91
- autocoder/rag/cache/simple_cache.py,sha256=Wb6udIAm3R0QO6ouSFDGdUowqvkuqOCHi2ncQNbMZ2U,8857
91
+ autocoder/rag/cache/simple_cache.py,sha256=4ZnDHuQyNDxaJ70_OlRMiuwPbjYId8ZaukTRfKAtzCw,9279
92
92
  autocoder/rag/loaders/__init__.py,sha256=EQHEZ5Cmz-mGP2SllUTvcIbYCnF7W149dNpNItfs0yE,304
93
- autocoder/rag/loaders/docx_loader.py,sha256=FMRwmbACevcjTdhr5slVfXgq6SRoWPlEILMAfmQbQSI,547
93
+ autocoder/rag/loaders/docx_loader.py,sha256=ejonb3OFxeMBEV_qRRh556SrjlBbDIsU7lTuxuXCQXg,610
94
94
  autocoder/rag/loaders/excel_loader.py,sha256=Ue8YB1z_kBs8SjIPuBskyM08Q1JiONs_BJZPrzi59oo,896
95
- autocoder/rag/loaders/pdf_loader.py,sha256=0-42afOpanFZZOFmuTmuu7AqZyzaOsLPnXRlPlHOnoM,650
95
+ autocoder/rag/loaders/pdf_loader.py,sha256=9cLPdhfSiedvEUFFM7I-PkZ-9klJmj8AtuihETfzO_o,706
96
96
  autocoder/rag/loaders/ppt_loader.py,sha256=7VEYc-bqgK8VHCoGC3DIUcqbpda-E5jQF9lYLqP256I,1681
97
97
  autocoder/rag/stream_event/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
98
  autocoder/rag/stream_event/event_writer.py,sha256=l7kq_LnDDE8E5dZ-73C7J2MgzSL7WrozdXk0eV-k55Q,409
@@ -115,9 +115,9 @@ autocoder/utils/request_event_queue.py,sha256=r3lo5qGsB1dIjzVQ05dnr0z_9Z3zOkBdP1
115
115
  autocoder/utils/request_queue.py,sha256=nwp6PMtgTCiuwJI24p8OLNZjUiprC-TsefQrhMI-yPE,3889
116
116
  autocoder/utils/rest.py,sha256=HawagAap3wMIDROGhY1730zSZrJR_EycODAA5qOj83c,8807
117
117
  autocoder/utils/tests.py,sha256=BqphrwyycGAvs-5mhH8pKtMZdObwhFtJ5MC_ZAOiLq8,1340
118
- auto_coder-0.1.208.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
119
- auto_coder-0.1.208.dist-info/METADATA,sha256=zyzXEAoJ0t4iwED4AAmoikyYPg-4RwCg6JFm6Y34YhA,2575
120
- auto_coder-0.1.208.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
121
- auto_coder-0.1.208.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
122
- auto_coder-0.1.208.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
123
- auto_coder-0.1.208.dist-info/RECORD,,
118
+ auto_coder-0.1.209.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
119
+ auto_coder-0.1.209.dist-info/METADATA,sha256=W5eS6nakqpiW7JSoDFCgCbqFw8iN4vzzqoYXLOFmgzI,2571
120
+ auto_coder-0.1.209.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
121
+ auto_coder-0.1.209.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
122
+ auto_coder-0.1.209.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
123
+ auto_coder-0.1.209.dist-info/RECORD,,
@@ -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
- self.update_cache(file_info, result)
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
- self.update_cache(file_info, result)
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
- <{{ msg.role }}>: {{ msg.content }}
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
 
autocoder/rag/utils.py CHANGED
@@ -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(f"#{slide[0]}\n{slide[1]}\n\n" for slide in slides)
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(f"#{slide[0]}\n{slide[1]}\n\n" for slide in slides)
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 []
autocoder/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.208"
1
+ __version__ = "0.1.209"