-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
kind: bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
Confirm this is a Typescript library issue and not an underlying Cloudflare API issue
- This is an issue with the Typescript library
Describe the bug
When fetching a model's schema via client.ai.models.schema.get, the return type is SchemaGetResponse which unfortunately resolves to unknown.
I think this field can (and should) be typed properly to what the REST API returns, an object that looks like the following.
{
"success": true,
"result": {
"input": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "A text description of the image you want to generate."
},
"steps": {
"type": "integer",
"default": 4,
"maximum": 8,
"description": "The number of diffusion steps; higher values can improve quality but take longer."
}
},
"required": [
"prompt"
]
},
"output": {
"type": "object",
"contentType": "application/json",
"properties": {
"image": {
"type": "string",
"description": "The generated image in Base64 format."
}
}
}
}
}It looks like these types are generated automagically via Stainless, so perhaps an upstream change to the OpenAPI Spec is needed. I'm happy to take care of this myself, if you can point me in the right direction!
Thank you! 🧡
To Reproduce
- Instantiate a
cloudflareclient - Call
ai.models.schema.get - See that the response is
unknown
Code snippets
OS
macOS
Runtime version
Typescript 5.7.2
Library version
v5.2.0
Metadata
Metadata
Assignees
Labels
kind: bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.