Skip to main content

Adaline Class

The Adaline class is the main entry point for the TypeScript SDK. It provides methods for fetching deployments and initializing monitors for observability.

Constructor

Parameters

options
object
Configuration options for the Adaline client

Example

Methods

getDeployment()

Fetch a specific deployment by its ID.

Parameters

options
object
required

Returns

deployment
Deployment
The Deployment object.See Deployment Type for complete documentation.

Example

getLatestDeployment()

Fetch the latest deployment for a prompt in a specific environment.

Parameters

options
object
required

Returns

deployment
Deployment
The latest Deployment object for the specified environment.See Deployment Type for complete documentation.

Example

initLatestDeployment()

Initialize a cached latest deployment with automatic background refresh. This is the recommended approach for production applications.

Parameters

options
object
required

Returns

controller
DeploymentController
A controller object with the following methods:

Example

initEvaluationResults()

Initialize a cached, polling fetcher for evaluation results. Mirrors initLatestDeployment() but targets EvaluationResultsClient.list(). Useful when an evaluation is still running server-side and you want to surface partial results without writing your own polling loop — the same query (pagination + filters) is replayed on every refresh.

Parameters

options
object
required

Returns

controller
EvaluationResultsController
A controller with the same shape as the deployment controller:

Example

initMonitor()

Initialize a monitoring session for logging traces and spans.

Parameters

options
object
required

Returns

monitor
Monitor
A Monitor instance for creating traces and spans. See Monitor Class for details.

Example

Namespace clients

Seven namespace clients are attached to every Adaline instance. Each wraps the corresponding autogen API with retry-on-5xx, abort-on-4xx, and named-argument ergonomics: Raw escape hatches are also exposed for cases that don’t have a first-class helper yet:
  • adaline.deploymentsApi — raw DeploymentsApi from @adaline/api
  • adaline.logsApi — raw LogsApi (used internally by Monitor)
If you need identical retry behavior on an arbitrary call, use the exported withRetry helper:

Complete Example

Here’s a complete example showing all methods working together:

Type Definitions

Best Practices

Use Environment Variables

Initialize Once, Use Everywhere

Monitor Health in Production

Handle Graceful Shutdown