Maxim Logo
How toDatasets

Use variable columns in Datasets

Learn how to use variable columns in datasets

Maxim provides a way to insert dynamic values into your entities at runtime via your Datasets in the form of variables. A variable is a collection of a key and a value.

You can refer to variables using the Jinja template syntax (double curly braces) {{variable_name}}.

You can populate variable values in various ways

  • Dataset column
  • Use a context source to retrieve it at a run time

Maxim has specific types of reserved columns that take priority over the variables you've defined. These columns include:

  • input
  • expectedOutput
  • output
  • expectedToolCalls
  • scenario
  • expectedSteps

Variable usage in Prompt

You can use variables in your Prompt to refer to dynamic values at runtime. For example, if you're creating a Prompt and want to provide context to the model, you can refer to the context via a variable in your system prompt

You are a helpful assistant, answer a given answer with respect, be nice and respectful

You may use {{context}} to answer the questions

If you're using the Prompt playground, you can add variables via static values on the right side of the interface.

Alternatively, if you're using it in a test run, you can create a context-named variable in your dataset. When the test run executes, this variable will be replaced with the values from your dataset column.

You can use variables for Prompt Comparison and Prompt Chain in the same way as you do in your Prompt playground

Variable usage in Prompt

Variable usage in API Workflow

If you're using an API Workflow, you can add variables to your workflow body, headers, or query parameters in the same way.

Variable usage in Prompt

Variable usage in Evaluators

You can use variables in your custom evaluators in the same way as you do in your Prompts. This allows you to provide additional context to your evaluators for better results.

Variable usage in Prompt

On this page