| BOOL WINAPI LlmGetProviderFlags( |
| |
DWORD dwProviderId, |
|
| |
LPDWORD lpdwFlags |
|
| ); |
The LlmGetProviderFlags function returns the capability flags associated
with a provider.
Parameters
- dwProviderId
- Specifies the service provider. This parameter must be one of the
LLM_PROVIDER constants. Refer to the
providers page for a list of supported
providers and their default models.
- lpdwFlags
- A pointer to an unsigned integer which receives one or more
bit flags when the function returns. If there are no capabilities defined
for the provider, this value will be set to LLM_PROVIDER_FLAG_NONE. This
parameter cannot be NULL and does not need to be initialized by the caller.
| Name | Description |
| LLM_PROVIDER_FLAG_NONE | No provider requirements specified |
| LLM_PROVIDER_FLAG_REQUIRE_TLS | Requires a secure TLS (HTTPS) connection |
| LLM_PROVIDER_FLAG_REQUIRE_AUTH | Requires authentication (e.g., API key or token) |
| LLM_PROVIDER_FLAG_API_VERSION | Requires an explicit API version parameter |
| LLM_PROVIDER_FLAG_MODEL_LIST | Supports enumerating available models |
| LLM_PROVIDER_FLAG_MODEL_INFO | Supports retrieving detailed model information |
Return Value
If the function succeeds, the return value is non-zero. If the
function fails, the return value is zero. To get extended error
information, call LlmGetLastError.
Remarks
The LlmGetProviderFlags function retrieves the capability flags
associated with the specified provider. These flags describe the features
and requirements supported by the provider, such as whether authentication
is required or if model enumeration is available.
The value returned in lpdwFlags may contain one or more
LLM_PROVIDER_FLAG values combined with a bitwise OR operation. If no
capabilities are defined for the provider, the value will be
LLM_PROVIDER_FLAG_NONE.
This function does not require an active client session and can be used
to query provider capabilities before establishing a connection. This can
be useful when determining how to configure a session or which features are
available for a given provider.
If dwProviderId specifies an invalid provider, the function fails
and returns zero.
Example
DWORD dwFlags = LLM_PROVIDER_FLAG_NONE;
if (!LlmGetProviderFlags(dwProviderId, &dwFlags))
{
_tprintf(_T("Unable to get provider flags\n"));
return;
}
if (dwFlags & LLM_PROVIDER_FLAG_REQUIRE_AUTH)
{
_tprintf(_T("Provider requires authentication\n"));
}
if (dwFlags & LLM_PROVIDER_FLAG_MODEL_LIST)
{
_tprintf(_T("Provider supports model enumeration\n"));
}
Requirements
Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csllmv12.lib
See Also
LlmGetProviderInfo,
LlmGetProviderName,
LlmGetProviderUrl
|