-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support for Multi Model Detailed Response (Max Tokens, Prompt Tokens, etc) #1181
Merged
lemillermicrosoft
merged 11 commits into
microsoft:main
from
RogerBarreto:features/get-model-response
Jun 7, 2023
Merged
Support for Multi Model Detailed Response (Max Tokens, Prompt Tokens, etc) #1181
lemillermicrosoft
merged 11 commits into
microsoft:main
from
RogerBarreto:features/get-model-response
Jun 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RogerBarreto
changed the title
Support for Multi Model Detailed Response (Max Tokens, Prompt Tokens, etc)
Support for Multi Model/Modal Detailed Response (Max Tokens, Prompt Tokens, etc)
May 23, 2023
RogerBarreto
changed the title
Support for Multi Model/Modal Detailed Response (Max Tokens, Prompt Tokens, etc)
Support for Multi Model Detailed Response (Max Tokens, Prompt Tokens, etc)
May 23, 2023
github-actions
bot
added
.NET
Issue or Pull requests regarding .NET code
kernel
Issues or pull requests impacting the core kernel
kernel.core
labels
May 23, 2023
RogerBarreto
requested review from
dluc and
shawncal
and removed request for
dluc
May 23, 2023 18:25
dotnet/src/SemanticKernel.Abstractions/Orchestration/SKContext.cs
Outdated
Show resolved
Hide resolved
Can we just offer this as something like |
good to see this! I just took a quick glance, but I'll spend some time trying it out tomorrow. |
…ption captured in the ClienBase is passed as innerexception to the AIException
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/ITextCompletionResult.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/AzureSdk/ClientBase.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/AzureSdk/ClientBase.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/OpenAISKContextExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/OpenAISKContextExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/OpenAITextCompletionResultExtensions.cs
Outdated
Show resolved
Hide resolved
RogerBarreto
added
enhancement
PR: ready to merge
PR has been approved by all reviewers, and is ready to merge.
labels
May 30, 2023
lemillermicrosoft
approved these changes
Jun 7, 2023
shawncal
pushed a commit
to shawncal/semantic-kernel
that referenced
this pull request
Jul 6, 2023
… etc) (microsoft#1181) ### Motivation and Context Common feature request and missing capability to acquire the actual details from the models we are integrating. Resolves microsoft#802 Resolves microsoft#618 Resolves Partially microsoft#351 Getting the results alternative to microsoft#693 ### Description This change introduces a new Property in `object? SKContext.LastPromptResults` which will contain a list of each result detail for a given prompt. The Connector namespace will also provide a Extension methods that converts this object in the actual class that you will be using to serialize or get the detailed information about the Model result. Normal suggested usage ``` var textResult = await excuseFunction.InvokeAsync("I missed the F1 final race"); ``` Getting model result as json: ``` var modelResultJson = JsonSerializer.Serialize(textResult.LastPromptResults); ``` Getting model result as a traversable object (using a connector extension): ``` var modelResultJson = textResult.GetOpenAILastPromptResult()?.Usage.TotalTokens; ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kernel
Issues or pull requests impacting the core kernel
.NET
Issue or Pull requests regarding .NET code
PR: ready to merge
PR has been approved by all reviewers, and is ready to merge.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Common feature request and missing capability to acquire the actual details from the models we are integrating.
Resolves #802
Resolves #618
Resolves Partially #351
Getting the results alternative to #693
Description
This change introduces a new Property in
object? SKContext.LastPromptResults
which will contain a list of each result detail for a given prompt.The Connector namespace will also provide a Extension methods that converts this object in the actual class that you will be using to serialize or get the detailed information about the Model result.
Normal suggested usage
Getting model result as json:
Getting model result as a traversable object (using a connector extension):
Contribution Checklist
dotnet format