waldiez 0.1.0__py3-none-any.whl → 0.1.2__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/agents/rag_user/chroma_utils.py +4 -1
- waldiez/exporting/agents/rag_user/qdrant_utils.py +1 -1
- waldiez/exporting/agents/rag_user/rag_user.py +16 -5
- waldiez/exporting/utils/__init__.py +2 -0
- waldiez/exporting/utils/object_string.py +2 -0
- waldiez/exporting/utils/path_check.py +48 -0
- waldiez/models/agents/agent/agent_data.py +2 -13
- {waldiez-0.1.0.dist-info → waldiez-0.1.2.dist-info}/METADATA +5 -6
- {waldiez-0.1.0.dist-info → waldiez-0.1.2.dist-info}/RECORD +13 -12
- {waldiez-0.1.0.dist-info → waldiez-0.1.2.dist-info}/WHEEL +0 -0
- {waldiez-0.1.0.dist-info → waldiez-0.1.2.dist-info}/entry_points.txt +0 -0
- {waldiez-0.1.0.dist-info → waldiez-0.1.2.dist-info}/licenses/LICENSE +0 -0
waldiez/_version.py
CHANGED
|
@@ -28,8 +28,11 @@ def _get_chroma_client_string(agent: WaldiezRagUser) -> Tuple[str, str]:
|
|
|
28
28
|
agent.retrieve_config.db_config.use_local_storage
|
|
29
29
|
and agent.retrieve_config.db_config.local_storage_path is not None
|
|
30
30
|
):
|
|
31
|
+
# on windows, we get:
|
|
32
|
+
# SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes
|
|
33
|
+
# in position 2-3: truncated \UXXXXXXXX escape
|
|
31
34
|
local_path = Path(agent.retrieve_config.db_config.local_storage_path)
|
|
32
|
-
client_str += f'PersistentClient(path="{local_path}")'
|
|
35
|
+
client_str += f'PersistentClient(path=r"{local_path}")'
|
|
33
36
|
else:
|
|
34
37
|
client_str += "Client()"
|
|
35
38
|
return client_str, to_import
|
|
@@ -30,7 +30,7 @@ def _get_qdrant_client_string(agent: WaldiezRagUser) -> Tuple[str, str]:
|
|
|
30
30
|
and agent.retrieve_config.db_config.local_storage_path
|
|
31
31
|
):
|
|
32
32
|
local_path = Path(agent.retrieve_config.db_config.local_storage_path)
|
|
33
|
-
client_str += f'location="{local_path}")'
|
|
33
|
+
client_str += f'location=r"{local_path}")'
|
|
34
34
|
elif agent.retrieve_config.db_config.connection_url:
|
|
35
35
|
client_str += (
|
|
36
36
|
f'location="{agent.retrieve_config.db_config.connection_url}")'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""RAG User related exporting utils."""
|
|
2
2
|
|
|
3
|
-
from typing import Dict, Set, Tuple
|
|
3
|
+
from typing import Dict, List, Set, Tuple, Union
|
|
4
4
|
|
|
5
5
|
from waldiez.models import (
|
|
6
6
|
WaldiezAgent,
|
|
@@ -9,7 +9,7 @@ from waldiez.models import (
|
|
|
9
9
|
WaldiezRagUserRetrieveConfig,
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
-
from ...utils import get_object_string
|
|
12
|
+
from ...utils import get_object_string, get_path_string
|
|
13
13
|
from .vector_db import get_rag_user_vector_db_string
|
|
14
14
|
|
|
15
15
|
|
|
@@ -60,6 +60,7 @@ def get_rag_user_retrieve_config_str(
|
|
|
60
60
|
"\n\n"
|
|
61
61
|
)
|
|
62
62
|
args_dict["custom_text_split_function"] = text_split_arg_name
|
|
63
|
+
# docs_path = args_dict.pop("docs_path", [])
|
|
63
64
|
args_content = get_object_string(args_dict)
|
|
64
65
|
# get the last line (where the dict ends)
|
|
65
66
|
args_parts = args_content.split("\n")
|
|
@@ -131,9 +132,9 @@ def _get_args_dict(
|
|
|
131
132
|
agent: WaldiezRagUser,
|
|
132
133
|
retrieve_config: WaldiezRagUserRetrieveConfig,
|
|
133
134
|
model_names: Dict[str, str],
|
|
134
|
-
) -> Dict[str, str]:
|
|
135
|
+
) -> Dict[str, Union[str, List[str]]]:
|
|
135
136
|
model_arg = _get_model_arg(agent, retrieve_config, model_names)
|
|
136
|
-
args_dict = {
|
|
137
|
+
args_dict: Dict[str, Union[str, List[str]]] = {
|
|
137
138
|
"task": retrieve_config.task,
|
|
138
139
|
"model": model_arg,
|
|
139
140
|
}
|
|
@@ -142,13 +143,23 @@ def _get_args_dict(
|
|
|
142
143
|
"context_max_tokens",
|
|
143
144
|
"customized_prompt",
|
|
144
145
|
"customized_answer_prefix",
|
|
145
|
-
"docs_path",
|
|
146
146
|
]
|
|
147
147
|
for arg in optional_args:
|
|
148
148
|
arg_value = getattr(retrieve_config, arg)
|
|
149
149
|
if arg_value is not None:
|
|
150
150
|
args_dict[arg] = arg_value
|
|
151
151
|
args_dict[arg] = getattr(retrieve_config, arg)
|
|
152
|
+
docs_path: Union[str, List[str]] = []
|
|
153
|
+
if retrieve_config.docs_path:
|
|
154
|
+
docs_path = (
|
|
155
|
+
retrieve_config.docs_path
|
|
156
|
+
if isinstance(retrieve_config.docs_path, list)
|
|
157
|
+
else [retrieve_config.docs_path]
|
|
158
|
+
)
|
|
159
|
+
docs_path = [get_path_string(path) for path in docs_path]
|
|
160
|
+
args_dict["docs_path"] = docs_path
|
|
161
|
+
if docs_path:
|
|
162
|
+
args_dict["docs_path"] = docs_path
|
|
152
163
|
non_optional_args = [
|
|
153
164
|
"new_docs",
|
|
154
165
|
"update_context",
|
|
@@ -15,12 +15,14 @@ from .naming import (
|
|
|
15
15
|
get_valid_python_variable_name,
|
|
16
16
|
)
|
|
17
17
|
from .object_string import get_object_string
|
|
18
|
+
from .path_check import get_path_string
|
|
18
19
|
|
|
19
20
|
__all__ = [
|
|
20
21
|
"add_autogen_dot_import",
|
|
21
22
|
"comment",
|
|
22
23
|
"get_logging_start_string",
|
|
23
24
|
"get_logging_stop_string",
|
|
25
|
+
"get_path_string",
|
|
24
26
|
"get_pylint_ignore_comment",
|
|
25
27
|
"get_sqlite_to_csv_string",
|
|
26
28
|
"get_sqlite_to_csv_call_string",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Path check utility functions."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
# pylint: disable=broad-except
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _is_local_path(string: str) -> bool:
|
|
10
|
+
"""Check if a string is a local path.
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
----------
|
|
14
|
+
string : str
|
|
15
|
+
The string to check.
|
|
16
|
+
|
|
17
|
+
Returns
|
|
18
|
+
-------
|
|
19
|
+
bool
|
|
20
|
+
True if the path is a local path.
|
|
21
|
+
"""
|
|
22
|
+
try:
|
|
23
|
+
path = Path(string).resolve()
|
|
24
|
+
return path.exists()
|
|
25
|
+
except Exception: # pragma: no cover
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_path_string(string: str) -> str:
|
|
30
|
+
"""Get the path string.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
string : str
|
|
35
|
+
The string to check.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
str
|
|
40
|
+
The local path string.
|
|
41
|
+
"""
|
|
42
|
+
# On windows, we get paths like "C:\path\to\file"
|
|
43
|
+
# if so, let's try to avoid invalid escape sequences
|
|
44
|
+
if not _is_local_path(string):
|
|
45
|
+
return string
|
|
46
|
+
if os.name == "nt": # pragma: no cover
|
|
47
|
+
return f"r'{string}'"
|
|
48
|
+
return f"'{string}'"
|
|
@@ -24,9 +24,7 @@ class WaldiezAgentData(WaldiezBase):
|
|
|
24
24
|
human_input_mode : Literal["ALWAYS", "NEVER", "TERMINATE"]
|
|
25
25
|
The human input mode to use for the agent.
|
|
26
26
|
code_execution_config : Union[WaldiezAgentCodeExecutionConfig, False]
|
|
27
|
-
The code execution config. Either False (no execution) or a dict
|
|
28
|
-
max_tokens : Optional[int]
|
|
29
|
-
The maximum tokens to use. Default: None (no limit).
|
|
27
|
+
The code execution config. Either False (no execution) or a dict.
|
|
30
28
|
agent_default_auto_reply : Optional[str]
|
|
31
29
|
The agent's default auto reply when no input is received.
|
|
32
30
|
max_consecutive_auto_reply : Optional[int]
|
|
@@ -45,7 +43,7 @@ class WaldiezAgentData(WaldiezBase):
|
|
|
45
43
|
"""
|
|
46
44
|
|
|
47
45
|
model_config = ConfigDict(
|
|
48
|
-
extra="
|
|
46
|
+
extra="ignore",
|
|
49
47
|
alias_generator=to_camel,
|
|
50
48
|
populate_by_name=True,
|
|
51
49
|
# we have a field starting with "model_" (model_ids)
|
|
@@ -71,15 +69,6 @@ class WaldiezAgentData(WaldiezBase):
|
|
|
71
69
|
alias="humanInputMode",
|
|
72
70
|
),
|
|
73
71
|
]
|
|
74
|
-
max_tokens: Annotated[
|
|
75
|
-
Optional[int],
|
|
76
|
-
Field(
|
|
77
|
-
None,
|
|
78
|
-
title="Max tokens",
|
|
79
|
-
description="The maximum tokens to use. Default: None (no limit).",
|
|
80
|
-
alias="maxTokens",
|
|
81
|
-
),
|
|
82
|
-
]
|
|
83
72
|
code_execution_config: Annotated[
|
|
84
73
|
Union[WaldiezAgentCodeExecutionConfig, Literal[False]],
|
|
85
74
|
Field(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: waldiez
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: waldiez
|
|
5
5
|
Project-URL: homepage, https://waldiez.github.io/py/
|
|
6
6
|
Project-URL: repository, https://github.com/waldiez/py.git
|
|
@@ -74,11 +74,11 @@ Description-Content-Type: text/markdown
|
|
|
74
74
|
|
|
75
75
|
# Waldiez
|
|
76
76
|
|
|
77
|
-
 [](https://coveralls.io/github/waldiez/py)
|
|
77
|
+
 [](https://coveralls.io/github/waldiez/py) [](https://badge.fury.io/py/waldiez)
|
|
78
78
|
|
|
79
79
|
Translate a Waldiez flow:
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+

|
|
82
82
|
|
|
83
83
|
To a python script or a jupyter notebook with the corresponding [autogen](https://github.com/microsoft/autogen/) agents and chats.
|
|
84
84
|
|
|
@@ -91,14 +91,13 @@ To a python script or a jupyter notebook with the corresponding [autogen](https:
|
|
|
91
91
|
|
|
92
92
|
## Installation
|
|
93
93
|
|
|
94
|
-
<!--
|
|
95
94
|
On PyPI:
|
|
96
95
|
|
|
97
96
|
```bash
|
|
98
97
|
python -m pip install waldiez
|
|
99
|
-
```
|
|
98
|
+
```
|
|
100
99
|
|
|
101
|
-
From
|
|
100
|
+
From the repository:
|
|
102
101
|
|
|
103
102
|
```bash
|
|
104
103
|
python -m pip install git+https://github.com/waldiez/py.git
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
waldiez/__init__.py,sha256=pX6lHj8fNlfqCpHEfF6MNQBCR6qRjFYjwBSOCoxrlwk,313
|
|
2
2
|
waldiez/__main__.py,sha256=9xR-F2ohZcRPDG6KrM7cJpXciKX-u6WdL221ckyJ04k,112
|
|
3
|
-
waldiez/_version.py,sha256=
|
|
3
|
+
waldiez/_version.py,sha256=hiO5XGIMf-JKIDO7TZrWy6g1Iq-nh3n_W-WL3Cll4ZM,62
|
|
4
4
|
waldiez/cli.py,sha256=vIQDqs9XBOlDpshq7rNgvoTcnnkeZrsXa_51gMWs6H4,4690
|
|
5
5
|
waldiez/exporter.py,sha256=iKe-l_Me8NRWsXHIdBcrOrnLT9XIyp4iYi4HLuuj2jA,9342
|
|
6
6
|
waldiez/io_stream.py,sha256=YczhIw0PKEsxCSY6tAqElCqOUh8b-aEkSIGC1JjXxAs,5877
|
|
@@ -16,11 +16,11 @@ waldiez/exporting/agents/llm_config.py,sha256=A88e-RKp09r8n9MG11hArpITzxK8nVrTZ6
|
|
|
16
16
|
waldiez/exporting/agents/teachability.py,sha256=ame4hHJCZRBp7hAQGZzv2Cjs6QtcV9vlQ1zheMEMac0,1103
|
|
17
17
|
waldiez/exporting/agents/termination_message.py,sha256=tzI4-tcveYKBVx5PsznQZwAoghSX3mbn_vPu4rX8tuU,1276
|
|
18
18
|
waldiez/exporting/agents/rag_user/__init__.py,sha256=01F4gwgUwtSpZbGXcfieqIuLNT64u9KiqMIB2f0mplI,196
|
|
19
|
-
waldiez/exporting/agents/rag_user/chroma_utils.py,sha256=
|
|
19
|
+
waldiez/exporting/agents/rag_user/chroma_utils.py,sha256=jBncfPsepTzgSo9wxyeLFEVvmoWDpIC-dJCpyqRQvx4,4632
|
|
20
20
|
waldiez/exporting/agents/rag_user/mongo_utils.py,sha256=y5IL-Anfktg9cYo2o-ED1A7lwHQWdVMWD_W1AT5_RmE,2664
|
|
21
21
|
waldiez/exporting/agents/rag_user/pgvector_utils.py,sha256=EyGDwvo1Pe8bqoJl3NFpqK6zizN81lPPaSMBMQF79Dc,2722
|
|
22
|
-
waldiez/exporting/agents/rag_user/qdrant_utils.py,sha256=
|
|
23
|
-
waldiez/exporting/agents/rag_user/rag_user.py,sha256=
|
|
22
|
+
waldiez/exporting/agents/rag_user/qdrant_utils.py,sha256=tn1A7pjQjJfGS33ALgnPYTz7xu8rVBidcc5-WHLq8e8,3487
|
|
23
|
+
waldiez/exporting/agents/rag_user/rag_user.py,sha256=l2RcQ2Ni5EerLk23js_aq70EKA-jZzDzTWsL8WhU5hY,5824
|
|
24
24
|
waldiez/exporting/agents/rag_user/vector_db.py,sha256=64Gr_y1VTZLXi1pC4KjChsZ6DTX7cxdkDRQI3Ty_H-U,3659
|
|
25
25
|
waldiez/exporting/chats/__init__.py,sha256=v5aR1gWqSN5xeDDMIFo-ceC_Z9UgL8qJZofC2sU8HqQ,296
|
|
26
26
|
waldiez/exporting/chats/chats.py,sha256=xI5ZzWpcqYz8Kuu7B9pU6iHN16wUwHxOvYFhH5vxWuA,1259
|
|
@@ -31,20 +31,21 @@ waldiez/exporting/flow/def_main.py,sha256=YpdhqO4iFng3r7if69ZPMJAibPVNDqnrOrWvGw
|
|
|
31
31
|
waldiez/exporting/flow/flow.py,sha256=AGISfMOicdee4zikvuega8ZnHceQpdfCphDBgIE5_94,6038
|
|
32
32
|
waldiez/exporting/models/__init__.py,sha256=qJvP0CIrgLPM2pnIoXM26eyUdh7ub-CiNNLJwXEOAwQ,5829
|
|
33
33
|
waldiez/exporting/skills/__init__.py,sha256=oIA9f5ABtYSbS0kMY_4ovU3-m6meVk5blEu_xViZsRU,3536
|
|
34
|
-
waldiez/exporting/utils/__init__.py,sha256=
|
|
34
|
+
waldiez/exporting/utils/__init__.py,sha256=tP1V4g9-MyARlfOEL_1YWMJNW7UivUrrukq7DIwdq6k,1018
|
|
35
35
|
waldiez/exporting/utils/comments.py,sha256=X9j8w48rh3DfFDjiMverU9DBSuE9yuMMbbStxBbN1sE,3190
|
|
36
36
|
waldiez/exporting/utils/importing.py,sha256=M7vBcW9gPe3hCaTX2Bsv-mz36DAiCe4R-3mLrMWGY-Y,8616
|
|
37
37
|
waldiez/exporting/utils/logging_utils.py,sha256=uoV6O23lfB5ztOYEZiYu8Mn-2xEUwp_Qx404Mr62i7M,5822
|
|
38
38
|
waldiez/exporting/utils/method_utils.py,sha256=7-RUMTylNM2W0iM1bPX2_Gn3553XZSl2s2VGEijxNp4,891
|
|
39
39
|
waldiez/exporting/utils/naming.py,sha256=VdoVODQduhXIs9hQFWUVEVqTaSyNDt7rkECsuIgXYwI,3196
|
|
40
|
-
waldiez/exporting/utils/object_string.py,sha256=
|
|
40
|
+
waldiez/exporting/utils/object_string.py,sha256=2kdIu4in3iUV92a2KbLWwp9POhvY-fzF_r2AGVnCKls,2166
|
|
41
|
+
waldiez/exporting/utils/path_check.py,sha256=laGSLLiiwIIKxpAp5JIbtEvurbvXGkT4Hx0lemJcA9s,976
|
|
41
42
|
waldiez/models/__init__.py,sha256=IMq8vzuAgmv92kHSSuZQLF38vVd31ojgOHonuHqWYj0,2888
|
|
42
43
|
waldiez/models/waldiez.py,sha256=B_ujtMVnuGFAB_d9gMDydOdbe2XtP80EH7FVefwpHeg,8909
|
|
43
44
|
waldiez/models/agents/__init__.py,sha256=3ZyVYBHMFzZjRMIdPrBF6HLg82LPAlEubL6utL6KhfU,1856
|
|
44
45
|
waldiez/models/agents/agents.py,sha256=zIqihnoBjzaQLL_P6FcVoHddcusRNYsWPIFLZD091bE,3641
|
|
45
46
|
waldiez/models/agents/agent/__init__.py,sha256=inA0zV3dnwmcQlcObH_FLaZSURjFG31E_XUampJAnJU,746
|
|
46
47
|
waldiez/models/agents/agent/agent.py,sha256=DAwreQtIdoM2x_vVccIkALl5whyS07GvfKRUxdVhLeY,5513
|
|
47
|
-
waldiez/models/agents/agent/agent_data.py,sha256=
|
|
48
|
+
waldiez/models/agents/agent/agent_data.py,sha256=A3qIvOKyUKBIqqPbsBKVE5JTNQ8JcoDEGMqazNkN_rA,5009
|
|
48
49
|
waldiez/models/agents/agent/code_execution.py,sha256=kgL3pbEEyuMvJid0sIbfe4os7SWKpzL1Bv4O525Biyk,1942
|
|
49
50
|
waldiez/models/agents/agent/linked_skill.py,sha256=8RHWHkHXqFuv7lEe1PuQoK1hTO3kBQ7ILKm9kCEWqNs,667
|
|
50
51
|
waldiez/models/agents/agent/nested_chat.py,sha256=DAF3TCbTwyDvg6PGbeETtBLCQ4Xz5Saw5a4Xi-jr6jA,1929
|
|
@@ -87,8 +88,8 @@ waldiez/stream/__init__.py,sha256=6qst5j2iXmV-wDTnhgCna3llqUfJ6tkR0HBq7Vx9x-Q,19
|
|
|
87
88
|
waldiez/stream/consumer.py,sha256=VQDJEomYpGjmAtOoFBJrpCyoYzwykJUIOrdiLn08Uj4,4049
|
|
88
89
|
waldiez/stream/provider.py,sha256=JqnnR1yAimfK4HxW4gr4HIoJ15Ly71kXn75mv7FZBmw,9478
|
|
89
90
|
waldiez/stream/server.py,sha256=Ya4AKP5Wr_xAsbG3Q-qShqHmfIyamj9LGXizJsL-N4Y,11815
|
|
90
|
-
waldiez-0.1.
|
|
91
|
-
waldiez-0.1.
|
|
92
|
-
waldiez-0.1.
|
|
93
|
-
waldiez-0.1.
|
|
94
|
-
waldiez-0.1.
|
|
91
|
+
waldiez-0.1.2.dist-info/METADATA,sha256=CoM_iWzFesJK4x_hhyAojVpt9joTUZMFiwRyxRoemoE,6745
|
|
92
|
+
waldiez-0.1.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
93
|
+
waldiez-0.1.2.dist-info/entry_points.txt,sha256=5Po4yQXPa_QEdtTevpEBgr3rGoIvDMeQuJR2zqwBLBo,45
|
|
94
|
+
waldiez-0.1.2.dist-info/licenses/LICENSE,sha256=VQEHM6WMQLRu1qaGl3GWsoOknDwro-69eGo4NLIJPIM,1064
|
|
95
|
+
waldiez-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|