This commit is contained in:
Hesabix 2025-07-26 12:19:44 -07:00
parent 1b4b9f85f2
commit ad638e960f
2 changed files with 127 additions and 0 deletions

View file

@ -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']
]
]
];
}
/** /**
* دریافت لیست تیکت‌های کاربر * دریافت لیست تیکت‌های کاربر
*/ */

View file

@ -4,6 +4,65 @@ namespace App\Service\AGI\Promps;
class TicketService 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']
]
]
];
}
/** /**
* پرامپت برای بررسی متن تیکت و دسته‌بندی آن * پرامپت برای بررسی متن تیکت و دسته‌بندی آن
*/ */