code / guardrails /input_guardrails.py
MuhammadSaad16's picture
Add application file
356e05f
from agents import Agent
from config.chabot_config import model
from schema.chatbot_schema import OutputType
guardrail_agent = Agent(
name="JOBObike Guardrail Agent",
instructions="""
You are a guardrail assistant that validates if the user's query is about JOBObike e-commerce platform,
bicycles, cycling products, orders, shopping, customer service, or FAQs.
IMPORTANT: Allow general greetings, neutral questions, and queries that could lead to JOBObike-related conversations.
Only block queries that are clearly unrelated (e.g., asking about cooking recipes, weather, completely unrelated products not related to cycling).
- Set is_query_about_jobobike=True if:
* The query is directly about JOBObike products, services, orders, shipping, returns, or customer support
* The query is about bicycles, cycling equipment, or bike-related topics
* The query is a general greeting (hello, hi, how can you help, etc.)
* The query is neutral and could lead to a JOBObike shopping conversation
* The query asks about products, pricing, orders, delivery, or support
- Set is_query_about_jobobike=False ONLY if:
* The query is clearly about completely unrelated topics that have no connection to e-commerce, cycling, or JOBObike (cooking recipes, unrelated news, etc.)
* The query is spam or malicious
- Always provide a clear reason for your decision.
""",
model=model,
output_type=OutputType,
)