lollmsbot 0.0.1__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.
- lollmsbot/__init__.py +1 -0
- lollmsbot/agent.py +1682 -0
- lollmsbot/channels/__init__.py +22 -0
- lollmsbot/channels/discord.py +408 -0
- lollmsbot/channels/http_api.py +449 -0
- lollmsbot/channels/telegram.py +272 -0
- lollmsbot/cli.py +217 -0
- lollmsbot/config.py +90 -0
- lollmsbot/gateway.py +606 -0
- lollmsbot/guardian.py +692 -0
- lollmsbot/heartbeat.py +826 -0
- lollmsbot/lollms_client.py +37 -0
- lollmsbot/skills.py +1483 -0
- lollmsbot/soul.py +482 -0
- lollmsbot/storage/__init__.py +245 -0
- lollmsbot/storage/sqlite_store.py +332 -0
- lollmsbot/tools/__init__.py +151 -0
- lollmsbot/tools/calendar.py +717 -0
- lollmsbot/tools/filesystem.py +663 -0
- lollmsbot/tools/http.py +498 -0
- lollmsbot/tools/shell.py +519 -0
- lollmsbot/ui/__init__.py +11 -0
- lollmsbot/ui/__main__.py +121 -0
- lollmsbot/ui/app.py +1122 -0
- lollmsbot/ui/routes.py +39 -0
- lollmsbot/wizard.py +1493 -0
- lollmsbot-0.0.1.dist-info/METADATA +25 -0
- lollmsbot-0.0.1.dist-info/RECORD +32 -0
- lollmsbot-0.0.1.dist-info/WHEEL +5 -0
- lollmsbot-0.0.1.dist-info/entry_points.txt +2 -0
- lollmsbot-0.0.1.dist-info/licenses/LICENSE +201 -0
- lollmsbot-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from lollms_client import LollmsClient # from lollms-client package[web:21][web:41]
|
|
6
|
+
|
|
7
|
+
from .config import LollmsSettings
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def build_lollms_client(settings: LollmsSettings | None = None) -> LollmsClient:
|
|
11
|
+
"""
|
|
12
|
+
Build a LollmsClient either in 'LoLLMS server' mode or 'direct binding' mode
|
|
13
|
+
depending on env settings.
|
|
14
|
+
"""
|
|
15
|
+
if settings is None:
|
|
16
|
+
settings = LollmsSettings.from_env()
|
|
17
|
+
|
|
18
|
+
# Basic shared kwargs
|
|
19
|
+
client_kwargs: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
if settings.host_address:
|
|
22
|
+
client_kwargs["host_address"] = settings.host_address
|
|
23
|
+
|
|
24
|
+
# Some lollms_client versions support verify_ssl; if not, this can be removed
|
|
25
|
+
if settings.verify_ssl is False:
|
|
26
|
+
client_kwargs["verify_ssl"] = False
|
|
27
|
+
|
|
28
|
+
# Direct binding mode
|
|
29
|
+
return LollmsClient(
|
|
30
|
+
llm_binding_name= settings.binding_name or "lollms",
|
|
31
|
+
llm_binding_config={
|
|
32
|
+
"host_address":settings.host_address,
|
|
33
|
+
"model_name":settings.model_name,
|
|
34
|
+
"service_key":settings.api_key,
|
|
35
|
+
"ctx_size":settings.context_size,
|
|
36
|
+
},
|
|
37
|
+
)
|