Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SwarmNetwork #513

Open
evelynmitchell opened this issue Jun 25, 2024 · 2 comments
Open

[BUG] SwarmNetwork #513

evelynmitchell opened this issue Jun 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@evelynmitchell
Copy link
Contributor

evelynmitchell commented Jun 25, 2024

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[<ipython-input-14-1f396324b767>](https://localhost:8080/#) in <cell line: 6>()
      4 
      5 # Import the OpenAIChat model and the Agent struct
----> 6 from swarms import Agent, OpenAIChat, SwarmNetwork
      7 
      8 # Load the environment variables

ImportError: cannot import name 'SwarmNetwork' from 'swarms' (/usr/local/lib/python3.10/dist-packages/swarms/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@evelynmitchell evelynmitchell added the bug Something isn't working label Jun 25, 2024
@sambhavnoobcoder
Copy link
Contributor

To solve this bug, we need to update the import statement. The SwarmNetwork class should be imported from swarms.structs instead of directly from swarms . Here's how to fix the import:

from swarms import Agent
from swarm_models import OpenAIChat
from swarms.structs import SwarmNetwork

This change addresses the ImportError by correctly importing SwarmNetwork from the swarms.structs module.
You can reference this change in the following line :

from swarms.structs.swarm_net import SwarmNetwork

located at the top imports of the structs/init.py

@kyegomez
Copy link
Owner

@evelynmitchell @sambhavnoobcoder yeah, the swarm network has been dropped out of production because it's not production grade yet. I will close this error for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants