Class Model
ScriptableObject representation of a generative AI model with metadata, configuration, and pricing information.
Supports token limits, ownership, creation time, and dynamic pricing for various content types (text, image, audio).
Assembly: .dll
Syntax
public class Model : AIDevKitAsset
Properties
Capability
The type of the model, such as LLM (text), TTS (speech), STT (transcription), or Image.
This information is used to route requests to the correct CRUDService of the AIClient.
Declaration
public ModelCapability Capability { get; }
Property Value
Family
The family classification of the model (e.g., GPT, Gemini, Imagen).
This information is usually used to determine the structure of the request body.
Declaration
public string Family { get; }
Property Value
FamilyVersion
Declaration
public string FamilyVersion { get; }
Property Value
A bitflag indicating supported input modalities (e.g., Text, Image, Audio).
This information is used to determines which input types the model supports.
Declaration
public Modality InputModality { get; }
Property Value
IsFineTuned
Declaration
public bool IsFineTuned { get; }
Property Value
IsLegacy
Indicates whether the model is a legacy version.
Legacy models often have a different endpoint or API structure.
Declaration
public bool IsLegacy { get; }
Property Value
MaxImageOutput
The maximum number of images that this model can generate in a single request.
This information is only relevant for image generation models.
Declaration
public int MaxImageOutput { get; }
Property Value
Declaration
public int MaxInputTokens { get; }
Property Value
MaxOutputTokens
Declaration
public int MaxOutputTokens { get; }
Property Value
ModelVersion
Declaration
public string ModelVersion { get; }
Property Value
OutputModality
A bitflag indicating supported output modalities (e.g., Text, Image, Audio).
This information is used to determines which output types the model supports.
Declaration
public Modality OutputModality { get; }
Property Value
Prices
Declaration
public ModelPrice[] Prices { get; }
Property Value
Methods
EstimatePrice(Usage)
Estimates the price of using the model based on the provided usage data.
The price is calculated based on the number of input and output tokens used.
Declaration
public Currency EstimatePrice(Usage usage)
Parameters
Type |
Name |
Description |
Usage |
usage |
|
Returns
Type |
Description |
Currency |
|
Operators
implicit operator Model(string)
Declaration
public static implicit operator Model(string apiName)
Parameters
Type |
Name |
Description |
string |
apiName |
|
Returns