LaikaTest icon

LaikaTest

Fetch prompts and push scores to LaikaTest

Get Experimental Prompt

AI-generated

Summary

Fetch an A/B tested prompt variant from LaikaTest by providing the experiment title and optional user and session identifiers for consistent bucketing, including additional context and variable injection.

Inputs

  • Experiment Title (required) — Title of the experiment to fetch the prompt from.
  • User ID — User identifier for consistent bucketing in the experiment.
  • Session ID — Session identifier for consistent bucketing in the experiment.
  • Additional Context — Extra context as key-value pairs to include in the experiment evaluation.
  • Variables — Key-value pairs of variables to inject into the prompt content's {{placeholder}} syntax.

Output shape

a single record containing the evaluated prompt content and metadata.

Returns an object with keys: content (string or object with placeholders replaced), type (prompt type), experimentId, bucketId, promptVersionId, and promptId; errors throw NodeApiError with API error details.

Examples

Example 1: Fetch a prompt variant for experiment 'HomepageTest' for a user with ID 'user123' including context 'device=mobile' and inject variable 'username=John'.

Set operation to 'Get Experimental Prompt'; specify 'HomepageTest' as Experiment Title; provide 'user123' as User ID; add a context key-value pair 'device'='mobile'; add a variable key-value pair 'username'='John'.

Links

Discussion