Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: New Feature: dotnet: Get number of used tokens from embeddings #9945

Open
hesehus-bizzkit-mibu opened this issue Dec 11, 2024 · 4 comments
Labels
.NET Issue or Pull requests regarding .NET code

Comments

@hesehus-bizzkit-mibu
Copy link


name: Get number of used tokens from embeddings
about: When calling the GenerateEmbeddingsAsync on ITextEmbeddingGenerationService it would be really nice if it was possible to get number of spend tokens either by registering a filter in Kernel given as argument or through a new property on the returned object. Currently getting the number of spend tokens seems not to be possible.


@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Dec 11, 2024
@github-actions github-actions bot changed the title New Feature: dotnet: Get number of used tokens from embeddings .Net: New Feature: dotnet: Get number of used tokens from embeddings Dec 11, 2024
@hesehus-bizzkit-mibu
Copy link
Author

hesehus-bizzkit-mibu commented Dec 11, 2024

Further information:
The number of spend tokens are returned as part of the response from OpenAI:
https://platform.openai.com/docs/guides/embeddings/

The properties does not however seems to be mapped to the OpenAIEmbedding class in OpenAI.Embeddings from the Azure.AI.OpenAI package so I guess this issue is blocked by a change needed in that package.

@hesehus-bizzkit-mibu
Copy link
Author

Relates to: Azure/azure-sdk-for-net#47508

@markwallace-microsoft markwallace-microsoft moved this from Backlog to Sprint: In Progress in Semantic Kernel Dec 12, 2024
@markwallace-microsoft markwallace-microsoft removed their assignment Dec 12, 2024
@markwallace-microsoft markwallace-microsoft moved this from Sprint: In Progress to Backlog in Semantic Kernel Dec 12, 2024
@markwallace-microsoft
Copy link
Member

We need to extends the text generation abstractions to enable this

@markwallace-microsoft
Copy link
Member

@RogerBarreto can you take a look once the Azure SDK issue gets resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
Status: Backlog
Development

No branches or pull requests

3 participants