Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[Bug]: AttributeError: “list’ object has no attribute ‘startswith’” #623

Open
1 task done
hankp46 opened this issue Jul 20, 2023 · 2 comments
Open
1 task done

Comments

@hankp46
Copy link

hankp46 commented Jul 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Executed the following code:
import asyncio, json
from EdgeGPT.EdgeGPT import Chatbot, ConversationStyle

cookies = json.loads(open("/home/hank/bing_cookies_*.json", encoding="utf-8").read())

async def main():
bot = await Chatbot.create(cookies) # Passing cookies is "optional", as explained above
response = await bot.ask(prompt="Hello world", conversation_style=ConversationStyle.creative, simplify_response=True)
print(json.dumps(response, indent=2)) # Returns
"""
{
"text": str,
"author": str,
"sources": list[dict],
"sources_text": str,
"suggestions": list[str],
"messages_left": int
}
"""
await bot.close()

if name == "main":
asyncio.run(main())

When I ran it got following error:
File "/home/hank/.local/lib/python3.9/site-packages/EdgeGPT/conversation.py", line 86, in create
if proxy is not None and proxy.startswith("socks5h://"):
AttributeError: “list’ object has no attribute ‘startswith’”

Steps to reproduce the problem

run the script..

What should have happened?

should get print out

Version where the problem happens

Version: 0.12.1

What Python version are you running this with?

3.9

What is your operating system ?

No response

Command Line Arguments

no

Console logs

n/A

Additional information

No response

@SergeyHat
Copy link

поддержку прокси вырезали и попробуй установить питон поновее

@hankp46
Copy link
Author

hankp46 commented Jul 21, 2023

Thanks for replying: proxy support was cut out and try to install a newer python

The problem still exists after Installing Python 3.11.4.
This is in the EdgeGPT program which I don't know how to alter

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants