autocoder-nano 0.1.34__py3-none-any.whl → 0.1.35__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.
- autocoder_nano/auto_coder_nano.py +135 -99
- autocoder_nano/llm_client.py +11 -13
- autocoder_nano/version.py +1 -1
- {autocoder_nano-0.1.34.dist-info → autocoder_nano-0.1.35.dist-info}/METADATA +1 -1
- {autocoder_nano-0.1.34.dist-info → autocoder_nano-0.1.35.dist-info}/RECORD +9 -9
- {autocoder_nano-0.1.34.dist-info → autocoder_nano-0.1.35.dist-info}/LICENSE +0 -0
- {autocoder_nano-0.1.34.dist-info → autocoder_nano-0.1.35.dist-info}/WHEEL +0 -0
- {autocoder_nano-0.1.34.dist-info → autocoder_nano-0.1.35.dist-info}/entry_points.txt +0 -0
- {autocoder_nano-0.1.34.dist-info → autocoder_nano-0.1.35.dist-info}/top_level.txt +0 -0
@@ -75,7 +75,7 @@ memory = {
|
|
75
75
|
}
|
76
76
|
|
77
77
|
|
78
|
-
args: AutoCoderArgs = AutoCoderArgs()
|
78
|
+
# args: AutoCoderArgs = AutoCoderArgs()
|
79
79
|
|
80
80
|
|
81
81
|
def get_all_file_names_in_project() -> List[str]:
|
@@ -215,6 +215,40 @@ completer = CommandCompleter(
|
|
215
215
|
)
|
216
216
|
|
217
217
|
|
218
|
+
def get_final_config(query: str, delete_execute_file: bool = False) -> AutoCoderArgs | None:
|
219
|
+
conf = memory.get("conf", {})
|
220
|
+
yaml_config = {
|
221
|
+
"include_file": ["./base/base.yml"],
|
222
|
+
"skip_build_index": conf.get("skip_build_index", "true") == "true",
|
223
|
+
"skip_confirm": conf.get("skip_confirm", "true") == "true",
|
224
|
+
"chat_model": conf.get("chat_model", ""),
|
225
|
+
"code_model": conf.get("code_model", ""),
|
226
|
+
"auto_merge": conf.get("auto_merge", "editblock"),
|
227
|
+
"exclude_files": memory.get("exclude_files", [])
|
228
|
+
}
|
229
|
+
current_files = memory["current_files"]["files"]
|
230
|
+
yaml_config["urls"] = current_files
|
231
|
+
yaml_config["query"] = query
|
232
|
+
|
233
|
+
# 如果 conf 中有设置, 则以 conf 配置为主
|
234
|
+
for key, value in conf.items():
|
235
|
+
converted_value = convert_config_value(key, value)
|
236
|
+
if converted_value is not None:
|
237
|
+
yaml_config[key] = converted_value
|
238
|
+
|
239
|
+
execute_file = os.path.join(project_root, "actions", f"{uuid.uuid4()}.yml")
|
240
|
+
try:
|
241
|
+
yaml_content = convert_yaml_config_to_str(yaml_config=yaml_config)
|
242
|
+
with open(os.path.join(execute_file), "w") as f: # 保存此次查询的细节
|
243
|
+
f.write(yaml_content)
|
244
|
+
args = convert_yaml_to_config(execute_file) # 更新到args
|
245
|
+
finally:
|
246
|
+
if delete_execute_file:
|
247
|
+
if os.path.exists(execute_file):
|
248
|
+
os.remove(execute_file)
|
249
|
+
return args
|
250
|
+
|
251
|
+
|
218
252
|
def exclude_dirs(dir_names: List[str]):
|
219
253
|
new_dirs = dir_names
|
220
254
|
existing_dirs = memory.get("exclude_dirs", [])
|
@@ -281,7 +315,7 @@ def exclude_files(query: str):
|
|
281
315
|
|
282
316
|
|
283
317
|
def index_command(llm):
|
284
|
-
|
318
|
+
args = get_final_config(query="", delete_execute_file=True)
|
285
319
|
|
286
320
|
source_dir = os.path.abspath(args.source_dir)
|
287
321
|
printer.print_text(f"开始对目录 {source_dir} 中的源代码进行索引", style="green")
|
@@ -359,7 +393,7 @@ def index_import(import_path: str):
|
|
359
393
|
|
360
394
|
|
361
395
|
def index_query_command(query: str, llm: AutoLLM):
|
362
|
-
|
396
|
+
args = get_final_config(query=query, delete_execute_file=True)
|
363
397
|
|
364
398
|
# args.query = query
|
365
399
|
if args.project_type == "py":
|
@@ -389,12 +423,6 @@ def index_query_command(query: str, llm: AutoLLM):
|
|
389
423
|
panel=True
|
390
424
|
)
|
391
425
|
|
392
|
-
# headers = TargetFile.model_fields.keys()
|
393
|
-
# table_data = wrap_text_in_table(
|
394
|
-
# [[getattr(file_item, name) for name in headers] for file_item in all_results]
|
395
|
-
# )
|
396
|
-
# table_output = tabulate.tabulate(table_data, headers, tablefmt="grid")
|
397
|
-
# print(table_output, flush=True)
|
398
426
|
printer.print_table_compact(
|
399
427
|
headers=["文件路径", "原因"],
|
400
428
|
data=[[_target_file.file_path, _target_file.reason] for _target_file in all_results],
|
@@ -415,7 +443,8 @@ def convert_yaml_config_to_str(yaml_config):
|
|
415
443
|
|
416
444
|
|
417
445
|
def convert_yaml_to_config(yaml_file: str | dict | AutoCoderArgs):
|
418
|
-
global args
|
446
|
+
# global args
|
447
|
+
args = AutoCoderArgs()
|
419
448
|
config = {}
|
420
449
|
if isinstance(yaml_file, str):
|
421
450
|
args.file = yaml_file
|
@@ -452,40 +481,40 @@ def convert_config_value(key, value):
|
|
452
481
|
return None
|
453
482
|
|
454
483
|
|
455
|
-
def update_config_to_args(query, delete_execute_file: bool = False):
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
484
|
+
# def update_config_to_args(query, delete_execute_file: bool = False):
|
485
|
+
# conf = memory.get("conf", {})
|
486
|
+
#
|
487
|
+
# # 默认 chat 配置
|
488
|
+
# yaml_config = {
|
489
|
+
# "include_file": ["./base/base.yml"],
|
490
|
+
# "skip_build_index": conf.get("skip_build_index", "true") == "true",
|
491
|
+
# "skip_confirm": conf.get("skip_confirm", "true") == "true",
|
492
|
+
# "chat_model": conf.get("chat_model", ""),
|
493
|
+
# "code_model": conf.get("code_model", ""),
|
494
|
+
# "auto_merge": conf.get("auto_merge", "editblock"),
|
495
|
+
# "exclude_files": memory.get("exclude_files", [])
|
496
|
+
# }
|
497
|
+
# current_files = memory["current_files"]["files"]
|
498
|
+
# yaml_config["urls"] = current_files
|
499
|
+
# yaml_config["query"] = query
|
500
|
+
#
|
501
|
+
# # 如果 conf 中有设置, 则以 conf 配置为主
|
502
|
+
# for key, value in conf.items():
|
503
|
+
# converted_value = convert_config_value(key, value)
|
504
|
+
# if converted_value is not None:
|
505
|
+
# yaml_config[key] = converted_value
|
506
|
+
#
|
507
|
+
# yaml_content = convert_yaml_config_to_str(yaml_config=yaml_config)
|
508
|
+
# execute_file = os.path.join(args.source_dir, "actions", f"{uuid.uuid4()}.yml")
|
509
|
+
#
|
510
|
+
# with open(os.path.join(execute_file), "w") as f: # 保存此次查询的细节
|
511
|
+
# f.write(yaml_content)
|
512
|
+
#
|
513
|
+
# convert_yaml_to_config(execute_file) # 更新到args
|
514
|
+
#
|
515
|
+
# if delete_execute_file:
|
516
|
+
# if os.path.exists(execute_file):
|
517
|
+
# os.remove(execute_file)
|
489
518
|
|
490
519
|
|
491
520
|
def print_chat_history(history, max_entries=5):
|
@@ -519,7 +548,7 @@ def code_review(query: str) -> str:
|
|
519
548
|
|
520
549
|
|
521
550
|
def chat(query: str, llm: AutoLLM):
|
522
|
-
|
551
|
+
args = get_final_config(query)
|
523
552
|
|
524
553
|
is_history = query.strip().startswith("/history")
|
525
554
|
is_new = "/new" in query
|
@@ -664,19 +693,19 @@ def chat(query: str, llm: AutoLLM):
|
|
664
693
|
return
|
665
694
|
|
666
695
|
|
667
|
-
def init_project():
|
668
|
-
if not
|
696
|
+
def init_project(project_type):
|
697
|
+
if not project_type:
|
669
698
|
printer.print_text(
|
670
699
|
f"请指定项目类型。可选的项目类型包括:py|ts| 或文件扩展名(例如:.java,.scala), 多个扩展名逗号分隔.", style="green"
|
671
700
|
)
|
672
701
|
return
|
673
|
-
os.makedirs(os.path.join(
|
674
|
-
os.makedirs(os.path.join(
|
675
|
-
os.makedirs(os.path.join(
|
676
|
-
source_dir = os.path.abspath(
|
702
|
+
os.makedirs(os.path.join(project_root, "actions"), exist_ok=True)
|
703
|
+
os.makedirs(os.path.join(project_root, ".auto-coder"), exist_ok=True)
|
704
|
+
os.makedirs(os.path.join(project_root, ".auto-coder", "autocoderrules"), exist_ok=True)
|
705
|
+
source_dir = os.path.abspath(project_root)
|
677
706
|
create_actions(
|
678
707
|
source_dir=source_dir,
|
679
|
-
params={"project_type":
|
708
|
+
params={"project_type": project_type,
|
680
709
|
"source_dir": source_dir},
|
681
710
|
)
|
682
711
|
|
@@ -686,7 +715,7 @@ def init_project():
|
|
686
715
|
f.write("\nactions/")
|
687
716
|
f.write("\noutput.txt")
|
688
717
|
|
689
|
-
printer.print_text(f"已在 {os.path.abspath(
|
718
|
+
printer.print_text(f"已在 {os.path.abspath(project_root)} 成功初始化 autocoder-nano 项目", style="green")
|
690
719
|
return
|
691
720
|
|
692
721
|
|
@@ -739,7 +768,7 @@ def load_include_files(config, base_path, max_depth=10, current_depth=0):
|
|
739
768
|
|
740
769
|
def prepare_chat_yaml():
|
741
770
|
# auto_coder_main(["next", "chat_action"]) 准备聊天 yaml 文件
|
742
|
-
actions_dir = os.path.join(
|
771
|
+
actions_dir = os.path.join(project_root, "actions")
|
743
772
|
if not os.path.exists(actions_dir):
|
744
773
|
printer.print_text("当前目录中未找到 actions 目录。请执行初始化 AutoCoder Nano", style="yellow")
|
745
774
|
return
|
@@ -786,7 +815,7 @@ def coding(query: str, llm: AutoLLM):
|
|
786
815
|
current_files = memory["current_files"]["files"]
|
787
816
|
|
788
817
|
prepare_chat_yaml() # 复制上一个序号的 yaml 文件, 生成一个新的聊天 yaml 文件
|
789
|
-
latest_yaml_file = get_last_yaml_file(os.path.join(
|
818
|
+
latest_yaml_file = get_last_yaml_file(os.path.join(project_root, "actions"))
|
790
819
|
|
791
820
|
if latest_yaml_file:
|
792
821
|
yaml_config = {
|
@@ -808,7 +837,7 @@ def coding(query: str, llm: AutoLLM):
|
|
808
837
|
yaml_config["query"] = query
|
809
838
|
|
810
839
|
if is_apply:
|
811
|
-
memory_dir = os.path.join(
|
840
|
+
memory_dir = os.path.join(project_root, ".auto-coder", "memory")
|
812
841
|
os.makedirs(memory_dir, exist_ok=True)
|
813
842
|
memory_file = os.path.join(memory_dir, "chat_history.json")
|
814
843
|
|
@@ -837,25 +866,26 @@ def coding(query: str, llm: AutoLLM):
|
|
837
866
|
yaml_config["context"] += f"你: {conv['content']}\n"
|
838
867
|
yaml_config["context"] += "</history>\n"
|
839
868
|
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
869
|
+
# todo:暂时注释,后续通过一个 is_rules 的参数来控制
|
870
|
+
# if args.enable_rules:
|
871
|
+
# rules_dir_path = os.path.join(project_root, ".auto-coder", "autocoderrules")
|
872
|
+
# printer.print_text("已开启 Rules 模式", style="green")
|
873
|
+
# yaml_config["context"] += f"下面是我们对代码进行深入分析,提取具有通用价值的功能模式和设计模式,可在其他需求中复用的Rules\n"
|
874
|
+
# yaml_config["context"] += "你在编写代码时可以参考以下Rules\n"
|
875
|
+
# yaml_config["context"] += "<rules>\n"
|
876
|
+
# for rules_name in os.listdir(rules_dir_path):
|
877
|
+
# printer.print_text(f"正在加载 Rules:{rules_name}", style="green")
|
878
|
+
# rules_file_path = os.path.join(rules_dir_path, rules_name)
|
879
|
+
# with open(rules_file_path, "r") as fp:
|
880
|
+
# yaml_config["context"] += f"{fp.read()}\n"
|
881
|
+
# yaml_config["context"] += "</rules>\n"
|
852
882
|
|
853
883
|
yaml_config["file"] = latest_yaml_file
|
854
884
|
yaml_content = convert_yaml_config_to_str(yaml_config=yaml_config)
|
855
|
-
execute_file = os.path.join(
|
885
|
+
execute_file = os.path.join(project_root, "actions", latest_yaml_file)
|
856
886
|
with open(os.path.join(execute_file), "w") as f:
|
857
887
|
f.write(yaml_content)
|
858
|
-
convert_yaml_to_config(execute_file)
|
888
|
+
args = convert_yaml_to_config(execute_file)
|
859
889
|
|
860
890
|
dispacher = Dispacher(args=args, llm=llm)
|
861
891
|
dispacher.dispach()
|
@@ -866,7 +896,7 @@ def coding(query: str, llm: AutoLLM):
|
|
866
896
|
completer.refresh_files()
|
867
897
|
|
868
898
|
|
869
|
-
def execute_revert():
|
899
|
+
def execute_revert(args: AutoCoderArgs):
|
870
900
|
repo_path = args.source_dir
|
871
901
|
|
872
902
|
file_content = open(args.file).read()
|
@@ -883,11 +913,11 @@ def execute_revert():
|
|
883
913
|
|
884
914
|
|
885
915
|
def revert():
|
886
|
-
last_yaml_file = get_last_yaml_file(os.path.join(
|
916
|
+
last_yaml_file = get_last_yaml_file(os.path.join(project_root, "actions"))
|
887
917
|
if last_yaml_file:
|
888
|
-
file_path = os.path.join(
|
889
|
-
convert_yaml_to_config(file_path)
|
890
|
-
execute_revert()
|
918
|
+
file_path = os.path.join(project_root, "actions", last_yaml_file)
|
919
|
+
args = convert_yaml_to_config(file_path)
|
920
|
+
execute_revert(args)
|
891
921
|
else:
|
892
922
|
printer.print_text(f"No previous chat action found to revert.", style="yellow")
|
893
923
|
|
@@ -910,15 +940,15 @@ def print_commit_info(commit_result: CommitResult):
|
|
910
940
|
|
911
941
|
|
912
942
|
def commit_info(query: str, llm: AutoLLM):
|
913
|
-
repo_path =
|
943
|
+
repo_path = project_root
|
914
944
|
prepare_chat_yaml() # 复制上一个序号的 yaml 文件, 生成一个新的聊天 yaml 文件
|
915
945
|
|
916
|
-
latest_yaml_file = get_last_yaml_file(os.path.join(
|
946
|
+
latest_yaml_file = get_last_yaml_file(os.path.join(project_root, "actions"))
|
917
947
|
execute_file = None
|
918
948
|
|
919
949
|
if latest_yaml_file:
|
920
950
|
try:
|
921
|
-
execute_file = os.path.join(
|
951
|
+
execute_file = os.path.join(project_root, "actions", latest_yaml_file)
|
922
952
|
conf = memory.get("conf", {})
|
923
953
|
yaml_config = {
|
924
954
|
"include_file": ["./base/base.yml"],
|
@@ -937,11 +967,11 @@ def commit_info(query: str, llm: AutoLLM):
|
|
937
967
|
yaml_config["urls"] = current_files
|
938
968
|
|
939
969
|
# 临时保存yaml文件,然后读取yaml文件,更新args
|
940
|
-
temp_yaml = os.path.join(
|
970
|
+
temp_yaml = os.path.join(project_root, "actions", f"{uuid.uuid4()}.yml")
|
941
971
|
try:
|
942
972
|
with open(temp_yaml, "w", encoding="utf-8") as f:
|
943
973
|
f.write(convert_yaml_config_to_str(yaml_config=yaml_config))
|
944
|
-
convert_yaml_to_config(temp_yaml)
|
974
|
+
args = convert_yaml_to_config(temp_yaml)
|
945
975
|
finally:
|
946
976
|
if os.path.exists(temp_yaml):
|
947
977
|
os.remove(temp_yaml)
|
@@ -982,7 +1012,7 @@ def commit_info(query: str, llm: AutoLLM):
|
|
982
1012
|
|
983
1013
|
|
984
1014
|
def agentic_edit(query: str, llm: AutoLLM):
|
985
|
-
|
1015
|
+
args = get_final_config(query=query, delete_execute_file=True)
|
986
1016
|
|
987
1017
|
sources = SourceCodeList([])
|
988
1018
|
agentic_editor = AgenticEdit(
|
@@ -1032,7 +1062,7 @@ def _generate_shell_script(user_input: str) -> str:
|
|
1032
1062
|
|
1033
1063
|
|
1034
1064
|
def generate_shell_command(input_text: str, llm: AutoLLM) -> str | None:
|
1035
|
-
|
1065
|
+
args = get_final_config(query=input_text, delete_execute_file=True)
|
1036
1066
|
|
1037
1067
|
try:
|
1038
1068
|
printer.print_panel(
|
@@ -1274,13 +1304,18 @@ def initialize_system():
|
|
1274
1304
|
|
1275
1305
|
def _init_project():
|
1276
1306
|
first_time = False
|
1277
|
-
if not os.path.exists(os.path.join(
|
1307
|
+
if not os.path.exists(os.path.join(project_root, ".auto-coder")):
|
1278
1308
|
first_time = True
|
1279
1309
|
printer.print_text("当前目录未初始化为auto-coder项目.", style="yellow")
|
1280
1310
|
init_choice = input(f" 是否现在初始化项目?(y/n): ").strip().lower()
|
1281
1311
|
if init_choice == "y":
|
1282
1312
|
try:
|
1283
|
-
|
1313
|
+
if first_time: # 首次启动,配置项目类型
|
1314
|
+
if not os.path.exists(base_persist_dir):
|
1315
|
+
os.makedirs(base_persist_dir, exist_ok=True)
|
1316
|
+
printer.print_text("创建目录:{}".format(base_persist_dir), style="green")
|
1317
|
+
project_type = configure_project_type()
|
1318
|
+
init_project(project_type)
|
1284
1319
|
printer.print_text("项目初始化成功.", style="green")
|
1285
1320
|
except Exception as e:
|
1286
1321
|
printer.print_text(f"项目初始化失败, {str(e)}.", style="red")
|
@@ -1289,12 +1324,12 @@ def initialize_system():
|
|
1289
1324
|
printer.print_text("退出而不初始化.", style="yellow")
|
1290
1325
|
exit(1)
|
1291
1326
|
|
1292
|
-
if not os.path.exists(base_persist_dir):
|
1293
|
-
|
1294
|
-
|
1327
|
+
# if not os.path.exists(base_persist_dir):
|
1328
|
+
# os.makedirs(base_persist_dir, exist_ok=True)
|
1329
|
+
# printer.print_text("创建目录:{}".format(base_persist_dir), style="green")
|
1295
1330
|
|
1296
|
-
if first_time: # 首次启动,配置项目类型
|
1297
|
-
|
1331
|
+
# if first_time: # 首次启动,配置项目类型
|
1332
|
+
# project_type = configure_project_type()
|
1298
1333
|
|
1299
1334
|
printer.print_text("项目初始化完成.", style="green")
|
1300
1335
|
|
@@ -1656,7 +1691,7 @@ def rules(query_args: List[str], llm: AutoLLM):
|
|
1656
1691
|
/rules /analyze - 分析当前文件,可选提供查询内容
|
1657
1692
|
/rules /commit <提交ID> - 分析特定提交,必须提供提交ID和查询内容
|
1658
1693
|
"""
|
1659
|
-
|
1694
|
+
args = get_final_config(query="", delete_execute_file=True)
|
1660
1695
|
rules_dir_path = os.path.join(project_root, ".auto-coder", "autocoderrules")
|
1661
1696
|
if query_args[0] == "/list":
|
1662
1697
|
printer.print_table_compact(
|
@@ -1806,20 +1841,21 @@ def main():
|
|
1806
1841
|
memory["mode"] = "normal"
|
1807
1842
|
event.app.invalidate()
|
1808
1843
|
|
1809
|
-
def _update_bottom_toolbar(toolbar_arg):
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1844
|
+
# def _update_bottom_toolbar(toolbar_arg):
|
1845
|
+
# if toolbar_arg in memory['conf']:
|
1846
|
+
# return memory['conf'][toolbar_arg]
|
1847
|
+
# return args.model_dump()[toolbar_arg]
|
1813
1848
|
|
1814
1849
|
def get_bottom_toolbar():
|
1815
1850
|
if "mode" not in memory:
|
1816
1851
|
memory["mode"] = "normal"
|
1817
1852
|
mode = memory["mode"]
|
1818
|
-
skip_build_toolbar = _update_bottom_toolbar('skip_build_index')
|
1819
|
-
skip_filter_toolbar = _update_bottom_toolbar('skip_filter_index')
|
1820
|
-
index_filter_toolbar = _update_bottom_toolbar('index_filter_level')
|
1821
|
-
return (f" 当前模式: {MODES[mode]} (ctl+k 切换模式) | 跳过索引: {skip_build_toolbar} "
|
1822
|
-
|
1853
|
+
# skip_build_toolbar = _update_bottom_toolbar('skip_build_index')
|
1854
|
+
# skip_filter_toolbar = _update_bottom_toolbar('skip_filter_index')
|
1855
|
+
# index_filter_toolbar = _update_bottom_toolbar('index_filter_level')
|
1856
|
+
# return (f" 当前模式: {MODES[mode]} (ctl+k 切换模式) | 跳过索引: {skip_build_toolbar} "
|
1857
|
+
# f"| 跳过过滤: {skip_filter_toolbar} | 过滤等级: {index_filter_toolbar}")
|
1858
|
+
return f" 当前模式: {MODES[mode]} (ctl+k 切换模式) | 当前项目: {project_root}"
|
1823
1859
|
|
1824
1860
|
session = PromptSession(
|
1825
1861
|
history=InMemoryHistory(),
|
autocoder_nano/llm_client.py
CHANGED
@@ -41,10 +41,8 @@ class AutoLLM:
|
|
41
41
|
model = self.default_model_name
|
42
42
|
|
43
43
|
model_name = self.sub_clients[model]["model_name"]
|
44
|
-
printer.
|
45
|
-
title="模型调用"
|
46
|
-
content=f"调用函数: stream_chat_ai\n使用模型: {model}\n模型名称: {model_name}",
|
47
|
-
width=60
|
44
|
+
printer.print_key_value(
|
45
|
+
{"调用函数": "stream_chat_ai", "使用模型": f"{model}", "模型名称": f"{model_name}"}, title="模型调用"
|
48
46
|
)
|
49
47
|
request = LLMRequest(
|
50
48
|
model=model_name,
|
@@ -65,6 +63,10 @@ class AutoLLM:
|
|
65
63
|
client: OpenAI = self.sub_clients[model]["client"]
|
66
64
|
model_name = self.sub_clients[model]["model_name"]
|
67
65
|
|
66
|
+
printer.print_key_value(
|
67
|
+
{"调用函数": "stream_chat_ai_ex", "使用模型": f"{model}", "模型名称": f"{model_name}"}, title="模型调用"
|
68
|
+
)
|
69
|
+
|
68
70
|
request = LLMRequest(
|
69
71
|
model=model_name,
|
70
72
|
messages=conversations,
|
@@ -185,10 +187,8 @@ class AutoLLM:
|
|
185
187
|
conversations = [{"role": "user", "content": conversations}]
|
186
188
|
|
187
189
|
model_name = self.sub_clients[model]["model_name"]
|
188
|
-
printer.
|
189
|
-
title="模型调用"
|
190
|
-
content=f"调用函数: chat_ai\n使用模型: {model}\n模型名称: {model_name}",
|
191
|
-
width=60
|
190
|
+
printer.print_key_value(
|
191
|
+
{"调用函数": "chat_ai", "使用模型": f"{model}", "模型名称": f"{model_name}"}, title="模型调用"
|
192
192
|
)
|
193
193
|
request = LLMRequest(
|
194
194
|
model=model_name,
|
@@ -230,11 +230,9 @@ class AutoLLM:
|
|
230
230
|
model = self.default_model_name
|
231
231
|
|
232
232
|
model_name = self.sub_clients[model]["model_name"]
|
233
|
-
printer.
|
234
|
-
|
235
|
-
|
236
|
-
width=60
|
237
|
-
)
|
233
|
+
# printer.print_key_value(
|
234
|
+
# {"调用函数": "embedding", "使用模型": f"{model}", "模型名称": f"{model_name}"}, title="模型调用"
|
235
|
+
# )
|
238
236
|
|
239
237
|
res = self.sub_clients[model]["client"].embeddings.create(
|
240
238
|
model=model_name,
|
autocoder_nano/version.py
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
autocoder_nano/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
autocoder_nano/auto_coder_nano.py,sha256
|
2
|
+
autocoder_nano/auto_coder_nano.py,sha256=-_GJVdBRQs1SXmfxzhIqMMRTZZNjvpUo8y5Z4UjD_1Y,82353
|
3
3
|
autocoder_nano/auto_coder_nano_rag.py,sha256=9BtNZ6nC5D5SPTIuziXZOfouCBLOMNzvJMTdDPQEgO8,10436
|
4
4
|
autocoder_nano/auto_coder_nano_ui.py,sha256=ZBskcIJMeTJY7_JipGJaee58G9fUJaOv3LV4hptLc6c,12669
|
5
5
|
autocoder_nano/file_utils.py,sha256=iGbkbQ191nKL4aNufdexYYYQSDM1XrDC9Uxp_PIbawY,661
|
6
6
|
autocoder_nano/git_utils.py,sha256=zAhXi5WFHklpkoPH04kkXpQjQJv1CEHbXE-O3tqyNlA,23194
|
7
7
|
autocoder_nano/helper.py,sha256=LbieDBKp408x9g4GHCvcujUgMgxDTV9owGHIBYpT1ww,6643
|
8
|
-
autocoder_nano/llm_client.py,sha256=
|
8
|
+
autocoder_nano/llm_client.py,sha256=pJkEpAaPJgz7Yzzr1h-YUveiVidH8YNpLmdfwuM5t_I,11318
|
9
9
|
autocoder_nano/llm_prompt.py,sha256=ViWUfCZp0gDESAAPHBhZc2WhHiFUHIxK6a2xbFu0sjU,10864
|
10
10
|
autocoder_nano/llm_types.py,sha256=T0ugeWdwejy6BJaQrAlk8Pk5qweW2xbggxzHaSpTBOg,11588
|
11
11
|
autocoder_nano/sys_utils.py,sha256=Sn6kr5diaEkVWbYDBrtenr9zw32jVIWvsAReY7_uEd0,1638
|
12
12
|
autocoder_nano/templates.py,sha256=fqlRtnx6HvPE4CbdnPcnLBB-flPwufwcGRpsFD3aW2c,4271
|
13
|
-
autocoder_nano/version.py,sha256=
|
13
|
+
autocoder_nano/version.py,sha256=EHHVoJOXjCkEUL-Zl_GcPBCR9AFZZUcSa1h_MximxjQ,79
|
14
14
|
autocoder_nano/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
autocoder_nano/agent/agent_base.py,sha256=O5Hq6VnoqrXnBE_oXZHXlbmSRdOEe28H65bJ1WhAQjg,16377
|
16
16
|
autocoder_nano/agent/agentic_edit.py,sha256=I1HjRhMabDmtfxcCOKawUJV0wU1GNzKtof19_GNgAjU,88749
|
@@ -89,9 +89,9 @@ autocoder_nano/utils/completer_utils.py,sha256=MGA3r5pAvDhp1vNGGCyjHWDtqXnd-CF4z
|
|
89
89
|
autocoder_nano/utils/formatted_log_utils.py,sha256=1d3xvZ1Bo3-I1wQOMdXpwsMX5cl2FWkmpgHGHvTPEvI,5457
|
90
90
|
autocoder_nano/utils/printer_utils.py,sha256=6rGHihCh8DDESWs6qWqwsf3B6qaeM_CNx6crzkl9UCk,15303
|
91
91
|
autocoder_nano/utils/shell_utils.py,sha256=llVTrOrmS1RH2ws7W69tofVtf53Kq04uh-sURphejrU,2477
|
92
|
-
autocoder_nano-0.1.
|
93
|
-
autocoder_nano-0.1.
|
94
|
-
autocoder_nano-0.1.
|
95
|
-
autocoder_nano-0.1.
|
96
|
-
autocoder_nano-0.1.
|
97
|
-
autocoder_nano-0.1.
|
92
|
+
autocoder_nano-0.1.35.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
93
|
+
autocoder_nano-0.1.35.dist-info/METADATA,sha256=e5LU59CY6BwcJrQKIxMt2BdsQlnu_vHra50sL4EKsDc,13591
|
94
|
+
autocoder_nano-0.1.35.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
95
|
+
autocoder_nano-0.1.35.dist-info/entry_points.txt,sha256=Dj8gGZ_AgLy8ANqr2do_DJjpsR3JMh-ztsrUXo4Vn5Q,194
|
96
|
+
autocoder_nano-0.1.35.dist-info/top_level.txt,sha256=D7s34cwIs1F4EAjRRDvO_zTHtUz1Z7UVccFUNlJn7HI,15
|
97
|
+
autocoder_nano-0.1.35.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|