-
Notifications
You must be signed in to change notification settings - Fork 1
[Maxim] Varibles mapping docs #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,214 @@ | ||
| --- | ||
| title: Map Variables to Evaluators | ||
| description: Map variables from your prompts, workflows, or datasets to evaluator inputs using our flexible mapping system | ||
| --- | ||
|
|
||
| import { MaximPlayer } from '/snippets/maximPlayer.mdx'; | ||
| import { Plus } from 'lucide-react'; | ||
|
|
||
| Variable mapping defines where evaluators should access data from during evaluation. You can map variables from prompts, workflows, or datasets to any pre-built or custom evaluator. | ||
|
|
||
| When you select an evaluator, Maxim automatically fills in variable mappings based on common patterns. You can modify these mappings to fit your specific needs. If a variable isn't found in Maxim's built-in options, it falls back to matching dataset column names. | ||
|
|
||
| ## Dataset Variables | ||
|
|
||
| Access any dataset column by its type or column name. These variables are available for all entity types: | ||
|
|
||
| - `dataset.input` - Input column (same as `run.input`) | ||
| - `dataset.output` - Output column | ||
| - `dataset.expectedOutput` - Expected output column | ||
| - `dataset.scenario` - Scenario column | ||
| - `dataset.expectedSteps` - Expected steps column | ||
| - `dataset.expectedToolCalls` - Expected tool calls column | ||
| - `dataset.columns["column name"]` - Any custom column by name | ||
|
|
||
| ## Run Variables | ||
|
|
||
| Access run-specific data using the `run.` prefix. Available options depend on your entity type (prompt or workflow). | ||
|
|
||
| ## Prompt Variable Mapping | ||
|
|
||
| ### Single-Turn Prompts | ||
|
|
||
| Access prompt version data using the `version.` prefix: | ||
|
|
||
| - `version.messages` (`JSON`) - All messages in the prompt version, including saved messages | ||
| - `version.systemMessage` (`String`) - System message from the saved version | ||
| - `version.userMessages` (`JSON`) - User messages combining saved version messages and run input | ||
|
|
||
| Access run data: | ||
|
|
||
| - `run.input` (`String`) - Input variable | ||
| - `run.output` (`String`) - Output variable | ||
| - `run.retrieval` (`String`) - Retrieved context based on your selection | ||
| - `run.toolCalls` (`JSON`) - Tool calls with name, arguments, and results | ||
|
|
||
| ### Multi-Turn Prompts | ||
|
|
||
| Variable mapping works the same as single-turn prompts: | ||
|
|
||
| **Version variables:** | ||
| - `version.messages` (`JSON`) - All messages in the prompt version | ||
| - `version.systemMessage` (`String`) - System message | ||
| - `version.userMessages` (`JSON`) - Combined user messages | ||
|
|
||
| **Run variables:** | ||
| - `run.input` (`String`) - Input variable | ||
| - `run.output` (`String`) - Output variable | ||
| - `run.retrieval` (`String`) - Retrieved context | ||
| - `run.toolCalls` (`JSON`) - Tool calls with details | ||
|
|
||
| ## Workflow Variable Mapping | ||
|
|
||
| ### Single-Turn Workflows | ||
|
|
||
| Access workflow response data using the `response.` prefix: | ||
|
|
||
| - `run.input` (`String`) - Input variable | ||
| - `run.output` (`String`) - Output variable | ||
| - `run.retrieval` (`String`) - Retrieved context | ||
| - `run.response` (`JSON/any`) - Workflow response with nested field access via dropdown or dot notation for objects, index notation for arrays | ||
|
|
||
| ### Multi-Turn Workflows | ||
|
|
||
| For simulation runs, map variables from the conversation: | ||
|
|
||
| - `run.session` (`JSON`) - Complete conversation session | ||
|
|
||
| **Example session structure:** | ||
|
|
||
| ```json | ||
| [ | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { "query": "Can you please book a hotel for me?" } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Sure — may I know the city, check-in date, and number of guests?" | ||
| } | ||
| }, | ||
| "turn": 0 | ||
| }, | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "In Bangalore, 2 guests, check-in on 5th Nov, budget around $80 per night." | ||
| } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Got it. Do you prefer a hotel near city center or closer to airport?" | ||
| } | ||
| }, | ||
| "turn": 1 | ||
| }, | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { "query": "City center. Also free breakfast would be great." } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Understood. Should I auto-book the best matching option or show options first?" | ||
| } | ||
| }, | ||
| "turn": 2 | ||
| }, | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { "query": "Show options first." } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Here are 3 hotels under $80 with free breakfast near city center. Would you like me to proceed with Hotel Blu Orchid?" | ||
| } | ||
| }, | ||
| "turn": 3 | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ## Voice agent Variable Mapping | ||
|
|
||
| For voice agent simulation runs, map variables from the conversation: | ||
|
|
||
| - `run.session` (`JSON`) - Complete conversation session | ||
| - `run.recordingUrl` (`String`) - Call recording url of the call | ||
|
|
||
| **Example session structure:** | ||
|
|
||
| ```json | ||
| [ | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { "query": "Can you please book a hotel for me?" } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Sure — may I know the city, check-in date, and number of guests?" | ||
| } | ||
| }, | ||
| "turn": 0 | ||
| }, | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "In Bangalore, 2 guests, check-in on 5th Nov, budget around $80 per night." | ||
| } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Got it. Do you prefer a hotel near city center or closer to airport?" | ||
| } | ||
| }, | ||
| "turn": 1 | ||
| }, | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { "query": "City center. Also free breakfast would be great." } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Understood. Should I auto-book the best matching option or show options first?" | ||
| } | ||
| }, | ||
| "turn": 2 | ||
| }, | ||
| { | ||
| "request": { | ||
| "type": "text", | ||
| "payload": { "query": "Show options first." } | ||
| }, | ||
| "response": { | ||
| "type": "text", | ||
| "payload": { | ||
| "query": "Here are 3 hotels under $80 with free breakfast near city center. Would you like me to proceed with Hotel Blu Orchid?" | ||
| } | ||
| }, | ||
| "turn": 3 | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ## No-code agent Variable Mapping | ||
|
|
||
| Access no-code agent run data: | ||
|
|
||
| - `run.input` (`String`) - Input variable | ||
| - `run.output` (`String`) - Output variable | ||
| - `run.retrieval` (`String`) - Retrieved context based on your selection | ||
| - `run.toolCalls` (`JSON`) - Tool calls with name, arguments, and results |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.