When using the client.models.list()-function it returns a json-file that starts with ‘SyncPage[Model]’, and which is not subscriptable by pd.json_normalize or general subscripting methods.
Here’s , my code:
List available models
client = OpenAI()
data = client.models.list()
print(data)
Normalize the JSON query results into a DataFrame
result = pd.json_normalize(data[“data”], [“Model”,“id”])
Display the result
print(result)
Which results in a TypeError: ‘SyncPage[Model]’ object is not subscriptable
by pd.json_normalize.
Please return a normal json object when asking for the model list?