qingshui33
0.01D
V2EX  ›  问与答

调用 chatgpt 接口

  •  
  •   qingshui33 · Mar 14, 2023 · 1146 views
    This topic created in 1176 days ago, the information mentioned may be changed or developed.

    在自己项目中按照 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 replies    2023-03-15 09:33:37 +08:00
    qiayue
        1
    qiayue  
    PRO
       Mar 14, 2023
    你的问题我不太清楚,但是我就是特别好奇,都 2023 年的 3 月 14 日了,为什么你还要用 text-davinci-002 这个模型?
    直接上 gpt-3.5-trubo 不仅效果更好,还更便宜。
    qingshui33
        2
    qingshui33  
    OP
       Mar 15, 2023
    @qiayue 还没有仔细看这个来着,就先想着先调通然后再去看具体的内容来着
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1712 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:28 · PVG 00:28 · LAX 09:28 · JFK 12:28
    ♥ Do have faith in what you're doing.