NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Feature Request]: Is ChatGPTNextWeb configured to change the default access mode to POST?

Open playertk opened this issue 1 year ago • 4 comments

Problem Description

I tried using Postman monitoring, and compared POST with OPTTONS. The Ollama server only supports POST responses and rejected OPTTONS requests 我使用Ollama本地 访问, POST 请求通过,但是OPTTONS请求被拒绝, 不幸的是 ChatGPTNext客户端版本 默认 使用OPTTONS请求

[GIN] 2024/05/10-10:16:25 | 200 | 8.5950196s | 127.0.0.1 | POST "/v1/chat/completion"
[GIN] 2024/05/10-10:16:02 | 404 | 0s | 127.0.0.1 | Options "/v1/chat/completion"

Solution Description

Is ChatGPTNextWeb configured to change the default access mode to POST? 是否有办法可以修改请求方式

Alternatives Considered

No response

Additional Context

No response

playertk avatar May 10 '24 02:05 playertk

Problem Description

I tried using Postman monitoring, and compared POST with OPTTONS. The Ollama server only supports POST responses and rejected OPTTONS requests 我使用Ollama本地 访问, POST 请求通过,但是OPTTONS请求被拒绝, 不幸的是 ChatGPTNext客户端版本 默认 使用OPTTONS请求

[GIN] 2024/05/10-10:16:25 | 200 | 8.5950196s | 127.0.0.1 | POST "/v1/chat/completion"
[GIN] 2024/05/10-10:16:02 | 404 | 0s | 127.0.0.1 | Options "/v1/chat/completion"

Solution Description

Is ChatGPTNextWeb configured to change the default access mode to POST? 是否有办法可以修改请求方式

Alternatives Considered

No response

Additional Context

No response

the OPTTONS is CORS from next.js middleware router

H0llyW00dzZ avatar May 10 '24 02:05 H0llyW00dzZ

you can allow it by modifying the GIN engine to accept cors

H0llyW00dzZ avatar May 10 '24 02:05 H0llyW00dzZ

@playertk that issue should be fixed in the latest release.

https://github.com/ollama/ollama/releases/tag/v0.1.35-rc1

H0llyW00dzZ avatar May 10 '24 15:05 H0llyW00dzZ

same for me , I use client, i set system env by OLLAM_ORIGINS=* in windows,than restart ollama terminal , it works well. 设置系统环境变量OLLAM_ORINGINS,并将值设为通配符 *即可,不需要加引号,重启ollama serve即可。

021gink avatar Aug 07 '24 03:08 021gink