Object AI Explanation


Overview

Get an AI-generated explanation for the given object. Optionally, you can retrieve a detailed explanation by using the detailed query parameter. The object content is extracted and analyzed using AI services to provide this explanation. Note: This service relies on several Imaging components. Please make sure all imaging services are running before calling this api.

URI

GET /rest/applications/{name}/objects/{id}/explain

Path parameters

name (string)

This parameter identifies the analyzed application. The application name must be properly encoded if it is required. Character back-quote is not allowed.

id (int)

The unique identifier of the object. This ID is used to fetch the object whose source code will be explained.

Query parameters

detailed (boolean)

optional, default: false When true, provides a more elaborate explanation of the object’s source code. When false or omitted, a concise explanation is returned.

Responses

application/json

The response contains an AI-generated explanation of the object source code. Example:

{
    "success": "The given source code consists of SQL statements that are used to add users to the 'db_owner' role in a Microsoft SQL Server database. The 'sp_addrolemember' stored procedure is being called to add the following users to the 'db_owner' role: 'emsAppUser', 'processesAppUser', and 'CASTCORPicastmailer'. These users will have permission to perform tasks as owners of the database, such as modifying schema, creating tables, and other administrative functions.",
    "input_tokens": 299,
    "output_tokens": 109
}

JSON representation

Property Type Description
success string The AI-generated explanation of the object source code.
input_tokens integer The number of tokens in the input sent to the AI service.
output_tokens integer The number of tokens generated by the AI service in the explanation.