MetaGLM/zhipuai-sdk-python-v4

为什么文档中异常处理要调用OpenAI?

hanlintao opened this issue · 2 comments

import openai
from openai import OpenAI

client = OpenAI()

try:
client.fine_tunes.create(
training_file="file-XGinujblHPwGLSztz8cPS8XY",
)
except openai.APIConnectionError as e:
print("The server could not be reached")
print(e.cause) # an underlying Exception, likely raised within httpx.
except openai.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
except openai.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)

什么?

readme中存在的openai的调用示例,是由于开发人员的疏忽