azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[Codegen] Model hierarchy to support OpenAI package from Azure OpenAI package
trafficstars
In order to support model hierarchy which is the way we want to enable Azure OpenAI SDK usage from the OpenAI SDK we need the following features from the codegen.
Constructors
- Add a protected Client(string model, ClientPipeline pipeline, ApiKeyCredential keyCredential, Uri endpoint) (current existing internal constructor, just with model added)
Methods
- Do not make convenience methods virtual; do ensure all convenience methods are ultimately calls into their protocol counterparts
- Do make protocol methods virtual
- What about PipelineMessage creation? If not that, then RequestContent?
Fields
- Everything but constants seemingly become protected: _endpoint, _keyCredential, _pipeline
- We also introduce a new protected string Model since our clients stash that
Pipeline
- How should pipeline creation be overriden? Right now, the base library has its creation hard-coded in the factory client. 2. Should we replace that constructor with one that has a protected virtual CreatePipeline() used? And then, should directly instantiable scenario clients duplicate that logic, have a lazy-initialized back-ref to the parent factory client to generate their pipelines, or do something else?
- We should have CreatePipeline virtual method, just like we have CreateRequest.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.
This is no longer the current plan for extension. The current plan involves using extension members and an AdditionalProperties bag covered by other tracking. Closing this out as unplanned.