The GetNextModel method continues enumeration of the models available
for the provider associated with the client session. The
GetFirstModel method must be called to begin the enumeration prior
to calling this method. The values are
based on metadata and information returned by the provider
in response to a request for a list of supported inference models.
The model list may be cached for a limited period of time to avoid
unnecessary requests to the provider. Use CacheTime property to
determine or change the cache lifetime for the client session.
The model capabilities reported by this method are intended to help an
application select an appropriate model. Providers may change their model
availability, capabilities, or status over time.
The presence of a model in the provider's model list does not guarantee
that it can be used by the current client. Access to specific models may depend
on the provider account, subscription level, region, deployment configuration,
or other provider-specific requirements. Applications should use
ValidateModel before selecting a model, particularly if the model name was
chosen by the user or restored from a saved configuration.
The MaxTokens value returned by this method represents the
maximum output token limit reported for the model. This limit only
applies to generated content and may be lower than the model's total
context window. The client can further restrict the length of
generated responses by setting the MaxTokens property to a
smaller value. Setting the property does not increase the model's
limit; it only places an additional limit on responses generated by
the model.
The ContextSize value represents the maximum number of
tokens the model can process in a single request, including the system
prompt, conversation history, user messages, and generated output.
Most cloud-based service providers offer models which support very
large context sizes, while limiting the maximum number of tokens that
can be generated in a single response.
Dim strModel As String
Dim nMaxTokens As Long
Dim nContextSize As Long
Dim nFlags As Long
If LlmClient1.GetFirstModel(strModel, nMaxTokens, nContextSize, nFlags) Then
Do
Debug.Print "Model: " & strModel
Debug.Print "Max Tokens: " & CStr(nMaxTokens)
Debug.Print "Context Size: " & CStr(nContextSize)
If (nFlags And llmModelFlagReasoning) <> 0 Then
Debug.Print "Supports reasoning"
End If
Debug.Print ""
Loop While LlmClient1.GetNextModel(strModel, nMaxTokens, nContextSize, nFlags)
Else
MsgBox "Unable to retrieve model list. Error " & _
CStr(LlmClient1.LastError), vbExclamation
End If