azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] Azure.AI.OpenAI: Incorrect permission to CompletionsOptions.Stop
Library name and version
1.0.0-beta.2
Describe the bug
The Stop
variable in CompletionsOptions
is read only and cannot be changed. As a parameter to the Completetion API, it should have been specified by users.
Expected behavior
In \CompletionsOptions.cs
, public IList<string> Stop { get; }
should be public IList<string> Stop { get; set;}
Actual behavior
Currently, the parameter cannot be specified.
Reproduction Steps
CompletionsOptions requestOptions = new CompletionsOptions()
{
Prompt = { "Hello"},
Stop = { "<STOP>"}
};
Environment
Windows 11 and .Net 4.8 Visual Studio 2022
Thank you for your feedback. Tagging and routing to the team member best able to assist.
@pckennethma It's by design. See here:
DO NOT provide settable collection properties.
Users can replace the contents of the collection by clearing the collection first and then adding the new contents. If replacing the whole collection is a common scenario, consider providing the AddRange method on the collection.
You can set the Stop
property like below:
requestOptions.Stop.Add("stop");
Thanks!