Integration-Automation / ReEdgeGPT

Microsoft's Bing Chat AI
MIT License
163 stars 27 forks source link

ValueError: list.remove(x): x not in list #132

Closed Eikosa closed 7 months ago

Eikosa commented 8 months ago
Traceback (most recent call last):
  File "/root/main.py", line 549, in my_function
    async for i in bot.ask_stream(
  File "/usr/local/lib/python3.10/dist-packages/re_edge_gpt/chat/re_edge_gpt.py", line 202, in ask_stream
    async for response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.10/dist-packages/re_edge_gpt/chat/chathub.py", line 125, in ask_stream
    conversation_style.value.remove(option)
ValueError: list.remove(x): x not in list
JE-Chen commented 7 months ago

Look like you remove some option not in conversation_style list.

Eikosa commented 7 months ago

I delete "autosave", although it is not a problem the first time I delete it, I think it creates a problem in the following times because it has already been deleted before

JE-Chen commented 7 months ago

Because the new version of ReEdgeGPT’s conversation_style default setting does not include autosave new version :

    creative = [
        "nlu_direct_response_filter",
        "deepleo",
        "disable_emoji_spoken_text",
        "responsible_ai_policy_235",
        "enablemm",
        "dv3sugg",
        "autosave",
        "iyxapbing",
        "iycapbing",
        "h3imaginative",
        "clgalileo",
        "gencontentv3",
        "uquopt",
        "sunoupsell",
        "gndlogcf",
        "flxvsearch",
        "noknowimg",
        "eredirecturl"
    ]
    creative_classic = [
        "nlu_direct_response_filter",
        "deepleo",
        "disable_emoji_spoken_text",
        "responsible_ai_policy_235",
        "enablemm",
        "dv3sugg",
        "autosave",
        "iyxapbing",
        "iycapbing",
        "h3imaginative",
        "clgalileo",
        "gencontentv3",
        "uquopt",
        "sunoupsell",
        "gndlogcf",
        "flxvsearch",
        "noknowimg",
        "eredirecturl"
    ]
    balanced = [
        "nlu_direct_response_filter",
        "deepleo",
        "disable_emoji_spoken_text",
        "responsible_ai_policy_235",
        "enablemm",
        "dv3sugg",
        "autosave",
        "iyxapbing",
        "iycapbing",
        "enable_user_consent",
        "fluxmemcst",
        "galileo",
        "saharagenconv5",
        "dc1mncp",
        "uquopt",
        "sunoupsell",
        "crkt2t",
        "immslots",
        "cpproname",
        "vidtoppb",
        "gptv1desc2",
        "eredirecturl"
    ]
    precise = [
        "nlu_direct_response_filter",
        "deepleo",
        "disable_emoji_spoken_text",
        "responsible_ai_policy_235",
        "enablemm",
        "dv3sugg",
        "autosave",
        "iyxapbing",
        "iycapbing",
        "enable_user_consent",
        "fluxmemcst",
        "h3precise",
        "clgalileo",
        "uquopt",
        "sunoupsell",
        "crkt2t",
        "flxvsearchans",
        "noknowimg",
        "eredirecturl"
    ]
JE-Chen commented 7 months ago

So, I think this is not actually an issue. But I will add precheck to remove options. Like:

if option in style_options:
    style_options.remove(option)
else:
    print(f"Warning {option} not in style options list", file=sys.stderr)
JE-Chen commented 7 months ago

133