more bug fix

This commit is contained in:
Hesabix 2025-07-26 12:28:33 -07:00
parent ad638e960f
commit 82623c0df8

View file

@ -13,7 +13,7 @@ class TicketService
} }
/** /**
* دریافت ابزارهای مربوط به تیکت‌ها * Get the available tools for ticket management
* @return array * @return array
*/ */
public function getTools(): array public function getTools(): array
@ -21,60 +21,88 @@ class TicketService
return [ return [
[ [
'name' => 'get_user_tickets', 'name' => 'get_user_tickets',
'description' => 'دریافت لیست تیکت‌های کاربر', 'description' => 'Retrieve a list of tickets for the current user',
'parameters' => [ 'parameters' => [
'type' => 'object', 'type' => 'object',
'properties' => [ 'properties' => [
'user' => [ 'user_id' => [
'type' => 'object', 'type' => 'string',
'description' => 'کاربر درخواست کننده' 'description' => 'The ID of the user whose tickets to retrieve'
],
'status' => [
'type' => 'string',
'description' => 'Filter tickets by status (optional)',
'enum' => ['open', 'closed', 'pending']
] ]
], ],
'required' => ['user'] 'required' => ['user_id']
] ]
], ],
[ [
'name' => 'create_or_update_ticket', 'name' => 'create_or_update_ticket',
'description' => 'ایجاد یا به‌روزرسانی تیکت', 'description' => 'Create a new ticket or update an existing one',
'parameters' => [ 'parameters' => [
'type' => 'object', 'type' => 'object',
'properties' => [ 'properties' => [
'params' => [ 'ticket_id' => [
'type' => 'object',
'description' => 'پارامترهای تیکت'
],
'files' => [
'type' => 'array',
'description' => 'فایل‌های پیوست'
],
'user' => [
'type' => 'object',
'description' => 'کاربر درخواست کننده'
],
'id' => [
'type' => 'string', 'type' => 'string',
'description' => 'شناسه تیکت (برای به‌روزرسانی)' 'description' => 'Ticket ID (required for updates, omit for new tickets)'
] ],
'subject' => [
'type' => 'string',
'description' => 'The subject/title of the ticket'
],
'message' => [
'type' => 'string',
'description' => 'The ticket message or description'
],
'priority' => [
'type' => 'string',
'description' => 'Ticket priority level',
'enum' => ['low', 'medium', 'high']
],
'department' => [
'type' => 'string',
'description' => 'The department this ticket belongs to',
'enum' => ['technical', 'financial', 'general']
],
'attachments' => [
'type' => 'array',
'description' => 'Array of file attachments',
'items' => [
'type' => 'object',
'properties' => [
'filename' => [
'type' => 'string',
'description' => 'Name of the attached file'
],
'content' => [
'type' => 'string',
'description' => 'Base64 encoded content of the file'
]
}
]
}
], ],
'required' => ['params', 'files', 'user'] 'required' => ['subject', 'message', 'priority', 'department']
] ]
], ],
[ [
'name' => 'get_ticket_details', 'name' => 'get_ticket_details',
'description' => 'دریافت جزئیات تیکت و پاسخ‌های آن', 'description' => 'Get detailed information about a specific ticket including its conversation history',
'parameters' => [ 'parameters' => [
'type' => 'object', 'type' => 'object',
'properties' => [ 'properties' => [
'id' => [ 'ticket_id' => [
'type' => 'string', 'type' => 'string',
'description' => 'شناسه تیکت' 'description' => 'The unique identifier of the ticket'
], ],
'user' => [ 'include_messages' => [
'type' => 'object', 'type' => 'boolean',
'description' => 'کاربر درخواست کننده' 'description' => 'Whether to include the full conversation history'
] ]
], ],
'required' => ['id', 'user'] 'required' => ['ticket_id']
] ]
] ]
]; ];