-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TypeSpec with latest features including Assistants #6
base: main
Are you sure you want to change the base?
Conversation
): | ||
| CreateTranscriptionResponse | ||
| { | ||
// TODO: Is this the appropriate way to describe the multiple possible response types? | ||
@header contentType: "text/plain"; | ||
@body text: string; | ||
} | ||
| ErrorResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bterlson: Is this the appropriate way to describe the different types of responses? For the record, OpenAI's OpenAPIv3 spec does not describe this behavior even though that is how the service works.
@minValue(-9223372036854775808) // TODO: Min and max exceed the limits of safeint. | ||
@maxValue(9223372036854775807) | ||
seed?: safeint | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bterlson : OpenAI's OpenAPIv3 spec claims these are the min and max values for this property, but they exceed the limits of safeint, which makes me think they are wrong. What do you think?
// TODO: The generated spec produces "additionalProperties: {}" for this instead of | ||
// "additionalProperties: true". Are they equivalent? | ||
model FunctionParameters is Record<unknown>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bterlson: This is generated as "additionalProperties: {}" instead of "additionalProperties: true". Do you know if they equivalent?
/** For now, this is always going to be an empty object. */ | ||
@extension("x-oaiTypeLabel", "map") | ||
retrieval: { }; // TODO: Is this the appropriate way to represent an empty object? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bterlson: Is this the appropriate way to represent the empty object?
/** | ||
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` | ||
* for descending order. | ||
*/ | ||
@query order?: "asc" | "desc" = "desc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bterlson : I noticed that the generated OpenAPIv3 spec seems to have an issue when generating some enums. For example, this query parameter produces the following:
- name: order
in: query
required: false
description: |-
Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
for descending order.
schema:
type: string
enum:
- asc
- desc
- desc
- desc
- desc
- desc
- desc
default: desc
Please let me know where I can file a bug for this one. 🙂
Added all the new features that have been introduced since the last update to the spec, including the Assistants API. This now matches OpenAI's OpenAPI spec here:
🔗 https://raw.githubusercontent.com/openai/openai-openapi/b648b7823135e6fa5148ac9a303c16fdad050da6/openapi.yaml