canxin121 / async-bing-client Goto Github PK
View Code? Open in Web Editor NEWasync bing client for bing.com
async bing client for bing.com
I wrote a test code, but it gave an error:
raise Exception(f"Max Retry Exceed: {error}") Exception: Max Retry Exceed: I confirmed that my proxy is not the problem and it can be used for bing chat. Please let me know if there is any issue with my code, here is the code:
import asyncio
from pathlib import Path
from async_bing_client import Bing_Client, ConversationStyle
async def main():
client = Bing_Client(cookie="C:\\Users\\xxxx\\Desktop\\cookies.json", proxy="socks5://127.0.0.1:10801")
await client.init()
# 创建新的对话
chat = await client.create_chat()
# 与Bing对话
async for text in client.ask_stream("你知道地球吗?", chat=chat, conversation_style=ConversationStyle.Balanced):
print(text, end="")
# 获取缓存的chat列表
chat_list = client.chat_list
# 删除某个会话
conversation_to_delete_id = 'some_conversation_id'
await client.delete_conversation(conversation_to_delete_id)
# 批量删除(chat)
await client.delete_conversation_by_count(count=10)
# AI画图
images = await client.draw("一座森林里的小木屋")
for index, image in enumerate(images):
print(f"Image {index + 1}: {image.url}")
if __name__ == '__main__':
asyncio.run(main())
thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.