diff --git a/hesabixCore/src/AiTool/TicketService.php b/hesabixCore/src/AiTool/TicketService.php index 29a9459..aef6971 100644 --- a/hesabixCore/src/AiTool/TicketService.php +++ b/hesabixCore/src/AiTool/TicketService.php @@ -12,6 +12,74 @@ class TicketService ) { } + /** + * دریافت ابزارهای مربوط به تیکت‌ها + * @return array + */ + public function getTools(): array + { + return [ + [ + 'name' => 'get_user_tickets', + 'description' => 'دریافت لیست تیکت‌های کاربر', + 'parameters' => [ + 'type' => 'object', + 'properties' => [ + 'user' => [ + 'type' => 'object', + 'description' => 'کاربر درخواست کننده' + ] + ], + 'required' => ['user'] + ] + ], + [ + 'name' => 'create_or_update_ticket', + 'description' => 'ایجاد یا به‌روزرسانی تیکت', + 'parameters' => [ + 'type' => 'object', + 'properties' => [ + 'params' => [ + 'type' => 'object', + 'description' => 'پارامترهای تیکت' + ], + 'files' => [ + 'type' => 'array', + 'description' => 'فایل‌های پیوست' + ], + 'user' => [ + 'type' => 'object', + 'description' => 'کاربر درخواست کننده' + ], + 'id' => [ + 'type' => 'string', + 'description' => 'شناسه تیکت (برای به‌روزرسانی)' + ] + ], + 'required' => ['params', 'files', 'user'] + ] + ], + [ + 'name' => 'get_ticket_details', + 'description' => 'دریافت جزئیات تیکت و پاسخ‌های آن', + 'parameters' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'string', + 'description' => 'شناسه تیکت' + ], + 'user' => [ + 'type' => 'object', + 'description' => 'کاربر درخواست کننده' + ] + ], + 'required' => ['id', 'user'] + ] + ] + ]; + } + /** * دریافت لیست تیکت‌های کاربر */ diff --git a/hesabixCore/src/Service/AGI/Promps/TicketService.php b/hesabixCore/src/Service/AGI/Promps/TicketService.php index 7bb589a..47343e0 100644 --- a/hesabixCore/src/Service/AGI/Promps/TicketService.php +++ b/hesabixCore/src/Service/AGI/Promps/TicketService.php @@ -4,6 +4,65 @@ namespace App\Service\AGI\Promps; class TicketService { + /** + * دریافت ابزارهای مربوط به تیکت‌ها + * @return array + */ + public function getTools(): array + { + return [ + [ + 'name' => 'analyze_ticket', + 'description' => 'تحلیل و دسته‌بندی تیکت', + 'parameters' => [ + 'type' => 'object', + 'properties' => [ + 'ticket_body' => [ + 'type' => 'string', + 'description' => 'متن تیکت' + ] + ], + 'required' => ['ticket_body'] + ] + ], + [ + 'name' => 'draft_ticket_response', + 'description' => 'تهیه پیش‌نویس پاسخ تیکت', + 'parameters' => [ + 'type' => 'object', + 'properties' => [ + 'ticket_body' => [ + 'type' => 'string', + 'description' => 'متن تیکت' + ], + 'ticket_title' => [ + 'type' => 'string', + 'description' => 'عنوان تیکت' + ], + 'history' => [ + 'type' => 'array', + 'description' => 'تاریخچه مکالمات قبلی', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'sender' => [ + 'type' => 'string', + 'description' => 'فرستنده پیام' + ], + 'message' => [ + 'type' => 'string', + 'description' => 'متن پیام' + ] + ] + ] + ] + ], + 'required' => ['ticket_body', 'ticket_title'] + ] + ] + ]; + } + /** * پرامپت برای بررسی متن تیکت و دسته‌بندی آن */