Integration-Automation / ReEdgeGPT

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

JailBreak Filter error #166

Closed FuseFairy closed 1 month ago

FuseFairy commented 1 month ago

I tried using chatbot and it showed me this:

ERROR:InternalError: Error calling extension "JailBreak Filter" (jailbreak-filter) Full exception: {'type': 2, 'invocationId': '3', 'item': {'firstNewMessageIndex': None, 'defaultChatName': None, 'conversationId': '51D|BingProd|E9D8D1CD6542F375B2DAD496C1509B5B7890CCC0E1EBEE915AC469FA6B810BB1', 'requestId': '7f299a30-b661-4079-b42f-c3d324d6b533', 'telemetry': {'startTime': '2024-09-26T17:25:03.5254136Z', 'userMessageRequestStartTime': None}, 'result': {'value': 'InternalError', 'message': 'Error calling extension "JailBreak Filter" (jailbreak-filter)', 'error': 'Error calling extension "JailBreak Filter" (jailbreak-filter)', 'serviceVersion': '20240925.191'}}}

JE-Chen commented 1 month ago

Maybe Microsoft changed their service extension. Update the cookie and try again.

FuseFairy commented 1 month ago

I tried

JE-Chen commented 1 month ago

Or have some plugins changed their IDs? Can you provide how you initialize your bot?

JE-Chen commented 1 month ago

The bot runs normally without any plugins.

FuseFairy commented 1 month ago

You're right, using the Suno plugin would cause an error

 import asyncio
import json
from pathlib import Path

from re_edge_gpt import Chatbot
from re_edge_gpt import ConversationStyle
from re_edge_gpt.plugins.suno import generate_suno_music

# If you are using jupyter pls install this package
# from nest_asyncio import apply

async def test_ask() -> None:
    bot = None
    try:
        cookies: list[dict] = json.loads(open(
            str(Path(str(Path.cwd()) + "/bing_cookies.json")), encoding="utf-8").read())
        bot = await Chatbot.create(cookies=cookies, mode="Bing", plugin_ids=["suno"])
        prompt = """Can you create some epic music"""
        response = await bot.ask(
            prompt=prompt,
            conversation_style=ConversationStyle.balanced,
            simplify_response=True,
            add_options=["014CB21D"],
            plugins=[{"Id": "c310c353-b9f0-4d76-ab0d-1dd5e979cf68", "Category": 1}],
            message_type="GenerateContentQuery"
        )
        # Notice! only simplify_response=True return messageId & requestId
        # If you are using raw response you need self get it.
        # If you are using non ascii char you need set ensure_ascii=False
        print(json.dumps(response, indent=2, ensure_ascii=False))
        print(await generate_suno_music(cookies, response.get("messageId"), response.get("requestId")))
    except Exception as error:
        raise error
    finally:
        if bot is not None:
            await bot.close()

if __name__ == "__main__":
    # If you are using jupyter pls use nest_asyncio apply()
    # apply()
    try:
        loop = asyncio.get_running_loop()
    except RuntimeError:
        loop = asyncio.get_event_loop()
    loop.run_until_complete(test_ask())
Traceback (most recent call last):
  File "c:\Users\ASUS\python project\discord bot EdgeGPT\test2.py", line 48, in <module>
    loop.run_until_complete(test_ask())
  File "C:\Users\ASUS\anaconda3\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "c:\Users\ASUS\python project\discord bot EdgeGPT\test2.py", line 35, in test_ask
    raise error
  File "c:\Users\ASUS\python project\discord bot EdgeGPT\test2.py", line 21, in test_ask
    response = await bot.ask(
               ^^^^^^^^^^^^^^
  File "C:\Users\ASUS\anaconda3\Lib\site-packages\re_edge_gpt\chat\re_edge_gpt.py", line 120, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "C:\Users\ASUS\anaconda3\Lib\site-packages\re_edge_gpt\chat\chathub.py", line 197, in ask_stream
    raise ResponseError(
re_edge_gpt.utils.exception.exceptions.ResponseError: InternalError: Error calling extension "JailBreak Filter" (jailbreak-filter)
Full exception: {'type': 2, 'invocationId': '3', 'item': {'firstNewMessageIndex': None, 'defaultChatName': None, 'conversationId': '51D|BingProd|801A6CD25F361765FFFD4BD75F06DE0E45160FD8B967DD7EF5A04B04EC327FE6', 'requestId': 'b3a08a11-ba6d-4a4f-ab13-4223ffcd9d54', 'telemetry': {'startTime': '2024-10-04T09:22:14.7419452Z', 'userMessageRequestStartTime': None}, 'result': {'value': 'InternalError', 'message': 'Error calling extension "JailBreak Filter" (jailbreak-filter)', 'error': 'Error calling extension "JailBreak Filter" (jailbreak-filter)', 'serviceVersion': '20241001.327'}}}
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x00000242C6E32650>
JE-Chen commented 1 month ago

Yeah, I get the same error. Only the Suno plugin will raise this.

JE-Chen commented 1 month ago

Is this issue fixed by microsoft?

FuseFairy commented 1 month ago

not yet