open-swarm 0.1.1744942884__py3-none-any.whl → 0.1.1744943015__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.
- {open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/METADATA +1 -1
- {open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/RECORD +24 -24
- swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py +1 -1
- swarm/blueprints/divine_code/blueprint_divine_code.py +1 -1
- swarm/blueprints/django_chat/blueprint_django_chat.py +1 -1
- swarm/blueprints/echocraft/blueprint_echocraft.py +1 -1
- swarm/blueprints/family_ties/blueprint_family_ties.py +1 -1
- swarm/blueprints/mcp_demo/blueprint_mcp_demo.py +30 -1
- swarm/blueprints/mission_improbable/blueprint_mission_improbable.py +1 -1
- swarm/blueprints/monkai_magic/blueprint_monkai_magic.py +1 -1
- swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py +29 -1
- swarm/blueprints/omniplex/blueprint_omniplex.py +28 -18
- swarm/blueprints/rue_code/blueprint_rue_code.py +1 -1
- swarm/blueprints/suggestion/blueprint_suggestion.py +1 -1
- swarm/blueprints/unapologetic_press/blueprint_unapologetic_press.py +1 -1
- swarm/extensions/cli/commands/blueprint_management.py +3 -3
- swarm/extensions/cli/commands/config_management.py +5 -6
- swarm/extensions/cli/commands/edit_config.py +8 -6
- swarm/extensions/cli/commands/list_blueprints.py +1 -1
- swarm/extensions/cli/commands/validate_env.py +3 -3
- swarm/extensions/cli/commands/validate_envvars.py +6 -6
- {open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/WHEEL +0 -0
- {open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/entry_points.txt +0 -0
- {open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: open-swarm
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1744943015
|
4
4
|
Summary: Open Swarm: Orchestrating AI Agent Swarms with Django
|
5
5
|
Project-URL: Homepage, https://github.com/yourusername/open-swarm
|
6
6
|
Project-URL: Documentation, https://github.com/yourusername/open-swarm/blob/main/README.md
|
@@ -17,18 +17,18 @@ swarm/blueprints/README.md,sha256=tsngbSB9N0tILcz_m1OGAjyKZQYlGTN-i5e5asq1GbE,84
|
|
17
17
|
swarm/blueprints/chatbot/blueprint_chatbot.py,sha256=XUR9vt3qXSFrvqmjU01_T-R90Q_r7p560sHQ_febssA,7995
|
18
18
|
swarm/blueprints/chatbot/templates/chatbot/chatbot.html,sha256=REFnqNg0EHsXxAUfaCJe1YgOKiV_umBXuC6y8veF5CU,1568
|
19
19
|
swarm/blueprints/codey/blueprint_codey.py,sha256=dmKb2mHOeCNlnKrmmkqy9oh_3fJ1-QTg9gjql7RINb4,8850
|
20
|
-
swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py,sha256=
|
20
|
+
swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py,sha256=ShEeg7l_R0U6eFY2ty7ooJTO95OKGRcfiX997c8CtWU,11285
|
21
21
|
swarm/blueprints/divine_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
swarm/blueprints/divine_code/apps.py,sha256=k615JHdfOuo_GwfVbC7ah8X9OblkAL2XWm9aLBjmMyY,306
|
23
|
-
swarm/blueprints/divine_code/blueprint_divine_code.py,sha256=
|
23
|
+
swarm/blueprints/divine_code/blueprint_divine_code.py,sha256=0BcvuW1ixFgA5LF01sgUJ-_w0HYGt4S2mr1asp1LZiY,14978
|
24
24
|
swarm/blueprints/django_chat/apps.py,sha256=rn1Eu11c4zZ6DYZeFb6AkCDMoM_dcQTzeNwW-IxXpCI,200
|
25
|
-
swarm/blueprints/django_chat/blueprint_django_chat.py,sha256=
|
25
|
+
swarm/blueprints/django_chat/blueprint_django_chat.py,sha256=a8oiGTC7j7KfZiSlEvPNcdidvV8al-2ISTpLcNv3NiQ,3700
|
26
26
|
swarm/blueprints/django_chat/urls.py,sha256=TTTF3pgymvCYbuxpwi4WRBPv8ftQNH4pEoURT8sEVAg,147
|
27
27
|
swarm/blueprints/django_chat/views.py,sha256=MUKjXXjXsq8jMZtAb4RR9g2mEYrwFemN6Bqxpeyi7p4,1299
|
28
28
|
swarm/blueprints/django_chat/templates/django_chat/django_chat_webpage.html,sha256=wAEOI4Wg0JJ8drXaOcr2Pel6lW3JSHmyIpbocLS5tI8,1649
|
29
|
-
swarm/blueprints/echocraft/blueprint_echocraft.py,sha256=
|
29
|
+
swarm/blueprints/echocraft/blueprint_echocraft.py,sha256=lIo2I1I6E-FsNDDHR3wMThVvvctJ5yWEQR-S5oawH1c,3129
|
30
30
|
swarm/blueprints/family_ties/apps.py,sha256=EjV7AxDNsLM4gsLr_qMEiLAVbERuo1ZsdU9vPtOEYAY,287
|
31
|
-
swarm/blueprints/family_ties/blueprint_family_ties.py,sha256=
|
31
|
+
swarm/blueprints/family_ties/blueprint_family_ties.py,sha256=ZSGzqZdlNt03ubEQKkuB84uCJm56N_i4LRyefx4xLug,9446
|
32
32
|
swarm/blueprints/family_ties/models.py,sha256=C3_okdVVYuu9xOpoKRsaLoGrM2775cS_cU4UKYAkJ9s,903
|
33
33
|
swarm/blueprints/family_ties/serializers.py,sha256=kH3T6OgXjF534bO3gfAUr6GpXZ5Jx0BQkK58nvuEcqA,325
|
34
34
|
swarm/blueprints/family_ties/settings.py,sha256=5zcVsq7ny3GLWcJnOplZW4fMFNtyC3ba0ZOESRD2gh4,425
|
@@ -36,16 +36,16 @@ swarm/blueprints/family_ties/urls.py,sha256=awRZHb1gb1p3I6YZzfKMGSydd6kYPTLgax2j
|
|
36
36
|
swarm/blueprints/family_ties/views.py,sha256=FbPkDNlFEixtRFbSpkr51IyJ28FRkXa1W5xyO_KeXH0,1081
|
37
37
|
swarm/blueprints/flock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
38
|
swarm/blueprints/gaggle/blueprint_gaggle.py,sha256=rP8uiSz3GLGEjYxXYlo_RCsus7HKBfYkexXoHBCsl7k,14928
|
39
|
-
swarm/blueprints/mcp_demo/blueprint_mcp_demo.py,sha256=
|
39
|
+
swarm/blueprints/mcp_demo/blueprint_mcp_demo.py,sha256=xLXDwW-mIeRp-rzdcnQyCdGciDqqHvkYhUXrMABjmOE,8470
|
40
40
|
swarm/blueprints/messenger/templates/messenger/messenger.html,sha256=izuFtFn40Gm7M4gSUAUT5CIezjBjmNv2w4_fwSlv7VA,2323
|
41
|
-
swarm/blueprints/mission_improbable/blueprint_mission_improbable.py,sha256=
|
42
|
-
swarm/blueprints/monkai_magic/blueprint_monkai_magic.py,sha256=
|
43
|
-
swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py,sha256=
|
44
|
-
swarm/blueprints/omniplex/blueprint_omniplex.py,sha256=
|
41
|
+
swarm/blueprints/mission_improbable/blueprint_mission_improbable.py,sha256=JseHJ7CXTvNqWfuN38JTXDsaf2VrMX7J1llXXroZMZg,12737
|
42
|
+
swarm/blueprints/monkai_magic/blueprint_monkai_magic.py,sha256=2Ay_IO2NgQEdVqwyw_kkyK6bzGl9XXlpcktmpv1RD4M,14219
|
43
|
+
swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py,sha256=gKe26daAUm7sDcALD_31RRe8jXSCSvL0jywkS4IboD8,11755
|
44
|
+
swarm/blueprints/omniplex/blueprint_omniplex.py,sha256=lCp_FXo1rkHtDu2UZVUa8px-1nIh9cl_LhorwL3hteY,13377
|
45
45
|
swarm/blueprints/rue_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
|
-
swarm/blueprints/rue_code/blueprint_rue_code.py,sha256=
|
47
|
-
swarm/blueprints/suggestion/blueprint_suggestion.py,sha256=
|
48
|
-
swarm/blueprints/unapologetic_press/blueprint_unapologetic_press.py,sha256=
|
46
|
+
swarm/blueprints/rue_code/blueprint_rue_code.py,sha256=kL6MJ-dYdwTsQBkmL_tTXnZUqai2KD1t94EuiVNUv2g,15401
|
47
|
+
swarm/blueprints/suggestion/blueprint_suggestion.py,sha256=NvQgGAR9iVlmEOk5i1xb5OLvxOTlXMEMtxT3_5g1tHY,7096
|
48
|
+
swarm/blueprints/unapologetic_press/blueprint_unapologetic_press.py,sha256=MDegKtYiea-MVNnOXHOk0grLRQnmxYBNI1b-6Bp4pK4,17632
|
49
49
|
swarm/blueprints/whiskeytango_foxtrot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
50
|
swarm/blueprints/whiskeytango_foxtrot/apps.py,sha256=V1QKvyb2Vz-EtDNhhNe4tw2W9LYhNDuiaIq_fAU4ilw,334
|
51
51
|
swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py,sha256=8PjKGDHSTaQ76DXPD3T4MXQ8uLIlm4xmJ5s0i64a_Jw,16179
|
@@ -64,12 +64,12 @@ swarm/extensions/cli/main.py,sha256=NnmovA7h1Rj1eDQVYe9AN6-eraIbIclHesNVmQPjdk4,
|
|
64
64
|
swarm/extensions/cli/selection.py,sha256=etdG6hJFgnLuvD_sVJvXg8qFcgjzCjyL-vYyxWcU0TI,2002
|
65
65
|
swarm/extensions/cli/utils.py,sha256=amDW-jbiM12N-t72j2S0cHP3Mxgoo3nrcwq6CwN9HFY,3290
|
66
66
|
swarm/extensions/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
|
-
swarm/extensions/cli/commands/blueprint_management.py,sha256=
|
68
|
-
swarm/extensions/cli/commands/config_management.py,sha256=
|
69
|
-
swarm/extensions/cli/commands/edit_config.py,sha256=
|
70
|
-
swarm/extensions/cli/commands/list_blueprints.py,sha256=
|
71
|
-
swarm/extensions/cli/commands/validate_env.py,sha256=
|
72
|
-
swarm/extensions/cli/commands/validate_envvars.py,sha256=
|
67
|
+
swarm/extensions/cli/commands/blueprint_management.py,sha256=CXjS3GAYIJ8aCcxDtDJ0Cehe-r8ZYjOnBsr8pn43l0Y,1084
|
68
|
+
swarm/extensions/cli/commands/config_management.py,sha256=L-z4YEJnfQQ-QGbQtodgptt8wbWtEPKJWHBIBx6TPj4,519
|
69
|
+
swarm/extensions/cli/commands/edit_config.py,sha256=oo_VPezAshyuCTfc1R2Ergtqwf5dHA5oC1FzfO8kn-A,2368
|
70
|
+
swarm/extensions/cli/commands/list_blueprints.py,sha256=jqyecR1tKpN9Q2tuanSL3rI4kTsqGCV6Lmc3JAsf1BY,752
|
71
|
+
swarm/extensions/cli/commands/validate_env.py,sha256=ilfBVsAsH4QVZVrarWEQxrJCtIp2XJ-0kVuCK1mTAaQ,1955
|
72
|
+
swarm/extensions/cli/commands/validate_envvars.py,sha256=ctXNHtvgPtIgk3vPj5D8OAJ-gQLHkEHEd0vvpDI8Luk,1613
|
73
73
|
swarm/extensions/cli/utils/discover_commands.py,sha256=aJdU3kSmLlpBxzGdfOA88AaCwpknHSD2cE0piCHZRUY,1053
|
74
74
|
swarm/extensions/cli/utils/env_setup.py,sha256=k7QxRjzIGx5HC6RVZP9QSaaXEKMkcKCewD66u0e7qfE,496
|
75
75
|
swarm/extensions/config/__init__.py,sha256=WjmGxMU5k3S40TNQxTfByYcT2YAchq_5gzXFWDLrLzU,141
|
@@ -235,8 +235,8 @@ swarm/views/message_views.py,sha256=sDUnXyqKXC8WwIIMAlWf00s2_a2T9c75Na5FvYMJwBM,
|
|
235
235
|
swarm/views/model_views.py,sha256=aAbU4AZmrOTaPeKMWtoKK7FPYHdaN3Zbx55JfKzYTRY,2937
|
236
236
|
swarm/views/utils.py,sha256=8Usc0g0L0NPegNAyY20tJBNBy-JLwODf4VmxV0yUtpw,3627
|
237
237
|
swarm/views/web_views.py,sha256=T1CKe-Nyv1C8aDt6QFTGWo_dkH7ojWAvS_QW9mZnZp0,7371
|
238
|
-
open_swarm-0.1.
|
239
|
-
open_swarm-0.1.
|
240
|
-
open_swarm-0.1.
|
241
|
-
open_swarm-0.1.
|
242
|
-
open_swarm-0.1.
|
238
|
+
open_swarm-0.1.1744943015.dist-info/METADATA,sha256=-IY39ve592zB1K4xEMlDzC6l0l0Z0DqjSgCE_b8pO5Q,18813
|
239
|
+
open_swarm-0.1.1744943015.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
240
|
+
open_swarm-0.1.1744943015.dist-info/entry_points.txt,sha256=fo28d0_zJrytRsh8QqkdlWQT_9lyAwYUx1WuSTDI3HM,177
|
241
|
+
open_swarm-0.1.1744943015.dist-info/licenses/LICENSE,sha256=BU9bwRlnOt_JDIb6OT55Q4leLZx9RArDLTFnlDIrBEI,1062
|
242
|
+
open_swarm-0.1.1744943015.dist-info/RECORD,,
|
@@ -16,7 +16,7 @@ try:
|
|
16
16
|
from agents.models.interface import Model
|
17
17
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
18
18
|
from openai import AsyncOpenAI
|
19
|
-
from swarm.
|
19
|
+
from swarm.core.blueprint_base import BlueprintBase
|
20
20
|
except ImportError as e:
|
21
21
|
print(f"ERROR: Import failed in DigitalButlersBlueprint: {e}. Check 'openai-agents' install and project structure.")
|
22
22
|
print(f"Attempted import from directory: {os.path.dirname(__file__)}")
|
@@ -16,7 +16,7 @@ try:
|
|
16
16
|
from agents.models.interface import Model
|
17
17
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
18
18
|
from openai import AsyncOpenAI
|
19
|
-
from swarm.
|
19
|
+
from swarm.core.blueprint_base import BlueprintBase
|
20
20
|
except ImportError as e:
|
21
21
|
print(f"ERROR: Import failed in DivineOpsBlueprint: {e}. Check 'openai-agents' install and project structure.")
|
22
22
|
print(f"sys.path: {sys.path}")
|
@@ -44,7 +44,7 @@ from django.contrib.auth.decorators import login_required
|
|
44
44
|
from django.views.decorators.csrf import csrf_exempt
|
45
45
|
from django.contrib.auth.models import User
|
46
46
|
from swarm.models import ChatConversation, ChatMessage
|
47
|
-
from swarm.
|
47
|
+
from swarm.core.blueprint_base import BlueprintBase as Blueprint
|
48
48
|
from swarm.utils.logger_setup import setup_logger
|
49
49
|
|
50
50
|
logger = setup_logger(__name__)
|
@@ -6,7 +6,7 @@ from typing import List, Dict, Any, AsyncGenerator
|
|
6
6
|
import uuid # Import uuid to generate IDs
|
7
7
|
import time # Import time for timestamp
|
8
8
|
|
9
|
-
from swarm.
|
9
|
+
from swarm.core.blueprint_base import BlueprintBase
|
10
10
|
|
11
11
|
logger = logging.getLogger(__name__)
|
12
12
|
|
@@ -16,7 +16,7 @@ try:
|
|
16
16
|
from agents.models.interface import Model
|
17
17
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
18
18
|
from openai import AsyncOpenAI
|
19
|
-
from swarm.
|
19
|
+
from swarm.core.blueprint_base import BlueprintBase
|
20
20
|
except ImportError as e:
|
21
21
|
print(f"ERROR: Import failed in FamilyTiesBlueprint: {e}. Check dependencies.")
|
22
22
|
print(f"sys.path: {sys.path}")
|
@@ -14,7 +14,7 @@ try:
|
|
14
14
|
from agents.models.interface import Model
|
15
15
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
16
16
|
from openai import AsyncOpenAI
|
17
|
-
from swarm.
|
17
|
+
from swarm.core.blueprint_base import BlueprintBase
|
18
18
|
except ImportError as e:
|
19
19
|
print(f"ERROR: Import failed in MCPDemoBlueprint: {e}. Check dependencies.")
|
20
20
|
print(f"sys.path: {sys.path}")
|
@@ -128,6 +128,35 @@ class MCPDemoBlueprint(BlueprintBase):
|
|
128
128
|
logger.debug("Sage agent created.")
|
129
129
|
return sage_agent
|
130
130
|
|
131
|
+
async def run(self, messages: List[dict], **kwargs):
|
132
|
+
"""Main execution entry point for the MCP Demo blueprint."""
|
133
|
+
logger.info("MCPDemoBlueprint run method called.")
|
134
|
+
instruction = messages[-1].get("content", "") if messages else ""
|
135
|
+
try:
|
136
|
+
mcp_servers = kwargs.get("mcp_servers", [])
|
137
|
+
starting_agent = self.create_starting_agent(mcp_servers=mcp_servers)
|
138
|
+
from agents import Runner
|
139
|
+
if not starting_agent.model:
|
140
|
+
yield {"messages": [{"role": "assistant", "content": f"Error: No model instance available for MCPDemo agent. Check your OPENAI_API_KEY, or LITELLM_MODEL/LITELLM_BASE_URL config."}]}
|
141
|
+
return
|
142
|
+
if not starting_agent.tools:
|
143
|
+
yield {"messages": [{"role": "assistant", "content": f"Warning: No tools registered for MCPDemo agent. Only direct LLM output is possible."}]}
|
144
|
+
required_mcps = self.metadata.get('required_mcp_servers', [])
|
145
|
+
missing_mcps = [m for m in required_mcps if m not in [s.name for s in mcp_servers]]
|
146
|
+
if missing_mcps:
|
147
|
+
yield {"messages": [{"role": "assistant", "content": f"Warning: Missing required MCP servers: {', '.join(missing_mcps)}. Some features may not work."}]}
|
148
|
+
from rich.console import Console
|
149
|
+
console = Console()
|
150
|
+
with console.status("Generating...", spinner="dots") as status:
|
151
|
+
async for chunk in Runner.run(starting_agent, instruction):
|
152
|
+
content = chunk.get("content")
|
153
|
+
if content and ("function call" in content or "args" in content):
|
154
|
+
continue
|
155
|
+
yield chunk
|
156
|
+
logger.info("MCPDemoBlueprint run method finished.")
|
157
|
+
except Exception as e:
|
158
|
+
yield {"messages": [{"role": "assistant", "content": f"Error: {e}"}]}
|
159
|
+
|
131
160
|
# Standard Python entry point
|
132
161
|
if __name__ == "__main__":
|
133
162
|
MCPDemoBlueprint.main()
|
@@ -17,7 +17,7 @@ try:
|
|
17
17
|
from agents.models.interface import Model
|
18
18
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
19
19
|
from openai import AsyncOpenAI
|
20
|
-
from swarm.
|
20
|
+
from swarm.core.blueprint_base import BlueprintBase
|
21
21
|
except ImportError as e:
|
22
22
|
print(f"ERROR: Import failed in MissionImprobableBlueprint: {e}. Check dependencies.")
|
23
23
|
print(f"sys.path: {sys.path}")
|
@@ -29,7 +29,7 @@ try:
|
|
29
29
|
from agents.models.interface import Model
|
30
30
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
31
31
|
from openai import AsyncOpenAI
|
32
|
-
from swarm.
|
32
|
+
from swarm.core.blueprint_base import BlueprintBase
|
33
33
|
except ImportError as e:
|
34
34
|
print(f"ERROR: Import failed in MonkaiMagicBlueprint: {e}. Check dependencies.")
|
35
35
|
print(f"sys.path: {sys.path}")
|
@@ -13,7 +13,7 @@ try:
|
|
13
13
|
from agents.models.interface import Model
|
14
14
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
15
15
|
from openai import AsyncOpenAI
|
16
|
-
from swarm.
|
16
|
+
from swarm.core.blueprint_base import BlueprintBase
|
17
17
|
from rich.panel import Panel # Import Panel for splash screen
|
18
18
|
except ImportError as e:
|
19
19
|
print(f"ERROR: Import failed in nebula_shellz: {e}. Ensure 'openai-agents' install and structure.")
|
@@ -170,5 +170,33 @@ Initializing NebulaShellzzar Crew...
|
|
170
170
|
logger.debug("NebulaShellzzar agent team created. Morpheus is the starting agent.") # Changed to DEBUG
|
171
171
|
return morpheus
|
172
172
|
|
173
|
+
async def run(self, messages: List[dict], **kwargs):
|
174
|
+
logger.info("NebuchaShellzzarBlueprint run method called.")
|
175
|
+
instruction = messages[-1].get("content", "") if messages else ""
|
176
|
+
try:
|
177
|
+
mcp_servers = kwargs.get("mcp_servers", [])
|
178
|
+
starting_agent = self.create_starting_agent(mcp_servers=mcp_servers)
|
179
|
+
from agents import Runner
|
180
|
+
if not starting_agent.model:
|
181
|
+
yield {"messages": [{"role": "assistant", "content": f"Error: No model instance available for NebuchaShellzzar agent. Check your OPENAI_API_KEY, or LITELLM_MODEL/LITELLM_BASE_URL config."}]}
|
182
|
+
return
|
183
|
+
if not starting_agent.tools:
|
184
|
+
yield {"messages": [{"role": "assistant", "content": f"Warning: No tools registered for NebuchaShellzzar agent. Only direct LLM output is possible."}]}
|
185
|
+
required_mcps = self.metadata.get('required_mcp_servers', [])
|
186
|
+
missing_mcps = [m for m in required_mcps if m not in [s.name for s in mcp_servers]]
|
187
|
+
if missing_mcps:
|
188
|
+
yield {"messages": [{"role": "assistant", "content": f"Warning: Missing required MCP servers: {', '.join(missing_mcps)}. Some features may not work."}]}
|
189
|
+
from rich.console import Console
|
190
|
+
console = Console()
|
191
|
+
with console.status("Generating...", spinner="dots") as status:
|
192
|
+
async for chunk in Runner.run(starting_agent, instruction):
|
193
|
+
content = chunk.get("content")
|
194
|
+
if content and ("function call" in content or "args" in content):
|
195
|
+
continue
|
196
|
+
yield chunk
|
197
|
+
logger.info("NebuchaShellzzarBlueprint run method finished.")
|
198
|
+
except Exception as e:
|
199
|
+
yield {"messages": [{"role": "assistant", "content": f"Error: {e}"}]}
|
200
|
+
|
173
201
|
if __name__ == "__main__":
|
174
202
|
NebuchaShellzzarBlueprint.main()
|
@@ -14,7 +14,7 @@ try:
|
|
14
14
|
from agents.models.interface import Model
|
15
15
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
16
16
|
from openai import AsyncOpenAI
|
17
|
-
from swarm.
|
17
|
+
from swarm.core.blueprint_base import BlueprintBase
|
18
18
|
except ImportError as e:
|
19
19
|
print(f"ERROR: Import failed in OmniplexBlueprint: {e}. Check dependencies.")
|
20
20
|
print(f"sys.path: {sys.path}")
|
@@ -216,26 +216,36 @@ class OmniplexBlueprint(BlueprintBase):
|
|
216
216
|
logger.info(f"Omniplex Coordinator created with tools for: {[t.name for t in team_tools]}")
|
217
217
|
return coordinator_agent
|
218
218
|
|
219
|
-
async def run(self, messages:
|
220
|
-
|
221
|
-
|
219
|
+
async def run(self, messages: list, **kwargs):
|
220
|
+
import logging
|
221
|
+
if not hasattr(self, "logger"):
|
222
|
+
self.logger = logging.getLogger(__name__)
|
223
|
+
self.logger.info("OmniplexBlueprint run method called.")
|
222
224
|
instruction = messages[-1].get("content", "") if messages else ""
|
223
|
-
async for chunk in self._run_non_interactive(instruction, **kwargs):
|
224
|
-
yield chunk
|
225
|
-
logger.info("OmniplexBlueprint run method finished.")
|
226
|
-
|
227
|
-
async def _run_non_interactive(self, instruction: str, **kwargs) -> Any:
|
228
|
-
logger.info(f"Running OmniplexBlueprint non-interactively with instruction: '{instruction[:100]}...'")
|
229
|
-
mcp_servers = kwargs.get("mcp_servers", [])
|
230
|
-
agent = self.create_starting_agent(mcp_servers=mcp_servers)
|
231
|
-
from agents import Runner
|
232
|
-
model_name = os.getenv("LITELLM_MODEL") or os.getenv("DEFAULT_LLM") or "gpt-3.5-turbo"
|
233
225
|
try:
|
234
|
-
|
235
|
-
|
226
|
+
mcp_servers = kwargs.get("mcp_servers", [])
|
227
|
+
agent = self.create_starting_agent(mcp_servers=mcp_servers)
|
228
|
+
from agents import Runner
|
229
|
+
if not agent.model:
|
230
|
+
yield {"messages": [{"role": "assistant", "content": f"Error: No model instance available for Omniplex agent. Check your OPENAI_API_KEY, or LITELLM_MODEL/LITELLM_BASE_URL config."}]}
|
231
|
+
return
|
232
|
+
if not agent.tools:
|
233
|
+
yield {"messages": [{"role": "assistant", "content": f"Warning: No tools registered for Omniplex agent. Only direct LLM output is possible."}]}
|
234
|
+
required_mcps = self.metadata.get('required_mcp_servers', [])
|
235
|
+
missing_mcps = [m for m in required_mcps if m not in [s.name for s in mcp_servers]]
|
236
|
+
if missing_mcps:
|
237
|
+
yield {"messages": [{"role": "assistant", "content": f"Warning: Missing required MCP servers: {', '.join(missing_mcps)}. Some features may not work."}]}
|
238
|
+
from rich.console import Console
|
239
|
+
console = Console()
|
240
|
+
with console.status("Generating...", spinner="dots") as status:
|
241
|
+
async for chunk in Runner.run(agent, instruction):
|
242
|
+
content = chunk.get("content")
|
243
|
+
if content and ("function call" in content or "args" in content):
|
244
|
+
continue
|
245
|
+
yield chunk
|
246
|
+
self.logger.info("OmniplexBlueprint run method finished.")
|
236
247
|
except Exception as e:
|
237
|
-
|
238
|
-
yield {"messages": [{"role": "assistant", "content": f"An error occurred: {e}"}]}
|
248
|
+
yield {"messages": [{"role": "assistant", "content": f"Error: {e}"}]}
|
239
249
|
|
240
250
|
# Standard Python entry point
|
241
251
|
if __name__ == "__main__":
|
@@ -13,7 +13,7 @@ logger = logging.getLogger(__name__)
|
|
13
13
|
|
14
14
|
# Attempt to import BlueprintBase, handle potential ImportError during early setup/testing
|
15
15
|
try:
|
16
|
-
from swarm.
|
16
|
+
from swarm.core.blueprint_base import BlueprintBase
|
17
17
|
except ImportError as e:
|
18
18
|
logger.error(f"Import failed: {e}. Check 'openai-agents' install and project structure.")
|
19
19
|
# *** REMOVED sys.exit(1) ***
|
@@ -14,7 +14,7 @@ try:
|
|
14
14
|
from agents.models.interface import Model
|
15
15
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
16
16
|
from openai import AsyncOpenAI
|
17
|
-
from swarm.
|
17
|
+
from swarm.core.blueprint_base import BlueprintBase
|
18
18
|
except ImportError as e:
|
19
19
|
print(f"ERROR: Failed to import 'agents' or 'BlueprintBase'. Is 'openai-agents' installed and src in PYTHONPATH? Details: {e}")
|
20
20
|
sys.exit(1)
|
@@ -18,7 +18,7 @@ try:
|
|
18
18
|
from agents.models.interface import Model
|
19
19
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
20
20
|
from openai import AsyncOpenAI
|
21
|
-
from swarm.
|
21
|
+
from swarm.core.blueprint_base import BlueprintBase
|
22
22
|
except ImportError as e:
|
23
23
|
print(f"ERROR: Import failed in UnapologeticPressBlueprint: {e}. Check dependencies.")
|
24
24
|
print(f"sys.path: {sys.path}")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Handles blueprint discovery and validation for the CLI
|
2
2
|
|
3
|
-
from swarm.
|
4
|
-
from swarm.
|
3
|
+
from swarm.core.blueprint_discovery import discover_blueprints
|
4
|
+
from swarm.core.config_loader import load_server_config
|
5
5
|
|
6
6
|
def list_blueprints():
|
7
7
|
"""List available blueprints and their metadata."""
|
@@ -16,7 +16,7 @@ def list_blueprints():
|
|
16
16
|
cat > src/swarm/extensions/cli/commands/config_management.py << 'EOF'
|
17
17
|
# Handles configuration management workflows (e.g., LLM, MCP servers)
|
18
18
|
|
19
|
-
from swarm.
|
19
|
+
from swarm.core.config_loader import (
|
20
20
|
load_server_config,
|
21
21
|
save_server_config,
|
22
22
|
)
|
@@ -1,15 +1,14 @@
|
|
1
1
|
# Handles configuration management workflows (e.g., LLM, MCP servers)
|
2
2
|
|
3
|
-
from swarm.
|
4
|
-
|
5
|
-
|
6
|
-
)
|
3
|
+
from swarm.core import config_loader
|
4
|
+
from swarm.core import config_manager
|
5
|
+
from swarm.core import server_config
|
7
6
|
|
8
7
|
def add_llm(model_name, api_key):
|
9
8
|
"""Add a new LLM configuration."""
|
10
|
-
config = load_server_config()
|
9
|
+
config = config_loader.load_server_config()
|
11
10
|
if "llms" not in config:
|
12
11
|
config["llms"] = {}
|
13
12
|
config["llms"][model_name] = {"api_key": api_key}
|
14
|
-
save_server_config(config)
|
13
|
+
config_manager.save_server_config(config)
|
15
14
|
print(f"Added LLM '{model_name}' to configuration.")
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import argparse
|
2
2
|
import json
|
3
|
-
from swarm.
|
4
|
-
|
5
|
-
|
3
|
+
from swarm.core import (
|
4
|
+
config_loader,
|
5
|
+
config_manager,
|
6
|
+
server_config,
|
7
|
+
setup_wizard,
|
6
8
|
)
|
7
9
|
from pathlib import Path
|
8
10
|
|
@@ -60,7 +62,7 @@ def main():
|
|
60
62
|
args = parser.parse_args()
|
61
63
|
|
62
64
|
try:
|
63
|
-
config = load_server_config(str(CONFIG_PATH))
|
65
|
+
config = config_loader.load_server_config(str(CONFIG_PATH))
|
64
66
|
except FileNotFoundError as e:
|
65
67
|
print(f"Error: {e}")
|
66
68
|
return
|
@@ -69,9 +71,9 @@ def main():
|
|
69
71
|
list_config(config)
|
70
72
|
elif args.interactive:
|
71
73
|
edit_config_interactive(config)
|
72
|
-
save_server_config(str(CONFIG_PATH), config)
|
74
|
+
config_loader.save_server_config(str(CONFIG_PATH), config)
|
73
75
|
elif args.field and args.value:
|
74
76
|
edit_config_field(config, args.field, args.value)
|
75
|
-
save_server_config(str(CONFIG_PATH), config)
|
77
|
+
config_loader.save_server_config(str(CONFIG_PATH), config)
|
76
78
|
else:
|
77
79
|
parser.print_help()
|
@@ -4,7 +4,7 @@ Description: Lists all blueprints available in the system.
|
|
4
4
|
"""
|
5
5
|
|
6
6
|
from pathlib import Path
|
7
|
-
from swarm.
|
7
|
+
from swarm.core.blueprint_discovery import discover_blueprints
|
8
8
|
|
9
9
|
# Metadata for dynamic registration
|
10
10
|
description = "Lists all blueprints available in the system."
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
import argparse
|
3
|
-
from swarm.
|
4
|
-
from swarm.
|
3
|
+
from swarm.core import config_loader, config_manager, server_config
|
4
|
+
from swarm.core.blueprint_base import BlueprintBase
|
5
5
|
|
6
6
|
CONFIG_PATH = "swarm_config.json"
|
7
7
|
|
@@ -43,7 +43,7 @@ def main():
|
|
43
43
|
args = parser.parse_args()
|
44
44
|
|
45
45
|
try:
|
46
|
-
config = load_server_config(CONFIG_PATH)
|
46
|
+
config = server_config.load_server_config(CONFIG_PATH)
|
47
47
|
except FileNotFoundError as e:
|
48
48
|
print(f"Error: {e}")
|
49
49
|
return
|
@@ -1,5 +1,5 @@
|
|
1
|
-
from swarm.
|
2
|
-
from swarm.
|
1
|
+
from swarm.core.blueprint_discovery import discover_blueprints
|
2
|
+
from swarm.core import config_loader, config_manager, server_config
|
3
3
|
import argparse
|
4
4
|
|
5
5
|
def validate_envvars(blueprint_name=None):
|
@@ -19,16 +19,16 @@ def validate_envvars(blueprint_name=None):
|
|
19
19
|
print(f"Blueprint '{blueprint_name}' not found.")
|
20
20
|
return
|
21
21
|
required_vars = blueprint.get("env_vars", [])
|
22
|
-
env_vars = load_env_config()
|
23
|
-
validation = validate_env_vars(env_vars, required_vars)
|
22
|
+
env_vars = config_loader.load_env_config()
|
23
|
+
validation = config_manager.validate_env_vars(env_vars, required_vars)
|
24
24
|
print(f"Validation for '{blueprint_name}': {validation}")
|
25
25
|
else:
|
26
26
|
# Global validation
|
27
|
-
env_vars = load_env_config()
|
27
|
+
env_vars = config_loader.load_env_config()
|
28
28
|
print("Global Environment Validation:")
|
29
29
|
for blueprint_name, blueprint_data in blueprints.items():
|
30
30
|
required_vars = blueprint_data.get("env_vars", [])
|
31
|
-
validation = validate_env_vars(env_vars, required_vars)
|
31
|
+
validation = config_manager.validate_env_vars(env_vars, required_vars)
|
32
32
|
print(f"Validation for '{blueprint_name}': {validation}")
|
33
33
|
|
34
34
|
def main():
|
File without changes
|
{open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/entry_points.txt
RENAMED
File without changes
|
{open_swarm-0.1.1744942884.dist-info → open_swarm-0.1.1744943015.dist-info}/licenses/LICENSE
RENAMED
File without changes
|