Aoun-Ai / app /services /tools /function_registry.py
MuhammadMahmoud's picture
fix: remove internal tokens from AI tools schema to fix validation 400
872d9d5
"""
Function Registry for the LLM Tool Use feature.
Defines tools available for the assistant to call.
"""
TOOL_DEFINITIONS = [
{
"type": "function",
"function": {
"name": "get_request_status",
"description": "الحصول على حالة طلب مساعدة بناءً على رقم الطلب.",
"parameters": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "رقم الطلب، مثل '1234' أو 'REQ-567'",
}
},
"required": ["request_id"],
},
},
},
{
"type": "function",
"function": {
"name": "get_required_documents",
"description": "الحصول على قائمة المستندات والوثائق المطلوبة لنوع مساعدة معين.",
"parameters": {
"type": "object",
"properties": {
"assistance_type": {
"type": "string",
"enum": ["Educational", "Medical", "Housing", "Financial", "General Support"],
"description": "نوع المساعدة المطلوب الاستفسار عنها باللغة الإنجليزية",
}
},
"required": ["assistance_type"],
},
},
},
{
"type": "function",
"function": {
"name": "calculate_eligibility",
"description": "حساب احتمالية قبول طلب المساعدة (الأهلية) بناءً على بيانات المستخدم بشكل مبدئي.",
"parameters": {
"type": "object",
"properties": {
"income_monthly": {
"type": "number",
"description": "إجمالي الدخل الشهري للأسرة (بالجنيه)",
},
"family_size": {
"type": "integer",
"description": "عدد أفراد الأسرة",
},
"debts": {
"type": "number",
"description": "إجمالي الديون (بالجنيه)",
}
},
"required": ["income_monthly", "family_size"],
},
},
},
{
"type": "function",
"function": {
"name": "cancel_request",
"description": "إلغاء طلب مساعدة قائم.",
"parameters": {
"type": "object",
"properties": {
"request_id": {"type": "string", "description": "رقم الطلب"}
},
"required": ["request_id"],
},
},
},
{
"type": "function",
"function": {
"name": "update_family_info",
"description": "تحديث بيانات ملف الأسرة.",
"parameters": {
"type": "object",
"properties": {
"first_name": {"type": "string"},
"last_name": {"type": "string"},
"phone": {"type": "string"},
"country": {"type": "string"},
"governorate": {"type": "string"},
"city": {"type": "string"},
"neighborhood": {"type": "string"}
},
"required": ["first_name", "last_name", "phone", "country", "governorate", "city"],
},
},
},
{
"type": "function",
"function": {
"name": "get_family_requests_summary",
"description": "جلب ملخص طلبات الأسرة وإحصاءاتها.",
"parameters": {
"type": "object",
"properties": {},
},
},
},
{
"type": "function",
"function": {
"name": "get_family_profile",
"description": "استرجاع تفاصيل الملف الشخصي والبيانات للأسرة المسجلة كالإسم والموقع.",
"parameters": {
"type": "object",
"properties": {},
},
},
},
{
"type": "function",
"function": {
"name": "get_detailed_requests",
"description": "جلب قائمة الطلبات التفصيلية للأسرة (وليس فقط الملخص) لمشاهدة حالات الطلبات وأنواعها.",
"parameters": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "حالة الطلب لو أردت فلترة (مثل 'Pending', 'Approved', 'Rejected'). اتركه فارغاً لجلب كل شيء."
}
},
},
},
},
{
"type": "function",
"function": {
"name": "get_association_analytics",
"description": "جلب إحصاءات الجمعية وأدائها، وعدد الطلبات والاسر المدعومة للمنظمة.",
"parameters": {
"type": "object",
"properties": {},
},
},
},
]