waldiez 0.1.0__tar.gz → 0.1.2__tar.gz

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.

Files changed (95) hide show
  1. {waldiez-0.1.0 → waldiez-0.1.2}/PKG-INFO +5 -6
  2. {waldiez-0.1.0 → waldiez-0.1.2}/README.md +4 -5
  3. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/_version.py +1 -1
  4. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/chroma_utils.py +4 -1
  5. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/qdrant_utils.py +1 -1
  6. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/rag_user.py +16 -5
  7. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/__init__.py +2 -0
  8. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/object_string.py +2 -0
  9. waldiez-0.1.2/waldiez/exporting/utils/path_check.py +48 -0
  10. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/agent_data.py +2 -13
  11. {waldiez-0.1.0 → waldiez-0.1.2}/.gitignore +0 -0
  12. {waldiez-0.1.0 → waldiez-0.1.2}/LICENSE +0 -0
  13. {waldiez-0.1.0 → waldiez-0.1.2}/pyproject.toml +0 -0
  14. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/__init__.py +0 -0
  15. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/__main__.py +0 -0
  16. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/cli.py +0 -0
  17. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporter.py +0 -0
  18. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/__init__.py +0 -0
  19. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/__init__.py +0 -0
  20. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/agent.py +0 -0
  21. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/agent_skills.py +0 -0
  22. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/code_execution.py +0 -0
  23. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/group_manager.py +0 -0
  24. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/llm_config.py +0 -0
  25. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/__init__.py +0 -0
  26. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/mongo_utils.py +0 -0
  27. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/pgvector_utils.py +0 -0
  28. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/rag_user/vector_db.py +0 -0
  29. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/teachability.py +0 -0
  30. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/agents/termination_message.py +0 -0
  31. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/chats/__init__.py +0 -0
  32. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/chats/chats.py +0 -0
  33. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/chats/helpers.py +0 -0
  34. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/chats/nested.py +0 -0
  35. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/flow/__init__.py +0 -0
  36. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/flow/def_main.py +0 -0
  37. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/flow/flow.py +0 -0
  38. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/models/__init__.py +0 -0
  39. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/skills/__init__.py +0 -0
  40. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/comments.py +0 -0
  41. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/importing.py +0 -0
  42. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/logging_utils.py +0 -0
  43. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/method_utils.py +0 -0
  44. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/exporting/utils/naming.py +0 -0
  45. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/io_stream.py +0 -0
  46. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/__init__.py +0 -0
  47. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/__init__.py +0 -0
  48. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/__init__.py +0 -0
  49. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/agent.py +0 -0
  50. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/code_execution.py +0 -0
  51. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/linked_skill.py +0 -0
  52. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/nested_chat.py +0 -0
  53. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/teachability.py +0 -0
  54. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agent/termination_message.py +0 -0
  55. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/agents.py +0 -0
  56. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/assistant/__init__.py +0 -0
  57. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/assistant/assistant.py +0 -0
  58. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/assistant/assistant_data.py +0 -0
  59. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/group_manager/__init__.py +0 -0
  60. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/group_manager/group_manager.py +0 -0
  61. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/group_manager/group_manager_data.py +0 -0
  62. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/group_manager/speakers.py +0 -0
  63. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/rag_user/__init__.py +0 -0
  64. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/rag_user/rag_user.py +0 -0
  65. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/rag_user/rag_user_data.py +0 -0
  66. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/rag_user/retrieve_config.py +0 -0
  67. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/rag_user/vector_db_config.py +0 -0
  68. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/user_proxy/__init__.py +0 -0
  69. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/user_proxy/user_proxy.py +0 -0
  70. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/agents/user_proxy/user_proxy_data.py +0 -0
  71. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/chat/__init__.py +0 -0
  72. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/chat/chat.py +0 -0
  73. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/chat/chat_data.py +0 -0
  74. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/chat/chat_message.py +0 -0
  75. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/chat/chat_nested.py +0 -0
  76. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/chat/chat_summary.py +0 -0
  77. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/common/__init__.py +0 -0
  78. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/common/base.py +0 -0
  79. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/common/method_utils.py +0 -0
  80. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/flow/__init__.py +0 -0
  81. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/flow/flow.py +0 -0
  82. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/flow/flow_data.py +0 -0
  83. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/model/__init__.py +0 -0
  84. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/model/model.py +0 -0
  85. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/model/model_data.py +0 -0
  86. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/skill/__init__.py +0 -0
  87. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/skill/skill.py +0 -0
  88. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/skill/skill_data.py +0 -0
  89. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/models/waldiez.py +0 -0
  90. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/py.typed +0 -0
  91. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/runner.py +0 -0
  92. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/stream/__init__.py +0 -0
  93. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/stream/consumer.py +0 -0
  94. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/stream/provider.py +0 -0
  95. {waldiez-0.1.0 → waldiez-0.1.2}/waldiez/stream/server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: waldiez
3
- Version: 0.1.0
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
- ![CI Build](https://github.com/waldiez/py/actions/workflows/main.yaml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/waldiez/py/badge.svg)](https://coveralls.io/github/waldiez/py)
77
+ ![CI Build](https://github.com/waldiez/py/actions/workflows/main.yaml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/waldiez/py/badge.svg)](https://coveralls.io/github/waldiez/py) [![PyPI version](https://badge.fury.io/py/waldiez.svg)](https://badge.fury.io/py/waldiez)
78
78
 
79
79
  Translate a Waldiez flow:
80
80
 
81
- [![Flow](./docs/flow.png)](./docs/flow.png)
81
+ ![Flow](https://raw.githubusercontent.com/waldiez/py/refs/heads/main/docs/flow.png)
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 this repository:
100
+ From the repository:
102
101
 
103
102
  ```bash
104
103
  python -m pip install git+https://github.com/waldiez/py.git
@@ -1,10 +1,10 @@
1
1
  # Waldiez
2
2
 
3
- ![CI Build](https://github.com/waldiez/py/actions/workflows/main.yaml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/waldiez/py/badge.svg)](https://coveralls.io/github/waldiez/py)
3
+ ![CI Build](https://github.com/waldiez/py/actions/workflows/main.yaml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/waldiez/py/badge.svg)](https://coveralls.io/github/waldiez/py) [![PyPI version](https://badge.fury.io/py/waldiez.svg)](https://badge.fury.io/py/waldiez)
4
4
 
5
5
  Translate a Waldiez flow:
6
6
 
7
- [![Flow](./docs/flow.png)](./docs/flow.png)
7
+ ![Flow](https://raw.githubusercontent.com/waldiez/py/refs/heads/main/docs/flow.png)
8
8
 
9
9
  To a python script or a jupyter notebook with the corresponding [autogen](https://github.com/microsoft/autogen/) agents and chats.
10
10
 
@@ -17,14 +17,13 @@ To a python script or a jupyter notebook with the corresponding [autogen](https:
17
17
 
18
18
  ## Installation
19
19
 
20
- <!--
21
20
  On PyPI:
22
21
 
23
22
  ```bash
24
23
  python -m pip install waldiez
25
- ``` -->
24
+ ```
26
25
 
27
- From this repository:
26
+ From the repository:
28
27
 
29
28
  ```bash
30
29
  python -m pip install git+https://github.com/waldiez/py.git
@@ -1,3 +1,3 @@
1
1
  """Version information for Waldiez."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.2"
@@ -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",
@@ -74,6 +74,8 @@ def get_object_string(obj: Any, tabs: int = 1) -> str:
74
74
  return f"[{to_return}]"
75
75
 
76
76
  if isinstance(obj, str):
77
+ if obj.startswith("r'") or obj.startswith('r"'):
78
+ return obj
77
79
  return f'"{obj}"'
78
80
 
79
81
  if obj is None:
@@ -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="forbid",
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(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes