-
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
Request to Return Additional Information in CompleteAsync Method and Store it in ContextVariables #351
Comments
Thanks for the feedback the team is looking into this. |
@DavidLuong98: one more upvote this this request. |
… etc) (#1181) ### 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 ``` 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; ```
@DavidLuong98 this PR #952 and #1117 addresses the first and second requests on this Issue. Now you can get more detailed information about your requests using the On the This IResult interface exposes also the |
@DavidLuong98, can you confirm if the PRs that @RogerBarreto mentioned address the challenges you faced? :) |
@RogerBarreto @matthewbolanos Looks good, thank you both. |
… 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; ```
Currently, the
CompleteAsync
method only returns a response string. I would like to request that additional information such as status codes be returned as well.I suggest that the
CompleteAsync
method inITextCompletion
should return some typeT
instead of a string to allow for this. This would enable us to gather more information about the response and make it easier to handle different scenarios.Furthermore, I would like to propose that the
ContextVariables
class be updated to use aConcurrentDictionary<string, object>
instead ofConcurrentDictionary<string, string>
. This would allow for the storage of variables of different types and make the class more flexible.Please let me know if these changes are feasible and if there are any concerns or suggestions for improvement. Thank you for your time and consideration.
The text was updated successfully, but these errors were encountered: