byllm 0.4.3__py2.py3-none-any.whl → 0.4.4__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 +3 -1
- byllm/plugin.py +28 -21
- {byllm-0.4.3.dist-info → byllm-0.4.4.dist-info}/METADATA +1 -1
- {byllm-0.4.3.dist-info → byllm-0.4.4.dist-info}/RECORD +6 -6
- {byllm-0.4.3.dist-info → byllm-0.4.4.dist-info}/WHEEL +0 -0
- {byllm-0.4.3.dist-info → byllm-0.4.4.dist-info}/entry_points.txt +0 -0
byllm/__init__.py
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from byllm.llm import Model
|
|
4
4
|
from byllm.mtir import MTIR
|
|
5
|
-
from byllm.plugin import
|
|
5
|
+
from byllm.plugin import JacMachine
|
|
6
6
|
from byllm.types import Image, MockToolCall, Video
|
|
7
7
|
|
|
8
|
+
by = JacMachine.by
|
|
9
|
+
|
|
8
10
|
__all__ = ["by", "Image", "MockToolCall", "Model", "MTIR", "Video"]
|
byllm/plugin.py
CHANGED
|
@@ -11,30 +11,37 @@ from jaclang.runtimelib.machine import hookimpl
|
|
|
11
11
|
class JacMachine:
|
|
12
12
|
"""Jac's with_llm feature."""
|
|
13
13
|
|
|
14
|
+
@staticmethod
|
|
15
|
+
@hookimpl
|
|
16
|
+
def get_mtir(caller: Callable, args: dict, call_params: dict) -> object:
|
|
17
|
+
"""Call JacLLM and return the result."""
|
|
18
|
+
return MTIR.factory(caller, args, call_params)
|
|
19
|
+
|
|
14
20
|
@staticmethod
|
|
15
21
|
@hookimpl
|
|
16
22
|
def call_llm(model: Model, mtir: MTIR) -> object:
|
|
17
23
|
"""Call JacLLM and return the result."""
|
|
18
24
|
return model.invoke(mtir=mtir)
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
@staticmethod
|
|
27
|
+
@hookimpl
|
|
28
|
+
def by(model: Model) -> Callable:
|
|
29
|
+
"""Python library mode decorator for Jac's by llm() syntax."""
|
|
30
|
+
|
|
31
|
+
def _decorator(caller: Callable) -> Callable:
|
|
32
|
+
def _wrapped_caller(*args: object, **kwargs: object) -> object:
|
|
33
|
+
invoke_args: dict[int | str, object] = {}
|
|
34
|
+
for i, arg in enumerate(args):
|
|
35
|
+
invoke_args[i] = arg
|
|
36
|
+
for key, value in kwargs.items():
|
|
37
|
+
invoke_args[key] = value
|
|
38
|
+
mtir = MTIR.factory(
|
|
39
|
+
caller=caller,
|
|
40
|
+
args=invoke_args,
|
|
41
|
+
call_params=model.llm_connector.call_params,
|
|
42
|
+
)
|
|
43
|
+
return model.invoke(mtir=mtir)
|
|
44
|
+
|
|
45
|
+
return _wrapped_caller
|
|
46
|
+
|
|
47
|
+
return _decorator
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
byllm/__init__.py,sha256=
|
|
1
|
+
byllm/__init__.py,sha256=fB2Jt0gjpW_B4HZJ3KmbbCDSeMS4K6AN41qbDYHRO70,254
|
|
2
2
|
byllm/llm.py,sha256=fjraqQaT1uiwxTjLW7Wm8TDnnl7N5xDztA2KhyUfIQE,3560
|
|
3
3
|
byllm/llm_connector.py,sha256=XK8ftsafTYWq7aAjDxk4R4OeyJ1P1ou2qrZAXOU9xmU,8546
|
|
4
4
|
byllm/mtir.py,sha256=V4fpc0-j_7pb8rVMV8yskc9XczUCtHczrj5OZGXKA8g,7083
|
|
5
|
-
byllm/plugin.py,sha256=
|
|
5
|
+
byllm/plugin.py,sha256=RrL2nwLlNi5Ipzig4x1KKb3K-3o_HxY83OG6ti2q7k4,1436
|
|
6
6
|
byllm/schema.py,sha256=VnqL03DYhroWjWRioLRoGBLNbjixw8Nk381gsHLpNXw,8927
|
|
7
7
|
byllm/types.py,sha256=rS_ISxYeHmXQiP1rv9qMKDiojdwk_x7bckOhn8_DFJk,11311
|
|
8
|
-
byllm-0.4.
|
|
9
|
-
byllm-0.4.
|
|
10
|
-
byllm-0.4.
|
|
11
|
-
byllm-0.4.
|
|
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
|
|
File without changes
|