-
Notifications
You must be signed in to change notification settings - Fork 340
Open
Open
Copy link
Labels
area: architectureThis item is related to general architecture of the OpenAI client library.This item is related to general architecture of the OpenAI client library.blocked: specThis issue is blocked on a needed REST API spec update.This issue is blocked on a needed REST API spec update.team-work-item
Description
Currently, there is only one namespace, namespace OpenAI;, in the base TypeSpec. We need to be able to generate clients in their corresponding nested namespaces (e.g., ChatClient → OpenAI.Chat, OpenAIResponseClient → OpenAI.Responses, and any new feature → OpenAI.<Feature>).
My understanding is that TypeSpec has a feature that could help with this: 🔗 https://typespec.io/docs/language-basics/namespaces/
The solution might be to write our base TypeSpec files (models.tsp, operations.tsp..etc) in a way that leverages this feature so that each sub-client goes into its own namespace.
By doing this,
- We don’t have to write custom code for each type, just to update the namespace.
- This will also enable us to apply decorators at the namespace level in
client.tsp. Currently, we can’t scope a decorator to a specific subclient(like Response or Chat) via namespace, so the only option is annotating each target model individually.
Metadata
Metadata
Assignees
Labels
area: architectureThis item is related to general architecture of the OpenAI client library.This item is related to general architecture of the OpenAI client library.blocked: specThis issue is blocked on a needed REST API spec update.This issue is blocked on a needed REST API spec update.team-work-item