GithubHelp home page GithubHelp logo

Comments (3)

Geniucker avatar Geniucker commented on July 30, 2024

我记得在这个提交 299253a 我加过,openai的标准不是json['usage']['promt_tokens']吗
参考:https://platform.openai.com/docs/api-reference/chat/object#chat/object-usage

from copilot-gpt4-service.

sheng-di avatar sheng-di commented on July 30, 2024

我记得在这个提交 299253a 我加过,openai的标准不是json['usage']['promt_tokens']吗 参考:https://platform.openai.com/docs/api-reference/chat/object#chat/object-usage

是的,类型上可能加了,不过我用 https://github.com/bravekingzhang/flutter_chat_box 这个项目去请求它,github 的返回值中提示 usage 是一个 null 空值。

是不是有的情况下,现在的接口会不返回 usage 字段?

from copilot-gpt4-service.

Geniucker avatar Geniucker commented on July 30, 2024

stream=false的时候我本地测的时候是有usage字段的
stream=true的时候不会有usage字段,但是openai API的行为也是这样的
参考:https://community.openai.com/t/openai-api-get-usage-tokens-in-response-when-set-stream-true/141866

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.