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

@@ -187,7 +187,7 @@ def get_tools(args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
187
187
  注意,尽量不要询问用户,除非你感受到你无法回答用户的问题。
188
188
  '''
189
189
 
190
- if args.request_id and not args.silence:
190
+ if args.request_id and not args.silence and not args.skip_events:
191
191
  event_data = {
192
192
  "question": question
193
193
  }
autocoder/auto_coder.py CHANGED
@@ -327,7 +327,7 @@ def main(input_args: Optional[List[str]] = None):
327
327
  )
328
328
  )
329
329
 
330
- if args.request_id and not args.silence:
330
+ if args.request_id and not args.silence and not args.skip_events:
331
331
  event_data = {
332
332
  "instruction": final_ins,
333
333
  "model": model,
@@ -747,6 +747,7 @@ def main(input_args: Optional[List[str]] = None):
747
747
  pp = SuffixProject(args=args, llm=llm, file_filter=None)
748
748
  pp.run()
749
749
  sources = pp.sources
750
+
750
751
  s = build_index_and_filter_files(
751
752
  llm=llm, args=args, sources=sources)
752
753
  if s:
@@ -762,7 +763,7 @@ def main(input_args: Optional[List[str]] = None):
762
763
 
763
764
  loaded_conversations = pre_conversations + \
764
765
  chat_history["ask_conversation"]
765
-
766
+
766
767
  if args.human_as_model:
767
768
  console = Console()
768
769
 
@@ -874,12 +875,12 @@ def main(input_args: Optional[List[str]] = None):
874
875
 
875
876
  return {}
876
877
 
877
- if args.enable_rag_search or args.enable_rag_context:
878
+ if args.enable_rag_search or args.enable_rag_context:
878
879
  rag = RAGFactory.get_rag(llm=chat_llm, args=args, path="")
879
880
  response = rag.stream_chat_oai(
880
881
  conversations=loaded_conversations)[0]
881
882
  v = ([item, None] for item in response)
882
- else:
883
+ else:
883
884
  v = chat_llm.stream_chat_oai(
884
885
  conversations=loaded_conversations, delta_mode=True
885
886
  )
@@ -895,13 +896,14 @@ def main(input_args: Optional[List[str]] = None):
895
896
  for res in v:
896
897
  markdown_content += res[0]
897
898
  assistant_response += res[0]
898
- request_queue.add_request(
899
- args.request_id,
900
- RequestValue(
901
- value=StreamValue(value=[res[0]]),
902
- status=RequestOption.RUNNING,
903
- ),
904
- )
899
+ if args.request_id:
900
+ request_queue.add_request(
901
+ args.request_id,
902
+ RequestValue(
903
+ value=StreamValue(value=[res[0]]),
904
+ status=RequestOption.RUNNING,
905
+ ),
906
+ )
905
907
  live.update(
906
908
  Panel(
907
909
  Markdown(markdown_content),
@@ -184,7 +184,7 @@ def main(input_args: Optional[List[str]] = None):
184
184
  serve_parser.add_argument(
185
185
  "--rag_context_window_limit",
186
186
  type=int,
187
- default=110000,
187
+ default=56000,
188
188
  help="The input context window limit for RAG",
189
189
  )
190
190
  serve_parser.add_argument(
@@ -395,7 +395,7 @@ def get_all_file_names_in_project() -> List[str]:
395
395
 
396
396
  file_names = []
397
397
  final_exclude_dirs = defaut_exclude_dirs + memory.get("exclude_dirs", [])
398
- for root, dirs, files in os.walk(project_root):
398
+ for root, dirs, files in os.walk(project_root,followlinks=True):
399
399
  dirs[:] = [d for d in dirs if d not in final_exclude_dirs]
400
400
  file_names.extend(files)
401
401
  return file_names
@@ -405,7 +405,7 @@ def get_all_file_in_project() -> List[str]:
405
405
 
406
406
  file_names = []
407
407
  final_exclude_dirs = defaut_exclude_dirs + memory.get("exclude_dirs", [])
408
- for root, dirs, files in os.walk(project_root):
408
+ for root, dirs, files in os.walk(project_root,followlinks=True):
409
409
  dirs[:] = [d for d in dirs if d not in final_exclude_dirs]
410
410
  for file in files:
411
411
  file_names.append(os.path.join(root, file))
@@ -415,7 +415,7 @@ def get_all_file_in_project() -> List[str]:
415
415
  def get_all_file_in_project_with_dot() -> List[str]:
416
416
  file_names = []
417
417
  final_exclude_dirs = defaut_exclude_dirs + memory.get("exclude_dirs", [])
418
- for root, dirs, files in os.walk(project_root):
418
+ for root, dirs, files in os.walk(project_root,followlinks=True):
419
419
  dirs[:] = [d for d in dirs if d not in final_exclude_dirs]
420
420
  for file in files:
421
421
  file_names.append(os.path.join(root, file).replace(project_root, "."))
@@ -425,7 +425,7 @@ def get_all_file_in_project_with_dot() -> List[str]:
425
425
  def get_all_dir_names_in_project() -> List[str]:
426
426
  dir_names = []
427
427
  final_exclude_dirs = defaut_exclude_dirs + memory.get("exclude_dirs", [])
428
- for root, dirs, files in os.walk(project_root):
428
+ for root, dirs, files in os.walk(project_root,followlinks=True):
429
429
  dirs[:] = [d for d in dirs if d not in final_exclude_dirs]
430
430
  for dir in dirs:
431
431
  dir_names.append(dir)
@@ -449,7 +449,7 @@ def find_files_in_project(patterns: List[str]) -> List[str]:
449
449
  else:
450
450
  is_added = False
451
451
  ## add files belongs to project
452
- for root, dirs, files in os.walk(project_root):
452
+ for root, dirs, files in os.walk(project_root,followlinks=True):
453
453
  dirs[:] = [d for d in dirs if d not in final_exclude_dirs]
454
454
  if pattern in files:
455
455
  matched_files.append(os.path.join(root, pattern))
@@ -1420,17 +1420,18 @@ def coding(query: str):
1420
1420
  yaml_config["query"] = v
1421
1421
 
1422
1422
  # Add context for active groups and their query prefixes
1423
- active_groups_context = "下面是对上面文件按分组给到的一些描述,当用户的需求正好匹配描述的时候,参考描述来做修改:\n"
1424
- for group in current_groups:
1425
- group_files = groups.get(group, [])
1426
- query_prefix = groups_info.get(group, {}).get("query_prefix", "")
1427
- active_groups_context += f"组名: {group}\n"
1428
- active_groups_context += f"文件列表:\n"
1429
- for file in group_files:
1430
- active_groups_context += f"- {file}\n"
1431
- active_groups_context += f"组描述: {query_prefix}\n\n"
1432
-
1433
- yaml_config["context"] = active_groups_context + "\n"
1423
+ if current_groups:
1424
+ active_groups_context = "下面是对上面文件按分组给到的一些描述,当用户的需求正好匹配描述的时候,参考描述来做修改:\n"
1425
+ for group in current_groups:
1426
+ group_files = groups.get(group, [])
1427
+ query_prefix = groups_info.get(group, {}).get("query_prefix", "")
1428
+ active_groups_context += f"组名: {group}\n"
1429
+ active_groups_context += f"文件列表:\n"
1430
+ for file in group_files:
1431
+ active_groups_context += f"- {file}\n"
1432
+ active_groups_context += f"组描述: {query_prefix}\n\n"
1433
+
1434
+ yaml_config["context"] = active_groups_context + "\n"
1434
1435
 
1435
1436
  if is_apply:
1436
1437
  memory_dir = os.path.join(".auto-coder", "memory")