Skip to content

Suggestion regarding the style of API #45

@ddobric

Description

@ddobric

Hi guys,

I love your library—great job. However, I have some suggestions about the API you used in the last package.

Designing the API like this one is not really best way:

var encoder = ModelToEncoder.For("gpt-4o"); //
I suggest using intuitive object names and method names.

The following is widely more acceptably standard in the software industry for many reasons:

`var encoder = TokenEncoder.Create("gpt-4o");

or

var encoder = new TokenEncoder.For("gpt-4o");

You can also use the Tiktoken or Tiiktoken encoder. ModelEncoder is not an intuitive name. We are not encoding Models. Tokenizer is not a concept of model by its original paper. We should stay consistent with the references which we use.

Another suggestion related to providing the "string" ("gpt-xy") is ok, but some kind of enum or similar round string would be helpful.

var encoder = new TokenEncoder.For(Models.Gpt4o);

Hope this helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions