Haystack

Example requires Haystack version 2.2.0 or later

To unlock full functionality, create a custom component to wrap the RS skill that supports Scorable Validators

from typing import Dict
from typing import List
from haystack import component
from root import Scorable
from root.validators import Validator

@component
class ScorableGenerator:
    """
    Component to enable skill use
    """
    def __init__(self, name: str, intent: str, prompt: str, model: str, validators: List[Validator]):
        self.client = Scorable()
        self.skill = self.client.skills.create(
            name=name,
            intent=intent,
            prompt=prompt,
            model=model,
            validators=validators,
        )

For convenience, lets create another component to parse validation results

We are now equipped to have any OpenAI compatible generator being replaced with a Validated one, based on the ScorableGenerator component.

Last updated