diff --git a/python/src/uagents/config.py b/python/src/uagents/config.py index 45f0a1865..042f730a7 100644 --- a/python/src/uagents/config.py +++ b/python/src/uagents/config.py @@ -92,7 +92,7 @@ def parse_agentverse_config( if "://" in base_url: protocol, base_url = base_url.split("://") protocol = protocol_override or protocol or "https" - http_prefix = "https" if protocol == "https" else "http" + http_prefix = "https" if protocol in {"wss", "https"} else "http" return { "api_key": api_key, "base_url": base_url, diff --git a/python/src/uagents/mailbox.py b/python/src/uagents/mailbox.py index 9d0e3f7b9..7bf3a42f6 100644 --- a/python/src/uagents/mailbox.py +++ b/python/src/uagents/mailbox.py @@ -49,7 +49,7 @@ def protocol(self): """ Property to access the protocol of the mailbox server. - Returns: The protocol of the mailbox server {http, https}. + Returns: The protocol of the mailbox server {ws, wss, http, https}. """ return self._agent.mailbox["protocol"] diff --git a/python/tests/test_config.py b/python/tests/test_config.py index 658a0ad93..481e4396a 100644 --- a/python/tests/test_config.py +++ b/python/tests/test_config.py @@ -72,7 +72,7 @@ "api_key": None, "base_url": "some_url", "protocol": "wss", - "http_prefix": "http", + "http_prefix": "https", "use_mailbox": False, }, { @@ -86,7 +86,7 @@ "api_key": "api_key", "base_url": "agentverse.ai", "protocol": "wss", - "http_prefix": "http", + "http_prefix": "https", "use_mailbox": True, }, {