Skip to content

Model class design is inconvenient - make them POCOs #82

Closed
@douglasware

Description

@douglasware

I gave feedback on the serialization approach negatively impacting usability in the greater, .NET ecosystem. Here is some more:

Perhaps there is a design intention for the init only setters? Why can't I read an assistant creation definition I persisted and then modify these values? To me, it just makes the library hard to use. I don't see the upside. As it is, you might as well just have each of these properties as arguments on the create method which would certainly make the values immutable.

namespace OpenAI.Assistants
{
public partial class AssistantCreationOptions
{
internal IDictionary<string, BinaryData> _serializedAdditionalRawData;

    internal AssistantCreationOptions(string model, string name, string description, string instructions, IList<ToolDefinition> tools, ToolResources toolResources, IDictionary<string, string> metadata, float? temperature, float? nucleusSamplingFactor, AssistantResponseFormat responseFormat, IDictionary<string, BinaryData> serializedAdditionalRawData)
    {
        Model = model;
        Name = name;
        Description = description;
        Instructions = instructions;
        Tools = tools;
        ToolResources = toolResources;
        Metadata = metadata;
        Temperature = temperature;
        NucleusSamplingFactor = nucleusSamplingFactor;
        ResponseFormat = responseFormat;
        _serializedAdditionalRawData = serializedAdditionalRawData;
    }
    public string Name { get; init; }
    public string Description { get; init; }
    public string Instructions { get; init; }
    public IDictionary<string, string> Metadata { get; }
    public float? Temperature { get; init; }
}

}

Please simplify the implementation of all of the model classes and remove these arbitrary blockers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestCategory: A new feature or enhancement to an existing feature is being requested.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions