-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
ITextCompletion Multiple Results (Incl. Streaming) #952
Merged
shawncal
merged 31 commits into
microsoft:main
from
RogerBarreto:features/itextcompletion-multi
May 17, 2023
Merged
ITextCompletion Multiple Results (Incl. Streaming) #952
shawncal
merged 31 commits into
microsoft:main
from
RogerBarreto:features/itextcompletion-multi
May 17, 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
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 11, 2023
…to keep the Title visible
…ogerBarreto/semantic-kernel into features/itextcompletion-multi
RogerBarreto
changed the title
DRAFT - ITextCompletion Multiple Results (Incl. Streaming)
ITextCompletion Multiple Results (Incl. Streaming)
May 12, 2023
RogerBarreto
added
the
PR: ready for review
All feedback addressed, ready for reviews
label
May 12, 2023
dluc
previously approved these changes
May 12, 2023
…to keep the Title visible
shawncal
force-pushed
the
features/itextcompletion-multi
branch
from
May 13, 2023 02:33
78fd561
to
4222bbb
Compare
shawncal
reviewed
May 13, 2023
dotnet/src/Connectors/Connectors.AI.OpenAI/TextCompletion/AzureTextCompletion.cs
Show resolved
Hide resolved
…oved current impl to extension + Added impl to OpenAI + HuggingFace concrete
RogerBarreto
added
PR: ready for review
All feedback addressed, ready for reviews
PR: ready to merge
PR has been approved by all reviewers, and is ready to merge.
and removed
PR: in progress
Under development and/or addressing feedback
labels
May 16, 2023
stephentoub
reviewed
May 16, 2023
dotnet/src/Connectors/Connectors.AI.HuggingFace/TextCompletion/HuggingFaceTextCompletion.cs
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/Connectors/Connectors.AI.HuggingFace/TextCompletion/HuggingFaceTextCompletion.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/Connectors/Connectors.AI.HuggingFace/TextCompletion/HuggingFaceTextCompletion.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/Connectors/Connectors.AI.OpenAI/AzureSdk/ClientBase.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
...Connectors/Connectors.UnitTests/HuggingFace/TextCompletion/HuggingFaceTextCompletionTests.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/CompleteRequestSettings.cs
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/ITextCompletion.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/TextCompletionExtensions.cs
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/TextCompletionExtensions.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/TextCompletionExtensions.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
May 16, 2023
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/TextCompletionExtensions.cs
Show resolved
Hide resolved
stephentoub
approved these changes
May 16, 2023
stephentoub
previously approved these changes
May 16, 2023
Co-authored-by: Stephen Toub <[email protected]>
RogerBarreto
removed
the
PR: ready for review
All feedback addressed, ready for reviews
label
May 16, 2023
shawncal
approved these changes
May 17, 2023
shawncal
approved these changes
May 17, 2023
shawncal
added a commit
to johnoliver/semantic-kernel
that referenced
this pull request
May 19, 2023
### Motivation and Context Potential to get multiple results for the same prompt with and without streaming support. Resolves microsoft#526 Closes microsoft#526 ![MultiChatCompletionStream2](https://github.com/microsoft/semantic-kernel/assets/19890735/fb37d37c-e915-4a2e-92c8-662cb26f1e89) ### Description This PR introduces abstractions and the capability to get multiple results for the same prompt using the same request including streaming support. Proposed: - Added 2 result abstractions `ITextCompletionResult` and `ITextCompletionStreamingResult` - Changed current base `ITextCompletion` interface with the multiple results abstraction capability - Added 2 extensions methods to `ITextCompletion` to keep it retro compatible / avoid major breaking changes - Added concrete implementation to: Azure OpenAI / Open AI / Hugging Face completion impl. - Added Samples (with and without streaming) how to use multiple results Breaking potential: - Any custom completion implementation will need to implement the new methods in `ITextCompletion` interface with the `ITextCompletionResult`/`ITextCompletionStreamingResult` abstractions. Pretty straightforward and example was added in `CustomLLM` sample. Co-authored-by: Lee Miller <[email protected]> Co-authored-by: Shawn Callegari <[email protected]> Co-authored-by: Stephen Toub <[email protected]>
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
Potential to get multiple results for the same prompt with and without streaming support.
Resolves #526
Closes #526
Description
This PR introduces abstractions and the capability to get multiple results for the same prompt using the same request including streaming support.
Proposed:
ITextCompletionResult
andITextCompletionStreamingResult
ITextCompletion
interface with the multiple results abstraction capabilityITextCompletion
to keep it retro compatible / avoid major breaking changesBreaking potential:
ITextCompletion
interface with theITextCompletionResult
/ITextCompletionStreamingResult
abstractions. Pretty straightforward and example was added inCustomLLM
sample.Contribution Checklist
dotnet format