-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net: Added dimensions property to OpenAI embedding generation services #6077
.Net: Added dimensions property to OpenAI embedding generation services #6077
Conversation
dotnet/src/Connectors/Connectors.OpenAI/OpenAIServiceCollectionExtensions.cs
Show resolved
Hide resolved
Adding this parameter at the connector level seems to be an issue, we might consider having a ExecutionSettings for embeddings API... Any change on this matter I would add as experimental if the plan is to soon move this to be a setting per Invocation. |
dotnet/src/Connectors/Connectors.OpenAI/OpenAIServiceCollectionExtensions.cs
Show resolved
Hide resolved
@RogerBarreto I thought about that, but I also think that we can have both options supported. If you set vector dimensions once on connector level, you won't have to do that with each request. And I don't think that this parameter will change too much in runtime, because every time you change the dimension, your data may lose a context.
All embedding functionality is marked as |
IF this is Experimental, suggest creating a new method marked as |
@RogerBarreto I thought about that as well :) But the thing is that there are 11 methods that were modified. In order to avoid breaking changes, I will need to add 11 more overload methods with new parameter. It's not a big problem, but since we agreed that at some point we will have to obsolete existing methods and replace them with Besides, this is breaking change only from API compatibility point of view, but not for compiler, that's the reason I added this parameter as last one. And since these are static methods, it's not possible to mock them in tests, so it should not break mocking scenarios. |
Motivation and Context
Resolves: #6026
This PR contains changes to expose
dimensions
property which is supported by OpenAI and Azure .NET SDK:https://platform.openai.com/docs/api-reference/embeddings/create#embeddings-create-dimensions
Contribution Checklist