.Net OpenAI SDK V2 - Phase 01 Embeddings + ClientCore (Feature Branch) - #6898
Conversation
|
Roger Barreto (@rogerbarreto) I know this is a draft but a few comments
FYI SergeyMenshykh |
…oft/semantic-kernel into features/openai-v2-phase001
Mark Wallace (markwallace-microsoft)
left a comment
There was a problem hiding this comment.
Some minor stuff but LGTM
| IList<string> data, | ||
| Kernel? kernel, | ||
| int? dimensions, | ||
| CancellationToken cancellationToken) |
There was a problem hiding this comment.
Should we allow a model id override when this method is called?
There was a problem hiding this comment.
I think this method should have an execution settings TBH where the ModelId would be overriden per request, I will keep track on this ask to investigate further.
Investigation: Check if this would require rethinking on ITextEmbeddingsGeneration interface which could have bigger consequences, impacting other connectors implementations, as well as how this also relates to the work on the Vector abstractions westey (@westey-m) is doing.
| /// </summary> | ||
| /// <param name="modelId">Model name</param> | ||
| /// <param name="apiKey">OpenAI API Key</param> | ||
| /// <param name="organization">OpenAI Organization Id (usually optional)</param> |
There was a problem hiding this comment.
Curious, when is it not optional?
There was a problem hiding this comment.
For users who belong to multiple organizations or are accessing their projects through their legacy user API key, you can pass a header to specify which organization and project is used for an API request. Usage from these API requests will count as usage for the specified organization and project.
To access the Default project in an organization, leave out the OpenAI-Project header
af19aa7
into
microsoft:feature-connectors-openai
ClientCore + Foundation
This PR is the first and starts the foundation structure and classes for the V2 OpenAI Connector.
In this PR I also used the simpler
TextEmbeddingsservice to wrap up a vertical slice of the Service + Client + UT + IT + Dependencies needed also to validate the proposed structure of folders and namespaces for internal and public components.ClientCore
As part of this PR I'm also taking benefit of the
partialkeyword forClientCoreclass dividing its implementation per Service. In the original V1 ClientCore the file was very big, and creating specific files PR service/modality will make it simpler and easier to maintain.What Changed
This change includes a new update from previous
Azure.CorePipeline abstractions to the newSystem.ClientModelwhich is used byOpenAIpackage.Those include the update and addition of the below files:
AddHeaderRequestPolicyRequestExceptionExtensionsOpenAIClientCorealso into this one and made it not asabstractclass.ClientCoredirectly instead ofOpenAIClientCore.Whats New
This file didn't exist and was necessary to add as it is a dependency for
AddHeaderRequestPolicySystem.ClientModelpipeline testingWhat was Removed
Unit & Integration Test
Differently from V1, this PR focus on individual UnitTest for the OpenAI connector only.
With the target of above 80% code converage the Unit Tests targets Services + Clients + Extensions & Utilities
The structure of folders and tested components on the UnitTests will follow the same structure defined in project under test.