Replies: 1 comment
-
I guess you have been following a Youtube tutorial. The code is outdated. It is due to argument mismatch. Update these lines:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Below code is giving me error -
import os
from autogen import AssistantAgent, UserProxyAgent
from dotenv import load_dotenv
load_dotenv()
model = "gpt-3.5-turbo"
llm2_config = {
"model":model,
"api_key":os.environ.get("OPENAI_API_KEY")
}
assistant = AssistantAgent("assistant",llm2_config)
userproxy = UserProxyAgent("userproxy",llm2_config, code_execution_config={"work_dir":"coding", "use_docker":False}, human_input_mode="NEVER")
res=userproxy.initiate_chat(assistant, message="what is the capital of France?",max_turns=2,)
==================================================
userproxy (to assistant):
what is the capital of France?
assistant (to userproxy):
TypeError Traceback (most recent call last)
Cell In[1], line 15
12 assistant = AssistantAgent("assistant",llm2_config)
13 userproxy = UserProxyAgent("userproxy",llm2_config, code_execution_config={"work_dir":"coding", "use_docker":False}, human_input_mode="NEVER")
---> 15 res=userproxy.initiate_chat(assistant, message="what is the capital of France?",max_turns=2,)
File ~\Desktop\Resume\python\virtualenvironment\Lib\site-packages\autogen\agentchat\conversable_agent.py:1086, in ConversableAgent.initiate_chat(self, recipient, clear_history, silent, cache, max_turns, summary_method, summary_args, message, **kwargs)
1084 msg2send = self.generate_init_message(message, **kwargs)
1085 else:
-> 1086 msg2send = self.generate_reply(messages=self.chat_messages[recipient], sender=recipient)
1087 if msg2send is None:
1088 break
File ~\Desktop\Resume\python\virtualenvironment\Lib\site-packages\autogen\agentchat\conversable_agent.py:2050, in ConversableAgent.generate_reply(self, messages, sender, **kwargs)
2048 continue
2049 if self._match_trigger(reply_func_tuple["trigger"], sender):
-> 2050 final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
2051 if logging_enabled():
2052 log_event(
2053 self,
2054 "reply_func_executed",
(...)
2058 reply=reply,
2059 )
File ~\Desktop\Resume\python\virtualenvironment\Lib\site-packages\autogen\agentchat\conversable_agent.py:1823, in ConversableAgent.check_termination_and_human_reply(self, messages, sender, config)
1821 # if the human input is empty, and the message is a termination message, then we will terminate the conversation
1822 reply = reply if reply or not terminate else "exit"
-> 1823 elif self._is_termination_msg(message):
1824 if self.human_input_mode == "NEVER":
1825 reply = "exit"
TypeError: 'dict' object is not callable
===========================================
list of packages -
aiohappyeyeballs==2.3.5
aiohttp==3.10.1
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.4.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
attrs==23.2.0
Babel==2.15.0
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.6.2
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
comm==0.2.2
contourpy==1.2.1
cycler==0.12.1
dataclasses-json==0.6.7
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
diskcache==5.6.3
distro==1.9.0
docker==7.1.0
executing==2.0.1
fastjsonschema==2.19.1
FLAML==2.2.0
fonttools==4.53.0
fqdn==1.5.1
frozenlist==1.4.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
ipykernel==6.29.4
ipython==8.25.0
ipywidgets==8.1.3
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.4
jiter==0.5.0
joblib==1.4.2
json5==0.9.25
jsonpatch==1.33
jsonpointer==2.4
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.2
jupyter_core==5.7.2
jupyter_server==2.14.1
jupyter_server_terminals==0.5.3
jupyterlab==4.2.1
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.2
jupyterlab_widgets==3.0.11
kiwisolver==1.4.5
langchain==0.2.12
langchain-community==0.2.11
langchain-core==0.2.29
langchain-openai==0.1.20
langchain-text-splitters==0.2.2
langchainhub==0.1.20
langsmith==0.1.98
MarkupSafe==2.1.5
marshmallow==3.21.3
matplotlib==3.9.0
matplotlib-inline==0.1.7
mistune==3.0.2
multidict==6.0.5
mypy-extensions==1.0.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
neo4j==5.22.0
nest-asyncio==1.6.0
notebook==7.2.0
notebook_shim==0.2.4
numpy==1.26.4
openai==1.40.1
orjson==3.10.6
overrides==7.7.0
packaging==24.0
pandas==2.2.2
pandas-flavor==0.6.0
pandocfilters==1.5.1
parso==0.8.4
patsy==0.5.6
pillow==10.3.0
pingouin==0.5.4
platformdirs==4.2.2
prometheus_client==0.20.0
prompt_toolkit==3.0.46
psutil==5.9.8
pure-eval==0.2.2
pyautogen==0.2.35
pycparser==2.22
pydantic==2.8.2
pydantic_core==2.20.1
Pygments==2.18.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-json-logger==2.0.7
pytz==2024.1
pywin32==306
pywinpty==2.0.13
PyYAML==6.0.1
pyzmq==26.0.3
qtconsole==5.5.2
QtPy==2.4.1
referencing==0.35.1
regex==2024.7.24
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.1
scikit-learn==1.5.1
scipy==1.14.0
seaborn==0.13.2
Send2Trash==1.8.3
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
SQLAlchemy==2.0.32
stack-data==0.6.3
statsmodels==0.14.2
tabulate==0.9.0
tenacity==8.5.0
termcolor==2.4.0
terminado==0.18.1
threadpoolctl==3.5.0
tiktoken==0.7.0
tinycss2==1.3.0
tornado==6.4
tqdm==4.66.5
traitlets==5.14.3
types-python-dateutil==2.9.0.20240316
types-requests==2.32.0.20240712
typing-inspect==0.9.0
typing_extensions==4.12.2
tzdata==2024.1
uri-template==1.3.0
urllib3==2.2.1
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==4.0.11
wordcloud==1.9.3
xarray==2024.7.0
yarl==1.9.4
Note: you may need to restart the kernel to use updated packages.
Beta Was this translation helpful? Give feedback.
All reactions