byllm 0.4.4__py2.py3-none-any.whl → 0.4.5__py2.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 byllm might be problematic. Click here for more details.

byllm/__init__.py CHANGED
@@ -1,10 +1 @@
1
- """byLLM Package."""
2
-
3
- from byllm.llm import Model
4
- from byllm.mtir import MTIR
5
- from byllm.plugin import JacMachine
6
- from byllm.types import Image, MockToolCall, Video
7
-
8
- by = JacMachine.by
9
-
10
- __all__ = ["by", "Image", "MockToolCall", "Model", "MTIR", "Video"]
1
+ """byLLM Package - Lazy Loading."""
byllm/lib.py ADDED
@@ -0,0 +1,10 @@
1
+ """byLLM Package."""
2
+
3
+ from byllm.llm import Model
4
+ from byllm.mtir import MTIR
5
+ from byllm.plugin import JacMachine
6
+ from byllm.types import Image, MockToolCall, Video
7
+
8
+ by = JacMachine.by
9
+
10
+ __all__ = ["by", "Image", "MockToolCall", "Model", "MTIR", "Video"]
byllm/llm_connector.py CHANGED
@@ -181,7 +181,7 @@ class LiteLLMConnector(LLMConnector):
181
181
  message: LiteLLMMessage = response.choices[0].message # type: ignore
182
182
  mtir.add_message(message)
183
183
 
184
- output_content: str = message.content # type: ignore
184
+ output_content: str = message.content or "" # type: ignore
185
185
  self.log_info(f"LLM call completed with response:\n{output_content}")
186
186
  output_value = mtir.parse_response(output_content)
187
187
 
byllm/plugin.py CHANGED
@@ -1,12 +1,16 @@
1
1
  """Plugin for Jac's with_llm feature."""
2
2
 
3
- from typing import Callable
3
+ from __future__ import annotations
4
4
 
5
- from byllm.llm import Model
6
- from byllm.mtir import MTIR
5
+
6
+ from typing import Callable, TYPE_CHECKING
7
7
 
8
8
  from jaclang.runtimelib.machine import hookimpl
9
9
 
10
+ if TYPE_CHECKING:
11
+ from byllm.llm import Model
12
+ from byllm.mtir import MTIR
13
+
10
14
 
11
15
  class JacMachine:
12
16
  """Jac's with_llm feature."""
@@ -15,6 +19,8 @@ class JacMachine:
15
19
  @hookimpl
16
20
  def get_mtir(caller: Callable, args: dict, call_params: dict) -> object:
17
21
  """Call JacLLM and return the result."""
22
+ from byllm.mtir import MTIR
23
+
18
24
  return MTIR.factory(caller, args, call_params)
19
25
 
20
26
  @staticmethod
@@ -30,6 +36,8 @@ class JacMachine:
30
36
 
31
37
  def _decorator(caller: Callable) -> Callable:
32
38
  def _wrapped_caller(*args: object, **kwargs: object) -> object:
39
+ from byllm.mtir import MTIR
40
+
33
41
  invoke_args: dict[int | str, object] = {}
34
42
  for i, arg in enumerate(args):
35
43
  invoke_args[i] = arg
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: byllm
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: byLLM Provides Easy to use APIs for different LLM Providers to be used with Jaseci's Jaclang Programming Language.
5
5
  License: MIT
6
6
  Keywords: llm,jaclang,jaseci,byLLM
7
7
  Author: Jason Mars
8
- Author-email: jason@jaseci.org
8
+ Author-email: jason@mars.ninja
9
9
  Maintainer: Jason Mars
10
- Maintainer-email: jason@jaseci.org
10
+ Maintainer-email: jason@mars.ninja
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 2
13
13
  Classifier: Programming Language :: Python :: 2.7
@@ -25,7 +25,7 @@ Classifier: Programming Language :: Python :: 3.13
25
25
  Classifier: Programming Language :: Python :: 3.14
26
26
  Provides-Extra: tools
27
27
  Provides-Extra: video
28
- Requires-Dist: jaclang (>=0.8.8)
28
+ Requires-Dist: jaclang (>=0.8.10)
29
29
  Requires-Dist: litellm (>=1.75.5.post1)
30
30
  Requires-Dist: loguru (>=0.7.2,<0.8.0)
31
31
  Requires-Dist: pillow (>=10.4.0,<10.5.0)
@@ -59,7 +59,7 @@ pip install byllm
59
59
  Consider building an application that translates english to other languages using an LLM. This can be simply built as follows:
60
60
 
61
61
  ```python
62
- import from byllm { Model }
62
+ import from byllm.lib { Model }
63
63
 
64
64
  glob llm = Model(model_name="gpt-4o");
65
65
 
@@ -78,7 +78,7 @@ This simple piece of code replaces traditional prompt engineering without introd
78
78
  Consider a program that detects the personality type of a historical figure from their name. This can eb built in a way that LLM picks from an enum and the output strictly adhere this type.
79
79
 
80
80
  ```python
81
- import from byllm { Model }
81
+ import from byllm.lib { Model }
82
82
  glob llm = Model(model_name="gemini/gemini-2.0-flash");
83
83
 
84
84
  enum Personality {
@@ -0,0 +1,12 @@
1
+ byllm/__init__.py,sha256=6sv886KZN9gR0_wxODVuc5jPLTWMsXOz55-r8Rhmb30,36
2
+ byllm/lib.py,sha256=fB2Jt0gjpW_B4HZJ3KmbbCDSeMS4K6AN41qbDYHRO70,254
3
+ byllm/llm.py,sha256=fjraqQaT1uiwxTjLW7Wm8TDnnl7N5xDztA2KhyUfIQE,3560
4
+ byllm/llm_connector.py,sha256=tAiHNG0vfHPvRSfdBC7uqOLDTawDU_2XEcCoCcHD5rw,8552
5
+ byllm/mtir.py,sha256=V4fpc0-j_7pb8rVMV8yskc9XczUCtHczrj5OZGXKA8g,7083
6
+ byllm/plugin.py,sha256=_HaGquoqQIxCbANpQ-OGBJC21jFuAQ0Cm-S5YM0xU5w,1596
7
+ byllm/schema.py,sha256=VnqL03DYhroWjWRioLRoGBLNbjixw8Nk381gsHLpNXw,8927
8
+ byllm/types.py,sha256=rS_ISxYeHmXQiP1rv9qMKDiojdwk_x7bckOhn8_DFJk,11311
9
+ byllm-0.4.5.dist-info/METADATA,sha256=7GrAg1bl6YPUuqtIfgu-GKMsNVymOmqKC-DtKYoswt4,7625
10
+ byllm-0.4.5.dist-info/WHEEL,sha256=MICUlqIgkuEnKh9OWy254Ca7q2MHOW-q0u36TZR60nU,92
11
+ byllm-0.4.5.dist-info/entry_points.txt,sha256=hUzQdaP8qTKkAqHfBpcqxQK02wixeyyzx3y-s6KyrQg,37
12
+ byllm-0.4.5.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- byllm/__init__.py,sha256=fB2Jt0gjpW_B4HZJ3KmbbCDSeMS4K6AN41qbDYHRO70,254
2
- byllm/llm.py,sha256=fjraqQaT1uiwxTjLW7Wm8TDnnl7N5xDztA2KhyUfIQE,3560
3
- byllm/llm_connector.py,sha256=XK8ftsafTYWq7aAjDxk4R4OeyJ1P1ou2qrZAXOU9xmU,8546
4
- byllm/mtir.py,sha256=V4fpc0-j_7pb8rVMV8yskc9XczUCtHczrj5OZGXKA8g,7083
5
- byllm/plugin.py,sha256=RrL2nwLlNi5Ipzig4x1KKb3K-3o_HxY83OG6ti2q7k4,1436
6
- byllm/schema.py,sha256=VnqL03DYhroWjWRioLRoGBLNbjixw8Nk381gsHLpNXw,8927
7
- byllm/types.py,sha256=rS_ISxYeHmXQiP1rv9qMKDiojdwk_x7bckOhn8_DFJk,11311
8
- byllm-0.4.4.dist-info/METADATA,sha256=M7bPyBdZzHrVfY_y24_-dXRoIcCvBWUnGeI8YsajYho,7616
9
- byllm-0.4.4.dist-info/WHEEL,sha256=MICUlqIgkuEnKh9OWy254Ca7q2MHOW-q0u36TZR60nU,92
10
- byllm-0.4.4.dist-info/entry_points.txt,sha256=hUzQdaP8qTKkAqHfBpcqxQK02wixeyyzx3y-s6KyrQg,37
11
- byllm-0.4.4.dist-info/RECORD,,
File without changes