open-swarm 0.1.1745019858__py3-none-any.whl → 0.1.1745019957__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.1745019858.dist-info → open_swarm-0.1.1745019957.dist-info}/METADATA +1 -1
- {open_swarm-0.1.1745019858.dist-info → open_swarm-0.1.1745019957.dist-info}/RECORD +7 -7
- swarm/blueprints/chatbot/blueprint_chatbot.py +41 -38
- swarm/extensions/blueprint/cli_handler.py +1 -2
- {open_swarm-0.1.1745019858.dist-info → open_swarm-0.1.1745019957.dist-info}/WHEEL +0 -0
- {open_swarm-0.1.1745019858.dist-info → open_swarm-0.1.1745019957.dist-info}/entry_points.txt +0 -0
- {open_swarm-0.1.1745019858.dist-info → open_swarm-0.1.1745019957.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.1745019957
|
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
|
@@ -15,7 +15,7 @@ swarm/wsgi.py,sha256=REM_u4HpMCkO0ddrOUXgtY-ITL-VTbRB1-WHvFJAtAU,408
|
|
15
15
|
swarm/agent/__init__.py,sha256=YESGu_UXEBxrlQwghodUMN0vmXZDwWMU7DclCUvoklA,104
|
16
16
|
swarm/blueprints/README.md,sha256=tsngbSB9N0tILcz_m1OGAjyKZQYlGTN-i5e5asq1GbE,8478
|
17
17
|
swarm/blueprints/blueprint_audit_status.json,sha256=-1jCh56y8BC0h5Z2o7-TWY2Xw5Jj4wEVNohZF_Dw4EE,1857
|
18
|
-
swarm/blueprints/chatbot/blueprint_chatbot.py,sha256=
|
18
|
+
swarm/blueprints/chatbot/blueprint_chatbot.py,sha256=Ws3eTfq6A_jsm4nGPo47pM06RdAYmur5YY2siOcbUwA,10484
|
19
19
|
swarm/blueprints/chatbot/templates/chatbot/chatbot.html,sha256=REFnqNg0EHsXxAUfaCJe1YgOKiV_umBXuC6y8veF5CU,1568
|
20
20
|
swarm/blueprints/codey/CODEY.md,sha256=JxGcR0INH0dLk_q4ua1D0YdvX99szyESsbbs4dIy5Sc,742
|
21
21
|
swarm/blueprints/codey/README.md,sha256=n2Sz1yg1FZp6ATV4W4rmgIYeQFFzlJ_APhCY1j6UR7o,3545
|
@@ -84,7 +84,7 @@ swarm/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
84
84
|
swarm/core/utils/logger.py,sha256=sUkKdZsjRiCGGCEPfZ4YqeZDbiaUeGFOa3mdbVOTmvU,1242
|
85
85
|
swarm/extensions/__init__.py,sha256=SadbzfxckByaaqzuKPfXMvqmj45-dcMlavlfQYhGnzE,56
|
86
86
|
swarm/extensions/blueprint/__init__.py,sha256=CqPy-gR0KAeVGxDnOWKOYZZzVC1FXRzQDtUCY8jmP1c,1850
|
87
|
-
swarm/extensions/blueprint/cli_handler.py,sha256=
|
87
|
+
swarm/extensions/blueprint/cli_handler.py,sha256=_sUqT0FuVP6KcjxDqBHMzzWs0J5RH2VV7_VxSZq7MqQ,9981
|
88
88
|
swarm/extensions/blueprint/django_utils.py,sha256=ObtkmF1JW4H2OEYa7vC6ussUsMBtDsZTTVeHGHI-GOQ,17457
|
89
89
|
swarm/extensions/blueprint/interactive_mode.py,sha256=vGmMuAgC93TLjMi2RkXQ2FkWfIUblyOTFGHmVdGKLSQ,4572
|
90
90
|
swarm/extensions/blueprint/runnable_blueprint.py,sha256=1MywZ54vUysLVtYmwCbcDYQmQnoZffCHgsArbe-VKe8,1813
|
@@ -271,8 +271,8 @@ swarm/views/message_views.py,sha256=sDUnXyqKXC8WwIIMAlWf00s2_a2T9c75Na5FvYMJwBM,
|
|
271
271
|
swarm/views/model_views.py,sha256=aAbU4AZmrOTaPeKMWtoKK7FPYHdaN3Zbx55JfKzYTRY,2937
|
272
272
|
swarm/views/utils.py,sha256=8Usc0g0L0NPegNAyY20tJBNBy-JLwODf4VmxV0yUtpw,3627
|
273
273
|
swarm/views/web_views.py,sha256=T1CKe-Nyv1C8aDt6QFTGWo_dkH7ojWAvS_QW9mZnZp0,7371
|
274
|
-
open_swarm-0.1.
|
275
|
-
open_swarm-0.1.
|
276
|
-
open_swarm-0.1.
|
277
|
-
open_swarm-0.1.
|
278
|
-
open_swarm-0.1.
|
274
|
+
open_swarm-0.1.1745019957.dist-info/METADATA,sha256=3KsTmrhfQC5EfIMULXc4grReT6v3OqPjlMeXqvuJK2Q,23332
|
275
|
+
open_swarm-0.1.1745019957.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
276
|
+
open_swarm-0.1.1745019957.dist-info/entry_points.txt,sha256=fo28d0_zJrytRsh8QqkdlWQT_9lyAwYUx1WuSTDI3HM,177
|
277
|
+
open_swarm-0.1.1745019957.dist-info/licenses/LICENSE,sha256=BU9bwRlnOt_JDIb6OT55Q4leLZx9RArDLTFnlDIrBEI,1062
|
278
|
+
open_swarm-0.1.1745019957.dist-info/RECORD,,
|
@@ -19,6 +19,12 @@ if not os.environ.get("SWARM_DEBUG"):
|
|
19
19
|
else:
|
20
20
|
logging.basicConfig(level=logging.DEBUG)
|
21
21
|
|
22
|
+
# Set logging to WARNING by default unless SWARM_DEBUG=1
|
23
|
+
if not os.environ.get("SWARM_DEBUG"):
|
24
|
+
logging.basicConfig(level=logging.WARNING)
|
25
|
+
else:
|
26
|
+
logging.basicConfig(level=logging.DEBUG)
|
27
|
+
|
22
28
|
# Ensure src is in path for BlueprintBase import
|
23
29
|
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
24
30
|
src_path = os.path.join(project_root, 'src')
|
@@ -180,50 +186,47 @@ You are a helpful and friendly chatbot. Respond directly to the user's input in
|
|
180
186
|
logger.debug("Chatbot agent created.")
|
181
187
|
return chatbot_agent
|
182
188
|
|
183
|
-
def render_prompt(self, template_name: str, context: dict) -> str:
|
184
|
-
return f"User request: {context.get('user_request', '')}\nHistory: {context.get('history', '')}\nAvailable tools: {', '.join(context.get('available_tools', []))}"
|
185
|
-
|
186
189
|
async def run(self, messages: List[Dict[str, Any]], **kwargs) -> Any:
|
187
190
|
"""Main execution entry point for the Chatbot blueprint."""
|
188
191
|
logger.info("ChatbotBlueprint run method called.")
|
189
|
-
|
190
|
-
|
191
|
-
yield
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
]
|
206
|
-
}
|
207
|
-
return
|
192
|
+
instruction = messages[-1].get("content", "") if messages else ""
|
193
|
+
async for chunk in self._run_non_interactive(instruction, **kwargs):
|
194
|
+
yield chunk
|
195
|
+
logger.info("ChatbotBlueprint run method finished.")
|
196
|
+
|
197
|
+
async def _run_non_interactive(self, instruction: str, **kwargs) -> Any:
|
198
|
+
mcp_servers = kwargs.get("mcp_servers", [])
|
199
|
+
agent = self.create_starting_agent(mcp_servers=mcp_servers)
|
200
|
+
from agents import Runner
|
201
|
+
import os
|
202
|
+
model_name = os.getenv("LITELLM_MODEL") or os.getenv("DEFAULT_LLM") or "gpt-3.5-turbo"
|
203
|
+
try:
|
204
|
+
result = await Runner.run(agent, instruction)
|
205
|
+
yield {"messages": [{"role": "assistant", "content": getattr(result, 'final_output', str(result))}]}
|
206
|
+
except Exception as e:
|
207
|
+
logger.error(f"Error during non-interactive run: {e}", exc_info=True)
|
208
|
+
yield {"messages": [{"role": "assistant", "content": f"An error occurred: {e}"}]}
|
208
209
|
|
209
210
|
# Standard Python entry point
|
210
211
|
if __name__ == "__main__":
|
212
|
+
import sys
|
211
213
|
import asyncio
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
if instruction:
|
221
|
-
blueprint = ChatbotBlueprint(blueprint_id="chatbot")
|
222
|
-
async def runner():
|
223
|
-
async for chunk in blueprint._run_non_interactive(instruction):
|
224
|
-
msg = chunk["messages"][0]["content"]
|
225
|
-
if not msg.startswith("An error occurred:"):
|
226
|
-
print(msg)
|
227
|
-
asyncio.run(runner())
|
214
|
+
# --- AUTO-PYTHONPATH PATCH FOR AGENTS ---
|
215
|
+
import os
|
216
|
+
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..'))
|
217
|
+
src_path = os.path.join(project_root, 'src')
|
218
|
+
if src_path not in sys.path:
|
219
|
+
sys.path.insert(0, src_path)
|
220
|
+
if '--instruction' in sys.argv:
|
221
|
+
instruction = sys.argv[sys.argv.index('--instruction') + 1]
|
228
222
|
else:
|
229
223
|
print("Interactive mode not supported in this script.")
|
224
|
+
sys.exit(1)
|
225
|
+
|
226
|
+
blueprint = ChatbotBlueprint(blueprint_id="chatbot")
|
227
|
+
async def runner():
|
228
|
+
async for chunk in blueprint._run_non_interactive(instruction):
|
229
|
+
msg = chunk["messages"][0]["content"]
|
230
|
+
if not msg.startswith("An error occurred:"):
|
231
|
+
print(msg)
|
232
|
+
asyncio.run(runner())
|
@@ -24,7 +24,7 @@ logger = logging.getLogger("swarm.cli")
|
|
24
24
|
project_root = Path(__file__).parent.parent.parent.parent # /home/chatgpt/open-swarm
|
25
25
|
dotenv_path = project_root / ".env"
|
26
26
|
load_dotenv(dotenv_path=dotenv_path, override=True)
|
27
|
-
print("[DEBUG] LITELLM_API_KEY:", os.environ.get("LITELLM_API_KEY"))
|
27
|
+
# print("[DEBUG] LITELLM_API_KEY:", os.environ.get("LITELLM_API_KEY"))
|
28
28
|
# print(f"[DEBUG] Loaded .env from: {dotenv_path}")
|
29
29
|
# print(f"[DEBUG] LITELLM_MODEL={os.environ.get('LITELLM_MODEL')}")
|
30
30
|
# print(f"[DEBUG] LITELLM_BASE_URL={os.environ.get('LITELLM_BASE_URL')}")
|
@@ -73,7 +73,6 @@ async def _run_blueprint_async_with_shutdown(blueprint: 'BlueprintBase', instruc
|
|
73
73
|
sys.exit(1)
|
74
74
|
|
75
75
|
|
76
|
-
|
77
76
|
def run_blueprint_cli(
|
78
77
|
blueprint_cls: Type['BlueprintBase'],
|
79
78
|
swarm_version: str,
|
File without changes
|
{open_swarm-0.1.1745019858.dist-info → open_swarm-0.1.1745019957.dist-info}/entry_points.txt
RENAMED
File without changes
|
{open_swarm-0.1.1745019858.dist-info → open_swarm-0.1.1745019957.dist-info}/licenses/LICENSE
RENAMED
File without changes
|