StringExtensionsToTunedModelId Method

Converts a given model name into a formatted tuned model identifier.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public static string ToTunedModelId(
	this string modelName
)

Parameters

modelName  String
The name of the model to convert into a tuned model identifier.

Return Value

String
A string representing the tuned model identifier, prefixed with "tunedModels/" if it is not already formatted correctly.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentException Thrown when the provided model name is invalid, such as when it contains a "/" but does not start with "tunedModels/".

See Also