Replies: 4 comments 4 replies
-
@joshkyh could you help with this issue and check if doc is outdated? |
Beta Was this translation helpful? Give feedback.
-
Make sure you have the relevant libraries installed by running: pip install pyautogen[graphs] Then, you need to update your import to the following: from autogen.graph_utils import visualize_speaker_transitions_dict Then try running the code you provided above again: visualize_speaker_transitions_dict(allowed_speaker_transitions_dict, user_proxy, pcp, dbp, guardian, diagnosis_coordinator, diagnosis_rules_researcher, humm_responder) |
Beta Was this translation helpful? Give feedback.
-
we did an update just now and updated with the changes and got the following - it seems to be telling us it cannot find AssistantAgent. and why is it looking for it on C? Here is what we got: runfile('D:/AutoGen/NeuroGen1/ASD_D1_FSM.py', wdir='D:/AutoGen/NeuroGen1') File C:\ProgramData\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec File d:\autogen\neurogen1\asd_d1_fsm.py:1 ImportError: cannot import name 'AssistantAgent' from 'autogen' (C:\Users\iCELS\AppData\Roaming\Python\Python311\site-packages\autogen_init_.py) |
Beta Was this translation helpful? Give feedback.
-
Didn't work : File C:\ProgramData\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec File d:\autogen\neurogen1\asd_d1_fsm.py:1 ImportError: cannot import name 'AssistantAgent' from 'autogen' (C:\Users\iCELS\AppData\Roaming\Python\Python311\site-packages\autogen_init_.py) |
Beta Was this translation helpful? Give feedback.
-
HI, I've set up Autogen and have examples working. I have pulled in LLMs locally and have it working against them, so my prototyping is great on that, not using it in a real system yet but wow.
I hit a problem when I tried to use the FSM controls. I added it in as it seemed it was defined, but then I get an error that seems like the framework has no idea what i'm doing with the allowed speaker transition from the FSM. I'll describe below in more gory detail ;-) and would love help. This is super exciting work and I am working on projects to help the Neurodiverse so want to get it going! Could be a d'oh! do this kind of error. And happy to put all the code in a doc and attache it if that helps too.
Here what we did, added and the error: :
We created a use case with AutoGen with several different agents that worked but didn't do what we wanted because all the agents talked to each other. We got a redundant, maybe FIFO back and forth between our agents. We want to constrain conversations between certain agents. So, perfect for the AutoGen FSM. We went to the AutoGen FSM write-up (describes how we can define the transition paths amongst agents). This write up is located here:
autogen/notebook/agentchat_groupchat_finite_state_machine.ipynb at main · microsoft/autogen on GitHub
We took what was working fine and added the visualize_speaker_transitions_dict as follows to the top of our autogen per the directions (we think per them ;-):
_from autogen import AssistantAgent, UserProxyAgent, GroupChat, GroupChatManager, visualize_speaker_transitions_dict
Then below we added:
allowed_speaker_transitions_dict = {
user_proxy: [pcp, dbp, diagnosis_coordinator],
pcp: [dbp,user_proxy,diagnosis_coordinator],
dbp: [user_proxy, pcp, diagnosis_coordinator],
guardian: [diagnosis_coordinator, diagnosis_rules_researcher,humm_responder],
diagnosis_coordinator: [user_proxy, pcp, dbp, guardian, diagnosis_rules_researcher, humm_responder],
diagnosis_rules_researcher: [diagnosis_coordinator],
humm_responder: [diagnosis_coordinator],
}
visualize_speaker_transitions_dict(allowed_speaker_transitions_dict, user_proxy, pcp, dbp, guardian, diagnosis_coordinator, diagnosis_rules_researcher, humm_responder)
groupchat = GroupChat(
We got the following error:
InportError: cannot import name
'visualize_speaker_transitions_dict' from 'autogen' then the path to our .py
I'll attach the image of the error.
Beta Was this translation helpful? Give feedback.
All reactions