Skip to main content

PromptPlaygroundsClient

adaline.prompts.playgrounds reads the playgrounds attached to a prompt — the saved test scenarios with their own messages, variables, and run history.

Access

import { Adaline } from '@adaline/client';

const adaline = new Adaline();
const playgrounds = adaline.prompts.playgrounds; // PromptPlaygroundsClient
The class is also exported directly:
import { PromptPlaygroundsClient } from '@adaline/client';
Types from @adaline/api:
import type {
  ListPlaygroundsResponse,
  PlaygroundDetail,
} from '@adaline/api';

list()

List all playgrounds attached to a prompt.
list(options: { promptId: string }): Promise<ListPlaygroundsResponse>

Parameters

NameTypeRequiredDescription
promptIdstringYesPrompt identifier.

Returns

Promise<ListPlaygroundsResponse> with { data: Playground[] }.

Example

const { data } = await adaline.prompts.playgrounds.list({
  promptId: 'prompt_abc123',
});

for (const playground of data) {
  console.log(playground.id, playground.title);
}

get()

Retrieve a single playground by ID.
get(options: {
  promptId: string;
  playgroundId: string;
}): Promise<PlaygroundDetail>

Parameters

NameTypeRequiredDescription
promptIdstringYesPrompt identifier.
playgroundIdstringYesPlayground identifier.

Returns

Promise<PlaygroundDetail> — the full playground with its messages, variables, and recent runs.

Example

const playground = await adaline.prompts.playgrounds.get({
  promptId: 'prompt_abc123',
  playgroundId: 'playground_xyz789',
});

console.log(playground.variables);

See Also