pro-craft 0.1.18__py3-none-any.whl → 0.1.20__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 pro-craft might be problematic. Click here for more details.

@@ -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 = await self.intellect_remove(input_data = input_data,
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
- # input_prompt = chat_history + "\nuser:" + demand
387
- input_prompt = chat_history + "\nuser:" + demand + output_format
388
- else:
389
- # input_prompt = chat_history + "\nuser:" + demand + "\n-----input----\n" + input_
390
- input_prompt = chat_history + "\nuser:" + demand + output_format + "\n-----input----\n" + input_
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
- use_case = input_,
396
- score = 60,
397
- session = session)
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):
@@ -71,7 +71,7 @@ def create_router(database_url: str,
71
71
  demand = "",
72
72
  score = 61,
73
73
  session = session)
74
- return {"message": "success","result":result.version}
74
+ return {"message": "success"}
75
75
 
76
76
  return router
77
77
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pro-craft
3
- Version: 0.1.18
3
+ Version: 0.1.20
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -6,15 +6,15 @@ pro_craft/utils.py,sha256=R1DFkS4dsm5dIhg8lLTgBBvItvIYyyojROdh-ykqiYk,5250
6
6
  pro_craft/code_helper/coder.py,sha256=L6pRQr0pYRIHrMFZ4-pO_tZf1koxgGgF3L7Vl-GIyjM,24687
7
7
  pro_craft/code_helper/designer.py,sha256=3gyCqrjcw61sHzDjUPKhL1LOAE8xWLLbNT8NlK2mFLc,4739
8
8
  pro_craft/prompt_craft/__init__.py,sha256=83ruWO1Oci-DWvdVhPqcQrgdZTNfbmK72VQCkWASk7A,80
9
- pro_craft/prompt_craft/async_.py,sha256=iX1Ok2SrfU2jIR9ScgDoXdLN43lsVSdLpGArP_Hg3wc,27519
9
+ pro_craft/prompt_craft/async_.py,sha256=QvomyFUm2Hq0ZhRdOVaD0EsJTwm3GIANgG4IptLVQuY,29040
10
10
  pro_craft/prompt_craft/evals.py,sha256=XzaaQgA-Vgo8MNPYTdN0hyFJNmgTvw2jroWmeA02pBs,1847
11
11
  pro_craft/prompt_craft/new.py,sha256=cHugfhLNUMQk_l8JQBg5ZQXPYXqspexnCOgp3YUzoD0,25894
12
12
  pro_craft/prompt_craft/sync.py,sha256=-rY1KxAP5FhxI6Vmm2hHoLvYMmtL7rbLcFQMqD9g8ZU,25841
13
13
  pro_craft/server/mcp/__init__.py,sha256=4dbl-lFcm0r2tkOP04OxqiZG2jR-rqF181qi2AfU6UA,123
14
14
  pro_craft/server/mcp/prompt.py,sha256=OZrsyUfSQMOY_KX7dWthW209adz5JfELsQ0ODfuQR44,1245
15
15
  pro_craft/server/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- pro_craft/server/router/prompt.py,sha256=81Pid2-e7cxY5qyUjUbvNmtjeZFW9okTBddcqm90vgY,2769
17
- pro_craft-0.1.18.dist-info/METADATA,sha256=BrmnblzGnbWe6lhgwKFjFv5dWelhqyFz7SYg50EpBDQ,1800
18
- pro_craft-0.1.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- pro_craft-0.1.18.dist-info/top_level.txt,sha256=yqYDHArnYMWpeCxkmGRwlL6sJtxiOUnYylLDx9EOgFg,10
20
- pro_craft-0.1.18.dist-info/RECORD,,
16
+ pro_craft/server/router/prompt.py,sha256=ecf8kpVqPp7q_VTcUNej3MAzpO4oywgY7TAV7R6qaBw,2745
17
+ pro_craft-0.1.20.dist-info/METADATA,sha256=ov7D7Q4ggdzxCAY26ho_-fCF4U55t4GPaTBSkQ53gCE,1800
18
+ pro_craft-0.1.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ pro_craft-0.1.20.dist-info/top_level.txt,sha256=yqYDHArnYMWpeCxkmGRwlL6sJtxiOUnYylLDx9EOgFg,10
20
+ pro_craft-0.1.20.dist-info/RECORD,,