Skip to content

[agents] add pinnedDynamicVariables to conversation initiation#592

Open
anurag-umich wants to merge 1 commit into
mainfrom
anurag/pinned-dynamic-variables-v2
Open

[agents] add pinnedDynamicVariables to conversation initiation#592
anurag-umich wants to merge 1 commit into
mainfrom
anurag/pinned-dynamic-variables-v2

Conversation

@anurag-umich

Copy link
Copy Markdown
Contributor

Summary

  • Adds pinnedDynamicVariables support across the SDK so callers can specify dynamic variable names that should not be overwritten by tool assignments during a conversation.
  • This pairs with the backend change in elevenlabs/xi#29274 which accepts pinned_dynamic_variables on ConversationInitiationClientDataRequest and skips tool assignments for pinned variables.
  • Once this SDK is released, the xi frontend can re-add lock toggles in the Dynamic Variables editor that pass pinned variables through startSession.

Changes

  • packages/types: Added pinned_dynamic_variables to ConversationInitiationPayload in the asyncapi schema; regenerated TypeScript types
  • packages/client: Added pinnedDynamicVariables?: string[] to BaseSessionConfig; mapped to pinned_dynamic_variables in constructOverrides
  • packages/react-native: Added pinnedDynamicVariables to ConversationConfig, overrides.ts, ElevenLabsProvider, and useConversationSession hook

Test plan

  • Verify type checks pass across all packages
  • Start a conversation with pinnedDynamicVariables: ["var_name"] and verify pinned_dynamic_variables appears in the WebSocket init message
  • Confirm pinned variables are not overwritten by tool assignments during the conversation

Made with Cursor

Allows callers to specify dynamic variable names that should not be
overwritten by tool assignments during a conversation. Used to keep
placeholder values stable when testing agents.

Changes across schema, web client, and React Native:
- asyncapi schema: added pinned_dynamic_variables to ConversationInitiationPayload
- @elevenlabs/client: added pinnedDynamicVariables to BaseSessionConfig and constructOverrides
- @elevenlabs/react-native: added pinnedDynamicVariables to ConversationConfig, overrides, provider, and session hook

Made-with: Cursor
@anurag-umich anurag-umich changed the title feat: add pinnedDynamicVariables to conversation initiation [agents] add pinnedDynamicVariables to conversation initiation Mar 17, 2026
@kraenhansen

Copy link
Copy Markdown
Member

We've been working on a re-architecture of the SDKs - if this is not time sensitive, could I ask you to rebase and target the next branch for this change instead? You would likely have to move a large part of the changes in the react-native package into the react package (as now our React Native SDK is just a thin wrapper around the React SDK).

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