Coder Social home page Coder Social logo

Comments (13)

aaamoon avatar aaamoon commented on June 5, 2024

帮你问了一下GPT-4:
这个问题可能是由于跨域请求(CORS)的限制导致的。浏览器出于安全考虑,会限制跨域的请求,除非服务器明确允许。
解决这个问题的一个可能的方法是在你的 copilot-gpt4-service 服务器上设置 CORS headers,允许来自你的 NextChat 客户端的请求。

from copilot-gpt4-service.

tomleung1996 avatar tomleung1996 commented on June 5, 2024

感谢回复。我尝试在同一台Linux服务器上用podman部署了copilot-gpt4-service和NextChat,接口地址填http://127.0.0.1:8080 但仍然报同样的错误,可否咨询一下您在http://gpt4copilot.tech/ 这个站点是怎么进行两者配置的吗?

from copilot-gpt4-service.

aaamoon avatar aaamoon commented on June 5, 2024

你在同一台Linux服务器部署了copilot-gpt4-service和NextChat的话,比如你的Linux服务器的IP是1.1.1.1,接口地址就填http://1.1.1.1:8080
这时候你在你的电脑去访问 http://1.1.1.1:3000 就可以了

from copilot-gpt4-service.

tomleung1996 avatar tomleung1996 commented on June 5, 2024

还是不行呢,1.1.1.1、127.0.0.1、localhost、本机IP都试了,还是不行… 您的copilot-gpt4-service和NextChat也都是用podman或者docker部署么?

from copilot-gpt4-service.

aaamoon avatar aaamoon commented on June 5, 2024

@tomleung1996 你截图一下整个网页url和配置那里的接口地址我看看?

from copilot-gpt4-service.

lxzcpro avatar lxzcpro commented on June 5, 2024

我试了一试NextChat的网页版跟本地版 如果直接修改API跟接口都是会报错的 只有用在http://gpt4copilot.tech/网页中的NextChat修改接口与API才可用

from copilot-gpt4-service.

aaamoon avatar aaamoon commented on June 5, 2024

@lxzcpro 这就是跨域的问题,如果你客户端用的是http://gpt4copilot.tech ,那么你的接口地址就只能填http://gpt4copilot.tech ;如果你客户端用本地版,那你的接口地址就只能填本地接口地址

from copilot-gpt4-service.

tomleung1996 avatar tomleung1996 commented on June 5, 2024

在同一台服务器通过podman部署的NextChat和copilot-gpt4-service成功了,填写的具体地址是http://服务器地址:8080 ,不过跨域问题尚未得到解决(其他及其的nextchat客户端无法通过这样填写来访问),应该在哪里修改配置允许跨域呢?谢谢!

from copilot-gpt4-service.

aaamoon avatar aaamoon commented on June 5, 2024

@tomleung1996 其他机器能够通过http://服务器地址:3000 访问到服务器部署的客户端吗

from copilot-gpt4-service.

tomleung1996 avatar tomleung1996 commented on June 5, 2024

@tomleung1996 其他机器能够通过http://服务器地址:3000 访问到服务器部署的客户端吗

可以的,其他机器可以通过浏览器使用NextChat。但如果是安装在其他机器的NextChat就不行

from copilot-gpt4-service.

aaamoon avatar aaamoon commented on June 5, 2024

@tomleung1996 其他机器能够通过curl请求到服务器部署的copilot-gpt4-service
curl --location 'http://服务器地址:8080/v1/chat/completions'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer ghu_xx'
--data '{
"model": "gpt-4",
"messages": [ {"role": "user", "content": "你好"}]
}'

from copilot-gpt4-service.

tomleung1996 avatar tomleung1996 commented on June 5, 2024

是有回复的,那看来这个问题是NextChat的问题?

from copilot-gpt4-service.

aaamoon avatar aaamoon commented on June 5, 2024

看不出具体什么问题,建议问问GPT-4,利用起来哈哈😃

from copilot-gpt4-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.