29 lines
790 B
C++
29 lines
790 B
C++
#include "xai/platform/clients.h"
|
|||
|
|
|
||
|
|
namespace molo::xai::platform {
|
||
|
|
|
||
|
|
llm::ApiClientConfig PlatformClients::api_config() {
|
||
|
|
llm::ApiClientConfig c;
|
||
|
|
c.vendor = "xai";
|
||
|
|
c.base_url = PlatformEndpoints::kApiBase;
|
||
|
|
c.key_env = PlatformEndpoints::kApiKeyEnv;
|
||
|
|
c.auth = llm::AuthStyle::kBearer;
|
||
|
|
return c;
|
||
|
|
}
|
||
|
|
|
||
|
|
llm::ApiClientConfig PlatformClients::management_config() {
|
||
|
|
llm::ApiClientConfig c;
|
||
|
|
c.vendor = "xai";
|
||
|
|
c.base_url = PlatformEndpoints::kManagementBase;
|
||
|
|
c.key_env = PlatformEndpoints::kManagementKeyEnv;
|
||
|
|
c.auth = llm::AuthStyle::kBearer;
|
||
|
|
return c;
|
||
|
|
}
|
||
|
|
|
||
|
|
PlatformClients PlatformClients::from_env() {
|
||
|
|
return PlatformClients(llm::ApiClient::from_env(api_config()),
|
||
|
|
llm::ApiClient::from_env(management_config()));
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace molo::xai::platform
|