V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
qingshui33
V2EX  ›  问与答

调用 chatgpt 接口

  •  
  •   qingshui33 · 2023-03-14 13:22:36 +08:00 · 663 次点击
    这是一个创建于 380 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在自己项目中按照 chatgpt 的文档调用接口,然后一直是请求加载中是怎么回事呢,已经开了代理,代码如下,求指教下:

    const configuration = new Configuration({
        organization: ***,
        apiKey: ***,
    })
    const openai = new OpenAIApi(configuration)
    
    const response = await openai.createCompletion({
        model: 'text-davinci-002',
        prompt: msg,
        temperature: 0,
        max_tokens: 7,
    })
    
    2 条回复    2023-03-15 09:33:37 +08:00
    qiayue
        1
    qiayue  
       2023-03-14 13:56:15 +08:00
    你的问题我不太清楚,但是我就是特别好奇,都 2023 年的 3 月 14 日了,为什么你还要用 text-davinci-002 这个模型?
    直接上 gpt-3.5-trubo 不仅效果更好,还更便宜。
    qingshui33
        2
    qingshui33  
    OP
       2023-03-15 09:33:37 +08:00
    @qiayue 还没有仔细看这个来着,就先想着先调通然后再去看具体的内容来着
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3343 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 13:42 · PVG 21:42 · LAX 06:42 · JFK 09:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.