Tool
domain_specific_content_filter_tool
checks if input text is relevant to the 2023 yearly report of Saudi Vision 2030 by identifying specific keywords, ensuring the AI model stays focused on its domain.
Tool ID
domain_specific_content_filter_tool
Creator
@y4zeed
Downloads
20+

Tool Content
python
from pydantic import BaseModel, Field
from typing import Any

class DomainSpecificFilterTool:
    class Valves(BaseModel):
        relevant_keywords: list = Field(
            default=[
                "Vision 2030", "2023 annual report", "Saudi Arabia", 
                "economic transformation", "renewable energy", "social empowerment"
            ],
            description="List of keywords relevant to the 2023 yearly report of Vision 2030."
        )

    def __init__(self):
        self.valves = self.Valves()

    def check_relevance(self, input_text: str) -> bool:
        """
        Check if the input text is relevant to the 2023 report of Vision 2030.

        :param input_text: The text to check for relevance.
        :return: True if relevant, False otherwise.
        """
        for keyword in self.valves.relevant_keywords:
            if keyword in input_text:
                return True
        return False