pycoze 0.1.317__py3-none-any.whl → 0.1.319__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.
pycoze/bot/tools.py CHANGED
@@ -22,11 +22,11 @@ def handle_normal_func(func, params):
22
22
 
23
23
  def call_func(func, params):
24
24
  if inspect.isgeneratorfunction(func):
25
- return handle_generator_func(func, params)
25
+ return list(func(**params))
26
26
  elif inspect.iscoroutinefunction(func):
27
- return asyncio.run(handle_async_func(func, params))
27
+ return asyncio.run(func(**params))
28
28
  else:
29
- return handle_normal_func(func, params)
29
+ return func(**params)
30
30
 
31
31
 
32
32
  class InvalidToolError(Exception):
@@ -286,6 +286,7 @@ class ToolExecutor:
286
286
  try:
287
287
  result = call_func(func, params)
288
288
  except Exception as e:
289
+ print("Execute tool error:", traceback.format_exc())
289
290
  return False, traceback.format_exc()
290
291
  return True, str(result)
291
292
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pycoze
3
- Version: 0.1.317
3
+ Version: 0.1.319
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -17,7 +17,7 @@ pycoze/bot/chat_base.py,sha256=czmOKUum3Rwo4lAOJtfslxaF8RKauWzj26s_WMmQa48,9180
17
17
  pycoze/bot/lib.py,sha256=IIihXPODCbM29TlxS0lhm2Fw3GWm2MzUeAn9LGa86lg,6889
18
18
  pycoze/bot/message.py,sha256=Zq-_k8HztBMOUIs3hbOvWvwHBNopn4UJJBliCROIGcc,718
19
19
  pycoze/bot/prompt.md,sha256=ehjdvZ-se9NaH0OSiDEvrFE9kvdj9MTZlWZUTxPY780,15743
20
- pycoze/bot/tools.py,sha256=GKEkauxP0f7eSD-d2occKcip0swihFV2TAI5xxaPrV8,10187
20
+ pycoze/bot/tools.py,sha256=yuXqB6nGg8XvKvJVF_OJbto8HCC1fjoA1LewZKPlfH4,10210
21
21
  pycoze/reference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  pycoze/reference/bot.py,sha256=pxHVYo0G3P3YZ--vBYbMEiEyBoxxPwaO5dMTf9WFMSc,2014
23
23
  pycoze/reference/lib.py,sha256=6jvowP2LqjyV21ppRhmtxHxnQJHCbHmlpbj9btV2RQ4,2191
@@ -33,8 +33,8 @@ pycoze/utils/arg.py,sha256=jop1tBfe5hYkHW1NSpCeaZBEznkgguBscj_7M2dWfrs,503
33
33
  pycoze/utils/env.py,sha256=5pWlXfM1F5ZU9hhv1rHlDEanjEW5wf0nbyez9bNRqqA,559
34
34
  pycoze/utils/socket.py,sha256=bZbFFRH4mfThzRqt55BAAGQ6eICx_ja4x8UGGrUdAm8,2428
35
35
  pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
36
- pycoze-0.1.317.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
37
- pycoze-0.1.317.dist-info/METADATA,sha256=oNdRRbYnG8Wneh6Y_b3SsSubGokqEarNQWs-_bzzZRA,854
38
- pycoze-0.1.317.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
39
- pycoze-0.1.317.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
40
- pycoze-0.1.317.dist-info/RECORD,,
36
+ pycoze-0.1.319.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
37
+ pycoze-0.1.319.dist-info/METADATA,sha256=aQQW7Xwfv_UF_aomuAbs51vUWmJMDHdED14miZIuVeE,854
38
+ pycoze-0.1.319.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
39
+ pycoze-0.1.319.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
40
+ pycoze-0.1.319.dist-info/RECORD,,