auto-coder 0.1.296__py3-none-any.whl → 0.1.298__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.296.dist-info → auto_coder-0.1.298.dist-info}/METADATA +3 -2
- {auto_coder-0.1.296.dist-info → auto_coder-0.1.298.dist-info}/RECORD +13 -13
- autocoder/auto_coder_rag.py +7 -0
- autocoder/common/__init__.py +2 -1
- autocoder/rag/cache/byzer_storage_cache.py +2 -1
- autocoder/rag/cache/local_byzer_storage_cache.py +1 -1
- autocoder/rag/cache/local_duckdb_storage_cache.py +30 -14
- autocoder/rag/qa_conversation_strategy.py +2 -2
- autocoder/version.py +1 -1
- {auto_coder-0.1.296.dist-info → auto_coder-0.1.298.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.296.dist-info → auto_coder-0.1.298.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.296.dist-info → auto_coder-0.1.298.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.296.dist-info → auto_coder-0.1.298.dist-info}/top_level.txt +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.298
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -26,7 +26,8 @@ Requires-Dist: tabulate
|
|
|
26
26
|
Requires-Dist: jupyter-client
|
|
27
27
|
Requires-Dist: prompt-toolkit
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
|
-
Requires-Dist:
|
|
29
|
+
Requires-Dist: aiofiles
|
|
30
|
+
Requires-Dist: byzerllm[saas] >=0.1.176
|
|
30
31
|
Requires-Dist: patch
|
|
31
32
|
Requires-Dist: diff-match-patch
|
|
32
33
|
Requires-Dist: GitPython
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
autocoder/auto_coder.py,sha256=zKqfMdm2F419hrNGaosW4kYJ3IbaxBKlpTlVl6JFWmE,65563
|
|
3
3
|
autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
|
|
4
|
-
autocoder/auto_coder_rag.py,sha256=
|
|
4
|
+
autocoder/auto_coder_rag.py,sha256=5TtAfbEBwyt-cB4WcI8eQ1G3AuKij0056wFYRViDhLs,34036
|
|
5
5
|
autocoder/auto_coder_rag_client_mcp.py,sha256=QRxUbjc6A8UmDMQ8lXgZkjgqtq3lgKYeatJbDY6rSo0,6270
|
|
6
6
|
autocoder/auto_coder_rag_mcp.py,sha256=-RrjNwFaS2e5v8XDIrKR-zlUNUE8UBaeOtojffBrvJo,8521
|
|
7
7
|
autocoder/auto_coder_runner.py,sha256=Q8dr9EsQob6xHZbVxopE30C4vuk5tDQ5lO8nGfx-1kM,101365
|
|
@@ -12,7 +12,7 @@ autocoder/chat_auto_coder_lang.py,sha256=-vyKq02RGn6N275YA06JZqXpfJkNq6PNjQ8wy4M
|
|
|
12
12
|
autocoder/command_args.py,sha256=9aYJ-AmPxP1sQh6ciw04FWHjSn31f2W9afXFwo8wgx4,30441
|
|
13
13
|
autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
|
|
14
14
|
autocoder/models.py,sha256=AyoZ-Pzy0oyYUmWCxOIRiOImsqboSfRET7LO9-UOuxI,11172
|
|
15
|
-
autocoder/version.py,sha256=
|
|
15
|
+
autocoder/version.py,sha256=6WgD8AUxiPQngIKXonXPlISWgH75TnoidQDJCS5V0hc,23
|
|
16
16
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
autocoder/agent/auto_demand_organizer.py,sha256=NWSAEsEk94vT3lGjfo25kKLMwYdPcpy9e-i21txPasQ,6942
|
|
18
18
|
autocoder/agent/auto_filegroup.py,sha256=CW7bqp0FW1GIEMnl-blyAc2UGT7O9Mom0q66ITz1ckM,6635
|
|
@@ -31,7 +31,7 @@ autocoder/commands/auto_web.py,sha256=_449f4rCoRG7Sv0SB0hIBRFLPLPJ5DgWW4DlI22a3X
|
|
|
31
31
|
autocoder/commands/tools.py,sha256=iBcGdTAOCoWk1wX05EbEfkzIEZiTMAKRthap0q1rM5E,21384
|
|
32
32
|
autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
|
|
33
33
|
autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
|
|
34
|
-
autocoder/common/__init__.py,sha256=
|
|
34
|
+
autocoder/common/__init__.py,sha256=pO198YBdywGYarPhT7ild3GcdvcFhLJTe63ilZR1d5E,13705
|
|
35
35
|
autocoder/common/anything2images.py,sha256=0ILBbWzY02M-CiWB-vzuomb_J1hVdxRcenAfIrAXq9M,25283
|
|
36
36
|
autocoder/common/anything2img.py,sha256=iZQmg8srXlD7N5uGl5b_ONKJMBjYoW8kPmokkG6ISF0,10118
|
|
37
37
|
autocoder/common/audio.py,sha256=Kn9nWKQddWnUrAz0a_ZUgjcu4VUU_IcZBigT7n3N3qc,7439
|
|
@@ -123,7 +123,7 @@ autocoder/rag/document_retriever.py,sha256=5BDqKVJqLPScEnua5S5suXhWuCaALIfPf5obX
|
|
|
123
123
|
autocoder/rag/lang.py,sha256=_jmUtxZDG1fmF4b2mhMJbYS1YQDb2ZE8nyAn5_vrvjA,3350
|
|
124
124
|
autocoder/rag/llm_wrapper.py,sha256=Ht5GF5yJtrztoliujsZzx_ooWZmHkd5xLZKcGEiicZw,4303
|
|
125
125
|
autocoder/rag/long_context_rag.py,sha256=6rqq0pvYe9N4TvyLwd2OB21ZUrPC4FfxZuks0weAz4A,41935
|
|
126
|
-
autocoder/rag/qa_conversation_strategy.py,sha256=
|
|
126
|
+
autocoder/rag/qa_conversation_strategy.py,sha256=1AcHV0MU00yTls20LlCPO-Un_OhSrr_p-H5lxLleAq4,6060
|
|
127
127
|
autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
|
|
128
128
|
autocoder/rag/rag_entry.py,sha256=6TKtErZ0Us9XSV6HgRKXA6yR3SiZGPHpynOKSaR1wgE,2463
|
|
129
129
|
autocoder/rag/raw_rag.py,sha256=BOr0YGf3umjqXOIDVO1LXQ0bIHx8hzBdiubND2ezyxc,2946
|
|
@@ -140,11 +140,11 @@ autocoder/rag/utils.py,sha256=f21ybCAlYVgr3tJP9MkVoM9d82-uG5NHu2gsv2oaVBQ,4961
|
|
|
140
140
|
autocoder/rag/variable_holder.py,sha256=PFvBjFcR7-fNDD4Vcsc8CpH2Te057vcpwJMxtrfUgKI,75
|
|
141
141
|
autocoder/rag/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
142
|
autocoder/rag/cache/base_cache.py,sha256=EaYYYbclMBvnlOUoM7qonnluwZX5oSvUjdvGvFun8_8,742
|
|
143
|
-
autocoder/rag/cache/byzer_storage_cache.py,sha256=
|
|
143
|
+
autocoder/rag/cache/byzer_storage_cache.py,sha256=S_afj4_fFt88A0KJ23N-Gc3mMwPTDjzv9E3J9O_IiT4,29319
|
|
144
144
|
autocoder/rag/cache/cache_result_merge.py,sha256=VnTdbT2OMBmWl_83bqds97d9_M33IhPNX8tF7KH2GMM,10556
|
|
145
145
|
autocoder/rag/cache/file_monitor_cache.py,sha256=OdSXTH3vo6inAzkN5d55I0RN03GUlSlnUEKmXpjFl78,9443
|
|
146
|
-
autocoder/rag/cache/local_byzer_storage_cache.py,sha256=
|
|
147
|
-
autocoder/rag/cache/local_duckdb_storage_cache.py,sha256=
|
|
146
|
+
autocoder/rag/cache/local_byzer_storage_cache.py,sha256=1xskK7X_hFEAsHHoT_F9lFYhQOTrpQtsFyFCIeI2Mvk,31964
|
|
147
|
+
autocoder/rag/cache/local_duckdb_storage_cache.py,sha256=gTfAzFTfVLoi8cqxct_I3-ozdoZvKUVSiI1w8NxbjX8,28540
|
|
148
148
|
autocoder/rag/cache/rag_file_meta.py,sha256=RQ3n4wfkHlB-1ljS3sFSi8ijbsUPeIqBSgjmmbRuwRI,20521
|
|
149
149
|
autocoder/rag/cache/simple_cache.py,sha256=j9dxhei-Nwq9FJrrGOWhaDIDSb_Iz6JSojT1pelS9k4,13084
|
|
150
150
|
autocoder/rag/loaders/__init__.py,sha256=EQHEZ5Cmz-mGP2SllUTvcIbYCnF7W149dNpNItfs0yE,304
|
|
@@ -183,9 +183,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
183
183
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
184
184
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=lkJ_A-sYU36JMzjFWkk3pR6uos8oZHYt9GPsPe_CPAo,11766
|
|
185
185
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
|
-
auto_coder-0.1.
|
|
187
|
-
auto_coder-0.1.
|
|
188
|
-
auto_coder-0.1.
|
|
189
|
-
auto_coder-0.1.
|
|
190
|
-
auto_coder-0.1.
|
|
191
|
-
auto_coder-0.1.
|
|
186
|
+
auto_coder-0.1.298.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
187
|
+
auto_coder-0.1.298.dist-info/METADATA,sha256=COiMKzvXqK4P1_xs-qwuOdDDQZ3fLMinxhc0EpzJP6I,2689
|
|
188
|
+
auto_coder-0.1.298.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
189
|
+
auto_coder-0.1.298.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
190
|
+
auto_coder-0.1.298.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
191
|
+
auto_coder-0.1.298.dist-info/RECORD,,
|
autocoder/auto_coder_rag.py
CHANGED
|
@@ -187,6 +187,13 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
187
187
|
help="The storage type of the RAG, duckdb or byzer-storage",
|
|
188
188
|
)
|
|
189
189
|
|
|
190
|
+
build_index_parser.add_argument(
|
|
191
|
+
"--rag_index_build_workers",
|
|
192
|
+
type=int,
|
|
193
|
+
default=5,
|
|
194
|
+
help="The number of workers to build the RAG index",
|
|
195
|
+
)
|
|
196
|
+
|
|
190
197
|
build_index_parser.add_argument(
|
|
191
198
|
"--quick", action="store_true", help="Skip system initialization"
|
|
192
199
|
)
|
autocoder/common/__init__.py
CHANGED
|
@@ -300,6 +300,7 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
300
300
|
rag_duckdb_vector_dim: Optional[int] = 1024 # DuckDB 向量化存储的维度
|
|
301
301
|
rag_duckdb_query_similarity: Optional[float] = 0.1 # DuckDB 向量化检索 相似度 阈值
|
|
302
302
|
rag_duckdb_query_top_k: Optional[int] = 10000 # DuckDB 向量化检索 返回 TopK个结果(且大于相似度)
|
|
303
|
+
rag_index_build_workers: Optional[int] = 10
|
|
303
304
|
# rag 本地图床地址
|
|
304
305
|
local_image_host: Optional[str] = ""
|
|
305
306
|
rag_recall_max_queries: Optional[int] = 5
|
|
@@ -377,7 +378,7 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
377
378
|
rank_strategy: Optional[str] = "file"
|
|
378
379
|
|
|
379
380
|
action: List[str] = []
|
|
380
|
-
enable_global_memory: Optional[bool] =
|
|
381
|
+
enable_global_memory: Optional[bool] = False
|
|
381
382
|
product_mode: Optional[str] = "lite"
|
|
382
383
|
|
|
383
384
|
keep_reasoning_content: Optional[bool] = False
|
|
@@ -132,6 +132,7 @@ class ByzerStorageCache(BaseCacheManager):
|
|
|
132
132
|
self.path = path
|
|
133
133
|
self.ignore_spec = ignore_spec
|
|
134
134
|
self.required_exts = required_exts
|
|
135
|
+
self.extra_params = extra_params
|
|
135
136
|
self.rag_build_name = extra_params.rag_build_name
|
|
136
137
|
self.storage = ByzerStorage("byzerai_store", "rag", self.rag_build_name)
|
|
137
138
|
self.queue = []
|
|
@@ -329,7 +330,7 @@ class ByzerStorageCache(BaseCacheManager):
|
|
|
329
330
|
start_time = time.time()
|
|
330
331
|
|
|
331
332
|
# Use more workers to process the smaller batches efficiently
|
|
332
|
-
max_workers = min(
|
|
333
|
+
max_workers = min(self.extra_params.rag_index_build_workers, total_batches) # Cap at 10 workers or total batch count
|
|
333
334
|
logger.info(f"[BUILD CACHE] Using {max_workers} parallel workers for processing")
|
|
334
335
|
|
|
335
336
|
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
|
@@ -338,7 +338,7 @@ class LocalByzerStorageCache(BaseCacheManager):
|
|
|
338
338
|
start_time = time.time()
|
|
339
339
|
|
|
340
340
|
# Use more workers to process the smaller batches efficiently
|
|
341
|
-
max_workers = min(
|
|
341
|
+
max_workers = min(self.extra_params.rag_index_build_workers, total_batches) # Cap at 10 workers or total batch count
|
|
342
342
|
logger.info(f"[BUILD CACHE] Using {max_workers} parallel workers for processing")
|
|
343
343
|
|
|
344
344
|
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
|
@@ -133,15 +133,31 @@ class LocalDuckdbStorage:
|
|
|
133
133
|
return reduced
|
|
134
134
|
|
|
135
135
|
def _embedding(self, context: str, norm: bool = True, dim: int | None = None) -> List[float]:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
max_retries = 3
|
|
137
|
+
retry_count = 0
|
|
138
|
+
|
|
139
|
+
while retry_count < max_retries:
|
|
140
|
+
try:
|
|
141
|
+
embedding = self.llm.emb_query(context)[0].output
|
|
142
|
+
|
|
143
|
+
if dim:
|
|
144
|
+
embedding = self._apply_pca(embedding, target_dim=dim) # 降维后形状 (1024,)
|
|
145
|
+
|
|
146
|
+
if norm:
|
|
147
|
+
embedding = embedding / np.linalg.norm(embedding)
|
|
148
|
+
|
|
149
|
+
return embedding.tolist()
|
|
150
|
+
except Exception as e:
|
|
151
|
+
retry_count += 1
|
|
152
|
+
if retry_count >= max_retries:
|
|
153
|
+
logger.error(f"Failed to get embedding after {max_retries} attempts: {str(e)}")
|
|
154
|
+
raise
|
|
155
|
+
|
|
156
|
+
# Sleep between 1-5 seconds before retrying
|
|
157
|
+
sleep_time = 1 + (retry_count * 1.5)
|
|
158
|
+
logger.warning(f"Embedding API call failed (attempt {retry_count}/{max_retries}). "
|
|
159
|
+
f"Error: {str(e)}. Retrying in {sleep_time:.1f} seconds...")
|
|
160
|
+
time.sleep(sleep_time)
|
|
145
161
|
|
|
146
162
|
def _initialize(self) -> None:
|
|
147
163
|
if self.embed_dim is None:
|
|
@@ -452,9 +468,9 @@ class LocalDuckDBStorageCache(BaseCacheManager):
|
|
|
452
468
|
self.write_cache()
|
|
453
469
|
|
|
454
470
|
if items:
|
|
455
|
-
logger.info("[BUILD CACHE] Clearing existing cache from
|
|
471
|
+
logger.info("[BUILD CACHE] Clearing existing cache from DuckDB Storage")
|
|
456
472
|
self.storage.truncate_table()
|
|
457
|
-
logger.info(f"[BUILD CACHE] Preparing to write to
|
|
473
|
+
logger.info(f"[BUILD CACHE] Preparing to write to DuckDB Storage, "
|
|
458
474
|
f"total chunks: {len(items)}, total files: {len(files_to_process)}")
|
|
459
475
|
|
|
460
476
|
# Use a fixed optimal batch size instead of dividing by worker count
|
|
@@ -464,12 +480,12 @@ class LocalDuckDBStorageCache(BaseCacheManager):
|
|
|
464
480
|
total_batches = len(item_batches)
|
|
465
481
|
completed_batches = 0
|
|
466
482
|
|
|
467
|
-
logger.info(f"[BUILD CACHE] Starting to write to
|
|
483
|
+
logger.info(f"[BUILD CACHE] Starting to write to DuckDB Storage using {batch_size} items per batch, "
|
|
468
484
|
f"total batches: {total_batches}")
|
|
469
485
|
start_time = time.time()
|
|
470
486
|
|
|
471
|
-
# Use more workers to process the smaller batches efficiently
|
|
472
|
-
max_workers = min(
|
|
487
|
+
# Use more workers to process the smaller batches efficiently
|
|
488
|
+
max_workers = min(self.extra_params.rag_index_build_workers, total_batches) # Cap at 10 workers or total batch count
|
|
473
489
|
logger.info(f"[BUILD CACHE] Using {max_workers} parallel workers for processing")
|
|
474
490
|
|
|
475
491
|
def batch_add_doc(_batch):
|
|
@@ -63,7 +63,7 @@ class MultiRoundStrategy(QAConversationStrategy):
|
|
|
63
63
|
{% if local_image_host %}
|
|
64
64
|
4. 图片路径处理
|
|
65
65
|
- 图片地址需返回绝对路径,
|
|
66
|
-
- 对于Windows风格的路径,需要转换为Linux风格, 例如:C
|
|
66
|
+
- 对于Windows风格的路径,需要转换为Linux风格, 例如:C:\\Users\\user\\Desktop\\image.png 转换为 C:/Users/user/Desktop/image.png
|
|
67
67
|
- 为请求图片资源 需增加 http://{{ local_image_host }}/static/ 作为前缀
|
|
68
68
|
例如:/path/to/images/image.png, 返回 http://{{ local_image_host }}/static/path/to/images/image.png
|
|
69
69
|
{% endif %}
|
|
@@ -115,7 +115,7 @@ class SingleRoundStrategy(QAConversationStrategy):
|
|
|
115
115
|
{% if local_image_host %}
|
|
116
116
|
4. 图片路径处理
|
|
117
117
|
- 图片地址需返回绝对路径,
|
|
118
|
-
- 对于Windows风格的路径,需要转换为Linux风格, 例如:C
|
|
118
|
+
- 对于Windows风格的路径,需要转换为Linux风格, 例如:C:\\Users\\user\\Desktop\\image.png 转换为 C:/Users/user/Desktop/image.png
|
|
119
119
|
- 为请求图片资源 需增加 http://{{ local_image_host }}/static/ 作为前缀
|
|
120
120
|
例如:/path/to/images/image.png, 返回 http://{{ local_image_host }}/static/path/to/images/image.png
|
|
121
121
|
{% endif %}
|
autocoder/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.298"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|