xhcoding / emacs-aichat

AI Chat in Emacs, including OpenAI and Bing Chat
62 stars 8 forks source link

Trying to try, error message #20

Closed Ypot closed 1 year ago

Ypot commented 1 year ago

Hi! Trying the installation, I am receiving this message (Windows OS). I have exported cookies.json. And when launching: "aichat-bingai-chat" I receive this message:

(error (error (error (exited abnormally with code 2 curl: option --no-styled-output: is unknown curl: try 'curl --help' for more information ))))

The aichat-debug content:

cur command: (curl --silent --show-error --include --no-styled-output --config -), config: 
url = "https://edgeservices.bing.com/edgesvc/turing/conversation/create"
request = "GET"
user-agent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36 Edg/111.0.1661.41"
header = "authority: edgeservices.bing.com"
header = "accept: application/json"
header = "accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
header = "content-type: application/json"
header = "referer: https://edgeservices.bing.com/edgesvc/chat"
header = "sec-ch-ua: \"Microsoft Edge\"=\"111\", \"Not(A:Brand\";v=\"8\", \"Chromium\";v=\"111\""
header = "sec-ch-ua-mobile: ?0"
header = "sec-ch-ua-platform: \"Windows\""
header = "sec-fetch-dest: empty"
header = "sec-fetch-mode: cors"
header = "sec-fetch-site: same-origin"
header = "x-ms-client-request-id: 2ce0ae5f-1983-4b8f-bd45-4fc8a031bacb"
header = "x-ms-useragent: azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.0 OS/Win32"
header = "x-forwarded-for: 1.1.1.1"

curl process sentinel: exited abnormally with code 2
xhcoding commented 1 year ago

Your system's curl does not meet the requirements, you can try using the url.el library that comes with emacs.

(setq aichat-http-backend 'url)
Ypot commented 1 year ago

(setq aichat-http-backend 'url) works, thanks!!!

I updated curl, and the aichat-debug is as follows:

cur command: (curl --silent --show-error --include --no-styled-output --config -), config: 
url = "https://edgeservices.bing.com/edgesvc/turing/conversation/create"
request = "GET"
user-agent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36 Edg/111.0.1661.41"
header = "authority: edgeservices.bing.com"
header = "accept: application/json"
header = "accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
header = "content-type: application/json"
header = "referer: https://edgeservices.bing.com/edgesvc/chat"
header = "sec-ch-ua: \"Microsoft Edge\"=\"111\", \"Not(A:Brand\";v=\"8\", \"Chromium\";v=\"111\""
header = "sec-ch-ua-mobile: ?0"
header = "sec-ch-ua-platform: \"Windows\""
header = "sec-fetch-dest: empty"
header = "sec-fetch-mode: cors"
header = "sec-fetch-site: same-origin"
header = "x-ms-client-request-id: 43925933-f899-4693-8595-25afef32a35d"
header = "x-ms-useragent: azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.0 OS/Win32"
header = "x-forwarded-for: 1.1.1.1"

curl process sentinel: exited abnormally with code 60
xhcoding commented 1 year ago

Same issue with curl, try running curl https://httpbin.org/get in the terminal to see if curl is working properly.

Ypot commented 1 year ago

I got this message:

C:\Windows\System32>curl https://httpbin.org/get
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
C:\Windows\System32>curl -V
curl 8.1.2 (x86_64-w64-mingw32) libcurl/8.1.2 OpenSSL/3.1.0 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.5 WinIDN libssh2/1.11.0 nghttp2/1.54.0 ngtcp2/0.15.0 nghttp3/0.11.0 libgsasl/2.2.0
Release-Date: 2023-05-30
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe UnixSockets zstd
xhcoding commented 1 year ago

Do not use Mingw's curl, use the curl that comes with Windows.

C:\Users\xhcoding>curl -V
curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
Release-Date: 2023-03-20
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets
Ypot commented 1 year ago

Do not use Mingw's curl, use the curl that comes with Windows.

C:\Users\xhcoding>curl -V
curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
Release-Date: 2023-03-20
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets

Thanks, it's version curl 7.55.1, so it's outdated and doesn't work.