Skip to content

Conversation

@vapi-tasker
Copy link
Contributor

@vapi-tasker vapi-tasker bot commented Jan 15, 2026

Summary

  • Adds a new documentation page (fern/chat/variable-substitution.mdx) explaining how variableValues behave when using sessions with the Chat API
  • Updates fern/docs.yml to add the new page to the Chat section navigation

What this documents

This page explains a critical behavior that developers need to understand:

  1. Variables are "baked in" at session creation - When you pass assistantOverrides.variableValues in POST /session, the template placeholders (e.g., {{name}}) are immediately substituted and the pre-substituted assistant is stored
  2. Subsequent chats use the pre-substituted assistant - Chat requests with just sessionId automatically use the stored values
  3. New variableValues in chat requests have no effect - Because the {{}} placeholders no longer exist in the stored assistant
  4. Fresh templates can override - If you need different values mid-session, you must provide a new template with {{}} placeholders along with new variableValues

Content includes

  • Overview of how variable substitution works
  • Step-by-step explanation of session creation and chat creation behavior
  • Code examples in cURL, TypeScript, and Python
  • Quick reference table summarizing all scenarios
  • Best practices section with accordion-based recommendations
  • Links to related documentation

Test plan

  • Verify the new page renders correctly in the Fern docs preview
  • Check that navigation link appears correctly in the Chat section
  • Validate all code examples are syntactically correct
  • Confirm internal links resolve properly

Closes VAP-11219

🤖 Generated with Claude Code

vapi-tasker bot and others added 2 commits January 15, 2026 19:12
…nd chat

Explains how variableValues work when using sessions with the Chat API:
- Variables are substituted at session creation and "baked in"
- Subsequent chat requests cannot override with new variableValues
- Fresh templates must be provided to use different values

Includes code examples, quick reference table, and best practices.

VAP-11219

Co-Authored-By: Claude <noreply@anthropic.com>
VAP-11219

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

- Changed all examples from gpt-4o-mini to gpt-4.1
- Added note explaining that Vapi uses LiquidJS for variable substitution
- Clarified that {{ }} syntax follows Liquid template language conventions

VAP-11219

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Remove TypeScript and Python code examples, keeping only cURL for cleaner documentation.

VAP-11219

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Replace placeholder IDs with proper UUID format examples.

VAP-11219

Co-Authored-By: Claude <noreply@anthropic.com>
@stevenbdf stevenbdf merged commit 3138813 into main Jan 15, 2026
6 checks passed
@github-actions
Copy link
Contributor

@stevenbdf stevenbdf deleted the tasker/VAP-11219-variable-substitution-docs branch January 15, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants