gpt4free/g4f/Provider/FreeRouter.py
hlohaus 90ef870345 fix: update provider integrations, recipient logic, and auth handling
- In **FreeRouter.py**, change the `working` flag from `False` to `True`.
- In **LMArenaProvider.py**, replace the `.rstrip("▌")` call with a manual check that, if the content ends with `▌`, slices off the trailing characters.
- In **hf_space/__init__.py**, update the async generator call to pass the `media` parameter instead of `images`.
- In **OpenaiChat.py**:
  - Modify the citation replacement regex to use `[0-9]+` (supporting any turn number) instead of a hardcoded `0`.
  - Replace `fields.is_recipient` boolean checks with comparisons against `fields.recipient == "all"` for processing text and metadata.
  - Add a new branch to process `/message/metadata/content_references` for adding source links.
  - Update the conversation initialization by replacing `self.is_recipient` with setting `self.recipient` to `"all"`.
  - Change the auth check from using `cls._api_key` to checking `cls.request_config.access_token`.
- In **chat.v1.js**, adjust the QR code URL assignment to use `window.conversation_id` if available, else default to `/qrcode`.
- In **raise_for_status.py**, update error handling by replacing `ResponseStatusError` with `MissingAuthError` for 403 responses detected as OpenAI Bot.
2025-04-17 03:26:50 +02:00

9 lines
No EOL
253 B
Python

from __future__ import annotations
from .template import OpenaiTemplate
class FreeRouter(OpenaiTemplate):
label = "CablyAI FreeRouter"
url = "https://freerouter.cablyai.com"
api_base = "https://freerouter.cablyai.com/v1"
working = True