Skip to content

Conversation

Quitehours
Copy link
Collaborator

Adding Versioning for Local Prompts

Description of Changes

This PR introduces support for versioning local prompts in LlmEvalRuby::PromptAdapters::Local. Now, a prompt version can be specified, allowing for testing and gradual deployment of updated versions without affecting existing ones.

Changes:

  • Added a version parameter to the fetch_prompt method.
  • The prompt path now includes the version: lib/prompts/{name}/{version}/system.txt and lib/prompts/{name}/{version}/user.txt.
  • Removed recursive Dir.glob calls; files are now fetched using a strict path.
  • Updated class documentation.

Example File Structure:

lib/prompts/test
├── system.txt
├── user.txt
└── v2
    ├── system.txt
    └── user.txt
└── v3
    ├── system.txt
    └── user.txt

Reasons for Changes:

  • Improved flexibility in handling prompts.
  • Ability to roll back to previous versions if needed.
  • Simplifies testing and deployment of new prompt versions.

How to Test:

  1. Call LlmEvalRuby::PromptAdapters::Local.fetch_prompt(name: "test", version: "v2").
  2. Ensure the correct version of the prompt is loaded.
  3. Verify that when no version is specified, the default prompt is loaded.

Backward Compatibility

This PR maintains backward compatibility: if no version is specified, the behavior remains unchanged.

Copy link
Contributor

@mesmerze mesmerze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@ihor-tokaryk ihor-tokaryk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@garciaf garciaf changed the title Add Versioning for local adaptar Add Versioning for local adaptor Jul 16, 2025
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.

4 participants