Open Vasabiko opened 5 days ago
Your OS and Browser version?
Ваша версия ОС и браузера?
Win 11 23H3 22635.4300, Tried it in 3 different browsers, Chrom, Vivaldi, Edge. My friend also has the same problem.
I can't replicate the bug.
Try these steps (Google Chrome):
Tried it in 3 different browsers, Chrom, Vivaldi, Edge.
Try Firefox
I can't replicate the bug.
Try these steps (Google Chrome):
- Clear Browser cache and history.
- Open Developer Tools >> "Console" (Instructions)
- Go to http://localhost:8080
- Open chat and click Copy button.
- Inside Console window, right-click on text >> Save As >> Save.
- Attach saved .log file here Log.log
Tried it in 3 different browsers, Chrom, Vivaldi, Edge.
Try Firefox
unchanged
I suspect the bug is line 97 the writeText call is not awaited and can throw exceptions. https://github.com/xtekky/gpt4free/blob/04386f7b4b70db6b0fbc5747f530e58c2638d4b6/g4f/gui/client/static/js/chat.v1.js#L90-L99
I pushed a fix and added a fallback function using document.exec("copy")
This is my repository: https://github.com/foxfire52/gpt4free/tree/copy-patch repository zip
Would you please download, run it and repeat steps 1-6?
Are you sure you ran my repository?
Do this
cd "C://path..."
docker compose up --build
If you need help with Docker, you can ask.
When server is running follow step 1-6
Are you sure you ran my repository?
Do this
- Install Docker Desktop Docker Instruction
- Extract zip file
- Open Command Line
- change directory to extracted folder path
cd "C://path..."
- run
docker compose up --build
If you need help with Docker, you can ask.
When server is running follow step 1-6
No, not in the docker, in Windows itself via the command line
No, not in the docker, in Windows itself via the command line
Are you using python?
No, not in the docker, in Windows itself via the command line
Are you using python?
yes, Python 3.12.5
Do you use these instructions to run the server? https://github.com/xtekky/gpt4free/blob/main/docs/git.md#installation-steps
in command line, inside extracted gpt4free/ folder run git switch copy-patch
Do you use these instructions to run the server? https://github.com/xtekky/gpt4free/blob/main/docs/git.md#installation-steps
in command line, inside extracted gpt4free/ folder run
git switch copy-patch
almost, downloaded the archive and ran the .bat file. git is not installed
@echo off
chcp 65001
REM Переход в нужную директорию
cd /d d:\gpt4free
REM Проверка наличия Python
where python >nul 2>nul
if errorlevel 1 (
echo Python не найден. Пожалуйста, установите Python и добавьте его в PATH.
exit /b
)
REM Проверка на существование виртуального окружения
if exist venv (
echo Виртуальное окружение уже существует. Активируем его...
) else (
echo Создаем новое виртуальное окружение...
python.exe -m venv venv
)
REM Активация виртуального окружения
call venv\Scripts\activate
REM Установка зависимостей
pip install -r requirements.txt
pip install -U g4f[webdriver]
REM Запуск скрипта
python -m g4f.gui.run
REM Деактивация виртуального окружения
deactivate
pause
What button are their talking about?
Promt example:
Write image generation promts for Midjorney about gemstones, different minerals, close-up, in English and each promt in its own block code
This button doesn't work:
What button are their talking about?
Promt example:
Write image generation promts for Midjorney about gemstones, different minerals, close-up, in English and each promt in its own block code
This button doesn't work:
Yeah, that's exactly what I meant.
chrome://flags
in your browser's address bar.Insecure origins treated as secure
.http://localhost:3000
or http://example.com
.
http://localhost:3000,http://example.com
http://
or https://
).It solves the copying problem
It solves the copying problem
Yes, that's it, thank you very much
What button are their talking about?
Promt example:
Write image generation promts for Midjorney about gemstones, different minerals, close-up, in English and each promt in its own block code
This button doesn't work:
I forgot to fix this one. Thank you for reporting It. Relevant code is in https://github.com/xtekky/gpt4free/blob/main/g4f/gui/client/static/js/highlightjs-copy.min.js
- Enter
chrome://flags
in your browser's address bar.- Search for
Insecure origins treated as secure
.- Enable the setting by clicking on the button to the right.
- Type the origins that you want to enable the setting for, e.g. ...
- NOTE: After you enable the setting, you have to relaunch Chrome for the changes to take effect.
It solves the copying problem
This confirms the cause of this issue. Clipboard.writeText() fails if context is not Secure.
Tomorrow I will send a Pull Request to add fallback copy function. If you use Docker you can already download my repository and use it https://github.com/foxfire52/gpt4free/tree/copy-patch
Since the problem code is part of highlight.js copy plugin, I may open a PR there too.
Steps to playback Send a request to the chatbot to output the response in block code, click on the Copy copied copied and try to paste the text into any text field (e.g. notepad).