PROMPT.SETACTIVE
PROMPT.SETACTIVE name version
- Group
- Prompt registry
- Complexity
- O(N) where N is the number of stored versions
- Arity
- 3 (exactly, counting the command name)
- Flags
- write, fast
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- Performance and Scale
- On-Premise
- requires the prompt-registry license feature
The prompt registry stores versioned prompt templates by name, with one version marked active, so you can roll a prompt forward or back without deploying code. PROMPT.SETACTIVE points the template’s active version at
version, which must still be stored. Use it to roll back a bad prompt.
The next PROMPT.PUT makes its new version active again.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Active version changed | Simple string OK |
Same |
Errors:
ERR template or version not foundif the template or the version does not exist.ERR invalid versionifversionis not a non-negative integer.ERR wrong number of arguments for 'prompt.setactive' commandif the argument count is wrong.NOLICENSE prompt-registry requires a HotKV license. Contact sales@hotkv.comif your license does not include theprompt-registryfeature.
Examples
Section titled “Examples”127.0.0.1:6379> PROMPT.SETACTIVE support-agent 1OK127.0.0.1:6379> PROMPT.GET support-agent1) (integer) 12) "You are a helpful support agent."3) ""4) (integer) 1790985000Compatibility
Section titled “Compatibility”HotKV-only command. Redis and Valkey have no equivalent.
See also
Section titled “See also”PROMPT.PUT, PROMPT.GET, PROMPT.LATEST, PROMPT.VERSIONS, PROMPT.DROP, PROMPT.LIST, AI features guide
Was this page helpful?
Thanks for the feedback.