mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-14 18:23:37 +00:00
41 lines
1.7 KiB
C#
41 lines
1.7 KiB
C#
|
|
using static AIStudio.Provider.Capability;
|
||
|
|
|
||
|
|
namespace AIStudio.Models.OpenAI;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// GPT-3.5, which answers with text and does nothing else.
|
||
|
|
/// </summary>
|
||
|
|
public sealed class Gpt35Family : ModelFamily
|
||
|
|
{
|
||
|
|
/// <inheritdoc />
|
||
|
|
public override ModelVendor Vendor => ModelVendor.OPEN_AI;
|
||
|
|
|
||
|
|
/// <inheritdoc />
|
||
|
|
public override ModelSource Source => new("https://platform.openai.com/docs/models", new DateOnly(2026, 9, 11), "Ported unchanged from the rules in ProviderExtensions.OpenAI.cs: text in, text out, no tools and no images.");
|
||
|
|
|
||
|
|
/// <inheritdoc />
|
||
|
|
public override IReadOnlyList<ModelSource> FurtherSources =>
|
||
|
|
[
|
||
|
|
new("https://github.com/openai/tiktoken/blob/main/tiktoken/model.py", new DateOnly(2026, 9, 12), "OpenAI's own mapping from model names to encodings. It maps \"gpt-3.5\", \"gpt-3.5-turbo\" and the prefix \"gpt-3.5-turbo-\" to cl100k_base.")
|
||
|
|
];
|
||
|
|
|
||
|
|
/// <inheritdoc />
|
||
|
|
protected override void Declare(ModelFamilyBuilder builder)
|
||
|
|
{
|
||
|
|
builder.Rule("gpt-3.5").AsPrefix()
|
||
|
|
.Capabilities(TEXT_INPUT | TEXT_OUTPUT)
|
||
|
|
.Apis(CHAT_COMPLETION_API)
|
||
|
|
.Tokenizer(TokenizerKind.TIKTOKEN, "cl100k_base");
|
||
|
|
|
||
|
|
//
|
||
|
|
// The odd one out, and kept odd on purpose: the previous rules put this one model on the
|
||
|
|
// Responses API and every other GPT-3.5 on the chat completion API. It reads like an
|
||
|
|
// oversight, but what the app answers today is what the snapshot pins, and correcting it is
|
||
|
|
// a decision of its own rather than something to slip into a port.
|
||
|
|
//
|
||
|
|
builder.Rule("gpt-3.5-turbo").AsExact()
|
||
|
|
.Capabilities(TEXT_INPUT | TEXT_OUTPUT)
|
||
|
|
.Apis(RESPONSES_API)
|
||
|
|
.Tokenizer(TokenizerKind.TIKTOKEN, "cl100k_base");
|
||
|
|
}
|
||
|
|
}
|