MuhammadMahmoud commited on
Commit
872d9d5
·
1 Parent(s): 3bb2c5b

fix: remove internal tokens from AI tools schema to fix validation 400

Browse files
app/services/tools/function_registry.py CHANGED
@@ -15,9 +15,7 @@ TOOL_DEFINITIONS = [
15
  "request_id": {
16
  "type": "string",
17
  "description": "رقم الطلب، مثل '1234' أو 'REQ-567'",
18
- },
19
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"},
20
- "family_id": {"type": "integer", "description": "معرف الأسرة عند استخدام bot internal key"}
21
  },
22
  "required": ["request_id"],
23
  },
@@ -35,8 +33,7 @@ TOOL_DEFINITIONS = [
35
  "type": "string",
36
  "enum": ["Educational", "Medical", "Housing", "Financial", "General Support"],
37
  "description": "نوع المساعدة المطلوب الاستفسار عنها باللغة الإنجليزية",
38
- },
39
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"}
40
  },
41
  "required": ["assistance_type"],
42
  },
@@ -61,8 +58,7 @@ TOOL_DEFINITIONS = [
61
  "debts": {
62
  "type": "number",
63
  "description": "إجمالي الديون (بالجنيه)",
64
- },
65
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"}
66
  },
67
  "required": ["income_monthly", "family_size"],
68
  },
@@ -76,9 +72,7 @@ TOOL_DEFINITIONS = [
76
  "parameters": {
77
  "type": "object",
78
  "properties": {
79
- "request_id": {"type": "string", "description": "رقم الطلب"},
80
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"},
81
- "family_id": {"type": "integer", "description": "معرف الأسرة عند استخدام bot internal key"}
82
  },
83
  "required": ["request_id"],
84
  },
@@ -98,9 +92,7 @@ TOOL_DEFINITIONS = [
98
  "country": {"type": "string"},
99
  "governorate": {"type": "string"},
100
  "city": {"type": "string"},
101
- "neighborhood": {"type": "string"},
102
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"},
103
- "family_id": {"type": "integer", "description": "معرف الأسرة عند استخدام bot internal key"}
104
  },
105
  "required": ["first_name", "last_name", "phone", "country", "governorate", "city"],
106
  },
@@ -113,10 +105,7 @@ TOOL_DEFINITIONS = [
113
  "description": "جلب ملخص طلبات الأسرة وإحصاءاتها.",
114
  "parameters": {
115
  "type": "object",
116
- "properties": {
117
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"},
118
- "family_id": {"type": "integer", "description": "معرف الأسرة عند استخدام bot internal key"}
119
- },
120
  },
121
  },
122
  },
@@ -127,10 +116,7 @@ TOOL_DEFINITIONS = [
127
  "description": "استرجاع تفاصيل الملف الشخصي والبيانات للأسرة المسجلة كالإسم والموقع.",
128
  "parameters": {
129
  "type": "object",
130
- "properties": {
131
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"},
132
- "family_id": {"type": "integer", "description": "معرف الأسرة عند استخدام bot internal key"}
133
- },
134
  },
135
  },
136
  },
@@ -145,9 +131,7 @@ TOOL_DEFINITIONS = [
145
  "status": {
146
  "type": "string",
147
  "description": "حالة الطلب لو أردت فلترة (مثل 'Pending', 'Approved', 'Rejected'). اتركه فارغاً لجلب كل شيء."
148
- },
149
- "access_token": {"type": "string", "description": "رمز دخول المستخدم إن توفر"},
150
- "family_id": {"type": "integer", "description": "معرف الأسرة عند استخدام bot internal key"}
151
  },
152
  },
153
  },
@@ -159,9 +143,7 @@ TOOL_DEFINITIONS = [
159
  "description": "جلب إحصاءات الجمعية وأدائها، وعدد الطلبات والاسر المدعومة للمنظمة.",
160
  "parameters": {
161
  "type": "object",
162
- "properties": {
163
- "access_token": {"type": "string", "description": "رمز دخول ممثل الجمعية إن توفر"}
164
- },
165
  },
166
  },
167
  },
 
15
  "request_id": {
16
  "type": "string",
17
  "description": "رقم الطلب، مثل '1234' أو 'REQ-567'",
18
+ }
 
 
19
  },
20
  "required": ["request_id"],
21
  },
 
33
  "type": "string",
34
  "enum": ["Educational", "Medical", "Housing", "Financial", "General Support"],
35
  "description": "نوع المساعدة المطلوب الاستفسار عنها باللغة الإنجليزية",
36
+ }
 
37
  },
38
  "required": ["assistance_type"],
39
  },
 
58
  "debts": {
59
  "type": "number",
60
  "description": "إجمالي الديون (بالجنيه)",
61
+ }
 
62
  },
63
  "required": ["income_monthly", "family_size"],
64
  },
 
72
  "parameters": {
73
  "type": "object",
74
  "properties": {
75
+ "request_id": {"type": "string", "description": "رقم الطلب"}
 
 
76
  },
77
  "required": ["request_id"],
78
  },
 
92
  "country": {"type": "string"},
93
  "governorate": {"type": "string"},
94
  "city": {"type": "string"},
95
+ "neighborhood": {"type": "string"}
 
 
96
  },
97
  "required": ["first_name", "last_name", "phone", "country", "governorate", "city"],
98
  },
 
105
  "description": "جلب ملخص طلبات الأسرة وإحصاءاتها.",
106
  "parameters": {
107
  "type": "object",
108
+ "properties": {},
 
 
 
109
  },
110
  },
111
  },
 
116
  "description": "استرجاع تفاصيل الملف الشخصي والبيانات للأسرة المسجلة كالإسم والموقع.",
117
  "parameters": {
118
  "type": "object",
119
+ "properties": {},
 
 
 
120
  },
121
  },
122
  },
 
131
  "status": {
132
  "type": "string",
133
  "description": "حالة الطلب لو أردت فلترة (مثل 'Pending', 'Approved', 'Rejected'). اتركه فارغاً لجلب كل شيء."
134
+ }
 
 
135
  },
136
  },
137
  },
 
143
  "description": "جلب إحصاءات الجمعية وأدائها، وعدد الطلبات والاسر المدعومة للمنظمة.",
144
  "parameters": {
145
  "type": "object",
146
+ "properties": {},
 
 
147
  },
148
  },
149
  },