waldiez 0.5.10__py3-none-any.whl → 0.6.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.

Files changed (192) hide show
  1. waldiez/__init__.py +1 -1
  2. waldiez/_version.py +1 -1
  3. waldiez/cli.py +19 -7
  4. waldiez/cli_extras/jupyter.py +3 -0
  5. waldiez/cli_extras/runner.py +3 -1
  6. waldiez/cli_extras/studio.py +3 -1
  7. waldiez/exporter.py +9 -3
  8. waldiez/exporting/agent/exporter.py +15 -16
  9. waldiez/exporting/agent/extras/captain_agent_extras.py +6 -6
  10. waldiez/exporting/agent/extras/doc_agent_extras.py +6 -6
  11. waldiez/exporting/agent/extras/group_manager_agent_extas.py +40 -24
  12. waldiez/exporting/agent/extras/group_member_extras.py +6 -5
  13. waldiez/exporting/agent/extras/handoffs/after_work.py +2 -1
  14. waldiez/exporting/agent/extras/handoffs/available.py +2 -1
  15. waldiez/exporting/agent/extras/handoffs/condition.py +3 -2
  16. waldiez/exporting/agent/extras/handoffs/handoff.py +2 -1
  17. waldiez/exporting/agent/extras/handoffs/target.py +7 -4
  18. waldiez/exporting/agent/extras/rag/chroma_extras.py +27 -19
  19. waldiez/exporting/agent/extras/rag/mongo_extras.py +8 -8
  20. waldiez/exporting/agent/extras/rag/pgvector_extras.py +5 -5
  21. waldiez/exporting/agent/extras/rag/qdrant_extras.py +5 -4
  22. waldiez/exporting/agent/extras/rag/vector_db_extras.py +1 -1
  23. waldiez/exporting/agent/extras/rag_user_proxy_agent_extras.py +5 -7
  24. waldiez/exporting/agent/extras/reasoning_agent_extras.py +3 -5
  25. waldiez/exporting/agent/termination.py +1 -0
  26. waldiez/exporting/chats/exporter.py +4 -4
  27. waldiez/exporting/chats/processor.py +1 -2
  28. waldiez/exporting/chats/utils/common.py +89 -48
  29. waldiez/exporting/chats/utils/group.py +9 -9
  30. waldiez/exporting/chats/utils/nested.py +7 -7
  31. waldiez/exporting/chats/utils/sequential.py +1 -1
  32. waldiez/exporting/chats/utils/single.py +2 -2
  33. waldiez/exporting/core/constants.py +3 -1
  34. waldiez/exporting/core/content.py +7 -7
  35. waldiez/exporting/core/context.py +5 -3
  36. waldiez/exporting/core/exporter.py +5 -3
  37. waldiez/exporting/core/exporters.py +2 -2
  38. waldiez/exporting/core/extras/agent_extras/captain_extras.py +2 -2
  39. waldiez/exporting/core/extras/agent_extras/group_manager_extras.py +2 -2
  40. waldiez/exporting/core/extras/agent_extras/rag_user_extras.py +2 -2
  41. waldiez/exporting/core/extras/agent_extras/standard_extras.py +3 -8
  42. waldiez/exporting/core/extras/base.py +7 -5
  43. waldiez/exporting/core/extras/flow_extras.py +4 -5
  44. waldiez/exporting/core/extras/model_extras.py +2 -2
  45. waldiez/exporting/core/extras/path_resolver.py +1 -2
  46. waldiez/exporting/core/extras/serializer.py +13 -11
  47. waldiez/exporting/core/protocols.py +6 -5
  48. waldiez/exporting/core/result.py +25 -28
  49. waldiez/exporting/core/types.py +11 -10
  50. waldiez/exporting/core/utils/llm_config.py +4 -4
  51. waldiez/exporting/core/validation.py +10 -11
  52. waldiez/exporting/flow/execution_generator.py +99 -10
  53. waldiez/exporting/flow/exporter.py +2 -2
  54. waldiez/exporting/flow/factory.py +2 -2
  55. waldiez/exporting/flow/file_generator.py +4 -2
  56. waldiez/exporting/flow/merger.py +5 -3
  57. waldiez/exporting/flow/orchestrator.py +72 -2
  58. waldiez/exporting/flow/utils/common.py +6 -6
  59. waldiez/exporting/flow/utils/importing.py +7 -8
  60. waldiez/exporting/flow/utils/linting.py +25 -9
  61. waldiez/exporting/flow/utils/logging.py +5 -77
  62. waldiez/exporting/models/exporter.py +8 -8
  63. waldiez/exporting/models/processor.py +5 -5
  64. waldiez/exporting/tools/exporter.py +2 -2
  65. waldiez/exporting/tools/processor.py +7 -4
  66. waldiez/io/__init__.py +11 -5
  67. waldiez/io/_ws.py +12 -6
  68. waldiez/io/models/constants.py +10 -10
  69. waldiez/io/models/content/audio.py +1 -0
  70. waldiez/io/models/content/base.py +20 -18
  71. waldiez/io/models/content/file.py +1 -0
  72. waldiez/io/models/content/image.py +1 -0
  73. waldiez/io/models/content/text.py +1 -0
  74. waldiez/io/models/content/video.py +1 -0
  75. waldiez/io/models/user_input.py +10 -5
  76. waldiez/io/models/user_response.py +17 -16
  77. waldiez/io/mqtt.py +18 -31
  78. waldiez/io/redis.py +18 -22
  79. waldiez/io/structured.py +122 -70
  80. waldiez/io/utils.py +19 -10
  81. waldiez/io/ws.py +7 -3
  82. waldiez/logger.py +16 -3
  83. waldiez/models/agents/__init__.py +3 -0
  84. waldiez/models/agents/agent/agent.py +25 -17
  85. waldiez/models/agents/agent/agent_data.py +25 -22
  86. waldiez/models/agents/agent/code_execution.py +9 -11
  87. waldiez/models/agents/agent/termination_message.py +10 -12
  88. waldiez/models/agents/agent/update_system_message.py +2 -4
  89. waldiez/models/agents/agents.py +8 -8
  90. waldiez/models/agents/assistant/assistant.py +6 -3
  91. waldiez/models/agents/assistant/assistant_data.py +2 -2
  92. waldiez/models/agents/captain/captain_agent.py +7 -4
  93. waldiez/models/agents/captain/captain_agent_data.py +5 -7
  94. waldiez/models/agents/doc_agent/doc_agent.py +7 -4
  95. waldiez/models/agents/doc_agent/doc_agent_data.py +9 -10
  96. waldiez/models/agents/doc_agent/rag_query_engine.py +10 -12
  97. waldiez/models/agents/extra_requirements.py +3 -3
  98. waldiez/models/agents/group_manager/group_manager.py +12 -7
  99. waldiez/models/agents/group_manager/group_manager_data.py +13 -12
  100. waldiez/models/agents/group_manager/speakers.py +17 -19
  101. waldiez/models/agents/rag_user_proxy/rag_user_proxy.py +7 -4
  102. waldiez/models/agents/rag_user_proxy/rag_user_proxy_data.py +4 -1
  103. waldiez/models/agents/rag_user_proxy/retrieve_config.py +69 -63
  104. waldiez/models/agents/rag_user_proxy/vector_db_config.py +19 -19
  105. waldiez/models/agents/reasoning/reasoning_agent.py +7 -4
  106. waldiez/models/agents/reasoning/reasoning_agent_data.py +3 -2
  107. waldiez/models/agents/reasoning/reasoning_agent_reason_config.py +8 -8
  108. waldiez/models/agents/user_proxy/user_proxy.py +6 -3
  109. waldiez/models/agents/user_proxy/user_proxy_data.py +1 -1
  110. waldiez/models/chat/chat.py +28 -20
  111. waldiez/models/chat/chat_data.py +22 -21
  112. waldiez/models/chat/chat_message.py +9 -9
  113. waldiez/models/chat/chat_nested.py +9 -9
  114. waldiez/models/chat/chat_summary.py +6 -6
  115. waldiez/models/common/__init__.py +2 -0
  116. waldiez/models/common/ag2_version.py +2 -0
  117. waldiez/models/common/base.py +2 -0
  118. waldiez/models/common/dict_utils.py +8 -6
  119. waldiez/models/common/handoff.py +20 -17
  120. waldiez/models/common/method_utils.py +9 -7
  121. waldiez/models/common/naming.py +49 -0
  122. waldiez/models/flow/flow.py +11 -6
  123. waldiez/models/flow/flow_data.py +23 -17
  124. waldiez/models/flow/info.py +3 -3
  125. waldiez/models/flow/naming.py +2 -1
  126. waldiez/models/model/_aws.py +11 -13
  127. waldiez/models/model/_llm.py +8 -0
  128. waldiez/models/model/_price.py +2 -4
  129. waldiez/models/model/extra_requirements.py +1 -3
  130. waldiez/models/model/model.py +2 -2
  131. waldiez/models/model/model_data.py +21 -21
  132. waldiez/models/tool/extra_requirements.py +2 -4
  133. waldiez/models/tool/predefined/_duckduckgo.py +1 -0
  134. waldiez/models/tool/predefined/_email.py +4 -0
  135. waldiez/models/tool/predefined/_google.py +1 -0
  136. waldiez/models/tool/predefined/_perplexity.py +2 -1
  137. waldiez/models/tool/predefined/_searxng.py +2 -1
  138. waldiez/models/tool/predefined/_tavily.py +1 -0
  139. waldiez/models/tool/predefined/_wikipedia.py +2 -1
  140. waldiez/models/tool/predefined/_youtube.py +1 -0
  141. waldiez/models/tool/tool.py +8 -5
  142. waldiez/models/tool/tool_data.py +2 -2
  143. waldiez/models/waldiez.py +152 -4
  144. waldiez/runner.py +11 -5
  145. waldiez/running/async_utils.py +192 -0
  146. waldiez/running/base_runner.py +155 -241
  147. waldiez/running/dir_utils.py +52 -0
  148. waldiez/running/environment.py +10 -44
  149. waldiez/running/events_mixin.py +252 -0
  150. waldiez/running/exceptions.py +20 -0
  151. waldiez/running/gen_seq_diagram.py +18 -15
  152. waldiez/running/io_utils.py +216 -0
  153. waldiez/running/protocol.py +11 -5
  154. waldiez/running/requirements_mixin.py +65 -0
  155. waldiez/running/results_mixin.py +926 -0
  156. waldiez/running/standard_runner.py +24 -27
  157. waldiez/running/step_by_step/breakpoints_mixin.py +503 -47
  158. waldiez/running/step_by_step/command_handler.py +154 -0
  159. waldiez/running/step_by_step/events_processor.py +379 -0
  160. waldiez/running/step_by_step/step_by_step_models.py +425 -41
  161. waldiez/running/step_by_step/step_by_step_runner.py +437 -382
  162. waldiez/running/subprocess_runner/__base__.py +13 -8
  163. waldiez/running/subprocess_runner/_async_runner.py +6 -4
  164. waldiez/running/subprocess_runner/_sync_runner.py +11 -6
  165. waldiez/running/subprocess_runner/runner.py +48 -23
  166. waldiez/running/timeline_processor.py +1 -1
  167. waldiez/utils/__init__.py +2 -0
  168. waldiez/utils/conflict_checker.py +4 -4
  169. waldiez/utils/python_manager.py +415 -0
  170. waldiez/ws/__init__.py +8 -7
  171. waldiez/ws/_file_handler.py +18 -20
  172. waldiez/ws/_mock.py +75 -0
  173. waldiez/ws/cli.py +58 -10
  174. waldiez/ws/client_manager.py +77 -53
  175. waldiez/ws/errors.py +3 -0
  176. waldiez/ws/models.py +61 -53
  177. waldiez/ws/reloader.py +33 -4
  178. waldiez/ws/server.py +121 -52
  179. waldiez/ws/session_manager.py +8 -9
  180. waldiez/ws/session_stats.py +1 -1
  181. waldiez/ws/utils.py +33 -5
  182. {waldiez-0.5.10.dist-info → waldiez-0.6.1.dist-info}/METADATA +107 -109
  183. waldiez-0.6.1.dist-info/RECORD +254 -0
  184. waldiez/running/post_run.py +0 -180
  185. waldiez/running/pre_run.py +0 -159
  186. waldiez/running/run_results.py +0 -14
  187. waldiez/running/utils.py +0 -511
  188. waldiez-0.5.10.dist-info/RECORD +0 -248
  189. {waldiez-0.5.10.dist-info → waldiez-0.6.1.dist-info}/WHEEL +0 -0
  190. {waldiez-0.5.10.dist-info → waldiez-0.6.1.dist-info}/entry_points.txt +0 -0
  191. {waldiez-0.5.10.dist-info → waldiez-0.6.1.dist-info}/licenses/LICENSE +0 -0
  192. {waldiez-0.5.10.dist-info → waldiez-0.6.1.dist-info}/licenses/NOTICE.md +0 -0
@@ -1,5 +1,8 @@
1
1
  # SPDX-License-Identifier: Apache-2.0.
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
+
4
+ # pyright: reportArgumentType=false,reportIncompatibleVariableOverride=false
5
+
3
6
  """Document agent model."""
4
7
 
5
8
  from typing import Literal
@@ -23,7 +26,7 @@ class WaldiezDocAgent(WaldiezAgent):
23
26
  Extends `WaldiezAgent`.
24
27
  """
25
28
 
26
- agent_type: Annotated[ # pyright: ignore
29
+ agent_type: Annotated[
27
30
  Literal["doc_agent"],
28
31
  Field(
29
32
  default="doc_agent",
@@ -31,13 +34,13 @@ class WaldiezDocAgent(WaldiezAgent):
31
34
  description="The agent type: 'doc_agent' for a document agent",
32
35
  alias="agentType",
33
36
  ),
34
- ] = "doc_agent"
35
- data: Annotated[ # pyright: ignore
37
+ ]
38
+ data: Annotated[
36
39
  WaldiezDocAgentData,
37
40
  Field(
38
41
  title="Data",
39
42
  description="The document agent's data",
40
- default_factory=WaldiezDocAgentData, # pyright: ignore
43
+ default_factory=WaldiezDocAgentData,
41
44
  ),
42
45
  ]
43
46
 
@@ -3,7 +3,6 @@
3
3
  """Document agent data model."""
4
4
 
5
5
  from pathlib import Path
6
- from typing import Optional, Union
7
6
 
8
7
  from pydantic import Field, model_validator
9
8
  from typing_extensions import Annotated, Self
@@ -25,14 +24,14 @@ class WaldiezDocAgentData(WaldiezAgentData):
25
24
  """
26
25
 
27
26
  collection_name: Annotated[
28
- Optional[str],
27
+ str | None,
29
28
  Field(
30
29
  title="Collection Name",
31
30
  description="The name of the collection for the document agent.",
32
31
  default=None,
33
32
  alias="collectionName",
34
33
  ),
35
- ] = None
34
+ ]
36
35
  reset_collection: Annotated[
37
36
  bool,
38
37
  Field(
@@ -43,9 +42,9 @@ class WaldiezDocAgentData(WaldiezAgentData):
43
42
  default=False,
44
43
  alias="resetCollection",
45
44
  ),
46
- ] = False
45
+ ]
47
46
  parsed_docs_path: Annotated[
48
- Optional[Union[str, Path]],
47
+ str | Path | None,
49
48
  Field(
50
49
  title="Parsed Documents Path",
51
50
  description=(
@@ -54,16 +53,16 @@ class WaldiezDocAgentData(WaldiezAgentData):
54
53
  default=None,
55
54
  alias="parsedDocsPath",
56
55
  ),
57
- ] = None
56
+ ]
58
57
  query_engine: Annotated[
59
- Optional[WaldiezDocAgentQueryEngine],
58
+ WaldiezDocAgentQueryEngine | None,
60
59
  Field(
61
60
  title="Query Engine",
62
61
  description="The query engine to use for the document agent.",
63
62
  default=None,
64
63
  alias="queryEngine",
65
64
  ),
66
- ] = None
65
+ ]
67
66
 
68
67
  @model_validator(mode="after")
69
68
  def validate_parsed_docs_path(self) -> Self:
@@ -129,13 +128,13 @@ class WaldiezDocAgentData(WaldiezAgentData):
129
128
 
130
129
 
131
130
  def get_parsed_docs_path(
132
- parsed_docs_path: Optional[Union[str, Path]] = None,
131
+ parsed_docs_path: str | Path | None = None,
133
132
  ) -> str:
134
133
  """Get the parsed documents path for the document agent.
135
134
 
136
135
  Parameters
137
136
  ----------
138
- parsed_docs_path : Optional[Union[str, Path]]
137
+ parsed_docs_path : str | Path | None
139
138
  The path to the parsed documents.
140
139
 
141
140
  Returns
@@ -3,7 +3,6 @@
3
3
  """Document agent data model."""
4
4
 
5
5
  from pathlib import Path
6
- from typing import Optional, Union
7
6
 
8
7
  from platformdirs import user_data_dir
9
8
  from pydantic import Field, model_validator
@@ -19,24 +18,23 @@ class WaldiezDocAgentQueryEngine(WaldiezBase):
19
18
  """
20
19
 
21
20
  type: Annotated[
22
- Optional[
23
- Literal[
24
- "VectorChromaQueryEngine",
25
- "VectorChromaCitationQueryEngine",
26
- "InMemoryQueryEngine",
27
- ]
28
- ],
21
+ Literal[
22
+ "VectorChromaQueryEngine",
23
+ "VectorChromaCitationQueryEngine",
24
+ "InMemoryQueryEngine",
25
+ ]
26
+ | None,
29
27
  "RAG Query Engine type",
30
28
  ] = "VectorChromaQueryEngine"
31
29
  db_path: Annotated[
32
- Optional[Union[str, Path]],
30
+ str | Path | None,
33
31
  Field(
34
32
  title="Database Path",
35
33
  description="The path to the database for the query engine.",
36
34
  default=None,
37
35
  alias="dbPath",
38
36
  ),
39
- ] = None
37
+ ]
40
38
  enable_query_citations: Annotated[
41
39
  bool,
42
40
  Field(
@@ -47,7 +45,7 @@ class WaldiezDocAgentQueryEngine(WaldiezBase):
47
45
  default=False,
48
46
  alias="enableQueryCitations",
49
47
  ),
50
- ] = False
48
+ ]
51
49
  citation_chunk_size: Annotated[
52
50
  int,
53
51
  Field(
@@ -56,7 +54,7 @@ class WaldiezDocAgentQueryEngine(WaldiezBase):
56
54
  default=512,
57
55
  alias="citationChunkSize",
58
56
  ),
59
- ] = 512
57
+ ]
60
58
 
61
59
  @model_validator(mode="after")
62
60
  def validate_db_path(self) -> Self:
@@ -1,9 +1,9 @@
1
1
  # SPDX-License-Identifier: Apache-2.0.
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
- """Extra requirements for agents."""
3
+
4
4
  # pylint: disable=line-too-long
5
5
 
6
- from typing import Set
6
+ """Extra requirements for agents."""
7
7
 
8
8
  from .agent import WaldiezAgent
9
9
  from .rag_user_proxy import WaldiezRagUserProxy
@@ -26,7 +26,7 @@ def get_retrievechat_extra_requirements(
26
26
  """
27
27
  # https://github.com/ag2ai/ag2/blob/main/pyproject.toml
28
28
  # with chromadb and sentence_transdormers relaxed
29
- rag_requirements: Set[str] = {
29
+ rag_requirements: set[str] = {
30
30
  "protobuf==5.29.3",
31
31
  "chromadb>=0.5.23",
32
32
  "sentence_transformers",
@@ -1,5 +1,8 @@
1
1
  # SPDX-License-Identifier: Apache-2.0.
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
+
4
+ # pyright: reportArgumentType=false,reportIncompatibleVariableOverride=false
5
+
3
6
  """Group chat manager agent."""
4
7
 
5
8
  import warnings
@@ -29,23 +32,23 @@ class WaldiezGroupManager(WaldiezAgent):
29
32
  The group manager agent's data.
30
33
  """
31
34
 
32
- agent_type: Annotated[ # pyright: ignore
35
+ agent_type: Annotated[
33
36
  Literal["group_manager", "manager"],
34
37
  Field(
35
- "manager",
38
+ "group_manager",
36
39
  title="Agent type",
37
40
  description=(
38
41
  "The agent type: 'group_manager' for a group manager agent"
39
42
  ),
40
43
  alias="agentType",
41
44
  ),
42
- ] = "group_manager"
43
- data: Annotated[ # pyright: ignore
45
+ ]
46
+ data: Annotated[
44
47
  WaldiezGroupManagerData,
45
48
  Field(
46
49
  title="Data",
47
50
  description="The group manager agent's data",
48
- default_factory=WaldiezGroupManagerData, # pyright: ignore
51
+ default_factory=WaldiezGroupManagerData,
49
52
  ),
50
53
  ]
51
54
 
@@ -83,10 +86,11 @@ class WaldiezGroupManager(WaldiezAgent):
83
86
  stacklevel=2,
84
87
  )
85
88
  if v != "group_manager": # pragma: no cover
86
- raise ValueError(
89
+ msg = (
87
90
  "The agent type must be 'group_manager'. "
88
91
  "Use 'group_manager' instead."
89
92
  )
93
+ raise ValueError(msg)
90
94
  return "group_manager"
91
95
 
92
96
  def validate_initial_agent_id(self, all_agent_ids: list[str]) -> None:
@@ -106,10 +110,11 @@ class WaldiezGroupManager(WaldiezAgent):
106
110
  """
107
111
  initial_agent_id = self.data.initial_agent_id
108
112
  if initial_agent_id not in all_agent_ids:
109
- raise ValueError(
113
+ msg = (
110
114
  f"Initial agent ID '{initial_agent_id}' "
111
115
  f"is not in the list of agent IDs: {all_agent_ids}"
112
116
  )
117
+ raise ValueError(msg)
113
118
 
114
119
  def get_speakers_order(self) -> list[str]:
115
120
  """Get the order of the speakers.
@@ -1,8 +1,9 @@
1
1
  # SPDX-License-Identifier: Apache-2.0.
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
- """Group chat manager data."""
4
3
 
5
- from typing import Optional
4
+ # pyright: reportArgumentType=false
5
+
6
+ """Group chat manager data."""
6
7
 
7
8
  from pydantic import Field
8
9
  from typing_extensions import Annotated, Literal
@@ -47,7 +48,7 @@ class WaldiezGroupManagerData(WaldiezAgentData):
47
48
  description="The human input mode, Defaults to `NEVER`",
48
49
  alias="humanInputMode",
49
50
  ),
50
- ] = "NEVER"
51
+ ]
51
52
  max_round: Annotated[
52
53
  int,
53
54
  Field(
@@ -56,9 +57,9 @@ class WaldiezGroupManagerData(WaldiezAgentData):
56
57
  description="The maximum number of rounds to have in the group.",
57
58
  alias="maxRound",
58
59
  ),
59
- ] = 20
60
+ ]
60
61
  admin_name: Annotated[
61
- Optional[str],
62
+ str | None,
62
63
  Field(
63
64
  default=None,
64
65
  title="Group Admin name",
@@ -68,24 +69,24 @@ class WaldiezGroupManagerData(WaldiezAgentData):
68
69
  ),
69
70
  alias="adminName",
70
71
  ),
71
- ] = None
72
+ ]
72
73
  speakers: Annotated[
73
74
  WaldiezGroupManagerSpeakers,
74
75
  Field(
75
76
  title="Speakers",
76
77
  description="The rules for the speaker selection and repetition",
77
- default_factory=WaldiezGroupManagerSpeakers, # pyright: ignore
78
+ default_factory=WaldiezGroupManagerSpeakers,
78
79
  ),
79
80
  ]
80
81
  enable_clear_history: Annotated[
81
- Optional[bool],
82
+ bool | None,
82
83
  Field(
83
84
  default=None,
84
85
  title="Enable clear history",
85
86
  description="Enable clearing the history in the chat group.",
86
87
  alias="enableClearHistory",
87
88
  ),
88
- ] = None
89
+ ]
89
90
  send_introductions: Annotated[
90
91
  bool,
91
92
  Field(
@@ -94,16 +95,16 @@ class WaldiezGroupManagerData(WaldiezAgentData):
94
95
  description="Send the group members' introductions.",
95
96
  alias="sendIntroductions",
96
97
  ),
97
- ] = False
98
+ ]
98
99
  group_name: Annotated[
99
- Optional[str],
100
+ str | None,
100
101
  Field(
101
102
  default=None,
102
103
  title="Group name",
103
104
  description="The name of the group.",
104
105
  alias="groupName",
105
106
  ),
106
- ] = None
107
+ ]
107
108
  initial_agent_id: Annotated[
108
109
  str,
109
110
  Field(
@@ -2,8 +2,6 @@
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
3
  """Group chat speakers."""
4
4
 
5
- from typing import Optional, Union
6
-
7
5
  from pydantic import Field, model_validator
8
6
  from typing_extensions import Annotated, Literal, Self
9
7
 
@@ -61,7 +59,7 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
61
59
  ----------
62
60
  selection_method : WaldiezGroupManagerSpeakersSelectionMethod
63
61
  The next speaker selection method.
64
- selection_custom_method : Optional[str]
62
+ selection_custom_method : str | None
65
63
  Method for custom selection.
66
64
  max_retries_for_selecting : Optional[int]
67
65
  Max retries for selecting a speaker.
@@ -85,9 +83,9 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
85
83
  description="The next speaker selection method",
86
84
  alias="selectionMethod",
87
85
  ),
88
- ] = "auto"
86
+ ]
89
87
  selection_custom_method: Annotated[
90
- Optional[str],
88
+ str | None,
91
89
  Field(
92
90
  default=None,
93
91
  title="Method for custom selection.",
@@ -102,9 +100,9 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
102
100
  ),
103
101
  alias="selectionCustomMethod",
104
102
  ),
105
- ] = None
103
+ ]
106
104
  max_retries_for_selecting: Annotated[
107
- Optional[int],
105
+ int | None,
108
106
  Field(
109
107
  default=None,
110
108
  title="Max retries for a selecting",
@@ -114,7 +112,7 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
114
112
  ),
115
113
  alias="maxRetriesForSelecting",
116
114
  ),
117
- ] = None
115
+ ]
118
116
  selection_mode: Annotated[
119
117
  WaldiezGroupManagerSpeakersSelectionMode,
120
118
  Field(
@@ -127,9 +125,9 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
127
125
  ),
128
126
  alias="selectionMode",
129
127
  ),
130
- ] = "repeat"
128
+ ]
131
129
  allow_repeat: Annotated[
132
- Union[bool, list[str]],
130
+ bool | list[str] | None,
133
131
  Field(
134
132
  default=True,
135
133
  title="Allow repeat",
@@ -139,7 +137,7 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
139
137
  ),
140
138
  alias="allowRepeat",
141
139
  ),
142
- ] = True
140
+ ]
143
141
  allowed_or_disallowed_transitions: Annotated[
144
142
  dict[str, list[str]],
145
143
  Field(
@@ -151,7 +149,7 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
151
149
  ),
152
150
  alias="allowedOrDisallowedTransitions",
153
151
  ),
154
- ] = {}
152
+ ]
155
153
  transitions_type: Annotated[
156
154
  WaldiezGroupManagerSpeakersTransitionsType,
157
155
  Field(
@@ -164,7 +162,7 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
164
162
  ),
165
163
  alias="transitionsType",
166
164
  ),
167
- ] = "allowed"
165
+ ]
168
166
  order: Annotated[
169
167
  list[str],
170
168
  Field(
@@ -176,12 +174,12 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
176
174
  "will be determined by the order of the agents in the flow."
177
175
  ),
178
176
  ),
179
- ] = []
180
- _custom_method_string: Optional[str] = None
181
- _order: Optional[list[str]] = None
177
+ ]
178
+ _custom_method_string: str | None = None
179
+ _order: list[str] | None = None
182
180
 
183
181
  @property
184
- def custom_method_string(self) -> Optional[str]:
182
+ def custom_method_string(self) -> str | None:
185
183
  """Get the custom method string.
186
184
 
187
185
  Returns
@@ -193,8 +191,8 @@ class WaldiezGroupManagerSpeakers(WaldiezBase):
193
191
 
194
192
  def get_custom_method_function(
195
193
  self,
196
- name_prefix: Optional[str] = None,
197
- name_suffix: Optional[str] = None,
194
+ name_prefix: str | None = None,
195
+ name_suffix: str | None = None,
198
196
  ) -> tuple[str, str]:
199
197
  """Get the custom method function.
200
198
 
@@ -1,5 +1,8 @@
1
1
  # SPDX-License-Identifier: Apache-2.0.
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
+
4
+ # pyright: reportArgumentType=false,reportIncompatibleVariableOverride=false
5
+
3
6
  """RAG user agent.
4
7
 
5
8
  It extends a user agent and has RAG related parameters (`retrieve_config`).
@@ -27,7 +30,7 @@ class WaldiezRagUserProxy(WaldiezAgent):
27
30
  See `WaldiezRagUserProxyData` for more info.
28
31
  """
29
32
 
30
- agent_type: Annotated[ # pyright: ignore
33
+ agent_type: Annotated[
31
34
  Literal["rag_user", "rag_user_proxy"],
32
35
  Field(
33
36
  "rag_user_proxy",
@@ -39,14 +42,14 @@ class WaldiezRagUserProxy(WaldiezAgent):
39
42
  ),
40
43
  alias="agentType",
41
44
  ),
42
- ] = "rag_user_proxy"
45
+ ]
43
46
 
44
- data: Annotated[ # pyright: ignore
47
+ data: Annotated[
45
48
  WaldiezRagUserProxyData,
46
49
  Field(
47
50
  title="Data",
48
51
  description="The RAG user agent's data",
49
- default_factory=WaldiezRagUserProxyData, # pyright: ignore
52
+ default_factory=WaldiezRagUserProxyData,
50
53
  ),
51
54
  ]
52
55
 
@@ -1,5 +1,8 @@
1
1
  # SPDX-License-Identifier: Apache-2.0.
2
2
  # Copyright (c) 2024 - 2025 Waldiez and contributors.
3
+
4
+ # pyright: reportArgumentType=false
5
+
3
6
  """Waldiez RAG user agent data."""
4
7
 
5
8
  from pydantic import Field
@@ -27,7 +30,7 @@ class WaldiezRagUserProxyData(WaldiezUserProxyData):
27
30
  Field(
28
31
  title="Retrieve Config",
29
32
  description="The RAG user agent's retrieve config",
30
- default_factory=WaldiezRagUserProxyRetrieveConfig, # pyright: ignore # noqa: E501
33
+ default_factory=WaldiezRagUserProxyRetrieveConfig,
31
34
  alias="retrieveConfig",
32
35
  ),
33
36
  ]