Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

WARNING | poe_api_wrapper.api:on_ws_close:273 - Connection to remote host was lost. Reconnecting... #215

@CheeMao

Description

@CheeMao

code:
`import threading
from poe_api_wrapper import PoeApi
import time

clash

proxy_context = [
{"https":'socks5://127.0.0.1:7890', "http":'socks5://127.0.0.1:7890'},
{"https":'127.0.0.1:7890', "http":'127.0.0.1:7890'},
]

def chat_thread(thread_id, tokens, bot, message):
try:
#
client = PoeApi(tokens=tokens, proxy=proxy_context)
response_accumulated = ""

    # 
    for chunk in client.send_message(bot, message):
        print(chunk["response"], end="", flush=True)
    
    # 
    chatId = chunk["chatId"]
    chatCode = chunk["chatCode"]
    print(chatId)
    print(chatCode)
    
    for chunk in client.send_message(bot, "继续刚才的话题", chatCode=chatCode):
                print(chunk["response"], end="", flush=True)`

log:
935501971
33n7ny931rxcfv30hnb
2025-02-03 22:36:44.388 | WARNING | poe_api_wrapper.api:on_ws_close:273 - Connection to remote host was lost. Reconnecting...
2025-02-03 22:37:46.726 | WARNING | poe_api_wrapper.api:on_ws_close:273 - Connection to remote host was lost. Reconnecting...
2025-02-03 22:38:48.597 | WARNING | poe_api_wrapper.api:on_ws_close:273 - Connection to remote host was lost. Reconnecting...
2025-02-03 22:39:50.810 | WARNING | poe_api_wrapper.api:on_ws_close:273 - Connection to remote host was lost. Reconnecting...

Why is it normal to call send_message for the first time,

but an error will be reported as long as chatid or chatcode is added to the parameter?

The first time I tried calling to add the chatcode parameter, I got the same error prompt.

I don't know what went wrong. I've been working on it for 2 days, but I can't solve it.

Please help me, thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions