Package ai.chalk.client
Interface ChalkClient.Builder
- All Known Implementing Classes:
BuilderImpl
- Enclosing interface:
- ChalkClient
public static interface ChalkClient.Builder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()withApiServer(String apiServer) Sets the API server URL.withBranch(String branch) Sets the branch name.withClientId(String clientId) Sets the client ID.withClientSecret(String clientSecret) Sets the client secret.withDeploymentTag(String deploymentTag) Sets the deployment Tag.withEnvironmentId(String environmentId) Sets the environment ID.withGrpc()withHttpClient(HttpClient httpClient) Sets the HTTP client.withQueryServer(String queryServer) Chalk routes performance sensitive requests like online query directly to the query server that runs the engine.withRootCa(Path rootCa) Sets the root CA certificate file.withTimeout(Duration timeout) Sets the timeout for all requests.
-
Method Details
-
withClientId
Sets the client ID. Used for authentication. -
withClientSecret
Sets the client secret. Used for authentication. -
withApiServer
Sets the API server URL. Defaults to "https://api.chalk.ai". -
withQueryServer
Chalk routes performance sensitive requests like online query directly to the query server that runs the engine. Populate this field if you would like to route these requests to a different query server than the one automatically resolved by Chalk. -
withEnvironmentId
Sets the environment ID. This is the identifier that distinguishes between different environments in your Chalk project. -
withBranch
Sets the branch name. This is the identifier that distinguishes between different branches of a particular environment. -
withDeploymentTag
Sets the deployment Tag. This is the identifier that distinguishes between different tagged deployments in a particular environment. -
withHttpClient
Sets the HTTP client. This is useful for setting custom timeouts, etc. -
withGrpc
ChalkClient.Builder withGrpc() -
withTimeout
Sets the timeout for all requests. Defaults to no timeout. Timeout of 0 means the query times out immediately. Request level timeouts takes precedence over this timeout.- Parameters:
timeout- The timeout duration
-
withRootCa
Sets the root CA certificate file.- Parameters:
rootCa- The path to the root CA
-
getClientId
String getClientId() -
getClientSecret
String getClientSecret() -
getApiServer
String getApiServer() -
getEnvironmentId
String getEnvironmentId() -
getBranch
String getBranch() -
getDeploymentTag
String getDeploymentTag() -
getRootCa
Path getRootCa() -
getHttpClient
HttpClient getHttpClient() -
getTimeout
Duration getTimeout() -
build
- Throws:
ChalkException
-