Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
11 stars 37 forks source link

Feat. req.: multi-namespace client definitions #1226

Open trrwilson opened 2 months ago

trrwilson commented 2 months ago

Clear and concise description of the problem

The OpenAI REST API has a large surface area with many models and operations, making it is useful to organize the client library into separate namespaces. To accomplish this, we need to be able to define which client namespace each capability-grouped subclient and each model go into.

To give an example of why this is important: The OpenAI REST API features three different completion APIs: 1) legacy completions, 2) chat completions, and 3) assistants. The models used in one significantly resemble the models used in the other two, but they are NOT actually compatible with each other. If these three APIs coexisted in the same client namespace, it would be very difficult for users to understand which models are to be used where.

Without this feature, we have to write custom code to manually pull every single model into a separate client namespace one by one. Additionally, this is not a one-time effort, since we have to do this for any new models that get added as OpenAI introduces new features.

Checklist

tadelesh commented 1 month ago

We do have the ability to reorganize the client structure (see doc). Do you mean the models should also be separated into different namespace?