lionagi 0.9.1__py3-none-any.whl → 0.9.3__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.
- lionagi/service/endpoints/base.py +1 -1
- lionagi/service/endpoints/chat_completion.py +9 -1
- lionagi/service/imodel.py +7 -8
- lionagi/tools/__init__.py +3 -0
- lionagi/tools/base.py +4 -0
- lionagi/tools/browser/__init__.py +0 -0
- lionagi/tools/browser/providers/__init__.py +3 -0
- lionagi/tools/browser/providers/browser_use_.py +3 -0
- lionagi/tools/code/__init__.py +3 -0
- lionagi/tools/code/coder.py +3 -0
- lionagi/tools/code/manager.py +3 -0
- lionagi/tools/code/providers/__init__.py +3 -0
- lionagi/tools/code/providers/aider_.py +3 -0
- lionagi/tools/code/providers/e2b_.py +3 -0
- lionagi/tools/code/sandbox.py +3 -0
- lionagi/tools/file/__init__.py +3 -0
- lionagi/tools/file/manager.py +3 -0
- lionagi/tools/file/providers/__init__.py +3 -0
- lionagi/tools/file/providers/docling_.py +3 -0
- lionagi/tools/file/reader.py +5 -1
- lionagi/tools/file/writer.py +3 -0
- lionagi/tools/types.py +5 -0
- lionagi/version.py +1 -1
- {lionagi-0.9.1.dist-info → lionagi-0.9.3.dist-info}/METADATA +1 -1
- {lionagi-0.9.1.dist-info → lionagi-0.9.3.dist-info}/RECORD +27 -13
- {lionagi-0.9.1.dist-info → lionagi-0.9.3.dist-info}/WHEEL +0 -0
- {lionagi-0.9.1.dist-info → lionagi-0.9.3.dist-info}/licenses/LICENSE +0 -0
@@ -79,7 +79,7 @@ class EndpointConfig(BaseModel):
|
|
79
79
|
requires_tokens: bool = False
|
80
80
|
api_version: str | None = None
|
81
81
|
allowed_roles: list[str] | None = None
|
82
|
-
request_options: type | None = None
|
82
|
+
request_options: type | None = Field(None, exclude=True)
|
83
83
|
|
84
84
|
|
85
85
|
class EndPoint(ABC):
|
@@ -1,11 +1,19 @@
|
|
1
1
|
# Copyright (c) 2023 - 2025, HaiyangLi <quantocean.li at gmail dot com>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
4
|
-
|
4
|
+
import warnings
|
5
5
|
from collections.abc import AsyncGenerator
|
6
6
|
|
7
7
|
from .base import EndPoint
|
8
8
|
|
9
|
+
warnings.filterwarnings(
|
10
|
+
"ignore",
|
11
|
+
message=".*Valid config keys have changed in V2.*",
|
12
|
+
category=UserWarning,
|
13
|
+
module="pydantic._internal._config",
|
14
|
+
)
|
15
|
+
|
16
|
+
|
9
17
|
CHAT_COMPLETION_CONFIG = {
|
10
18
|
"endpoint": "chat/completions",
|
11
19
|
"method": "post",
|
lionagi/service/imodel.py
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
|
5
5
|
import asyncio
|
6
6
|
import os
|
7
|
-
import warnings
|
8
7
|
from collections.abc import AsyncGenerator, Callable
|
9
8
|
|
10
9
|
from pydantic import BaseModel
|
@@ -16,13 +15,6 @@ from .endpoints.base import APICalling, EndPoint
|
|
16
15
|
from .endpoints.match_endpoint import match_endpoint
|
17
16
|
from .endpoints.rate_limited_processor import RateLimitedAPIExecutor
|
18
17
|
|
19
|
-
warnings.filterwarnings(
|
20
|
-
"ignore",
|
21
|
-
message=".*Valid config keys have changed in V2.*",
|
22
|
-
category=UserWarning,
|
23
|
-
module="pydantic._internal._config",
|
24
|
-
)
|
25
|
-
|
26
18
|
|
27
19
|
class iModel:
|
28
20
|
"""Manages API calls for a specific provider with optional rate-limiting.
|
@@ -62,6 +54,7 @@ class iModel:
|
|
62
54
|
invoke_with_endpoint: bool = False,
|
63
55
|
concurrency_limit: int | None = None,
|
64
56
|
streaming_process_func: Callable = None,
|
57
|
+
requires_api_key: bool = True,
|
65
58
|
**kwargs,
|
66
59
|
) -> None:
|
67
60
|
"""Initializes the iModel instance.
|
@@ -103,6 +96,7 @@ class iModel:
|
|
103
96
|
provider-specific fields.
|
104
97
|
"""
|
105
98
|
if api_key is None:
|
99
|
+
provider = str(provider or "").strip().lower()
|
106
100
|
match provider:
|
107
101
|
case "openai":
|
108
102
|
api_key = "OPENAI_API_KEY"
|
@@ -116,6 +110,11 @@ class iModel:
|
|
116
110
|
api_key = "GROQ_API_KEY"
|
117
111
|
case "exa":
|
118
112
|
api_key = "EXA_API_KEY"
|
113
|
+
case "":
|
114
|
+
if requires_api_key:
|
115
|
+
raise ValueError("API key must be provided")
|
116
|
+
case _:
|
117
|
+
api_key = f"{provider.upper()}_API_KEY"
|
119
118
|
|
120
119
|
if os.getenv(api_key, None) is not None:
|
121
120
|
self.api_key_scheme = api_key
|
lionagi/tools/__init__.py
CHANGED
lionagi/tools/base.py
CHANGED
File without changes
|
lionagi/tools/file/__init__.py
CHANGED
lionagi/tools/file/reader.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
# Copyright (c) 2023 - 2025, HaiyangLi <quantocean.li at gmail dot com>
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
4
|
+
|
1
5
|
import tempfile
|
2
6
|
from enum import Enum
|
3
7
|
|
4
|
-
from pydantic import BaseModel, Field,
|
8
|
+
from pydantic import BaseModel, Field, model_validator
|
5
9
|
|
6
10
|
from lionagi.operatives.action.tool import Tool
|
7
11
|
from lionagi.utils import to_num
|
lionagi/tools/types.py
CHANGED
lionagi/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.9.
|
1
|
+
__version__ = "0.9.3"
|
@@ -4,7 +4,7 @@ lionagi/_errors.py,sha256=JlBTFJnRWtVYcRxKb7fWFiJHLbykl1E19mSJ8sXYVxg,455
|
|
4
4
|
lionagi/_types.py,sha256=9g7iytvSj3UjZxD-jL06_fxuNfgZyWT3Qnp0XYp1wQU,63
|
5
5
|
lionagi/settings.py,sha256=W52mM34E6jXF3GyqCFzVREKZrmnUqtZm_BVDsUiDI_s,1627
|
6
6
|
lionagi/utils.py,sha256=_A98YIoJMeQXKchx9m_cWTOutjdZRZASWTOSIRGTOB4,73177
|
7
|
-
lionagi/version.py,sha256=
|
7
|
+
lionagi/version.py,sha256=xKd3pzbczuMsdB08eLAOqZDUd_q1IRxwZ_ccAFL4c4A,22
|
8
8
|
lionagi/libs/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
9
9
|
lionagi/libs/parse.py,sha256=JRS3bql0InHJqATnAatl-hQv4N--XXw4P77JHhTFnrc,1011
|
10
10
|
lionagi/libs/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
@@ -161,12 +161,12 @@ lionagi/protocols/messages/templates/instruction_message.jinja2,sha256=L-ptw5OHx
|
|
161
161
|
lionagi/protocols/messages/templates/system_message.jinja2,sha256=JRKJ0aFpYfaXSFouKc_N4unZ35C3yZTOWhIrIdCB5qk,215
|
162
162
|
lionagi/protocols/messages/templates/tool_schemas.jinja2,sha256=ozIaSDCRjIAhLyA8VM6S-YqS0w2NcctALSwx4LjDwII,126
|
163
163
|
lionagi/service/__init__.py,sha256=DMGXIqPsmut9H5GT0ZeSzQIzYzzPwI-2gLXydpbwiV8,21
|
164
|
-
lionagi/service/imodel.py,sha256=
|
164
|
+
lionagi/service/imodel.py,sha256=w3cqrJSz2q7k_Y3BXsuS85ZTpBOfa0bNM7Gr58IdTaA,14589
|
165
165
|
lionagi/service/manager.py,sha256=FkuqAtLErqLmXNnDtuAdTUFo4uuE_VL660BBGBhzInU,1435
|
166
166
|
lionagi/service/types.py,sha256=CHPi8Bxl_yJ1pl2jYZBOrTHbT8_oO9sK75d4LMB651g,486
|
167
167
|
lionagi/service/endpoints/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
168
|
-
lionagi/service/endpoints/base.py,sha256=
|
169
|
-
lionagi/service/endpoints/chat_completion.py,sha256=
|
168
|
+
lionagi/service/endpoints/base.py,sha256=WuXs2tDrOxbbv9-UkiAgpVcM_6nuCNmvvry7eN1GuoI,23482
|
169
|
+
lionagi/service/endpoints/chat_completion.py,sha256=nihV7kCYm7ixdm8dH0JW7vKjqH9yIom4QDXGeDwuO6E,2964
|
170
170
|
lionagi/service/endpoints/match_endpoint.py,sha256=hPCqFwVirj5g9Husec980OCUynjRmr0zQzrs7O4yP74,1874
|
171
171
|
lionagi/service/endpoints/rate_limited_processor.py,sha256=P0CsMyhuG8OHCPYe2qez92Bm7v2ZRq4L5I6LOiAoGYs,5199
|
172
172
|
lionagi/service/endpoints/token_calculator.py,sha256=-AKwDvV7C8k8MTmd62ymT0ETSUPWBJ_DQKLZUutlyfg,6161
|
@@ -191,12 +191,26 @@ lionagi/session/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,1
|
|
191
191
|
lionagi/session/branch.py,sha256=XL0P507Jfqk9LhC8rDvajkjVE8FkPx7hnLltb-LdqHw,71503
|
192
192
|
lionagi/session/prompts.py,sha256=AhuHL19s0TijVZX3tMKUKMi6l88xeVdpkuEn2vJSRyU,3236
|
193
193
|
lionagi/session/session.py,sha256=8SuNMiJX6IAW6Ou8aDK0LsVG7zcD5yd22sakMyrd3pw,8987
|
194
|
-
lionagi/tools/__init__.py,sha256=
|
195
|
-
lionagi/tools/base.py,sha256=
|
196
|
-
lionagi/tools/types.py,sha256=
|
197
|
-
lionagi/tools/
|
198
|
-
lionagi/tools/
|
199
|
-
lionagi
|
200
|
-
lionagi
|
201
|
-
lionagi
|
202
|
-
lionagi
|
194
|
+
lionagi/tools/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
195
|
+
lionagi/tools/base.py,sha256=R5T8hliDfJwXitNcgs2RPogE3yYserRjfRAVzAY2kM4,349
|
196
|
+
lionagi/tools/types.py,sha256=f4TgF9LJ86P5dHIXNAHMSnLDnjto45M8Q_UJlyI-G3Y,177
|
197
|
+
lionagi/tools/browser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
198
|
+
lionagi/tools/browser/providers/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
199
|
+
lionagi/tools/browser/providers/browser_use_.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
200
|
+
lionagi/tools/code/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
201
|
+
lionagi/tools/code/coder.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
202
|
+
lionagi/tools/code/manager.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
203
|
+
lionagi/tools/code/sandbox.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
204
|
+
lionagi/tools/code/providers/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
205
|
+
lionagi/tools/code/providers/aider_.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
206
|
+
lionagi/tools/code/providers/e2b_.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
207
|
+
lionagi/tools/file/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
208
|
+
lionagi/tools/file/manager.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
209
|
+
lionagi/tools/file/reader.py,sha256=deqrmkyc0UMvHwKxdZ50uN9cNUVc5JKRjAaKa2dw728,7802
|
210
|
+
lionagi/tools/file/writer.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
211
|
+
lionagi/tools/file/providers/__init__.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
212
|
+
lionagi/tools/file/providers/docling_.py,sha256=5y5joOZzfFWERl75auAcNcKC3lImVJ5ZZGvvHZUFCJM,112
|
213
|
+
lionagi-0.9.3.dist-info/METADATA,sha256=5uKoYjOnEIJL_4VJE-gS4GlCsMdFfqZF7MpvKZvjX1g,18053
|
214
|
+
lionagi-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
215
|
+
lionagi-0.9.3.dist-info/licenses/LICENSE,sha256=VXFWsdoN5AAknBCgFqQNgPWYx7OPp-PFEP961zGdOjc,11288
|
216
|
+
lionagi-0.9.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|