The provider names listed above are predefined values used by the control to
select an internal provider definition. In some cases, applications may
be able to use a compatible provider by selecting the provider whose API
format it supports, and then setting the BaseUrl and ModelName
properties to the appropriate values. For example, a provider which
implements an OpenAI-compatible API may be used by setting this property to
"OpenAI" and specifying the provider's endpoint and model name.
The ProviderName property can be used to display a
human-readable provider name to a user, or as an alternative to assigning a
numeric identifier to the Provider property. If the
application assigns a value to this property, it is compared against
an internal table of matching names to determine the appropriate
provider. The comparison is not case-sensitive, and matches do not
have to be exact. For example, if the string "Microsoft Foundry" were
assigned to this property, it would recognize the provider as
llmProviderMicrosoft.
If the specified provider name is not recognized, assigning a value to this
property will fail and the control will return an invalid provider error.
Assigning an empty string to this property is the same as setting the
Provider property to llmProviderNone.
The ProviderName and Provider properties are
reciprocal. Changing the value of one property automatically changes
the value of the other.
Changing the current provider also resets the ModelName and
ModelFlags properties to the default model for the selected
provider, and resets the BaseUrl property to the default
endpoint for that provider. Applications should always set the
provider name first, and then change the model name or endpoint
URL if necessary.
Setting this property to an empty string clears the values of the
BaseUrl, ModelName and ModelFlags properties.
LlmClient1.ProviderName = "OpenAI"
LlmClient1.ModelName = "gpt-5.4-nano"
LlmClient1.ApiKey = "%OPENAI_API_KEY%"
If LlmClient1.Connect() Then
LlmClient1.Prompt = "What is the capital of Denmark?"
If LlmClient1.SendMessage() Then
MsgBox LlmClient1.Response, vbInformation
Else
MsgBox LlmClient1.LastErrorString, vbExclamation
End If
LlmClient1.Disconnect
Else
MsgBox LlmClient1.LastErrorString, vbExclamation
End If