Skip to content

OpenAI.Model

Andrew Lambert edited this page Jul 7, 2024 · 11 revisions

OpenAI.Model

Class Declaration

 Protected Class Model

Remarks

This class represents an AI model. Refer to the OpenAI documentation on the /v1/models endpoint for further details.

Use the Count() and Lookup() shared methods to list and select from the available AI models, or use the Operator_Convert() method to create an instance of Model from the model name as a string. Operator_Convert() will raise an exception if the model name is invalid.

Example

Listing and selecting from available models:

 ' using Count() and Lookup() to find the model you want
 Dim gpt4 As OpenAI.Model
 For i As Integer = 0 To OpenAI.Model.Count - 1
   Dim model As OpenAI.Model = OpenAI.Model.Lookup(i)
   If model.ID = "gpt-4" Then
     gpt4 = model
     Exit For
   End If
 Next

Or, calling Operator_Convert() with the name of the model:

 ' converting from the name
 Dim gpt4 As OpenAI.Model = "gpt-4"

Methods

Properties

Shared Methods

Clone this wiki locally