waldiez 0.4.0__py3-none-any.whl → 0.4.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.
Potentially problematic release.
This version of waldiez might be problematic. Click here for more details.
- waldiez/_version.py +1 -1
- waldiez/exporting/agent/utils/captain_agent.py +5 -4
- waldiez/exporting/flow/flow_exporter.py +1 -1
- waldiez/exporting/flow/utils/importing_utils.py +0 -1
- waldiez/exporting/flow/utils/logging_utils.py +25 -4
- waldiez/models/model/__init__.py +2 -1
- waldiez/models/model/model.py +25 -6
- {waldiez-0.4.0.dist-info → waldiez-0.4.1.dist-info}/METADATA +4 -4
- {waldiez-0.4.0.dist-info → waldiez-0.4.1.dist-info}/RECORD +13 -13
- {waldiez-0.4.0.dist-info → waldiez-0.4.1.dist-info}/WHEEL +0 -0
- {waldiez-0.4.0.dist-info → waldiez-0.4.1.dist-info}/entry_points.txt +0 -0
- {waldiez-0.4.0.dist-info → waldiez-0.4.1.dist-info}/licenses/LICENSE +0 -0
- {waldiez-0.4.0.dist-info → waldiez-0.4.1.dist-info}/licenses/NOTICE.md +0 -0
waldiez/_version.py
CHANGED
|
@@ -142,10 +142,11 @@ def get_llm_config(
|
|
|
142
142
|
max_tokens: Optional[int] = 2048
|
|
143
143
|
if agent.data.model_ids:
|
|
144
144
|
waldiez_model = get_waldiez_model(agent.data.model_ids[0], all_models)
|
|
145
|
-
|
|
146
|
-
temperature
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
llm_config = waldiez_model.get_llm_config(skip_price=True)
|
|
146
|
+
for key in ["temperature", "top_p", "max_tokens"]:
|
|
147
|
+
if key not in llm_config:
|
|
148
|
+
llm_config[key] = None
|
|
149
|
+
return llm_config
|
|
149
150
|
config_dict = {
|
|
150
151
|
"model": model_name,
|
|
151
152
|
"temperature": temperature,
|
|
@@ -213,7 +213,7 @@ class FlowExporter(BaseExporter, ExporterMixin):
|
|
|
213
213
|
content += imports[0] + "\n"
|
|
214
214
|
content += get_np_no_nep50_handle() + "\n"
|
|
215
215
|
content += self.get_comment("logging", self.for_notebook) + "\n"
|
|
216
|
-
content += get_start_logging(tabs=0) + "\n"
|
|
216
|
+
content += get_start_logging(is_async=is_async, tabs=0) + "\n"
|
|
217
217
|
content += "start_logging()\n\n"
|
|
218
218
|
if models_output:
|
|
219
219
|
content += self.get_comment("models", self.for_notebook) + "\n"
|
|
@@ -16,11 +16,13 @@ get_sqlite_to_csv_call_string
|
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def get_start_logging(tabs: int = 0) -> str:
|
|
19
|
+
def get_start_logging(is_async: bool, tabs: int = 0) -> str:
|
|
20
20
|
"""Get the logging start call string.
|
|
21
21
|
|
|
22
22
|
Parameters
|
|
23
23
|
----------
|
|
24
|
+
is_async : bool
|
|
25
|
+
Whether to use async mode.
|
|
24
26
|
tabs : int, optional
|
|
25
27
|
The number of tabs to use for indentation, by default 0
|
|
26
28
|
|
|
@@ -41,7 +43,8 @@ def get_start_logging(tabs: int = 0) -> str:
|
|
|
41
43
|
)
|
|
42
44
|
"""
|
|
43
45
|
tab = " " * tabs
|
|
44
|
-
|
|
46
|
+
if is_async is False:
|
|
47
|
+
return f'''
|
|
45
48
|
{tab}def start_logging() -> None:
|
|
46
49
|
{tab} """Start logging."""
|
|
47
50
|
{tab} runtime_logging.start(
|
|
@@ -49,7 +52,20 @@ def get_start_logging(tabs: int = 0) -> str:
|
|
|
49
52
|
{tab} config={{"dbname": "flow.db"}},
|
|
50
53
|
{tab} )
|
|
51
54
|
'''
|
|
52
|
-
return
|
|
55
|
+
return f'''
|
|
56
|
+
{tab}def start_logging() -> None:
|
|
57
|
+
{tab} """Start logging."""
|
|
58
|
+
{tab} # pylint: disable=import-outside-toplevel
|
|
59
|
+
{tab} from anyio.from_thread import start_blocking_portal
|
|
60
|
+
|
|
61
|
+
{tab} with start_blocking_portal(backend="asyncio") as portal:
|
|
62
|
+
{tab} portal.call(
|
|
63
|
+
{tab} runtime_logging.start,
|
|
64
|
+
{tab} None,
|
|
65
|
+
{tab} "sqlite",
|
|
66
|
+
{tab} {{"dbname": "flow.db"}},
|
|
67
|
+
{tab} )
|
|
68
|
+
'''
|
|
53
69
|
|
|
54
70
|
|
|
55
71
|
# pylint: disable=differing-param-doc,differing-type-doc
|
|
@@ -336,6 +352,11 @@ def get_stop_logging(tabs: int, is_async: bool) -> str:
|
|
|
336
352
|
content += "async "
|
|
337
353
|
content += "def stop_logging() -> None:\n"
|
|
338
354
|
content += ' """Stop logging."""\n'
|
|
339
|
-
|
|
355
|
+
if is_async:
|
|
356
|
+
content += f"{tab} # pylint: disable=import-outside-toplevel\n"
|
|
357
|
+
content += f"{tab} from asyncer import asyncify\n\n"
|
|
358
|
+
content += f"{tab} await asyncify(runtime_logging.stop)()\n"
|
|
359
|
+
else:
|
|
360
|
+
content += f"{tab} runtime_logging.stop()\n"
|
|
340
361
|
content += get_sqlite_out_call(tabs + 1, is_async)
|
|
341
362
|
return content
|
waldiez/models/model/__init__.py
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
"""Waldiez model."""
|
|
4
4
|
|
|
5
5
|
from .extra_requirements import get_models_extra_requirements
|
|
6
|
-
from .model import DEFAULT_BASE_URLS, WaldiezModel
|
|
6
|
+
from .model import DEFAULT_BASE_URLS, MODEL_NEEDS_BASE_URL, WaldiezModel
|
|
7
7
|
from .model_data import WaldiezModelAPIType, WaldiezModelData, WaldiezModelPrice
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
10
10
|
"get_models_extra_requirements",
|
|
11
11
|
"DEFAULT_BASE_URLS",
|
|
12
|
+
"MODEL_NEEDS_BASE_URL",
|
|
12
13
|
"WaldiezModel",
|
|
13
14
|
"WaldiezModelData",
|
|
14
15
|
"WaldiezModelPrice",
|
waldiez/models/model/model.py
CHANGED
|
@@ -23,6 +23,22 @@ DEFAULT_BASE_URLS: Dict[WaldiezModelAPIType, str] = {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
# we can omit the base_url for these models
|
|
27
|
+
MODEL_NEEDS_BASE_URL: Dict[WaldiezModelAPIType, bool] = {
|
|
28
|
+
"openai": False,
|
|
29
|
+
"azure": False,
|
|
30
|
+
"google": False,
|
|
31
|
+
"anthropic": False,
|
|
32
|
+
"cohere": False,
|
|
33
|
+
"other": False, # falls back to openai
|
|
34
|
+
"deepseek": True,
|
|
35
|
+
"mistral": True,
|
|
36
|
+
"groq": True,
|
|
37
|
+
"together": True,
|
|
38
|
+
"nim": True,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
26
42
|
class WaldiezModel(WaldiezBase):
|
|
27
43
|
"""Waldiez Model class.
|
|
28
44
|
|
|
@@ -225,10 +241,13 @@ def set_default_base_url(
|
|
|
225
241
|
Dict[str, Any]
|
|
226
242
|
The llm config dictionary with the default base url set.
|
|
227
243
|
"""
|
|
228
|
-
|
|
229
|
-
return llm_config
|
|
244
|
+
dict_copy = llm_config.copy()
|
|
230
245
|
if "base_url" not in llm_config or not llm_config["base_url"]:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
246
|
+
if MODEL_NEEDS_BASE_URL.get(api_type, True):
|
|
247
|
+
dict_copy["base_url"] = DEFAULT_BASE_URLS.get(api_type, "")
|
|
248
|
+
if (
|
|
249
|
+
not llm_config.get("base_url", "")
|
|
250
|
+
and MODEL_NEEDS_BASE_URL.get(api_type, True) is False
|
|
251
|
+
):
|
|
252
|
+
dict_copy.pop("base_url", None)
|
|
253
|
+
return dict_copy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: waldiez
|
|
5
5
|
Project-URL: homepage, https://waldiez.github.io/waldiez/python
|
|
6
6
|
Project-URL: repository, https://github.com/waldiez/python.git
|
|
@@ -90,12 +90,12 @@ Requires-Dist: mkdocs-material==9.6.4; extra == 'docs'
|
|
|
90
90
|
Requires-Dist: mkdocs-minify-html-plugin==0.2.4; extra == 'docs'
|
|
91
91
|
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
|
|
92
92
|
Requires-Dist: mkdocstrings-python==1.15.0; extra == 'docs'
|
|
93
|
-
Requires-Dist: mkdocstrings[crystal,python]==0.28.
|
|
93
|
+
Requires-Dist: mkdocstrings[crystal,python]==0.28.1; extra == 'docs'
|
|
94
94
|
Provides-Extra: jupyter
|
|
95
95
|
Requires-Dist: jupyterlab>=4.3.0; extra == 'jupyter'
|
|
96
|
-
Requires-Dist: waldiez-jupyter==0.4.
|
|
96
|
+
Requires-Dist: waldiez-jupyter==0.4.1; extra == 'jupyter'
|
|
97
97
|
Provides-Extra: studio
|
|
98
|
-
Requires-Dist: waldiez-studio==0.4.
|
|
98
|
+
Requires-Dist: waldiez-studio==0.4.1; extra == 'studio'
|
|
99
99
|
Provides-Extra: test
|
|
100
100
|
Requires-Dist: pytest-asyncio==0.25.3; extra == 'test'
|
|
101
101
|
Requires-Dist: pytest-cov==6.0.0; extra == 'test'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
waldiez/__init__.py,sha256=cXWdy5P9i_x6fHwlL5DRaIhmpfnhabo5GjASStlcLWw,819
|
|
2
2
|
waldiez/__main__.py,sha256=0dYzNrQbovRwQQvmZC6_1FDR1m71SUIOkTleO5tBnBw,203
|
|
3
|
-
waldiez/_version.py,sha256=
|
|
3
|
+
waldiez/_version.py,sha256=VHh_I0xQTv4ulSgfDjPM_C5DVb9vuauW9XaxjICO6dc,155
|
|
4
4
|
waldiez/cli.py,sha256=FaPWh9IHBHoC9rtyt2bKBrk7S018BX__mwtTArfv4AA,6992
|
|
5
5
|
waldiez/exporter.py,sha256=ZuMF8cra0Shw4nkDiFuPqaQKFYrF0vPj_I3EhPyesPw,4788
|
|
6
6
|
waldiez/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -9,7 +9,7 @@ waldiez/exporting/__init__.py,sha256=nlMWBnn_MViGBJmDhrTCYpPv19fEP_WixvmmY9jt5c8
|
|
|
9
9
|
waldiez/exporting/agent/__init__.py,sha256=GOgri16QNICpx3YNZPzVn_KYVxuQACYKQyazhJNtYK0,188
|
|
10
10
|
waldiez/exporting/agent/agent_exporter.py,sha256=Rv-Fcsf3r_nEib1HVk3SglKkLU6fN7cMLgUwJ4Vi4sw,10482
|
|
11
11
|
waldiez/exporting/agent/utils/__init__.py,sha256=UlyOZCm3jLz5PHOJ9fhZuCqbNBBlomzvRd7K_tKR-No,844
|
|
12
|
-
waldiez/exporting/agent/utils/captain_agent.py,sha256=
|
|
12
|
+
waldiez/exporting/agent/utils/captain_agent.py,sha256=TJZbjf7TtIdS00wTWciqneoNrGC4aJiYL2Rn6WpxMLs,7277
|
|
13
13
|
waldiez/exporting/agent/utils/code_execution.py,sha256=sRHczOmm12U9E-Q1v9UQRwao1LUEve4fnKvJwsokNNk,2352
|
|
14
14
|
waldiez/exporting/agent/utils/group_manager.py,sha256=VCqd-lsCertwVTWVez9Z1HS_H-UmBGyNGizvC736VnI,7360
|
|
15
15
|
waldiez/exporting/agent/utils/reasoning.py,sha256=EBE42Dar9n6fBrhg9D9wch0KptsP_m3Dm2WNEDuKb7g,999
|
|
@@ -43,15 +43,15 @@ waldiez/exporting/chats/utils/sequential.py,sha256=TYAte2hwpGkEENjCMer-6PcL2r8PE
|
|
|
43
43
|
waldiez/exporting/chats/utils/single_chat.py,sha256=FYz0jvtO0yFYPk5CBuXb7rOW8VxB0NJWvWY1PEHPIAQ,9535
|
|
44
44
|
waldiez/exporting/chats/utils/swarm.py,sha256=i8n-QNSgAOGHGMcV1pwbEVqb_LJZtNxtJ4yR42yLl6I,6928
|
|
45
45
|
waldiez/exporting/flow/__init__.py,sha256=TAJ8lq9saP1IX0U-A6yGKCfvbQnEocmRAX4Hc60f3yY,183
|
|
46
|
-
waldiez/exporting/flow/flow_exporter.py,sha256=
|
|
46
|
+
waldiez/exporting/flow/flow_exporter.py,sha256=Lt4FC8cyRiEVcRpYr_sCLeE1MijNFV2LQGvNxJLGQCs,18215
|
|
47
47
|
waldiez/exporting/flow/utils/__init__.py,sha256=Alk9M4_BLvnZ5yO3y0T-Xie__OgtjCPtjzfZx_tH0Ig,1380
|
|
48
48
|
waldiez/exporting/flow/utils/agent_utils.py,sha256=QL1nzlgYeh6Y-l9R3hmCsrxSzluvBVciuuEIFdBXXKM,6109
|
|
49
49
|
waldiez/exporting/flow/utils/chat_utils.py,sha256=q6HS4JTNQJe15eh78H1BlN-wId9XzvVQziGhxsUIEFs,1882
|
|
50
50
|
waldiez/exporting/flow/utils/def_main.py,sha256=GxEBfX6cUGFCMdxiu_hp5TLIhIC4ohczxA1A01mHnOo,2746
|
|
51
51
|
waldiez/exporting/flow/utils/flow_content.py,sha256=w2JUqx1EmYRnptGtsYrU-gfETHi6bkimV9vd2Ao-YBI,5548
|
|
52
52
|
waldiez/exporting/flow/utils/flow_names.py,sha256=GtfVRF8WYUP8Xx47AiyZ5FuuCUb22jhJn3diblbbBfM,3463
|
|
53
|
-
waldiez/exporting/flow/utils/importing_utils.py,sha256=
|
|
54
|
-
waldiez/exporting/flow/utils/logging_utils.py,sha256=
|
|
53
|
+
waldiez/exporting/flow/utils/importing_utils.py,sha256=ysryaFF872wrtqRDAlZB2mFvXwjmkX_PG-j5vLPViWQ,7106
|
|
54
|
+
waldiez/exporting/flow/utils/logging_utils.py,sha256=DsBuv7LLWb4i18HQkXrJV2YpjG_Jzk0ZDsM-8HJ5bMg,11720
|
|
55
55
|
waldiez/exporting/models/__init__.py,sha256=QbyYuS-Px-M9vMrdL-UKqnDzhYWRkNmRGBbc1IBuwpM,212
|
|
56
56
|
waldiez/exporting/models/models_exporter.py,sha256=i9aSnL7JNU8iWJotfSxWbm1CRjUP6yqd9CtfXWiRbV4,6289
|
|
57
57
|
waldiez/exporting/models/utils.py,sha256=g15N_JA21Ly5nzCfburEbHf6fTWX7hG5rxyTvAwyXl0,4997
|
|
@@ -119,9 +119,9 @@ waldiez/models/flow/__init__.py,sha256=3UFbMMn_5c5AXs6ppkvhNeWb9jelru2lNHUjpEq0N
|
|
|
119
119
|
waldiez/models/flow/flow.py,sha256=Shyg-XwzloSzqLLFPwY9g_MjZHxAGy2h_qfPmK58UZs,16876
|
|
120
120
|
waldiez/models/flow/flow_data.py,sha256=afD97Ff9Yd7QSXE4DphaENY7wqrq4QIl4EVgI8O4ZFk,5464
|
|
121
121
|
waldiez/models/flow/utils.py,sha256=X_jelP5lHuQt1OZE6sxLlhEKbkkt8jZgbkF79e9rQig,7140
|
|
122
|
-
waldiez/models/model/__init__.py,sha256=
|
|
122
|
+
waldiez/models/model/__init__.py,sha256=jyJHJWzqNxnmDHAhpXWMnMK_4VF2olPIE3k7KV7_xVg,532
|
|
123
123
|
waldiez/models/model/extra_requirements.py,sha256=KgqzixbsvzM6Ec8rdQEVoWtyNusqW33ukdRoBHS5LAg,1690
|
|
124
|
-
waldiez/models/model/model.py,sha256=
|
|
124
|
+
waldiez/models/model/model.py,sha256=A1N90QZsbd3vEddeffAMdKIja9RjspZl46Ff4q2CP9w,7743
|
|
125
125
|
waldiez/models/model/model_data.py,sha256=5bdUz0gi3RNowVh4SCKiTds6sZMMBvf69pNO6mx4LnA,3793
|
|
126
126
|
waldiez/models/skill/__init__.py,sha256=EMkjfsMUU-2H5cZ4NhzHJWuyaSp605whT-zf7Gxt4aA,470
|
|
127
127
|
waldiez/models/skill/extra_requirements.py,sha256=q3ZY5v6mWQ_9C0GuAmFm8DK2j8TDr9CQafTmFY0w5bc,1082
|
|
@@ -139,9 +139,9 @@ waldiez/utils/pysqlite3_checker.py,sha256=8m0yBAbg3tMyXOBktL2q1WXMgjym_Ttn2NbgpL
|
|
|
139
139
|
waldiez/utils/cli_extras/__init__.py,sha256=FQ6biuz6Ig-U3xkmgac3WMUynH_7XWjeGI-DqWFTC8c,625
|
|
140
140
|
waldiez/utils/cli_extras/jupyter.py,sha256=C4fOiS_PbU15X-6HUZBPHvfgEjOrY39e07mClKvswPI,2971
|
|
141
141
|
waldiez/utils/cli_extras/studio.py,sha256=te6VmwYDeEEK6Jps-Ou84QPZmCYMsF-oE1hNu6ewFHg,887
|
|
142
|
-
waldiez-0.4.
|
|
143
|
-
waldiez-0.4.
|
|
144
|
-
waldiez-0.4.
|
|
145
|
-
waldiez-0.4.
|
|
146
|
-
waldiez-0.4.
|
|
147
|
-
waldiez-0.4.
|
|
142
|
+
waldiez-0.4.1.dist-info/METADATA,sha256=K25AqCDPJc5CMWseNYv8QrLGtKA4jcuBRDqKWpnRpDA,9830
|
|
143
|
+
waldiez-0.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
144
|
+
waldiez-0.4.1.dist-info/entry_points.txt,sha256=9MQ8Y1rD19CU7UwjNPwoyTRpQsPs2QimjrtwTD0bD6k,44
|
|
145
|
+
waldiez-0.4.1.dist-info/licenses/LICENSE,sha256=bWinEG_ynCS8eSj1vhAmYDWwYODhBOF0AUEjOgZ3kmU,11355
|
|
146
|
+
waldiez-0.4.1.dist-info/licenses/NOTICE.md,sha256=lrKsUNrpE18LPSLPJY_kt2ZJFZJEwH55wPv5Axcheyc,133
|
|
147
|
+
waldiez-0.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|