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