waldiez 0.2.2__py3-none-any.whl → 0.3.0__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 (138) hide show
  1. waldiez/__init__.py +2 -0
  2. waldiez/__main__.py +2 -0
  3. waldiez/_version.py +3 -1
  4. waldiez/cli.py +13 -3
  5. waldiez/cli_extras.py +4 -3
  6. waldiez/conflict_checker.py +4 -3
  7. waldiez/exporter.py +28 -105
  8. waldiez/exporting/__init__.py +8 -9
  9. waldiez/exporting/agent/__init__.py +7 -0
  10. waldiez/exporting/agent/agent_exporter.py +279 -0
  11. waldiez/exporting/agent/utils/__init__.py +23 -0
  12. waldiez/exporting/agent/utils/agent_class_name.py +34 -0
  13. waldiez/exporting/agent/utils/agent_imports.py +50 -0
  14. waldiez/exporting/{agents → agent/utils}/code_execution.py +9 -11
  15. waldiez/exporting/{agents → agent/utils}/group_manager.py +47 -35
  16. waldiez/exporting/{agents → agent/utils}/rag_user/__init__.py +2 -0
  17. waldiez/exporting/{agents → agent/utils}/rag_user/chroma_utils.py +22 -17
  18. waldiez/exporting/{agents → agent/utils}/rag_user/mongo_utils.py +14 -10
  19. waldiez/exporting/{agents → agent/utils}/rag_user/pgvector_utils.py +12 -8
  20. waldiez/exporting/{agents → agent/utils}/rag_user/qdrant_utils.py +11 -8
  21. waldiez/exporting/{agents → agent/utils}/rag_user/rag_user.py +78 -55
  22. waldiez/exporting/{agents → agent/utils}/rag_user/vector_db.py +10 -8
  23. waldiez/exporting/agent/utils/swarm_agent.py +463 -0
  24. waldiez/exporting/{agents → agent/utils}/teachability.py +10 -6
  25. waldiez/exporting/{agents → agent/utils}/termination_message.py +7 -8
  26. waldiez/exporting/base/__init__.py +25 -0
  27. waldiez/exporting/base/agent_position.py +75 -0
  28. waldiez/exporting/base/base_exporter.py +118 -0
  29. waldiez/exporting/base/export_position.py +48 -0
  30. waldiez/exporting/base/import_position.py +23 -0
  31. waldiez/exporting/base/mixin.py +134 -0
  32. waldiez/exporting/base/utils/__init__.py +18 -0
  33. waldiez/exporting/{utils → base/utils}/comments.py +12 -55
  34. waldiez/exporting/{utils → base/utils}/naming.py +14 -4
  35. waldiez/exporting/base/utils/path_check.py +68 -0
  36. waldiez/exporting/{utils/object_string.py → base/utils/to_string.py} +21 -20
  37. waldiez/exporting/chats/__init__.py +5 -12
  38. waldiez/exporting/chats/chats_exporter.py +240 -0
  39. waldiez/exporting/chats/utils/__init__.py +15 -0
  40. waldiez/exporting/chats/utils/common.py +81 -0
  41. waldiez/exporting/chats/{nested.py → utils/nested.py} +125 -86
  42. waldiez/exporting/chats/utils/sequential.py +244 -0
  43. waldiez/exporting/chats/utils/single_chat.py +313 -0
  44. waldiez/exporting/chats/utils/swarm.py +207 -0
  45. waldiez/exporting/flow/__init__.py +5 -3
  46. waldiez/exporting/flow/flow_exporter.py +503 -0
  47. waldiez/exporting/flow/utils/__init__.py +47 -0
  48. waldiez/exporting/flow/utils/agent_utils.py +204 -0
  49. waldiez/exporting/flow/utils/chat_utils.py +71 -0
  50. waldiez/exporting/flow/utils/def_main.py +62 -0
  51. waldiez/exporting/flow/utils/flow_content.py +112 -0
  52. waldiez/exporting/flow/utils/flow_names.py +115 -0
  53. waldiez/exporting/flow/utils/importing_utils.py +179 -0
  54. waldiez/exporting/{utils → flow/utils}/logging_utils.py +34 -31
  55. waldiez/exporting/models/__init__.py +7 -242
  56. waldiez/exporting/models/models_exporter.py +192 -0
  57. waldiez/exporting/models/utils.py +166 -0
  58. waldiez/exporting/skills/__init__.py +7 -161
  59. waldiez/exporting/skills/skills_exporter.py +169 -0
  60. waldiez/exporting/skills/utils.py +281 -0
  61. waldiez/models/__init__.py +25 -7
  62. waldiez/models/agents/__init__.py +70 -0
  63. waldiez/models/agents/agent/__init__.py +11 -1
  64. waldiez/models/agents/agent/agent.py +9 -4
  65. waldiez/models/agents/agent/agent_data.py +3 -1
  66. waldiez/models/agents/agent/code_execution.py +2 -0
  67. waldiez/models/agents/agent/linked_skill.py +2 -0
  68. waldiez/models/agents/agent/nested_chat.py +2 -0
  69. waldiez/models/agents/agent/teachability.py +2 -0
  70. waldiez/models/agents/agent/termination_message.py +49 -13
  71. waldiez/models/agents/agents.py +15 -3
  72. waldiez/models/agents/assistant/__init__.py +2 -0
  73. waldiez/models/agents/assistant/assistant.py +2 -0
  74. waldiez/models/agents/assistant/assistant_data.py +2 -0
  75. waldiez/models/agents/group_manager/__init__.py +9 -1
  76. waldiez/models/agents/group_manager/group_manager.py +2 -0
  77. waldiez/models/agents/group_manager/group_manager_data.py +2 -0
  78. waldiez/models/agents/group_manager/speakers.py +49 -13
  79. waldiez/models/agents/rag_user/__init__.py +21 -4
  80. waldiez/models/agents/rag_user/rag_user.py +3 -1
  81. waldiez/models/agents/rag_user/rag_user_data.py +2 -0
  82. waldiez/models/agents/rag_user/retrieve_config.py +268 -17
  83. waldiez/models/agents/rag_user/vector_db_config.py +5 -3
  84. waldiez/models/agents/swarm_agent/__init__.py +49 -0
  85. waldiez/models/agents/swarm_agent/after_work.py +178 -0
  86. waldiez/models/agents/swarm_agent/on_condition.py +103 -0
  87. waldiez/models/agents/swarm_agent/on_condition_available.py +140 -0
  88. waldiez/models/agents/swarm_agent/on_condition_target.py +40 -0
  89. waldiez/models/agents/swarm_agent/swarm_agent.py +107 -0
  90. waldiez/models/agents/swarm_agent/swarm_agent_data.py +125 -0
  91. waldiez/models/agents/swarm_agent/update_system_message.py +144 -0
  92. waldiez/models/agents/user_proxy/__init__.py +2 -0
  93. waldiez/models/agents/user_proxy/user_proxy.py +2 -0
  94. waldiez/models/agents/user_proxy/user_proxy_data.py +2 -0
  95. waldiez/models/chat/__init__.py +21 -3
  96. waldiez/models/chat/chat.py +241 -7
  97. waldiez/models/chat/chat_data.py +192 -48
  98. waldiez/models/chat/chat_message.py +153 -144
  99. waldiez/models/chat/chat_nested.py +33 -53
  100. waldiez/models/chat/chat_summary.py +2 -0
  101. waldiez/models/common/__init__.py +6 -6
  102. waldiez/models/common/base.py +4 -1
  103. waldiez/models/common/method_utils.py +163 -83
  104. waldiez/models/flow/__init__.py +2 -0
  105. waldiez/models/flow/flow.py +176 -40
  106. waldiez/models/flow/flow_data.py +63 -2
  107. waldiez/models/flow/utils.py +172 -0
  108. waldiez/models/model/__init__.py +2 -0
  109. waldiez/models/model/model.py +25 -6
  110. waldiez/models/model/model_data.py +3 -1
  111. waldiez/models/skill/__init__.py +4 -1
  112. waldiez/models/skill/skill.py +30 -2
  113. waldiez/models/skill/skill_data.py +2 -0
  114. waldiez/models/waldiez.py +28 -4
  115. waldiez/runner.py +142 -228
  116. waldiez/running/__init__.py +33 -0
  117. waldiez/running/environment.py +83 -0
  118. waldiez/running/gen_seq_diagram.py +185 -0
  119. waldiez/running/running.py +300 -0
  120. {waldiez-0.2.2.dist-info → waldiez-0.3.0.dist-info}/METADATA +32 -26
  121. waldiez-0.3.0.dist-info/RECORD +125 -0
  122. waldiez-0.3.0.dist-info/licenses/LICENSE +201 -0
  123. waldiez/exporting/agents/__init__.py +0 -5
  124. waldiez/exporting/agents/agent.py +0 -236
  125. waldiez/exporting/agents/agent_skills.py +0 -67
  126. waldiez/exporting/agents/llm_config.py +0 -53
  127. waldiez/exporting/chats/chats.py +0 -46
  128. waldiez/exporting/chats/helpers.py +0 -420
  129. waldiez/exporting/flow/def_main.py +0 -32
  130. waldiez/exporting/flow/flow.py +0 -189
  131. waldiez/exporting/utils/__init__.py +0 -36
  132. waldiez/exporting/utils/importing.py +0 -265
  133. waldiez/exporting/utils/method_utils.py +0 -35
  134. waldiez/exporting/utils/path_check.py +0 -51
  135. waldiez-0.2.2.dist-info/RECORD +0 -92
  136. waldiez-0.2.2.dist-info/licenses/LICENSE +0 -21
  137. {waldiez-0.2.2.dist-info → waldiez-0.3.0.dist-info}/WHEEL +0 -0
  138. {waldiez-0.2.2.dist-info → waldiez-0.3.0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,125 @@
1
+ waldiez/__init__.py,sha256=WrnR3f-FQ0mK2orSfyApwRs9UGfq1nYiohQTyLrX_hs,2149
2
+ waldiez/__main__.py,sha256=0dYzNrQbovRwQQvmZC6_1FDR1m71SUIOkTleO5tBnBw,203
3
+ waldiez/_version.py,sha256=hYl_P0IvGsJ8GonDWm3yBqvX4ADcfHQKDot-6Tl9sPc,155
4
+ waldiez/cli.py,sha256=SUdYLwNfG2TRnZr_E2gZ6SGczSQMIUdeIDzSZEYaw7o,6947
5
+ waldiez/cli_extras.py,sha256=cnMJnznNgTjtI_qKAlgLOzXaJSuzx7D_XNDzC1faKzw,3018
6
+ waldiez/conflict_checker.py,sha256=oF7PT2bdMGeIoj13cE2F6hn5dxhMhOutq34z8hCkZYg,976
7
+ waldiez/exporter.py,sha256=8EqLya3UqCA_F2TwtfdeRCt7ILnWxBcQvkMyX8no0BU,6501
8
+ waldiez/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ waldiez/runner.py,sha256=5J8bAdh2XaovM6xA8OW2jtfHXckjVUIE_9GtHn1UqzI,11038
10
+ waldiez/exporting/__init__.py,sha256=7dMoWMJ-Hv48ZmM4m7QaqYvZ4G1o9uDJnklI6EU4r50,345
11
+ waldiez/exporting/agent/__init__.py,sha256=GOgri16QNICpx3YNZPzVn_KYVxuQACYKQyazhJNtYK0,188
12
+ waldiez/exporting/agent/agent_exporter.py,sha256=1fjf8yJdSDnYAeEmEUVL955f2ztlMHq33I8Tek9qYQo,9823
13
+ waldiez/exporting/agent/utils/__init__.py,sha256=G0iJgfI8tKrNufawPmG2um-hijUS4TZEn7Xwk2DkC88,825
14
+ waldiez/exporting/agent/utils/agent_class_name.py,sha256=V3EB5VhMT5xDC0u92YB7_p_nEL6rO1Jbp63DKG60kVY,927
15
+ waldiez/exporting/agent/utils/agent_imports.py,sha256=X8aX0ThYmBVYzqzAdKX1U4IttqneJuYANi3eAj7mGiE,1549
16
+ waldiez/exporting/agent/utils/code_execution.py,sha256=sRHczOmm12U9E-Q1v9UQRwao1LUEve4fnKvJwsokNNk,2352
17
+ waldiez/exporting/agent/utils/group_manager.py,sha256=VCqd-lsCertwVTWVez9Z1HS_H-UmBGyNGizvC736VnI,7360
18
+ waldiez/exporting/agent/utils/swarm_agent.py,sha256=rAg_d9WDtWRQKMsI85xSrr5MqR8yYjZZTeQveyCmRFU,15775
19
+ waldiez/exporting/agent/utils/teachability.py,sha256=4RXj-NfNZwdSTKBqw583EIXUzTuWMXYtMp2kRsCixsk,1268
20
+ waldiez/exporting/agent/utils/termination_message.py,sha256=tQ4rCOLumn-xbQzTPK397BQI_fOV6QrjbylA0F4TMrw,1280
21
+ waldiez/exporting/agent/utils/rag_user/__init__.py,sha256=B7vM06Cqe1rfeB_srQxzl1wOHb4wzOwdsTXQy4BFEQc,289
22
+ waldiez/exporting/agent/utils/rag_user/chroma_utils.py,sha256=4dzjYQpgxtylOU_Nph3Ndec33Zbj7aKbWpv7iOkdpWI,4935
23
+ waldiez/exporting/agent/utils/rag_user/mongo_utils.py,sha256=XWo6ixphBtcpmFIe9fE7WpZ1-lQ8zNYOmfD3gbehpU4,2804
24
+ waldiez/exporting/agent/utils/rag_user/pgvector_utils.py,sha256=KScLbdMdiZRWfBXhMTDQUIYYoC0gaH6rJWhJ4TZsVq8,2922
25
+ waldiez/exporting/agent/utils/rag_user/qdrant_utils.py,sha256=eBOGRUoTnb7QMXpScWIlMnhOv1jS4qlRJkwze0SB0Bo,3605
26
+ waldiez/exporting/agent/utils/rag_user/rag_user.py,sha256=gg9vH98Pf5dV42IW9HHB1Ajs6kPFVuzblFhGc_il6CU,7024
27
+ waldiez/exporting/agent/utils/rag_user/vector_db.py,sha256=cbZWrzd3PmIvQ9U95kZmc1mND0ZIh3Y4UiK8EnWR-sE,3807
28
+ waldiez/exporting/base/__init__.py,sha256=CTfIOJt8Kgljv-jrktP3_AXnKhtn5ijaMP3QCk4b6NE,816
29
+ waldiez/exporting/base/agent_position.py,sha256=1qKE4MxNfJXwgsAjd674eXYub5X82WInBUc6Lh1Tw98,1642
30
+ waldiez/exporting/base/base_exporter.py,sha256=P4_TcF4jpsRszNUJ1LZvWCgL3IaG-xYHnUNj6Yv9HKo,3522
31
+ waldiez/exporting/base/export_position.py,sha256=bV50acpqHv6BQ6q6UNXg0e17Tv_koyardSA_RZDgFP4,1106
32
+ waldiez/exporting/base/import_position.py,sha256=EzgHF8GZZ8UsyFdNo_da9hTrQEmbVtM2ofiv9W2-C_I,447
33
+ waldiez/exporting/base/mixin.py,sha256=_QkBitZ3T6jdDx9yZTDFKToa0f9WsLKCW4FpZGjCztc,3376
34
+ waldiez/exporting/base/utils/__init__.py,sha256=2dp5wO0TYWywgXXptU9VLDjNQYCf8x7g4e4vPlLKW98,508
35
+ waldiez/exporting/base/utils/comments.py,sha256=M1W0lWMTyOjRZv5f58rktIPeYA9XF95lZlfcvB05tYU,2257
36
+ waldiez/exporting/base/utils/naming.py,sha256=Bi2Z2gcix0otOhXcgTUgP7kqCgGXIq_QyAcDJSH-g4A,3573
37
+ waldiez/exporting/base/utils/path_check.py,sha256=5XGKmHA3oi9kf2gI4ZHB3K9gnjDP0NEfpn0tP8cme-8,1425
38
+ waldiez/exporting/base/utils/to_string.py,sha256=fo8i6QaLZJsym3biN2IhVooTWlXiXVCzuU8FNFJVXME,2183
39
+ waldiez/exporting/chats/__init__.py,sha256=BS8F-hgrzsKPtWEyEMPE-e0JL6q5478i76vR1bKjXXY,195
40
+ waldiez/exporting/chats/chats_exporter.py,sha256=6nfLxvS3UWnhe0aq0l6FACJQIrdENCDZlyAl6qIAV84,8515
41
+ waldiez/exporting/chats/utils/__init__.py,sha256=FMS94ObfHIlH_Pg_5s5PR-QaXYzcpZErP1Vut2PYaTY,442
42
+ waldiez/exporting/chats/utils/common.py,sha256=kZ9xO26Oo3tKSxZescFfB2laE9I8F5Hnq3c8oojEVGo,2410
43
+ waldiez/exporting/chats/utils/nested.py,sha256=evjvJeWHATumNNffAPZUInlyQuzXLmBWnlHfYQaub0I,9227
44
+ waldiez/exporting/chats/utils/sequential.py,sha256=kKdfxpt-ZCDeXqwbWRDydkp5BwCuk2BJdG_6DMnK8TM,7787
45
+ waldiez/exporting/chats/utils/single_chat.py,sha256=DvB2ODOATHdJ1sw0QIuqoH-2jRim7Y22xWfCdMr6GCc,9416
46
+ waldiez/exporting/chats/utils/swarm.py,sha256=KJTtgQFt8c_jR800vC8R14ArYVm6ZgpsUyGbiOykmMI,6929
47
+ waldiez/exporting/flow/__init__.py,sha256=TAJ8lq9saP1IX0U-A6yGKCfvbQnEocmRAX4Hc60f3yY,183
48
+ waldiez/exporting/flow/flow_exporter.py,sha256=4Y99pzHx3DUcaSS8waXlS9-nZANIjoaAWJT9QL2GtNI,17336
49
+ waldiez/exporting/flow/utils/__init__.py,sha256=HYOVAoGP_LsN888DqJbPRU1MOfmTzN9bEIQ97o6aTng,1348
50
+ waldiez/exporting/flow/utils/agent_utils.py,sha256=QL1nzlgYeh6Y-l9R3hmCsrxSzluvBVciuuEIFdBXXKM,6109
51
+ waldiez/exporting/flow/utils/chat_utils.py,sha256=q6HS4JTNQJe15eh78H1BlN-wId9XzvVQziGhxsUIEFs,1882
52
+ waldiez/exporting/flow/utils/def_main.py,sha256=k9yxlc-Ct84PYpYNvzKjL16vZirC6N7Gq7vlOdG-NHw,2068
53
+ waldiez/exporting/flow/utils/flow_content.py,sha256=F5x22HVPEzpGRV7kRQrY_oE8nvmqOud5Qih963Z4zyA,2997
54
+ waldiez/exporting/flow/utils/flow_names.py,sha256=5i1qjSrkbIFtnE13sv_GjOTyRnmTzPMys1Ecd5au7mg,3463
55
+ waldiez/exporting/flow/utils/importing_utils.py,sha256=SidCqVVafdfkvPbDJR2CaoRklPaKHNd__sEwSvUXATk,5187
56
+ waldiez/exporting/flow/utils/logging_utils.py,sha256=QREMpEDiwo-V1UCWJ6t_J09AYOyubTcwBYGRIcg2dWw,6169
57
+ waldiez/exporting/models/__init__.py,sha256=QbyYuS-Px-M9vMrdL-UKqnDzhYWRkNmRGBbc1IBuwpM,212
58
+ waldiez/exporting/models/models_exporter.py,sha256=W4EDMY79RNSqZKBd2wYGFRQnt-OvbixXMXiAeTjNdU0,5994
59
+ waldiez/exporting/models/utils.py,sha256=atxJ1OxjlSIxdyfBCmr_U7aXjHcZ82IQmjgw8QB4XLM,4849
60
+ waldiez/exporting/skills/__init__.py,sha256=sJm4ZnN3haldxRBgNlLK0qMK5YtydF2XnSaqnxu2hQo,195
61
+ waldiez/exporting/skills/skills_exporter.py,sha256=o_16s0VjMoaDwe-JJdbqDP2BzQJV9SAM57k_4KxAix0,5290
62
+ waldiez/exporting/skills/utils.py,sha256=SAJ55fpNlU9DmmAcSHafq1ddgg4A-bjBxbL3aaWps50,8120
63
+ waldiez/models/__init__.py,sha256=x14L5RbRdfDhFpK-G66MirME3VxMlNxWhWRaqBqkgtw,3564
64
+ waldiez/models/waldiez.py,sha256=Pu0VLKcnkNqp6tURbNN14Uvy2SBu2HBjFSKtpwbDxoM,10297
65
+ waldiez/models/agents/__init__.py,sha256=uICskTyzSlCq1PpO4MHC6tcqwz0R2nSY_1ukp6U7MlY,4274
66
+ waldiez/models/agents/agents.py,sha256=mooR52KltEEEs25Cy8PTyAwqYCusw9AdT5A_KG4LUo0,4019
67
+ waldiez/models/agents/agent/__init__.py,sha256=us1qPNCwKdUao9UUVXDHbcjuUUA5yexWEQkozvWLUDY,1044
68
+ waldiez/models/agents/agent/agent.py,sha256=soYrJuklAvblkakyDB-J5IaBXK7p0daUTImTq4LOlz4,5704
69
+ waldiez/models/agents/agent/agent_data.py,sha256=rqRRMdqOzUF5jjdVoYika-tqe0YUWHQ4at5fNL9GAYM,5437
70
+ waldiez/models/agents/agent/code_execution.py,sha256=lBfJMRvzl1QfNIHwQXxY2ote2Kjh9iT3twz-Tj8JrZA,2035
71
+ waldiez/models/agents/agent/linked_skill.py,sha256=VpVDtI13bUPRUDk8usoIJVHs7ZLPWS3pp5GvuzIiZec,760
72
+ waldiez/models/agents/agent/nested_chat.py,sha256=wPwc_6qUMz8JgQL9rjx2ry4HPJKvGlLzDq5SmDXmku0,1850
73
+ waldiez/models/agents/agent/teachability.py,sha256=VI73WWdQ5kxVdrfglwojU4gxizkAfzB-dWg8FzFH0bs,1796
74
+ waldiez/models/agents/agent/termination_message.py,sha256=MhJhWgw6K-Wa_IsHUGazjKNe4DSVizkLLWIj6S2fg-k,6760
75
+ waldiez/models/agents/assistant/__init__.py,sha256=y2s2F2e7njMcmwye1UOUULHSvU3VsDLreTLvRU1I4M0,268
76
+ waldiez/models/agents/assistant/assistant.py,sha256=POBoEv5iOCKF3s7a5Ww7OojM16PREye6r9jO7e6epd8,1188
77
+ waldiez/models/agents/assistant/assistant_data.py,sha256=KFxgCXdcmr6v6kG13nLQYUrktIVV0DMNcpV-7kt-5rk,916
78
+ waldiez/models/agents/group_manager/__init__.py,sha256=MlMzrAfiSRprVJvAVNLUuulckNsBuWsiHXa0-tcUCWM,894
79
+ waldiez/models/agents/group_manager/group_manager.py,sha256=LG5-PEi6Hf69fZSkwOBjHnhC_SikRUewqBU37x4DxXk,2780
80
+ waldiez/models/agents/group_manager/group_manager_data.py,sha256=LZYG2RF6El041rIE0X_9tSfe7bElgixsSja04v4KiiA,2878
81
+ waldiez/models/agents/group_manager/speakers.py,sha256=0QAvlPswcBGFx3heCrX9AfWaVSHJxj0xV52IyYCHGjk,7848
82
+ waldiez/models/agents/rag_user/__init__.py,sha256=sGMVeg7J0QYclnS_iiM5XP6Lz_M9_Vvdz8_mpf0Ft3o,1382
83
+ waldiez/models/agents/rag_user/rag_user.py,sha256=eWCW0TxqS8eJ1ph-9UAYfD-MHwgAOhi8derMYDY4PkU,1620
84
+ waldiez/models/agents/rag_user/rag_user_data.py,sha256=Aboyy6JJcDzh2DQIttt1l-Uzqebn46HKlw11WObbUrA,963
85
+ waldiez/models/agents/rag_user/retrieve_config.py,sha256=gATcRPkHm44O-ElOA8Ur87mBxm1i_-dXysIFSdE0omo,29078
86
+ waldiez/models/agents/rag_user/vector_db_config.py,sha256=4aaYBTqtliUzUHmxVKBfyLs6gGtmx-f9hZdiwdlab9c,5015
87
+ waldiez/models/agents/swarm_agent/__init__.py,sha256=pytatc7xp3-FAWvpwMan-MQ53ghxt1Zvc3OrxbvH6iM,1561
88
+ waldiez/models/agents/swarm_agent/after_work.py,sha256=mKqk1P3AFrV4tveEkXLbMtdXJPTobUiFCkA3i12blcQ,6047
89
+ waldiez/models/agents/swarm_agent/on_condition.py,sha256=VZ9efN_r3KF_s0-DME_SmHwlh0F1QnGpW7XA6IziFnc,3158
90
+ waldiez/models/agents/swarm_agent/on_condition_available.py,sha256=jphgubLaNOn05XHEAi7BQ0J7asBwb_c9lum8SIc6XwM,4502
91
+ waldiez/models/agents/swarm_agent/on_condition_target.py,sha256=g41yZ_EnNBJyfZIOyC51MIYNT6KCjF75UXBvfDWLOCM,981
92
+ waldiez/models/agents/swarm_agent/swarm_agent.py,sha256=Uz2E8u0oolZCgXCxWlGv03lLjY36t2UWe_3YL03Sel8,2756
93
+ waldiez/models/agents/swarm_agent/swarm_agent_data.py,sha256=420GTzQBCR9-AVuAzaGvpVvwCo_8UbYDWtC8Fr9WlyI,4123
94
+ waldiez/models/agents/swarm_agent/update_system_message.py,sha256=aIHXqvpQnh8EFeYmpmFyvmsIUdVADbaU-tmUG2DVw44,4812
95
+ waldiez/models/agents/user_proxy/__init__.py,sha256=jBojxeNmG7B5P7mFg7Z10ETH6AHjkwe7-XIuxACpXSs,271
96
+ waldiez/models/agents/user_proxy/user_proxy.py,sha256=QT18qFeQUmnzClqIs15jwILfG60dhva58eGrlcGamjI,1164
97
+ waldiez/models/agents/user_proxy/user_proxy_data.py,sha256=ni9RTUmHHWPfBk_L7QTUkUkU6AopsHfGw3uYEOTtUzQ,926
98
+ waldiez/models/chat/__init__.py,sha256=uivo-wYhIiu0OyqhiXeNdES4dRToPxQTNmSWGjkfH6A,1049
99
+ waldiez/models/chat/chat.py,sha256=XL50OtIYSUFvkmOxkecMsz_sWqlh3crguv6mb8b1nr0,10602
100
+ waldiez/models/chat/chat_data.py,sha256=1_ZYiK1_PPEJze0rC06ctq8Gv7UmMozfhx-9_YKpRjc,13499
101
+ waldiez/models/chat/chat_message.py,sha256=6zrNMKQJzd1zePg5fqS6FaDAKfgWF31ybVyeLndCXYQ,9137
102
+ waldiez/models/chat/chat_nested.py,sha256=t9zbGlWwXlFvAR-tTwXczpzX2QRqRlbDABPyGvnY4Qw,4183
103
+ waldiez/models/chat/chat_summary.py,sha256=RDeRw7vTV4Niw5_v_UZTOWQkIZUI0q9vdQ01Ja1isM4,2916
104
+ waldiez/models/common/__init__.py,sha256=OpQTQ-wNA56hZTKZfBSj4joKRzX5n2uNGhL1jKoGbro,733
105
+ waldiez/models/common/base.py,sha256=SwnnuFTJ0C3PfBoRilqE0uZv3j5aelw7-s-79KcxJNA,1840
106
+ waldiez/models/common/method_utils.py,sha256=jT6Cpu_XskroLlMwLGCY4HNptQtnccvMOa2CwRwT6xc,6944
107
+ waldiez/models/flow/__init__.py,sha256=3UdwoUZdkLr6G78tNTyaijoiwvmHZ-N0tY3G7S_xbRs,255
108
+ waldiez/models/flow/flow.py,sha256=AIguDr9pd6N9csyKnnkHyJ0-g_4AcAT4TLcOOXTLDiU,14436
109
+ waldiez/models/flow/flow_data.py,sha256=5Mn27AMzd44rrcg2Toa6wZC4cX5oCOsCUhuoE0giQsE,4949
110
+ waldiez/models/flow/utils.py,sha256=Bd8dWYlCenuU4VeusAL_qxkXzYSuxl9e3a7FhHs6UCY,5435
111
+ waldiez/models/model/__init__.py,sha256=1cOyDThhZV8o7pZN1DaIhh12jWty_YMegoQ4Jg7uKyI,383
112
+ waldiez/models/model/model.py,sha256=PJCV0OJMDCCoy20voGZj2pFVZjjJw86ozKiMRsX6oSY,6736
113
+ waldiez/models/model/model_data.py,sha256=XrMBbnCRkJBlk46xJMoBJrcTX9qnViJZTn9_MS9ujPw,3792
114
+ waldiez/models/skill/__init__.py,sha256=kAyp9-LwBacI3ndQpU-dCGWjsjojRQy73zXsTddGAmg,306
115
+ waldiez/models/skill/skill.py,sha256=6r8heHUgRYwfcBJbdsV5DywvTXcEeWPuJN4jzCh3-O4,4255
116
+ waldiez/models/skill/skill_data.py,sha256=Spk3YxK0IgkXpJgk05DJwvZwUPrh-2l95o9PnS1WnoQ,908
117
+ waldiez/running/__init__.py,sha256=hptO_sDFv0Alg-YJmLN-A49SeQ4YyWUMP8nBH21qO-o,633
118
+ waldiez/running/environment.py,sha256=8IgEmm1MJrfwOlxyMAdoYtH-KRmLtlVROOWzlMtSbps,2268
119
+ waldiez/running/gen_seq_diagram.py,sha256=y9O5HFe25YvfNc78MrWTwaSfFQEDu6-buq7lja8PYgg,5639
120
+ waldiez/running/running.py,sha256=CpgiK9E-4T7ruVwB2baSv6qTipgTcdR9IulE8db5V4o,8561
121
+ waldiez-0.3.0.dist-info/METADATA,sha256=MXqBcs79PwxYwc3nwQnvYT-tAM8b_n-fKvKXjVtTDSE,8984
122
+ waldiez-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
123
+ waldiez-0.3.0.dist-info/entry_points.txt,sha256=9MQ8Y1rD19CU7UwjNPwoyTRpQsPs2QimjrtwTD0bD6k,44
124
+ waldiez-0.3.0.dist-info/licenses/LICENSE,sha256=bWinEG_ynCS8eSj1vhAmYDWwYODhBOF0AUEjOgZ3kmU,11355
125
+ waldiez-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Waldiez and contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ https://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,5 +0,0 @@
1
- """Agent related string generation functions."""
2
-
3
- from .agent import export_agent
4
-
5
- __all__ = ["export_agent"]
@@ -1,236 +0,0 @@
1
- """Agent strings generation.."""
2
-
3
- from typing import Dict, List, Set, Tuple
4
-
5
- from waldiez.models import WaldiezAgent, WaldiezModel, WaldiezSkill
6
-
7
- from ..utils import get_escaped_string
8
- from .agent_skills import get_agent_skill_registrations
9
- from .code_execution import get_agent_code_execution_config
10
- from .group_manager import get_group_manager_extras
11
- from .llm_config import get_agent_llm_config
12
- from .rag_user import get_rag_user_extras
13
- from .termination_message import get_is_termination_message
14
-
15
-
16
- def get_agent_class_name(agent: WaldiezAgent) -> str:
17
- """Get the agent class name.
18
-
19
- Parameters
20
- ----------
21
- agent : WaldiezAgent
22
- The agent.
23
-
24
- Returns
25
- -------
26
- str
27
- The agent class name.
28
- """
29
- if agent.data.is_multimodal:
30
- return "MultimodalConversableAgent"
31
- if agent.agent_type == "assistant":
32
- return "AssistantAgent"
33
- if agent.agent_type == "user":
34
- return "UserProxyAgent"
35
- if agent.agent_type == "manager":
36
- return "GroupChatManager"
37
- if agent.agent_type == "rag_user":
38
- return "RetrieveUserProxyAgent"
39
- return "ConversableAgent" # pragma: no cover
40
-
41
-
42
- def get_agent_imports(agent_class: str) -> Set[str]:
43
- """Get the imports needed for the agent.
44
-
45
- Parameters
46
- ----------
47
- agent_class : str
48
- The agent class name.
49
-
50
- Returns
51
- -------
52
- Set[str]
53
- The imports needed for the agent.
54
- """
55
- imports = set()
56
- if agent_class == "AssistantAgent":
57
- imports.add("from autogen import AssistantAgent")
58
- elif agent_class == "UserProxyAgent":
59
- imports.add("from autogen import UserProxyAgent")
60
- elif agent_class == "GroupChatManager":
61
- imports.add("from autogen import GroupChatManager")
62
- imports.add("from autogen import GroupChat")
63
- elif agent_class == "RetrieveUserProxyAgent":
64
- imports.add(
65
- "from autogen.agentchat.contrib.retrieve_user_proxy_agent "
66
- "import RetrieveUserProxyAgent"
67
- )
68
- elif agent_class == "MultimodalConversableAgent":
69
- imports.add(
70
- "from autogen.agentchat.contrib.multimodal_conversable_agent "
71
- "import MultimodalConversableAgent"
72
- )
73
- return imports
74
-
75
-
76
- def get_system_message_arg(agent: WaldiezAgent) -> str:
77
- """Get the system message argument.
78
-
79
- Parameters
80
- ----------
81
- agent : WaldiezAgent
82
- The agent.
83
-
84
- Returns
85
- -------
86
- str
87
- The system message argument.
88
- """
89
- if not agent.data.system_message:
90
- return ""
91
- return (
92
- "\n "
93
- f'system_message="{get_escaped_string(agent.data.system_message)}",'
94
- )
95
-
96
-
97
- # pylint: disable=too-many-locals, unused-argument
98
- def export_agent(
99
- agent: WaldiezAgent,
100
- agent_names: Dict[str, str],
101
- model_names: Dict[str, str],
102
- skill_names: Dict[str, str],
103
- all_models: List[WaldiezModel],
104
- all_skills: List[WaldiezSkill],
105
- group_chat_members: List[WaldiezAgent],
106
- ) -> Tuple[str, str, Set[str]]:
107
- """Export the agent to a string.
108
-
109
- If the agent's `is_termination_msg` is a method,
110
- the function definition and content will be included in the string.
111
- So it could be like:
112
- ```python
113
- ...
114
- def is_termination_message_{agent_name}(message):
115
- return ....
116
- ...
117
- agent_name = AssistantAgent(
118
- ...
119
- is_termination_msg=is_termination_message_{agent_name},
120
- ...
121
- )
122
- ```
123
- The same goes for any additional `before the agent` contents in the cases
124
- of a group chat manager (define the `GroupChat` first),
125
- a retrieve user proxy agent (define the retrieve/db config first),
126
- or the agent's `code_execution`: define the
127
- `DockerCommandLineCodeExecutor`/`LocalCommandLineCodeExecutor` first.
128
-
129
- The agent's `skill_registrations` and/or nested chats if any,
130
- should be added to the final string after all the agents are defined.
131
- definition. Example:
132
- ```python
133
- ...
134
- agent_name = AssistantAgent(
135
- ...
136
- )
137
- ...
138
- register_function(
139
- {skill_name},
140
- caller={caller_name},
141
- executor={executor_name},
142
- )
143
- ...
144
- ```
145
-
146
- Parameters
147
- ----------
148
- agent : WaldiezAgent
149
- The agent.
150
- agent_names : Dict[str, str]
151
- A mapping of agent id to agent name.
152
- model_names : Dict[str, str]
153
- A mapping of model id to model name.
154
- skill_names : Dict[str, str]
155
- A mapping of skill id to skill name.
156
- all_models : List[WaldiezModel]
157
- All the models in the flow.
158
- all_skills : List[WaldiezSkill]
159
- All the skills in the flow.
160
- group_chat_members : List[WaldiezAgent]
161
- The group chat members.
162
-
163
- Returns
164
- -------
165
- Tuple[str, str, Set[str], Set[str]]
166
- A tuple containing:
167
- - The string representation of the agent (w additional content before),
168
- - Extra content to be added after the agents are defined.
169
- - Needed imports (autogen.x, db/RAG or code execution related) if any.
170
- """
171
- imports: Set[str] = set()
172
- agent_name = agent_names[agent.id]
173
- before_agent_string = ""
174
- after_agent_string = ""
175
- before_manager, group_chat_arg = get_group_manager_extras(
176
- agent, group_chat_members, agent_names
177
- )
178
- if before_manager:
179
- before_agent_string += before_manager
180
- before_rag, retrieve_arg, rag_imports = get_rag_user_extras(
181
- agent, agent_name, model_names
182
- )
183
- if before_rag:
184
- before_agent_string += before_rag
185
- imports.update(rag_imports)
186
- is_termination_message, termination_function = get_is_termination_message(
187
- agent, agent_name
188
- )
189
- if termination_function:
190
- before_agent_string += termination_function
191
- executor, config_arg, coding_import = get_agent_code_execution_config(
192
- agent=agent, agent_name=agent_name, skill_names=skill_names
193
- )
194
- if executor:
195
- before_agent_string += executor
196
- if coding_import:
197
- imports.add(f"from autogen.coding import {coding_import}")
198
- agent_class = get_agent_class_name(agent)
199
- imports.update(get_agent_imports(agent_class))
200
- if agent.data.skills:
201
- imports.add("from autogen import register_function")
202
- default_auto_reply: str = "None"
203
- if agent.data.agent_default_auto_reply:
204
- default_auto_reply = (
205
- f'"{get_escaped_string(agent.data.agent_default_auto_reply)}"'
206
- )
207
- agent_llm_config_arg, llm_config_string = get_agent_llm_config(
208
- agent=agent,
209
- agent_name=agent_name,
210
- all_models=all_models,
211
- model_names=model_names,
212
- )
213
- before_agent_string += llm_config_string
214
- agent_str = f"""{agent_name} = {agent_class}(
215
- name="{agent_name}",
216
- description="{agent.description}",
217
- llm_config={agent_llm_config_arg},{(get_system_message_arg(agent))}
218
- human_input_mode="{agent.data.human_input_mode}",
219
- max_consecutive_auto_reply={agent.data.max_consecutive_auto_reply},
220
- default_auto_reply={default_auto_reply},
221
- code_execution_config={config_arg},
222
- is_termination_msg={is_termination_message},{group_chat_arg}{retrieve_arg}
223
- )
224
- """
225
- agent_skill_registrations = get_agent_skill_registrations(
226
- agent, agent_names, all_skills, skill_names
227
- )
228
- if before_agent_string:
229
- agent_str = before_agent_string + "\n" + agent_str
230
- if agent_skill_registrations:
231
- after_agent_string = "\n" + agent_skill_registrations + "\n"
232
- return (
233
- agent_str,
234
- after_agent_string,
235
- imports,
236
- )
@@ -1,67 +0,0 @@
1
- """Agent skills related string generation functions."""
2
-
3
- from typing import Dict, List
4
-
5
- from waldiez.models import WaldiezAgent, WaldiezSkill
6
-
7
- from ..utils import get_escaped_string
8
-
9
-
10
- def get_agent_skill_registrations(
11
- agent: WaldiezAgent,
12
- agent_names: Dict[str, str],
13
- all_skills: List[WaldiezSkill],
14
- skill_names: Dict[str, str],
15
- ) -> str:
16
- """Get the agent skill registrations.
17
-
18
- example output:
19
-
20
- ```python
21
- >>> register_function(
22
- {skill_name},
23
- caller={agent_name},
24
- executor={executor_agent_name},
25
- name="{skill_name}",
26
- description="{skill_description}",
27
- )
28
- ```
29
-
30
- Parameters
31
- ----------
32
- agent : WaldiezAgent
33
- The agent.
34
- agent_names : Dict[str, str]
35
- A mapping of agent id to agent name.
36
- all_skills : List[WaldiezSkill]
37
- All the skills in the flow.
38
- skill_names : Dict[str, str]
39
- A mapping of skill id to skill name.
40
-
41
- Returns
42
- -------
43
- str
44
- The agent skill registrations.
45
- """
46
- if not agent.data.skills or not all_skills:
47
- return ""
48
- content = ""
49
- for linked_skill in agent.data.skills:
50
- skill_name = skill_names[linked_skill.id]
51
- waldiez_skill = next(
52
- skill for skill in all_skills if skill.id == linked_skill.id
53
- )
54
- skill_description = (
55
- waldiez_skill.description or f"Description of {skill_name}"
56
- )
57
- skill_description = get_escaped_string(skill_description)
58
- content += (
59
- f"register_function(\n"
60
- f" {skill_name},\n"
61
- f" caller={agent_names[agent.id]},\n"
62
- f" executor={agent_names[linked_skill.executor_id]},\n"
63
- f' name="{skill_name}",\n'
64
- f' description="{skill_description}",\n'
65
- f")\n\n"
66
- )
67
- return content