Giter Site home page Giter Site logo

Continue generating about go-chatgpt-api HOT 14 CLOSED

 avatar commented on August 19, 2024
Continue generating

from go-chatgpt-api.

Comments (14)

linweiyuan avatar linweiyuan commented on August 19, 2024 1

适配了,但是要改个 url

https://github.com/linweiyuan/go-chatgpt-api#2023-06-18-%E7%A0%B4%E5%9D%8F%E6%80%A7%E6%9B%B4%E6%96%B0

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

这样看的话其实是客户端要支持,因为这个 action 是传过来的,api 只是转发

from go-chatgpt-api.

 avatar commented on August 19, 2024

是的,我用了 https://github.com/acheong08/ChatGPT/wiki/V1#ask 这个python库,里面有一个 auto_continue 参数,在获取长回复时很方便,但是需要相应 api 的支持才行

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

说的是一个请求返回所有是吧?

之前版本有,后面被我去掉了,当时是通过返回的 max token 还是啥判断的,但是测试的时候,部分提示词会永远返回 max token 导致返回了几分钟还在返回,我就去掉了,改为客户端自己处理

#8 #13

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

这个新的 action 需要再看看怎么弄,或者你弄个 PR?

from go-chatgpt-api.

 avatar commented on August 19, 2024

是一个请求返回所有。我不懂go😂

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

用 py 写,叫 gpt 转成 go

from go-chatgpt-api.

dvc890 avatar dvc890 commented on August 19, 2024

是的,我用了 https://github.com/acheong08/ChatGPT/wiki/V1#ask 这个python库,里面有一个 auto_continue 参数,在获取长回复时很方便,但是需要相应 api 的支持才行

cid = line["conversation_id"]
pid = line["message"]["id"]
metadata = line["message"].get("metadata", {})
model = metadata.get("model_slug", None)
finish_details = metadata.get("finish_details", {"type": None})["type"]

if not (auto_continue and finish_details == "max_tokens"):
    return
message = message.strip("\n")
async for i in self.continue_write(
    conversation_id=cid,
    timeout=timeout,
    auto_continue=False,
):
i["message"] = message + i["message"]
    yield i

看了一下源码,其实跟代理端关系可有可无(当然代理端实现就最方便了),实现方式就是判断finish_details == "max_tokens"
并且continue_write(),这个continue_write区别就是

"action": "continue",
"conversation_id": conversation_id,
"parent_message_id": parent_id,
"model": model

"action": "next",
"messages": messages,
"conversation_id": conversation_id,
"parent_message_id": parent_id,
"model": model

的区别,正常对话action为next并附带对话内容,而continue不需要附带内容,只需要"action": "continue"即可,之前@linweiyuan 大佬弄过,好像效果不好,估计就是没有使用"action": "continue"去做?

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

当初弄的时候,是魔改的,官方还没有这个参数

from go-chatgpt-api.

dvc890 avatar dvc890 commented on August 19, 2024

当初弄的时候,是魔改的,官方还没有这个参数

那你可以把代码回滚回来,稍加修改就可以支持该功能

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

当初是浏览器 JS 版本,不能直接回滚

from go-chatgpt-api.

znssattpc830 avatar znssattpc830 commented on August 19, 2024

是的,我用了 https://github.com/acheong08/ChatGPT/wiki/V1#ask 这个python库,里面有一个 auto_continue 参数,在获取长回复时很方便,但是需要相应 api 的支持才行

我也用的这个python库,auto_continue一直都是用默认False,更新go-chatgpt-api后似乎全部都变为自动继续了?

from go-chatgpt-api.

linweiyuan avatar linweiyuan commented on August 19, 2024

那么需要再加个适配

from go-chatgpt-api.

znssattpc830 avatar znssattpc830 commented on August 19, 2024

麻烦大佬加个适配吧🙏,因为这个自动继续,现在python库里的rollback_conversation好像都不能用了。

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.