lm-deluge 0.0.49__py3-none-any.whl → 0.0.50__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 lm-deluge might be problematic. Click here for more details.

lm_deluge/tool.py CHANGED
@@ -1,14 +1,14 @@
1
1
  import asyncio
2
2
  import inspect
3
- from typing import Any, Callable, Coroutine, Literal, TypedDict, get_type_hints
4
3
  from concurrent.futures import ThreadPoolExecutor
4
+ from typing import Any, Callable, Coroutine, Literal, TypedDict, get_type_hints
5
5
 
6
6
  from fastmcp import Client # pip install fastmcp >= 2.0
7
7
  from mcp.types import Tool as MCPTool
8
8
  from pydantic import BaseModel, Field, field_validator
9
9
 
10
- from lm_deluge.prompt import Text, ToolResultPart
11
10
  from lm_deluge.image import Image
11
+ from lm_deluge.prompt import Text, ToolResultPart
12
12
 
13
13
 
14
14
  async def _load_all_mcp_tools(client: Client) -> list["Tool"]:
@@ -18,10 +18,14 @@ async def _load_all_mcp_tools(client: Client) -> list["Tool"]:
18
18
  async def _async_call(**kw):
19
19
  async with client:
20
20
  # maybe should be call_tool_mcp if don't want to raise error
21
- content_blocks = await client.call_tool(name, kw)
21
+ raw_result = await client.call_tool(name, kw)
22
22
 
23
23
  # for now just concatenate them all into a result string
24
24
  results = []
25
+ if not isinstance(raw_result, list): # newer versions of fastmcp
26
+ content_blocks = raw_result.content
27
+ else:
28
+ content_blocks = raw_result
25
29
  for block in content_blocks:
26
30
  if block.type == "text":
27
31
  results.append(Text(block.text))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lm_deluge
3
- Version: 0.0.49
3
+ Version: 0.0.50
4
4
  Summary: Python utility for using LLM API models.
5
5
  Author-email: Benjamin Anderson <ben@trytaylor.ai>
6
6
  Requires-Python: >=3.10
@@ -13,7 +13,7 @@ lm_deluge/image.py,sha256=5AMXmn2x47yXeYNfMSMAOWcnlrOxxOel-4L8QCJwU70,8928
13
13
  lm_deluge/prompt.py,sha256=2-6bALg_hOfExh9vHeKPFA6E_O8rHe6p9eIdvCulERs,59654
14
14
  lm_deluge/request_context.py,sha256=o33LSEwnK6YPhZeulUoSE_VrdKCXiCQa0tjjixK2K6M,2540
15
15
  lm_deluge/rerank.py,sha256=-NBAJdHz9OB-SWWJnHzkFmeVO4wR6lFV7Vw-SxG7aVo,11457
16
- lm_deluge/tool.py,sha256=_coOKB9nPNVZoseMRumRyQ8BMR7_d0IlstzMHNT69JY,15732
16
+ lm_deluge/tool.py,sha256=kQbXsEgjTaW_y4ZPDRJg8G6Zhh1PXnFwxzvAnlYBv2M,15936
17
17
  lm_deluge/tracker.py,sha256=EHFPsS94NmsON2u97rSE70q1t6pwCsixUmGV-kIphMs,11531
18
18
  lm_deluge/usage.py,sha256=VMEKghePFIID5JFBObqYxFpgYxnbYm_dnHy7V1-_T6M,4866
19
19
  lm_deluge/api_requests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
@@ -66,8 +66,8 @@ lm_deluge/util/logprobs.py,sha256=UkBZakOxWluaLqHrjARu7xnJ0uCHVfLGHJdnYlEcutk,11
66
66
  lm_deluge/util/spatial.py,sha256=BsF_UKhE-x0xBirc-bV1xSKZRTUhsOBdGqsMKme20C8,4099
67
67
  lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
68
68
  lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
69
- lm_deluge-0.0.49.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
70
- lm_deluge-0.0.49.dist-info/METADATA,sha256=wxyjPS3Kf3XlXbO_Qc6RcmEWp7Lfe3La3tcDB_OH0_w,13443
71
- lm_deluge-0.0.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
- lm_deluge-0.0.49.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
73
- lm_deluge-0.0.49.dist-info/RECORD,,
69
+ lm_deluge-0.0.50.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
70
+ lm_deluge-0.0.50.dist-info/METADATA,sha256=rJjaKCn6fcI-68Ce4hjKl7nhahpWFCU0RGkU_Ud-Kn4,13443
71
+ lm_deluge-0.0.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
+ lm_deluge-0.0.50.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
73
+ lm_deluge-0.0.50.dist-info/RECORD,,