Giter Site home page Giter Site logo

Comments (7)

linweiyuan avatar linweiyuan commented on August 19, 2024

没测出来,发下提的问题看看?

或者拉下新镜像,这个是旧的

from go-chatgpt-api.

nephen avatar nephen commented on August 19, 2024
你好

这样的就不行,我手动把消息里面的回车\n去掉就可以了

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

还是没测出来,前端项目用的哪一个?

我这样测试会 200,可以看到请求数据吗?

2023-04-20_22-45

from go-chatgpt-api.

nephen avatar nephen commented on August 19, 2024

服务器上不知道咋打开google-chrome的窗口,go客户端,日志里面打印出来是这样

{
        "action": "next",
        "messages": [{
                "id": "02cb22ae-4839-455a-9a39-f239682195ef",
                "author": {
                        "role": "user"
                },
                "role": "user",
                "content": {
                        "content_type": "text",
                        "parts": ["你好
"]
                }
        }],
        "parent_message_id": "9c51464a-b8e4-43dd-a8da-9bf70153bcc0",
        "model": "text-davinci-002-render-sha",
        "conversation_id": "3f8ebcb1-8785-4cfd-b768-cb253d5cebc6"
},

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

用的是哪一款客户端?看起来是传的 JSON 数据本身不合法

api 加判断的话,也只能返回多一个错误信息数据不合法之类的,应该还是要改客户端修改传值处理

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

因为 api 反序列化 json 已经失败了,所以不能后续去掉回车,要客户端改完再提交合法 json

from go-chatgpt-api.

nephen avatar nephen commented on August 19, 2024

嗯,我在客户端加了strings.ReplaceAll(conversation.Content, "\n", "\\n")后再请求是没有问题的

from go-chatgpt-api.

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.