pro-craft 0.1.18__tar.gz → 0.1.20__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 pro-craft might be problematic. Click here for more details.
- {pro_craft-0.1.18 → pro_craft-0.1.20}/PKG-INFO +1 -1
- {pro_craft-0.1.18 → pro_craft-0.1.20}/pyproject.toml +1 -1
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/prompt_craft/async_.py +64 -22
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/server/router/prompt.py +1 -1
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft.egg-info/PKG-INFO +1 -1
- {pro_craft-0.1.18 → pro_craft-0.1.20}/README.md +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/setup.cfg +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/__init__.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/code_helper/coder.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/code_helper/designer.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/database.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/file_manager.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/log.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/prompt_craft/__init__.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/prompt_craft/evals.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/prompt_craft/new.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/prompt_craft/sync.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/server/mcp/__init__.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/server/mcp/prompt.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/server/router/__init__.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft/utils.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft.egg-info/SOURCES.txt +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft.egg-info/dependency_links.txt +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft.egg-info/requires.txt +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/src/pro_craft.egg-info/top_level.txt +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/tests/test22.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/tests/test_coder.py +0 -0
- {pro_craft-0.1.18 → pro_craft-0.1.20}/tests/test_designer.py +0 -0
|
@@ -14,7 +14,7 @@ from sqlalchemy import select, delete # 导入 select, delete 用于异步操作
|
|
|
14
14
|
import inspect
|
|
15
15
|
from datetime import datetime
|
|
16
16
|
from pro_craft.utils import extract_
|
|
17
|
-
|
|
17
|
+
import asyncio
|
|
18
18
|
import re
|
|
19
19
|
|
|
20
20
|
from sqlalchemy import select, desc
|
|
@@ -349,12 +349,7 @@ class AsyncIntel():
|
|
|
349
349
|
score = 60,
|
|
350
350
|
session = session
|
|
351
351
|
)
|
|
352
|
-
ai_result =
|
|
353
|
-
output_format = output_format,
|
|
354
|
-
prompt_id = prompt_id,
|
|
355
|
-
version = version,
|
|
356
|
-
inference_save_case = inference_save_case
|
|
357
|
-
)
|
|
352
|
+
ai_result = "初始化完成"
|
|
358
353
|
return ai_result
|
|
359
354
|
|
|
360
355
|
prompt = result_obj.prompt
|
|
@@ -379,22 +374,39 @@ class AsyncIntel():
|
|
|
379
374
|
demand = result_obj.demand
|
|
380
375
|
|
|
381
376
|
|
|
382
|
-
assert demand
|
|
383
|
-
# 注意, 这里的调整要求使用最初的那个输入, 最好一口气调整好
|
|
384
|
-
chat_history = prompt
|
|
385
|
-
if input_ == before_input: # 输入没变, 说明还是针对同一个输入进行讨论
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
else:
|
|
389
|
-
|
|
390
|
-
|
|
377
|
+
# assert demand
|
|
378
|
+
# # 注意, 这里的调整要求使用最初的那个输入, 最好一口气调整好
|
|
379
|
+
# chat_history = prompt
|
|
380
|
+
# if input_ == before_input: # 输入没变, 说明还是针对同一个输入进行讨论
|
|
381
|
+
# # input_prompt = chat_history + "\nuser:" + demand
|
|
382
|
+
# input_prompt = chat_history + "\nuser:" + demand + output_format
|
|
383
|
+
# else:
|
|
384
|
+
# # input_prompt = chat_history + "\nuser:" + demand + "\n-----input----\n" + input_
|
|
385
|
+
# input_prompt = chat_history + "\nuser:" + demand + output_format + "\n-----input----\n" + input_
|
|
391
386
|
|
|
392
|
-
ai_result = await self.llm.aproduct(input_prompt)
|
|
393
|
-
chat_history = input_prompt + "\nassistant:\n" + ai_result # 用聊天记录作为完整提示词
|
|
394
|
-
await self.save_prompt_increment_version(prompt_id, chat_history,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
387
|
+
# ai_result = await self.llm.aproduct(input_prompt)
|
|
388
|
+
# chat_history = input_prompt + "\nassistant:\n" + ai_result # 用聊天记录作为完整提示词
|
|
389
|
+
# await self.save_prompt_increment_version(prompt_id, chat_history,
|
|
390
|
+
# use_case = input_,
|
|
391
|
+
# score = 60,
|
|
392
|
+
# session = session)
|
|
393
|
+
|
|
394
|
+
if input_ == before_input:
|
|
395
|
+
new_prompt = prompt + "\nuser:" + demand
|
|
396
|
+
else:
|
|
397
|
+
new_prompt = prompt + "\nuser:" + input_
|
|
398
|
+
|
|
399
|
+
ai_result = await self.llm.aproduct(new_prompt + output_format)
|
|
400
|
+
|
|
401
|
+
save_new_prompt = new_prompt + "\nassistant:\n" + ai_result
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
await self.save_prompt_increment_version(
|
|
405
|
+
prompt_id,
|
|
406
|
+
new_prompt=save_new_prompt,
|
|
407
|
+
use_case = input_,
|
|
408
|
+
score = 60,
|
|
409
|
+
session = session)
|
|
398
410
|
|
|
399
411
|
elif result_obj.action_type == "summary":
|
|
400
412
|
|
|
@@ -514,6 +526,7 @@ class AsyncIntel():
|
|
|
514
526
|
use_case = input_,
|
|
515
527
|
score = 60,
|
|
516
528
|
session = session)
|
|
529
|
+
|
|
517
530
|
|
|
518
531
|
elif result_obj.action_type == "summary":
|
|
519
532
|
|
|
@@ -608,6 +621,35 @@ class AsyncIntel():
|
|
|
608
621
|
|
|
609
622
|
return ai_result
|
|
610
623
|
|
|
624
|
+
async def intellect_remove_formats(self,
|
|
625
|
+
input_datas: list[dict | str],
|
|
626
|
+
OutputFormat: object,
|
|
627
|
+
prompt_id: str,
|
|
628
|
+
ExtraFormats: list[object] = [],
|
|
629
|
+
version: str = None,
|
|
630
|
+
inference_save_case = True,
|
|
631
|
+
):
|
|
632
|
+
|
|
633
|
+
async with create_async_session(self.engine) as session:
|
|
634
|
+
prompt_result = await self.get_prompts_from_sql(prompt_id=prompt_id,
|
|
635
|
+
session=session)
|
|
636
|
+
if prompt_result.action_type != "inference":
|
|
637
|
+
input_datas = input_datas[:1]
|
|
638
|
+
tasks = []
|
|
639
|
+
for input_data in input_datas:
|
|
640
|
+
tasks.append(
|
|
641
|
+
self.intellect_remove_format(
|
|
642
|
+
input_data = input_data,
|
|
643
|
+
prompt_id = prompt_id,
|
|
644
|
+
OutputFormat = OutputFormat,
|
|
645
|
+
ExtraFormats = ExtraFormats,
|
|
646
|
+
version = version,
|
|
647
|
+
inference_save_case = inference_save_case,
|
|
648
|
+
)
|
|
649
|
+
)
|
|
650
|
+
results = await asyncio.gather(*tasks, return_exceptions=False)
|
|
651
|
+
return results
|
|
652
|
+
|
|
611
653
|
|
|
612
654
|
def intellect_remove_warp(self,prompt_id: str):
|
|
613
655
|
def outer_packing(func):
|
|
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
|