pro-craft 0.1.36__tar.gz → 0.1.37__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.

Files changed (28) hide show
  1. {pro_craft-0.1.36 → pro_craft-0.1.37}/PKG-INFO +1 -1
  2. {pro_craft-0.1.36 → pro_craft-0.1.37}/pyproject.toml +1 -1
  3. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/log.py +1 -1
  4. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/prompt_craft/async_.py +20 -23
  5. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft.egg-info/PKG-INFO +1 -1
  6. {pro_craft-0.1.36 → pro_craft-0.1.37}/README.md +0 -0
  7. {pro_craft-0.1.36 → pro_craft-0.1.37}/setup.cfg +0 -0
  8. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/__init__.py +0 -0
  9. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/code_helper/coder.py +0 -0
  10. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/code_helper/designer.py +0 -0
  11. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/database.py +0 -0
  12. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/file_manager.py +0 -0
  13. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/prompt_craft/__init__.py +0 -0
  14. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/prompt_craft/new.py +0 -0
  15. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/prompt_craft/sync.py +0 -0
  16. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/server/mcp/__init__.py +0 -0
  17. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/server/mcp/prompt.py +0 -0
  18. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/server/router/__init__.py +0 -0
  19. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/server/router/prompt.py +0 -0
  20. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft/utils.py +0 -0
  21. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft.egg-info/SOURCES.txt +0 -0
  22. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft.egg-info/dependency_links.txt +0 -0
  23. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft.egg-info/requires.txt +0 -0
  24. {pro_craft-0.1.36 → pro_craft-0.1.37}/src/pro_craft.egg-info/top_level.txt +0 -0
  25. {pro_craft-0.1.36 → pro_craft-0.1.37}/tests/test22.py +0 -0
  26. {pro_craft-0.1.36 → pro_craft-0.1.37}/tests/test_11.py +0 -0
  27. {pro_craft-0.1.36 → pro_craft-0.1.37}/tests/test_coder.py +0 -0
  28. {pro_craft-0.1.36 → pro_craft-0.1.37}/tests/test_designer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pro-craft
3
- Version: 0.1.36
3
+ Version: 0.1.37
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pro-craft"
3
- version = "0.1.36"
3
+ version = "0.1.37"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -12,7 +12,7 @@ class Log:
12
12
  def __init__(self, console_level = logging.INFO, log_file_name="app.log"):
13
13
  self.Console_LOG_LEVEL = console_level
14
14
  self.log_file_name = log_file_name
15
- os.makedirs("logs", exist_ok=False)
15
+ os.makedirs("logs", exist_ok=True)
16
16
  self.LOG_FILE_PATH = os.path.join("logs", log_file_name)
17
17
  self.logger = self.get_logger()
18
18
  self.super_log_level = self.logger.critical
@@ -364,7 +364,7 @@ class AsyncIntel():
364
364
  session = session)
365
365
  for use_case_old in use_cases:
366
366
  if use_case == use_case_old.use_case:
367
- print("用例已经存在")
367
+ # print("用例已经存在")
368
368
  return
369
369
 
370
370
  use_case = UseCase(prompt_id=prompt_id,
@@ -654,36 +654,34 @@ class AsyncIntel():
654
654
  version=version,
655
655
  inference_save_case=inference_save_case,
656
656
  )
657
-
658
- try:
659
- json_str = extract_(ai_result,r'json')
660
- ai_result = json.loads(json_str)
661
- if OutputFormat:
662
- OutputFormat(**ai_result)
663
-
664
- except JSONDecodeError as e:
657
+ if OutputFormat:
665
658
  try:
666
- self.logger.error(f"尝试补救")
667
- json_str = fix_broken_json_string(json_str)
659
+ json_str = extract_(ai_result,r'json')
668
660
  ai_result = json.loads(json_str)
669
- if OutputFormat:
670
- OutputFormat(**ai_result)
661
+ OutputFormat(**ai_result)
671
662
 
672
663
  except JSONDecodeError as e:
673
- raise IntellectRemoveFormatError(f"prompt_id: {prompt_id} 生成的内容为无法被Json解析 {e}") from e
674
-
675
- except ValidationError as e:
676
- err_info = e.errors()[0]
677
- raise IntellectRemoveFormatError(f"{err_info["type"]}: 属性:{err_info['loc']}, 发生了如下错误: {err_info['msg']}, 格式校验失败, 当前输入为: {err_info['input']} 请检查") from e
664
+ try:
665
+ self.logger.error(f"尝试补救")
666
+ json_str = fix_broken_json_string(json_str)
667
+ ai_result = json.loads(json_str)
668
+ OutputFormat(**ai_result)
678
669
 
679
- except Exception as e:
680
- raise Exception(f"Error {prompt_id} : {e}") from e
670
+ except JSONDecodeError as e:
671
+ raise IntellectRemoveFormatError(f"prompt_id: {prompt_id} 生成的内容为无法被Json解析 {e}") from e
672
+
673
+ except ValidationError as e:
674
+ err_info = e.errors()[0]
675
+ raise IntellectRemoveFormatError(f"{err_info["type"]}: 属性:{err_info['loc']}, 发生了如下错误: {err_info['msg']}, 格式校验失败, 当前输入为: {err_info['input']} 请检查") from e
676
+
677
+ except Exception as e:
678
+ raise Exception(f"Error {prompt_id} : {e}") from e
681
679
 
682
680
  return ai_result
683
681
 
684
682
  async def intellect_formats(self,
685
683
  input_datas: list[dict | str],
686
- OutputFormat: object,
684
+ OutputFormat: object | None,
687
685
  prompt_id: str,
688
686
  ExtraFormats: list[object] = [],
689
687
  version: str = None,
@@ -719,8 +717,7 @@ class AsyncIntel():
719
717
  # 修改逻辑
720
718
  assert kwargs.get('input_data') # 要求一定要有data入参
721
719
  input_data = kwargs.get('input_data')
722
- assert kwargs.get('OutputFormat') # 要求一定要有data入参
723
- OutputFormat = kwargs.get('OutputFormat')
720
+ OutputFormat = kwargs.get('OutputFormat','')
724
721
 
725
722
  if isinstance(input_data,dict):
726
723
  input_ = output_ = json.dumps(input_data,ensure_ascii=False)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pro-craft
3
- Version: 0.1.36
3
+ Version: 0.1.37
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
File without changes
File without changes
File without changes
File without changes