lm-deluge 0.0.84__py3-none-any.whl → 0.0.85__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.
@@ -149,6 +149,34 @@ OPENAI_MODELS = {
149
149
  "output_cost": 6.0,
150
150
  "reasoning_model": True,
151
151
  },
152
+ "o4-mini-deep-research": {
153
+ "id": "o4-mini-deep-research",
154
+ "name": "o4-mini-deep-research",
155
+ "api_base": "https://api.openai.com/v1",
156
+ "api_key_env_var": "OPENAI_API_KEY",
157
+ "supports_json": True,
158
+ "supports_logprobs": False,
159
+ "supports_responses": True,
160
+ "api_spec": "openai",
161
+ "input_cost": 2,
162
+ "cached_input_cost": 0.5,
163
+ "output_cost": 8.0,
164
+ "reasoning_model": True,
165
+ },
166
+ "o3-deep-research": {
167
+ "id": "o3-deep-research",
168
+ "name": "o3-deep-research",
169
+ "api_base": "https://api.openai.com/v1",
170
+ "api_key_env_var": "OPENAI_API_KEY",
171
+ "supports_json": True,
172
+ "supports_logprobs": False,
173
+ "supports_responses": True,
174
+ "api_spec": "openai",
175
+ "input_cost": 10,
176
+ "cached_input_cost": 2.50,
177
+ "output_cost": 40.0,
178
+ "reasoning_model": True,
179
+ },
152
180
  "o3": {
153
181
  "id": "o3",
154
182
  "name": "o3-2025-04-16",
@@ -13,8 +13,54 @@ def local_shell_openai():
13
13
  return {"type": "local_shell"}
14
14
 
15
15
 
16
- def web_search_openai():
17
- return {"type": "web_search_preview"}
16
+ def web_search_openai(
17
+ preview: bool = False,
18
+ user_location: dict | None = None,
19
+ allowed_domains: list[str] | None = None,
20
+ search_context_size: str | None = None,
21
+ ):
22
+ """OpenAI's built-in web search tool for the Responses API.
23
+
24
+ Args:
25
+ preview: If True, use web_search_preview. If False (default), use
26
+ the GA web_search tool.
27
+ user_location: Optional approximate user location to refine search results.
28
+ Should be a dict with "type": "approximate" and an "approximate" key
29
+ containing any of: country (ISO code), city, region, timezone.
30
+ Note: Not supported for deep research models.
31
+ allowed_domains: Optional list of domains to restrict search results to.
32
+ Up to 100 URLs, without http/https prefix (e.g. "openai.com").
33
+ Only available with web_search (not preview).
34
+ search_context_size: Controls how much context from web search results
35
+ is provided to the model. Options: "low", "medium" (default), "high".
36
+ Higher values use more tokens but may improve response quality.
37
+
38
+ Returns:
39
+ A dict representing the web search tool configuration.
40
+ """
41
+ tool: dict = {}
42
+ if preview:
43
+ tool["type"] = "web_search_preview"
44
+ if user_location:
45
+ tool["user_location"] = user_location
46
+ if search_context_size:
47
+ tool["search_context_size"] = search_context_size
48
+ return tool
49
+
50
+ # GA web_search tool
51
+ tool["type"] = "web_search"
52
+
53
+ if user_location:
54
+ tool["user_location"] = user_location
55
+
56
+ if search_context_size:
57
+ tool["search_context_size"] = search_context_size
58
+
59
+ # Domain filtering uses a nested filters structure
60
+ if allowed_domains:
61
+ tool["filters"] = {"allowed_domains": allowed_domains}
62
+
63
+ return tool
18
64
 
19
65
 
20
66
  def computer_use_openai(
@@ -76,12 +76,14 @@ class ExaWebSearchManager(AbstractWebSearchManager):
76
76
  search_tool_name: str = "web_search",
77
77
  fetch_tool_name: str = "web_fetch",
78
78
  timeout: int = 30,
79
+ max_contents_chars: int = 20_000,
79
80
  ):
80
81
  super().__init__(
81
82
  search_tool_name=search_tool_name,
82
83
  fetch_tool_name=fetch_tool_name,
83
84
  timeout=timeout,
84
85
  )
86
+ self.max_contents_chars = max_contents_chars
85
87
 
86
88
  async def _search( # type: ignore
87
89
  self,
@@ -146,7 +148,9 @@ class ExaWebSearchManager(AbstractWebSearchManager):
146
148
  raise ValueError("EXA_API_KEY environment variable not set")
147
149
  data = {
148
150
  "urls": [url],
149
- "text": True,
151
+ "text": {
152
+ "maxCharacters": self.max_contents_chars,
153
+ },
150
154
  }
151
155
 
152
156
  headers = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lm_deluge
3
- Version: 0.0.84
3
+ Version: 0.0.85
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
@@ -45,7 +45,7 @@ lm_deluge/models/kimi.py,sha256=B_ZL4_0q6hS1VVskBWlBR569nNSjC8RgA2lj1eCjRRE,1183
45
45
  lm_deluge/models/meta.py,sha256=BBgnscL1gMcIdPbRqrlDl_q9YAYGSrkw9JkAIabXtLs,1883
46
46
  lm_deluge/models/minimax.py,sha256=rwW9gNotAYfDVtMlqmSYegN6GoZM_9DSNNZU2yPOmaU,275
47
47
  lm_deluge/models/mistral.py,sha256=x67o5gckBGmPcIGdVbS26XZAYFKBYM4tsxEAahGp8bk,4323
48
- lm_deluge/models/openai.py,sha256=t6fcXo0YXgPQ6YiftZJP8gPw8FOBqoVapSavMVmtaOw,12411
48
+ lm_deluge/models/openai.py,sha256=UDmPqvMaBjqky2Z6yNV4bG4LqxUZmbWEJJO4pq0Mqzc,13329
49
49
  lm_deluge/models/openrouter.py,sha256=AHQTvnXM96_70XR0eqb3Wu2rAj2SHBZCWQeEKJ307LY,2816
50
50
  lm_deluge/models/together.py,sha256=wrGs4wO65on-dSlU9AARAA-rc4GDuWkidPjRQ7GScNg,4749
51
51
  lm_deluge/models/zai.py,sha256=BIde8TwjvmkfEi-6bSSBSFIh7KVnlJ7_aNdlqNZRGGI,16
@@ -59,7 +59,7 @@ lm_deluge/pipelines/translate.py,sha256=v_OvBQA2RB-QcWf0aopKHpYc2PDmckxzJGSmSuUX
59
59
  lm_deluge/tool/__init__.py,sha256=_GD2RAK0wYnKsAPdrM2w8X4xKtugBEm-eSZTboGRL9s,40260
60
60
  lm_deluge/tool/builtin/base.py,sha256=FLYdKVAqlffA6WOu4j8wQVRd0iHMsyBW_T3vfl--aXo,276
61
61
  lm_deluge/tool/builtin/gemini.py,sha256=uKrzzEZ0RO5EHddYYFvRKoMk7O6YOSWFDojhzbpQSfs,1724
62
- lm_deluge/tool/builtin/openai.py,sha256=aLuJdXbANvXVIU38Vo2zsir7zlwWgX0d8oDPT7Ql64A,721
62
+ lm_deluge/tool/builtin/openai.py,sha256=a6Y4TX_iqghDTnbL-HeFeVGq1nRdBosYJcLZzfCTy9g,2499
63
63
  lm_deluge/tool/builtin/anthropic/__init__.py,sha256=U-5VdcRS_ITjTBCoFoeABZOoG4nfBTgRvhT5eo1UY1g,10675
64
64
  lm_deluge/tool/builtin/anthropic/bash.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  lm_deluge/tool/builtin/anthropic/computer_use.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -83,7 +83,7 @@ lm_deluge/tool/prefab/sheets.py,sha256=RhH4PgRI4E6WYKfJpScflT7HtAULvp88ZA94NmJyE
83
83
  lm_deluge/tool/prefab/subagents.py,sha256=srJ7On7YR0Y8WuNvf5TJl_7IUfEtG3zlxZeLgmn_-NI,8484
84
84
  lm_deluge/tool/prefab/todos.py,sha256=mrtv68uRc-grc0xKP6xKpfPSA2yXYU7FLNy6fDzEbG8,14902
85
85
  lm_deluge/tool/prefab/tool_search.py,sha256=EJL5R5BgnO6owspk7F01Yzr8C9q9oJqmfMrWBjLE_bA,6151
86
- lm_deluge/tool/prefab/web_search.py,sha256=AQU7ISBkgao4GJxWPKT9pnYK5DTQMNTe_JS-EYGveTE,6028
86
+ lm_deluge/tool/prefab/web_search.py,sha256=i_FFBB2TAZwgN4-_9a6cD10Z9bgFGk4qNUbnOI3EnJA,6200
87
87
  lm_deluge/tool/prefab/otc/__init__.py,sha256=33AcwAt9ycECxonnvkcyh13w9Sr2Cbs6OOlBjzBvl54,6373
88
88
  lm_deluge/tool/prefab/otc/executor.py,sha256=4IROA_0un3HaV4GK7r4vQiVxJvcoHkqVii-4asGH-Cw,10508
89
89
  lm_deluge/tool/prefab/otc/parse.py,sha256=lSAtez-pBFcJVQMW2evRvV9KlduRtPevzGCEB1fmUMo,4517
@@ -94,8 +94,8 @@ lm_deluge/util/schema.py,sha256=q6uwhA4s1lM2dHT1Kwc46E7OY1VecMOtTEI0PTFn6tA,1320
94
94
  lm_deluge/util/spatial.py,sha256=BsF_UKhE-x0xBirc-bV1xSKZRTUhsOBdGqsMKme20C8,4099
95
95
  lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
96
96
  lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
97
- lm_deluge-0.0.84.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
98
- lm_deluge-0.0.84.dist-info/METADATA,sha256=bpC5Bxz4aqQ6bGqSpikv45zx1SlqMjmjxigIPKjTffM,13595
99
- lm_deluge-0.0.84.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- lm_deluge-0.0.84.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
101
- lm_deluge-0.0.84.dist-info/RECORD,,
97
+ lm_deluge-0.0.85.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
98
+ lm_deluge-0.0.85.dist-info/METADATA,sha256=MgU3mDxSvV_NBnmoacgJYXQZ-dAUdSI0JZHgXz7-BxY,13595
99
+ lm_deluge-0.0.85.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ lm_deluge-0.0.85.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
101
+ lm_deluge-0.0.85.dist-info/RECORD,,