From 88bc35d85dca283fc498fe19533885846fa25076 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Sat, 26 Jul 2025 12:34:04 -0700 Subject: [PATCH] more more bug fix in ticket tools --- hesabixCore/src/AiTool/TicketService.php | 93 ++++++++++++------------ 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/hesabixCore/src/AiTool/TicketService.php b/hesabixCore/src/AiTool/TicketService.php index 1b9f4ec..274d52d 100644 --- a/hesabixCore/src/AiTool/TicketService.php +++ b/hesabixCore/src/AiTool/TicketService.php @@ -25,17 +25,12 @@ class TicketService 'parameters' => [ 'type' => 'object', 'properties' => [ - 'user_id' => [ - 'type' => 'string', - 'description' => 'The ID of the user whose tickets to retrieve' - ], - 'status' => [ - 'type' => 'string', - 'description' => 'Filter tickets by status (optional)', - 'enum' => ['open', 'closed', 'pending'] + 'user' => [ + 'type' => 'object', + 'description' => 'The user object' ] ], - 'required' => ['user_id'] + 'required' => ['user'] ] ], [ @@ -44,47 +39,49 @@ class TicketService 'parameters' => [ 'type' => 'object', 'properties' => [ - 'ticket_id' => [ - 'type' => 'string', - 'description' => 'Ticket ID (required for updates, omit for new tickets)' + 'params' => [ + 'type' => 'object', + 'description' => 'The ticket parameters', + 'properties' => [ + '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'] + ] + ], + 'required' => ['subject', 'message'] ], - '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' => [ + 'files' => [ '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' - ] - } + 'description' => 'File object' ] - } + ], + 'user' => [ + 'type' => 'object', + 'description' => 'The user object' + ], + 'id' => [ + 'type' => 'string', + 'description' => 'Ticket ID (required for updates, omit for new tickets)' + ] ], - 'required' => ['subject', 'message', 'priority', 'department'] + 'required' => ['params', 'files', 'user'] ] ], [ @@ -93,16 +90,16 @@ class TicketService 'parameters' => [ 'type' => 'object', 'properties' => [ - 'ticket_id' => [ + 'id' => [ 'type' => 'string', 'description' => 'The unique identifier of the ticket' ], - 'include_messages' => [ - 'type' => 'boolean', - 'description' => 'Whether to include the full conversation history' + 'user' => [ + 'type' => 'object', + 'description' => 'The user object' ] ], - 'required' => ['ticket_id'] + 'required' => ['id', 'user'] ] ] ];