lm-deluge 0.0.56__py3-none-any.whl → 0.0.58__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,7 +1,17 @@
1
1
  import asyncio
2
2
  import inspect
3
3
  from concurrent.futures import ThreadPoolExecutor
4
- from typing import Any, Callable, Coroutine, Literal, TypedDict, get_type_hints
4
+ from typing import (
5
+ Any,
6
+ Callable,
7
+ Coroutine,
8
+ Literal,
9
+ Type,
10
+ TypedDict,
11
+ get_args,
12
+ get_origin,
13
+ get_type_hints,
14
+ )
5
15
 
6
16
  from fastmcp import Client # pip install fastmcp >= 2.0
7
17
  from mcp.types import Tool as MCPTool
@@ -11,6 +21,196 @@ from lm_deluge.image import Image
11
21
  from lm_deluge.prompt import Text, ToolResultPart
12
22
 
13
23
 
24
+ def _python_type_to_json_schema_enhanced(python_type: Any) -> dict[str, Any]:
25
+ """
26
+ Convert Python type annotations to JSON Schema.
27
+ Handles: primitives, Optional, Literal, list[T], dict[str, T], Union.
28
+ """
29
+ # Get origin and args for generic types
30
+ origin = get_origin(python_type)
31
+ args = get_args(python_type)
32
+
33
+ # Handle Optional[T] or T | None
34
+ if origin is type(None) or python_type is type(None):
35
+ return {"type": "null"}
36
+
37
+ # Handle Union types (including Optional)
38
+ if origin is Literal:
39
+ # Literal["a", "b"] -> enum
40
+ return {"type": "string", "enum": list(args)}
41
+
42
+ # Handle list[T]
43
+ if origin is list:
44
+ if args:
45
+ items_schema = _python_type_to_json_schema_enhanced(args[0])
46
+ return {"type": "array", "items": items_schema}
47
+ return {"type": "array"}
48
+
49
+ # Handle dict[str, T]
50
+ if origin is dict:
51
+ if len(args) >= 2:
52
+ # For dict[str, T], we can set additionalProperties
53
+ value_schema = _python_type_to_json_schema_enhanced(args[1])
54
+ return {"type": "object", "additionalProperties": value_schema}
55
+ return {"type": "object"}
56
+
57
+ # Handle basic types
58
+ if python_type is int:
59
+ return {"type": "integer"}
60
+ elif python_type is float:
61
+ return {"type": "number"}
62
+ elif python_type is str:
63
+ return {"type": "string"}
64
+ elif python_type is bool:
65
+ return {"type": "boolean"}
66
+ elif python_type is list:
67
+ return {"type": "array"}
68
+ elif python_type is dict:
69
+ return {"type": "object"}
70
+ else:
71
+ # Default to string for unknown types
72
+ return {"type": "string"}
73
+
74
+
75
+ class ToolParams:
76
+ """
77
+ Helper class for constructing tool parameters more easily.
78
+
79
+ Usage:
80
+ # Simple constructor with Python types
81
+ params = ToolParams({"city": str, "age": int})
82
+
83
+ # With extras (description, enum, etc)
84
+ params = ToolParams({
85
+ "operation": (str, {"enum": ["add", "sub"], "description": "Math operation"}),
86
+ "value": (int, {"description": "The value"})
87
+ })
88
+
89
+ # From Pydantic model
90
+ params = ToolParams.from_pydantic(MyModel)
91
+
92
+ # From TypedDict
93
+ params = ToolParams.from_typed_dict(MyTypedDict)
94
+
95
+ # From existing JSON Schema
96
+ params = ToolParams.from_json_schema(schema_dict, required=["field1"])
97
+ """
98
+
99
+ def __init__(self, spec: dict[str, Any]):
100
+ """
101
+ Create ToolParams from a dict mapping parameter names to types or (type, extras) tuples.
102
+
103
+ Args:
104
+ spec: Dict where values can be:
105
+ - A Python type (str, int, list[str], etc.)
106
+ - A tuple of (type, extras_dict) for additional JSON Schema properties
107
+ - An already-formed JSON Schema dict (passed through as-is)
108
+ """
109
+ self.parameters: dict[str, Any] = {}
110
+ self.required: list[str] = []
111
+
112
+ for param_name, param_spec in spec.items():
113
+ # If it's a tuple, extract (type, extras)
114
+ if isinstance(param_spec, tuple):
115
+ param_type, extras = param_spec
116
+ schema = _python_type_to_json_schema_enhanced(param_type)
117
+ schema.update(extras)
118
+ self.parameters[param_name] = schema
119
+ # Mark as required unless explicitly marked as optional
120
+ if extras.get("optional") is not True:
121
+ self.required.append(param_name)
122
+ # If it's already a dict with "type" key, use as-is
123
+ elif isinstance(param_spec, dict) and "type" in param_spec:
124
+ self.parameters[param_name] = param_spec
125
+ # Assume required unless marked optional
126
+ if param_spec.get("optional") is not True:
127
+ self.required.append(param_name)
128
+ # Otherwise treat as a Python type
129
+ else:
130
+ self.parameters[param_name] = _python_type_to_json_schema_enhanced(
131
+ param_spec
132
+ )
133
+ self.required.append(param_name)
134
+
135
+ @classmethod
136
+ def from_pydantic(cls, model: Type[BaseModel]) -> "ToolParams":
137
+ """
138
+ Create ToolParams from a Pydantic model.
139
+
140
+ Args:
141
+ model: A Pydantic BaseModel class
142
+ """
143
+ # Get the JSON schema from Pydantic
144
+ schema = model.model_json_schema()
145
+ properties = schema.get("properties", {})
146
+ required = schema.get("required", [])
147
+
148
+ return cls.from_json_schema(properties, required)
149
+
150
+ @classmethod
151
+ def from_typed_dict(cls, typed_dict: Type) -> "ToolParams":
152
+ """
153
+ Create ToolParams from a TypedDict.
154
+
155
+ Args:
156
+ typed_dict: A TypedDict class
157
+ """
158
+ hints = get_type_hints(typed_dict)
159
+
160
+ # TypedDict doesn't have a built-in way to mark optional fields,
161
+ # but we can check for Optional in the type hints
162
+ params = {}
163
+ required = []
164
+
165
+ for field_name, field_type in hints.items():
166
+ # Check if it's Optional (Union with None)
167
+ origin = get_origin(field_type)
168
+ # args = get_args(field_type)
169
+
170
+ is_optional = False
171
+ actual_type = field_type
172
+
173
+ # Check for Union types (including Optional[T] which is Union[T, None])
174
+ if origin is type(None):
175
+ is_optional = True
176
+ actual_type = type(None)
177
+
178
+ # For now, treat all TypedDict fields as required unless they're explicitly Optional
179
+ schema = _python_type_to_json_schema_enhanced(actual_type)
180
+ params[field_name] = schema
181
+
182
+ if not is_optional:
183
+ required.append(field_name)
184
+
185
+ instance = cls.__new__(cls)
186
+ instance.parameters = params
187
+ instance.required = required
188
+ return instance
189
+
190
+ @classmethod
191
+ def from_json_schema(
192
+ cls, properties: dict[str, Any], required: list[str] | None = None
193
+ ) -> "ToolParams":
194
+ """
195
+ Create ToolParams from an existing JSON Schema properties dict.
196
+
197
+ Args:
198
+ properties: The "properties" section of a JSON Schema
199
+ required: List of required field names
200
+ """
201
+ instance = cls.__new__(cls)
202
+ instance.parameters = properties
203
+ instance.required = required or []
204
+ return instance
205
+
206
+ def to_dict(self) -> dict[str, Any]:
207
+ """
208
+ Convert to a dict with 'parameters' and 'required' keys.
209
+ Useful for unpacking into Tool constructor.
210
+ """
211
+ return {"parameters": self.parameters, "required": self.required}
212
+
213
+
14
214
  async def _load_all_mcp_tools(client: Client) -> list["Tool"]:
15
215
  metas: list[MCPTool] = await client.list_tools()
16
216
 
@@ -79,6 +279,24 @@ class Tool(BaseModel):
79
279
  )
80
280
  return v
81
281
 
282
+ @field_validator("parameters", mode="before")
283
+ @classmethod
284
+ def validate_parameters(cls, v: Any) -> dict[str, Any] | None:
285
+ """Accept ToolParams objects and convert to dict for backwards compatibility."""
286
+ if isinstance(v, ToolParams):
287
+ return v.parameters
288
+ return v
289
+
290
+ def model_post_init(self, __context: Any) -> None:
291
+ """
292
+ After validation, if parameters came from ToolParams, also update required list.
293
+ This is called by Pydantic after __init__.
294
+ """
295
+ # This is a bit tricky - we need to capture the required list from ToolParams
296
+ # Since Pydantic has already converted it in the validator, we can't access it here
297
+ # Instead, we'll handle this differently in the convenience constructors
298
+ pass
299
+
82
300
  def _is_async(self) -> bool:
83
301
  return inspect.iscoroutinefunction(self.run)
84
302
 
@@ -143,7 +361,7 @@ class Tool(BaseModel):
143
361
  param_type = type_hints.get(param_name, str)
144
362
 
145
363
  # Convert Python types to JSON Schema types
146
- json_type = cls._python_type_to_json_schema(param_type)
364
+ json_type = _python_type_to_json_schema_enhanced(param_type)
147
365
 
148
366
  parameters[param_name] = json_type
149
367
 
@@ -209,6 +427,119 @@ class Tool(BaseModel):
209
427
  return t
210
428
  raise ValueError(f"Tool '{tool_name}' not found on that server")
211
429
 
430
+ @classmethod
431
+ def from_params(
432
+ cls,
433
+ name: str,
434
+ params: ToolParams,
435
+ *,
436
+ description: str | None = None,
437
+ run: Callable | None = None,
438
+ **kwargs,
439
+ ) -> "Tool":
440
+ """
441
+ Create a Tool from a ToolParams object.
442
+
443
+ Args:
444
+ name: Tool name
445
+ params: ToolParams object defining the parameter schema
446
+ description: Optional description
447
+ run: Optional callable to execute the tool
448
+ **kwargs: Additional Tool arguments
449
+
450
+ Example:
451
+ params = ToolParams({"city": str, "age": int})
452
+ tool = Tool.from_params("get_user", params, run=my_function)
453
+ """
454
+ return cls(
455
+ name=name,
456
+ description=description,
457
+ parameters=params.parameters,
458
+ required=params.required,
459
+ run=run,
460
+ **kwargs,
461
+ )
462
+
463
+ @classmethod
464
+ def from_pydantic(
465
+ cls,
466
+ name: str,
467
+ model: Type[BaseModel],
468
+ *,
469
+ description: str | None = None,
470
+ run: Callable | None = None,
471
+ **kwargs,
472
+ ) -> "Tool":
473
+ """
474
+ Create a Tool from a Pydantic model.
475
+
476
+ Args:
477
+ name: Tool name
478
+ model: Pydantic BaseModel class
479
+ description: Optional description (defaults to model docstring)
480
+ run: Optional callable to execute the tool
481
+ **kwargs: Additional Tool arguments
482
+
483
+ Example:
484
+ class UserQuery(BaseModel):
485
+ city: str
486
+ age: int
487
+
488
+ tool = Tool.from_pydantic("get_user", UserQuery, run=my_function)
489
+ """
490
+ params = ToolParams.from_pydantic(model)
491
+
492
+ # Use model docstring as default description if not provided
493
+ if description is None and model.__doc__:
494
+ description = model.__doc__.strip()
495
+
496
+ return cls(
497
+ name=name,
498
+ description=description,
499
+ parameters=params.parameters,
500
+ required=params.required,
501
+ run=run,
502
+ **kwargs,
503
+ )
504
+
505
+ @classmethod
506
+ def from_typed_dict(
507
+ cls,
508
+ name: str,
509
+ typed_dict: Type,
510
+ *,
511
+ description: str | None = None,
512
+ run: Callable | None = None,
513
+ **kwargs,
514
+ ) -> "Tool":
515
+ """
516
+ Create a Tool from a TypedDict.
517
+
518
+ Args:
519
+ name: Tool name
520
+ typed_dict: TypedDict class
521
+ description: Optional description
522
+ run: Optional callable to execute the tool
523
+ **kwargs: Additional Tool arguments
524
+
525
+ Example:
526
+ class UserQuery(TypedDict):
527
+ city: str
528
+ age: int
529
+
530
+ tool = Tool.from_typed_dict("get_user", UserQuery, run=my_function)
531
+ """
532
+ params = ToolParams.from_typed_dict(typed_dict)
533
+
534
+ return cls(
535
+ name=name,
536
+ description=description,
537
+ parameters=params.parameters,
538
+ required=params.required,
539
+ run=run,
540
+ **kwargs,
541
+ )
542
+
212
543
  @staticmethod
213
544
  def _tool_from_meta(meta: dict[str, Any], runner) -> "Tool":
214
545
  props = meta["inputSchema"].get("properties", {})
@@ -225,22 +556,11 @@ class Tool(BaseModel):
225
556
 
226
557
  @staticmethod
227
558
  def _python_type_to_json_schema(python_type) -> dict[str, Any]:
228
- """Convert Python type to JSON Schema type definition."""
229
- if python_type is int:
230
- return {"type": "integer"}
231
- elif python_type is float:
232
- return {"type": "number"}
233
- elif python_type is str:
234
- return {"type": "string"}
235
- elif python_type is bool:
236
- return {"type": "boolean"}
237
- elif python_type is list:
238
- return {"type": "array"}
239
- elif python_type is dict:
240
- return {"type": "object"}
241
- else:
242
- # Default to string for unknown types
243
- return {"type": "string"}
559
+ """
560
+ Convert Python type to JSON Schema type definition.
561
+ Now delegates to enhanced version for better type support.
562
+ """
563
+ return _python_type_to_json_schema_enhanced(python_type)
244
564
 
245
565
  def _json_schema(
246
566
  self, include_additional_properties=False, remove_defaults=False
lm_deluge/tracker.py CHANGED
@@ -171,20 +171,24 @@ class StatusTracker:
171
171
  )
172
172
 
173
173
  # Display cumulative usage stats if available
174
- if self.total_cost > 0 or self.total_input_tokens > 0 or self.total_output_tokens > 0:
174
+ if (
175
+ self.total_cost > 0
176
+ or self.total_input_tokens > 0
177
+ or self.total_output_tokens > 0
178
+ ):
175
179
  usage_parts = []
176
180
  if self.total_cost > 0:
177
- usage_parts.append(f"Cost: ${self.total_cost:.4f}")
181
+ usage_parts.append(f"💰 Cost: ${self.total_cost:.4f}")
178
182
  if self.total_input_tokens > 0 or self.total_output_tokens > 0:
179
183
  usage_parts.append(
180
- f"Tokens: {self.total_input_tokens:,} in / {self.total_output_tokens:,} out"
184
+ f"🔡 Tokens: {self.total_input_tokens:,} in / {self.total_output_tokens:,} out"
181
185
  )
182
186
  if self.total_cache_read_tokens > 0:
183
187
  usage_parts.append(f"Cache: {self.total_cache_read_tokens:,} read")
184
188
  if self.total_cache_write_tokens > 0:
185
189
  usage_parts.append(f"{self.total_cache_write_tokens:,} write")
186
190
 
187
- print(" | ".join(usage_parts))
191
+ print(" ", " ".join(usage_parts))
188
192
 
189
193
  @property
190
194
  def pbar(self) -> tqdm | None:
@@ -288,7 +292,9 @@ class StatusTracker:
288
292
  usage_text = f" [gold3]Usage:[/gold3] {' • '.join(usage_parts)}"
289
293
 
290
294
  if usage_text:
291
- display = Group(self._rich_progress, in_progress, capacity_text, usage_text)
295
+ display = Group(
296
+ self._rich_progress, in_progress, capacity_text, usage_text
297
+ )
292
298
  else:
293
299
  display = Group(self._rich_progress, in_progress, capacity_text)
294
300
  live.update(display)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lm_deluge
3
- Version: 0.0.56
3
+ Version: 0.0.58
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
@@ -1,23 +1,21 @@
1
- lm_deluge/__init__.py,sha256=D01sxqvAuW1QPYQfdSOlBFVhf7QUr78fGgCNPvKXbAc,346
2
- lm_deluge/agent.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1
+ lm_deluge/__init__.py,sha256=LKKIcqQoQyDpTck6fnB7iAs75BnfNNa3Bj5Nz7KU4Hk,376
3
2
  lm_deluge/batches.py,sha256=rQocJLyIs3Ko_nRdAE9jT__5cKWYxiIRAH_Lw3L0E1k,24653
4
3
  lm_deluge/cache.py,sha256=xO2AIYvP3tUpTMKQjwQQYfGRJSRi6e7sMlRhLjsS-u4,4873
5
4
  lm_deluge/cli.py,sha256=Ilww5gOw3J5v0NReq_Ra4hhxU4BCIJBl1oTGxJZKedc,12065
6
- lm_deluge/client.py,sha256=3V33qNbtinl5FoPDB2LxH-OLsJDWMG2bLGhQyNh_yIE,32609
5
+ lm_deluge/client.py,sha256=1ZxQAWkmtz-zhW4E8rfU2V4BfzvqGsKhvqz_CB63-lc,32894
7
6
  lm_deluge/config.py,sha256=H1tQyJDNHGFuwxqQNL5Z-CjWAC0luHSBA3iY_pxmACM,932
8
7
  lm_deluge/embed.py,sha256=CO-TOlC5kOTAM8lcnicoG4u4K664vCBwHF1vHa-nAGg,13382
9
8
  lm_deluge/errors.py,sha256=oHjt7YnxWbh-eXMScIzov4NvpJMo0-2r5J6Wh5DQ1tk,209
10
9
  lm_deluge/file.py,sha256=FGomcG8s2go_55Z2CChflHgmU-UqgFftgFY8c7f_G70,5631
11
- lm_deluge/gemini_limits.py,sha256=V9mpS9JtXYz7AY6OuKyQp5TuIMRH1BVv9YrSNmGmHNA,1569
12
10
  lm_deluge/image.py,sha256=5AMXmn2x47yXeYNfMSMAOWcnlrOxxOel-4L8QCJwU70,8928
13
- lm_deluge/prompt.py,sha256=2-6bALg_hOfExh9vHeKPFA6E_O8rHe6p9eIdvCulERs,59654
11
+ lm_deluge/prompt.py,sha256=RgZBcCiAtThqjILkPa4X530sR53SUK03U-6TWWk07tc,59607
14
12
  lm_deluge/request_context.py,sha256=o33LSEwnK6YPhZeulUoSE_VrdKCXiCQa0tjjixK2K6M,2540
15
13
  lm_deluge/rerank.py,sha256=-NBAJdHz9OB-SWWJnHzkFmeVO4wR6lFV7Vw-SxG7aVo,11457
16
- lm_deluge/tool.py,sha256=3weKo09E_srEKwHlz2WMVhk2BuDr5pJpi1UP0-qlcmo,16210
17
- lm_deluge/tracker.py,sha256=IIKReE1sNqzmhvHbokIAjKPwdOMG83jTAFanXAZCk04,14645
14
+ lm_deluge/tool.py,sha256=eZpzgkSIlGD7KdZQwzLF-UdyRJpRnNNXpceGJrNhRrE,26421
15
+ lm_deluge/tracker.py,sha256=aeS9GUJpgOSQRVXAnGDvlMO8qYpSxpTNLYj2hrMg0m8,14757
18
16
  lm_deluge/usage.py,sha256=xz9tAw2hqaJvv9aAVhnQ6N1Arn7fS8Shb28VwCW26wI,5136
19
17
  lm_deluge/api_requests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
20
- lm_deluge/api_requests/anthropic.py,sha256=Iy-AMo1o7xliwWhamFIUc601PZ0YWLhwAgszgfws42I,8467
18
+ lm_deluge/api_requests/anthropic.py,sha256=7tTb_NMPodDHrCzakrLd9LyXuLqeTQyAGU-FvMoV3gI,8437
21
19
  lm_deluge/api_requests/base.py,sha256=1et-5SdRqfnvXZT3b9fBEx0vvbCwbVunHBWtQr7Wurg,5878
22
20
  lm_deluge/api_requests/bedrock.py,sha256=GmVxXz3ERAeQ7e52Nlztt81O4H9eJOQeOnS6b65vjm4,15453
23
21
  lm_deluge/api_requests/common.py,sha256=BZ3vRO5TB669_UsNKugkkuFSzoLHOYJIKt4nV4sf4vc,422
@@ -43,21 +41,21 @@ lm_deluge/llm_tools/locate.py,sha256=lYNbKTmy9dTvj0lEQkOQ7yrxyqsgYzjD0C_byJKI_4w
43
41
  lm_deluge/llm_tools/ocr.py,sha256=7fDlvs6uUOvbxMasvGGNJx5Fj6biM6z3lijKZaGN26k,23
44
42
  lm_deluge/llm_tools/score.py,sha256=9oGA3-k2U5buHQXkXaEI9M4Wb5yysNhTLsPbGeghAlQ,2580
45
43
  lm_deluge/llm_tools/translate.py,sha256=iXyYvQZ8bC44FWhBk4qpdqjKM1WFF7Shq-H2PxhPgg4,1452
46
- lm_deluge/models/__init__.py,sha256=qlpGDoTC89dKOFW3KxLUMiHCg_OzpRYHyrCt0OiSW7c,4525
47
- lm_deluge/models/anthropic.py,sha256=qAsykXPDz0dK8o4h9vP1QtO-3am3VDzhsYBl4YhEsds,6734
48
- lm_deluge/models/bedrock.py,sha256=PIaXvho2agCm1hSSAEy8zHCITjApXT2eUOGDKW425tE,5424
44
+ lm_deluge/models/__init__.py,sha256=7HNEnpxpEguZYjcudY_9oJ79hOOLo0oNUvG-kwkEpv4,4539
45
+ lm_deluge/models/anthropic.py,sha256=5j75sB40yZzT1wwKC7Dh0f2Y2cXnp8yxHuXW63PCuns,6285
46
+ lm_deluge/models/bedrock.py,sha256=g1PbfceSRH2lWST3ja0mUlF3oTq4e4T-si6RMe7qXgg,4888
49
47
  lm_deluge/models/cerebras.py,sha256=u2FMXJF6xMr0euDRKLKMo_NVTOcvSrrEpehbHr8sSeE,2050
50
- lm_deluge/models/cohere.py,sha256=M_7cVA9QD4qe1X4sZXCpKEkKrKz2jibaspiTnzsZ1GU,3998
48
+ lm_deluge/models/cohere.py,sha256=iXjYtM6jy_YL73Op8OfNsrMNopwae9y-Sw-4vF9cEBw,3406
51
49
  lm_deluge/models/deepseek.py,sha256=6_jDEprNNYis5I5MDQNloRes9h1P6pMYHXxOd2UZMgg,941
52
50
  lm_deluge/models/fireworks.py,sha256=yvt2Ggzye4aUqCqY74ta67Vu7FrQaLFjdFtN4P7D-dc,638
53
- lm_deluge/models/google.py,sha256=_spZkMBuUkWTHhb_Z7_Nq75l_3QF7aUtlk-Wyh6pWEI,6117
54
- lm_deluge/models/grok.py,sha256=aInkUSclXE47Lm4PKiP3OebAP9V-GOZwK-Eiis4zVow,1199
55
- lm_deluge/models/groq.py,sha256=djBs9N8LpzE0BQSb4KiY6F06B4f8csn-fB_5wfQTpNU,2548
56
- lm_deluge/models/meta.py,sha256=m6HPR82TJONYTTWkQw5EKmITMxoWzrfYOuNgFnGaRX8,2195
51
+ lm_deluge/models/google.py,sha256=Hr2MolQoaeY85pKCGO7k7OH_1nQJdrwMgrJbfz5bI8w,5387
52
+ lm_deluge/models/grok.py,sha256=TDzr8yfTaHbdJhwMA-Du6L-efaKFJhjTQViuVElCCHI,2566
53
+ lm_deluge/models/groq.py,sha256=Mi5WE1xOBGoZlymD0UN6kzhH_NOmfJYU4N2l-TO0Z8Q,2552
54
+ lm_deluge/models/meta.py,sha256=BBgnscL1gMcIdPbRqrlDl_q9YAYGSrkw9JkAIabXtLs,1883
57
55
  lm_deluge/models/mistral.py,sha256=x67o5gckBGmPcIGdVbS26XZAYFKBYM4tsxEAahGp8bk,4323
58
- lm_deluge/models/openai.py,sha256=vp-VcTi21N7M-Lvohx4RFkvqCl-L-UwwWH0A8GwYoX8,11452
59
- lm_deluge/models/openrouter.py,sha256=aAgBT5_TZQtUPQyNn-Bob6NGyrlFOclnxIb0F53pgvA,23
60
- lm_deluge/models/together.py,sha256=RCZoYAb8OVxdH9uwXnv47TDTGzC30P-FZoDbiBE23_g,4957
56
+ lm_deluge/models/openai.py,sha256=HC_oNLmKkmShkcfeUgyhesACtXGg__I2WiIIDrN-X84,10176
57
+ lm_deluge/models/openrouter.py,sha256=O-Po4tmHjAqFIVU96TUL0QnK01R4e2yDN7Z4sYJ-CuE,2120
58
+ lm_deluge/models/together.py,sha256=AjKhPsazqBgqyLwHkNQW07COM1n_oSrYQRp2BFVvn9o,4381
61
59
  lm_deluge/presets/cerebras.py,sha256=MDkqj15qQRrj8wxSCDNNe_Cs7h1WN1UjV6lTmSY1olQ,479
62
60
  lm_deluge/presets/meta.py,sha256=QrreLAVgYS6VIC_NQth1vgGAYuxY38jFQQZSe6ot7C8,364
63
61
  lm_deluge/util/harmony.py,sha256=XBfJck6q-5HbOqMhEjdfy1i17i0QtpHG8ruXV4EsHl0,2731
@@ -66,8 +64,8 @@ lm_deluge/util/logprobs.py,sha256=UkBZakOxWluaLqHrjARu7xnJ0uCHVfLGHJdnYlEcutk,11
66
64
  lm_deluge/util/spatial.py,sha256=BsF_UKhE-x0xBirc-bV1xSKZRTUhsOBdGqsMKme20C8,4099
67
65
  lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
68
66
  lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
69
- lm_deluge-0.0.56.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
70
- lm_deluge-0.0.56.dist-info/METADATA,sha256=-eDXjRnhBK1u3StotPfhovz7nXS5Cgitz0K3ETSf4ZA,13443
71
- lm_deluge-0.0.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
- lm_deluge-0.0.56.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
73
- lm_deluge-0.0.56.dist-info/RECORD,,
67
+ lm_deluge-0.0.58.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
68
+ lm_deluge-0.0.58.dist-info/METADATA,sha256=jyhXeGVPAMMYBGm3omp6MKZfQGlRX-ow_9fI58ZZNGg,13443
69
+ lm_deluge-0.0.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ lm_deluge-0.0.58.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
71
+ lm_deluge-0.0.58.dist-info/RECORD,,
lm_deluge/agent.py DELETED
File without changes
@@ -1,65 +0,0 @@
1
- gemini_flash_limits = {
2
- "asia-east1": 2000,
3
- "asia-east2": 200,
4
- "asia-northeast1": 200,
5
- "asia-northeast3": 200,
6
- "asia-south1": 200,
7
- "asia-southeast1": 3_000,
8
- "australia-southeast1": 200,
9
- "europe-central2": 200,
10
- "europe-north1": 200,
11
- "europe-southwest1": 200,
12
- "europe-west1": 10_000,
13
- "europe-west2": 200,
14
- "europe-west3": 200,
15
- "europe-west4": 200,
16
- "europe-west6": 200,
17
- "europe-west8": 200,
18
- "europe-west9": 200,
19
- # 'me-central1': 200,
20
- "me-central2": 200,
21
- "me-west1": 200,
22
- "northamerica-northeast1": 200,
23
- "southamerica-east1": 200,
24
- "us-central1": 5_000,
25
- "us-east1": 3_000,
26
- "us-east4": 200,
27
- # 'us-east5': 200,
28
- "us-south1": 3_000,
29
- "us-west1": 5_000,
30
- "us-west4": 200,
31
- }
32
-
33
- # total: 7_520
34
- gemini_1_5_pro_limits = {
35
- "asia-east1": 500,
36
- "asia-east2": 500,
37
- "asia-northeast1": 500,
38
- # "asia-northeast2": 500,
39
- "asia-northeast3": 500,
40
- "asia-south1": 500,
41
- "asia-southeast1": 500,
42
- "australia-southeast1": 60,
43
- "europe-central2": 500,
44
- "europe-north1": 60,
45
- "europe-southwest1": 60,
46
- "europe-west1": 500,
47
- "europe-west2": 60,
48
- "europe-west3": 60,
49
- "europe-west4": 60,
50
- "europe-west6": 60,
51
- "europe-west8": 60,
52
- "europe-west9": 60,
53
- "me-central1": 60,
54
- "me-central2": 60,
55
- "me-west1": 60,
56
- "northamerica-northeast1": 60,
57
- "southamerica-east1": 500,
58
- "us-central1": 500,
59
- "us-east1": 500,
60
- "us-east4": 60,
61
- # "us-east5": 60,
62
- "us-south1": 60,
63
- "us-west1": 500,
64
- "us-west4": 60,
65
- }