LlmGetProviderInfo Function  
 
BOOL WINAPI LlmGetProviderInfo(
  DWORD dwProviderId,  
  LPLLM_PROVIDER_INFO lpProviderInfo  
);

The LlmGetProviderInfo function returns information about the specified service provider type.

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.
lpProviderInfo
A pointer to an LLM_PROVIDER_INFO structure which receives information about the specified provider. The dwSize member must be initialized to the size of the structure before calling this function.

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 LlmGetProviderInfo function returns general information about a provider, including its display name, description, default host name, default model and related configuration values.

The lpProviderInfo parameter must point to an LLM_PROVIDER_INFO structure initialized by the caller. The dwSize member must be set to the size of the structure. This enables the function to validate the structure version before returning provider information.

This function does not require an active client session. It can be used to query provider information before creating a session or connecting to a provider.

The information returned by this function describes the provider defaults defined by the library. A client session may use different values if the application overrides the provider, host name, base URL, model name or other session settings.

Example

DWORD dwProviderId = LLM_PROVIDER_NONE;
TCHAR szBaseUrl[MAX_PATH] = {0};

// Determine the provider ID for the current session and get
// the base URL used for API requests
dwProviderId = LlmGetClientProvider(hClient, szBaseUrl, _countof(szBaseUrl));

if (dwProviderId == LLM_PROVIDER_NONE)
{
    _tprintf(_T("Unable to get provider ID for this session\n"));
    return;
}

// Get the current client options
DWORD dwOptions = LLM_OPTION_NONE;

if (!LlmGetClientOptions(hClient, &dwOptions))
{
    _tprintf(_T("Unable to get client options for this session\n"));
    return;
}

// Get information about the current provider
LLM_PROVIDER_INFO providerInfo = { sizeof(providerInfo), 0 };

if (!LlmGetProviderInfo(dwProviderId, &providerInfo))
{
    _tprintf(_T("Unable to get provider information\n"));
    return;
}

_tprintf(_T("Connected to %s using %s, the connection is %s\n"),
         providerInfo.szDisplayName,
         szBaseUrl,
         ((dwOptions & LLM_OPTION_SECURE) ? _T("secure") : _T("not secure")));

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
Unicode: Implemented as Unicode and ANSI versions

See Also

LlmGetClientProvider, LlmGetProviderFlags, LlmGetProviderName, LlmGetProviderUrl