V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
cenyu1
V2EX  ›  问与答

Mac 打开 Tun Mode,终端 curl 方式可以调通 OpenAI API,但是 VSCode 代码无法调通报错: APITimeoutError: Request timed out.

  •  
  •   cenyu1 · May 17, 2024 · 699 views
    This topic created in 723 days ago, the information mentioned may be changed or developed.

    想问一下大家这个问题该怎么解决呀:

    Mac 已经打开了 Tun Mode ,且节点确定没有问题。终端使用 curl 的方式调用 OpenAI API 可以正常返回结果。但是 VSCode 中写的 ipynb 文件,用以下的形式报错:APITimeoutError: Request timed out.

    completion = client.chat.completions.create(
      model="gpt-3.5-turbo",
      messages=[
        {
            "role": "user",
            "content": "Say this is a test",
        }
      ]
    )
    

    求大神们帮忙看看,感谢!!!🙏

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   958 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 19:04 · PVG 03:04 · LAX 12:04 · JFK 15:04
    ♥ Do have faith in what you're doing.