-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Multiple responses that don't need to be parsed #1658
Comments
In theory, SK already supports this. A developer should be able to iterate through a collection of responses. For example, Kernel.RunAsync() returns SKContext and you should then be able to iterate through ModelResults which is part of the SKContext. Unfortunately, it looks like we have a bug where all responses are being appended to a string which is then provided as each of the responses contained in ModelResults. |
@RogerBarreto looks like ModelResults isn't getting filled in properly. Can you take a look please? |
@shawncal @chipalost. I could not find this behavior in the current Model Results although I found another unwanted behavior. Each ModelResult is actually including all the choices (Prompt Results) and is not clear from which ModelResult is which choice. I will open a small PR to make it clear in a ModelResult 1:1 Choice |
### Motivation and Context Prior to this change, when using the ModelResult in a multiple results scenario the choices were being repeated for each ModelResult object, not being clear which Choice was related to the Result. Resolves #1658 Closes #1658 ### Description Added two new representations for both `ChatResult` and `TextResult` that has one to one reference to the `choice` details coming from the LLM. Updated GetModelResult example with the expected behavior and an easier example to track the changes and different prompts. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
…soft#2214) ### Motivation and Context Prior to this change, when using the ModelResult in a multiple results scenario the choices were being repeated for each ModelResult object, not being clear which Choice was related to the Result. Resolves microsoft#1658 Closes microsoft#1658 ### Description Added two new representations for both `ChatResult` and `TextResult` that has one to one reference to the `choice` details coming from the LLM. Updated GetModelResult example with the expected behavior and an easier example to track the changes and different prompts. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
SK allows for multiple responses to be returned for one request; however, it appends all responses into one string. This makes it hard to interact with any one particular response as they must first be parsed into individual responses.
An alternative could be returning an array of ContextVariables or an array of Context objects, each of which containing its own result.
The text was updated successfully, but these errors were encountered: