Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
i am extremely new to python and i am having trouble with this. i think i have not install prosody correctly or i have not configured it yet. i don't know how to configure prosody with mac terminal everything is virtual. i posted the problem. please help me out here
What I Did
import argparse
from spade import quit_spade
from spade_bdi.bdi import BDIAgent
parser = argparse.ArgumentParser(description='spade bdi basic example')
parser.add_argument('--server', type=str, default="xmpp.jp", help='XMPP server address.')
parser.add_argument('--name', type=str, default="basicagent", help='XMPP name for the agent.')
parser.add_argument('--password', type=str, default="bdipassword", help='XMPP password for the agent.')
args = parser.parse_args()
a = BDIAgent("{}@{}".format(args.name, args.server), args.password, "basic.asl")
a.start()
import time
time.sleep(1)
a.bdi.set_belief("car", "azul", "big")
a.bdi.print_beliefs()
print("GETTING FIRST CAR BELIEF")
print(a.bdi.get_belief("car"))
a.bdi.print_beliefs()
a.bdi.remove_belief("car", 'azul', "big")
a.bdi.print_beliefs()
print(a.bdi.get_beliefs())
a.bdi.set_belief("car", 'amarillo')
time.sleep(1)
a.stop().result()
quit_spade()
Paste the command(s) you ran and the output.
======= RESTART: /Users/kiransaleem/Downloads/spadebdi/examples/basic.py =======
GETTING FIRST CAR BELIEF
Traceback (most recent call last):
File "/Users/kiransaleem/Downloads/spadebdi/examples/basic.py", line 22, in <module>
print(a.bdi.get_belief("car"))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/spade_bdi/bdi.py", line 125, in get_belief
raw_belief = (str(list(self.agent.bdi_agent.beliefs[beliefs])[0]))
IndexError: list index out of range
>>> main failed
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 837, in _on_main_done
task.result()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 997, in _main
await self._main_impl()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 952, in _main_impl
tls_transport, xmlstream, features = await connect_xmlstream(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 390, in connect_xmlstream
result = await _try_options(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 267, in _try_options
features = await security_layer.negotiate_sasl(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 1179, in negotiate_sasl
raise last_auth_error
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 1162, in negotiate_sasl
result = await sasl_provider.execute(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 962, in execute
mechanism_worked = await self._execute(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 840, in _execute
await mechanism.authenticate(sm, token)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiosasl/scram.py", line 158, in authenticate
username, password = await self._credential_provider()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 938, in credential_provider
raise aiosasl.AuthenticationFailure(
aiosasl.common.AuthenticationFailure: user intervention: authentication failed: authentication aborted by user
If there was a crash, please include the traceback here.
Traceback (most recent call last):
File "/Users/kiransaleem/Downloads/spadebdi/examples/basic.py", line 22, in
print(a.bdi.get_belief("car"))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/spade_bdi/bdi.py", line 125, in get_belief
raw_belief = (str(list(self.agent.bdi_agent.beliefs[beliefs])[0]))
IndexError: list index out of range
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 837, in _on_main_done
task.result()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 997, in _main
await self._main_impl()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 952, in _main_impl
tls_transport, xmlstream, features = await connect_xmlstream(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 390, in connect_xmlstream
result = await _try_options(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 267, in _try_options
features = await security_layer.negotiate_sasl(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 1179, in negotiate_sasl
raise last_auth_error
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 1162, in negotiate_sasl
result = await sasl_provider.execute(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 962, in execute
mechanism_worked = await self._execute(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 840, in _execute
await mechanism.authenticate(sm, token)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiosasl/scram.py", line 158, in authenticate
username, password = await self._credential_provider()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 938, in credential_provider
raise aiosasl.AuthenticationFailure(
aiosasl.common.AuthenticationFailure: user intervention: authentication failed: authentication aborted by user
Description
Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen. i am extremely new to python and i am having trouble with this. i think i have not install prosody correctly or i have not configured it yet. i don't know how to configure prosody with mac terminal everything is virtual. i posted the problem. please help me out here
What I Did
import argparse
from spade import quit_spade
from spade_bdi.bdi import BDIAgent
parser = argparse.ArgumentParser(description='spade bdi basic example') parser.add_argument('--server', type=str, default="xmpp.jp", help='XMPP server address.') parser.add_argument('--name', type=str, default="basicagent", help='XMPP name for the agent.') parser.add_argument('--password', type=str, default="bdipassword", help='XMPP password for the agent.') args = parser.parse_args()
a = BDIAgent("{}@{}".format(args.name, args.server), args.password, "basic.asl") a.start()
import time time.sleep(1)
a.bdi.set_belief("car", "azul", "big") a.bdi.print_beliefs() print("GETTING FIRST CAR BELIEF") print(a.bdi.get_belief("car")) a.bdi.print_beliefs() a.bdi.remove_belief("car", 'azul', "big") a.bdi.print_beliefs() print(a.bdi.get_beliefs()) a.bdi.set_belief("car", 'amarillo')
time.sleep(1)
a.stop().result()
quit_spade()
Traceback (most recent call last): File "/Users/kiransaleem/Downloads/spadebdi/examples/basic.py", line 22, in
print(a.bdi.get_belief("car"))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/spade_bdi/bdi.py", line 125, in get_belief
raw_belief = (str(list(self.agent.bdi_agent.beliefs[beliefs])[0]))
IndexError: list index out of range
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 837, in _on_main_done task.result() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 997, in _main await self._main_impl() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 952, in _main_impl tls_transport, xmlstream, features = await connect_xmlstream( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 390, in connect_xmlstream result = await _try_options( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/node.py", line 267, in _try_options features = await security_layer.negotiate_sasl( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 1179, in negotiate_sasl raise last_auth_error File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 1162, in negotiate_sasl result = await sasl_provider.execute( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 962, in execute mechanism_worked = await self._execute( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 840, in _execute await mechanism.authenticate(sm, token) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiosasl/scram.py", line 158, in authenticate username, password = await self._credential_provider() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aioxmpp/security_layer.py", line 938, in credential_provider raise aiosasl.AuthenticationFailure( aiosasl.common.AuthenticationFailure: user intervention: authentication failed: authentication aborted by user