PromptVCR is a Rails engine that provides a UI for browsing and viewing AI prompt/response VCR cassettes. It makes it easy to visualize and debug your AI interactions during development and testing.
PromptVCR is available directly via git source. Add this line to your application's Gemfile:
gem "prompt_vcr", git: "https://github.com/govly/prompt_vcr.git", branch: "main", group: [:development, :test]And then execute:
$ bundle installAdd this line to your config/routes.rb file to mount the engine:
if Rails.env.local?
mount PromptVCR::Engine, at: "/prompt_vcr"
endThis will make the UI available at /prompt_vcr in your application.
By default, PromptVCR looks for cassettes in these locations:
- General VCR cassettes:
test/vcr_cassettesin your host application - Prompt-specific cassettes:
test/vcr_cassettes/promptsin your host application
No additional configuration is required if you use these default locations.
If you need to customize the locations, you can configure them in an initializer:
# config/initializers/prompt_vcr.rb
PromptVCR.configure do |config|
# For all VCR cassettes
config.cassettes_path = Rails.root.join("your/custom/cassettes/path")
# For prompt-specific cassettes
config.prompt_cassettes_path = Rails.root.join("your/custom/prompt/cassettes/path")
endYou can configure just one or both paths as needed.
Once the engine is mounted, navigate to /prompt_vcr in your browser when running your application in development.
This engine provides only the viewer. To create cassettes, you'll need to use a VCRVCR.
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
The gem is available as open source under the terms of the MIT License.