Overview
With the Code Explanation feature of watsonx Code Assistant™ for Z, developers and system programmers can get AI-generated explanations with the click of a button.
These explanations can be used to:
- Reduce the knowledge gap: With real-time explanation of code, system programmers or developers without deep expertise can quickly learn the code functions or logic to accelerate development or modernization efforts.
- Free up senior subject matter experts: For advanced modernization work, reduce knowledge bottlenecks in your organization through real-time explanation of code.
- Increase application knowledge while reducing manual documentation: Code explanation helps to generate documentation faster, saving developers' time to focus on more critical tasks, accelerate their productivity, and develop well-documented applications for future maintainability.
- Make informed modernization decisions: With real-time explanations of code logic in the Refactor and Transform phases, developers can form a more comprehensive understanding of their applications during a modernization project.
2.4.0+watsonx
Code Assistant provides Chat Experience for Code Explanation
in VS Code.
You can initiate a whole program explanation from a chat window and ask some follow-on questions. In
addition, explanations initiated from the context menu are displayed in the chat window. Requesting
an explanation from the chat window does a program-level explanation equivalent to the Generate
simple explanation
menu option.
- Generate code
- Create new code from natural language prompts or modify existing code directly from the chat interface.
- Explain code with application insights
- Get detailed, AI-generated explanations enriched with additional application-level insights to help you understand programs or code segments.
- Get an explanation of the program and continue the conversation with follow-on questions.
- Use the context menu to trigger explanations directly in the chat window.
- Get application insights alongside explanations to better understand dependencies, business rules, and system context.
How does code explanation work?
- Simple explanation
- Provides you an overview and summary of the code.
- Detailed explanation
- Provides you an overview, information about the inputs and outputs of the code, and a functional summary of the code.
- Guided explanation
- Provides you an overview and walkthrough of the code step by step.
The code is securely sent to the watsonx Code Assistant for Z service. The selected code is encrypted on the client and then decrypted by the back-end service. The service strips out any comments before creating the prompt, as these comments might be inaccurate and can bias the AI model output.
Referenced files, such as copybooks in COBOL code are not
sent in the request. The AI model processes the request and
generates the explanation. The service returns the response to the IDE. 2.7.0+ Copybooks /
JCL
INCLUDE statements are expanded and sent in the request. This feature is not
available in PL/I, REXX, or Assembler code.
Code Explanation architecture for on prem setup
Does Code Explanation support native languages?
2.5.0+Yes. Code Explanation has native language support and currently, has localization support for French, Spanish, Japanese, Portuguese, and German languages.
2.6.0+ Dutch and Korean languages are also supported.
All these locales are supported on both VS Code and Eclipse based IDEs.
Native language support for Code Explanation is available only in the side panel experience. However, for follow-up questions Code Explanation generates response in English.
How does chat experience for Code Explanation work?
2.4.0+
The AI agents cannot be called directly. When you query a selected code snippet, each agent completes an eligibility check to see whether it can answer the question. The steps the agents take are generated based on the question that you ask. The agents generate potential useful information based on the question that you have asked, which is then passed to the large language model (LLM) to form an answer based on a predefined prompt.
- What is an agentic framework?
- An agentic framework is a collection of one or more AI agents that work together to interpret a user’s natural language request and formulate a plan to answer it.
- What is an AI agent?
- An AI agent is a system or program that can perform tasks on behalf of a user or another system. The agent performs these tasks by using a large language model (LLM) and a set of tools to get information. For more information, see What are AI agents?.
- What is the orchestrator agent?
- The orchestrator agent is the first point in the agentic framework, taking in requests from the user, and formatting responses from the AI agents. The orchestrator agent uses specialized agents to help answer the question that you ask.
- What is the explain agent?
- The explain agent provides explanations about selected code through a chat interface, enriching that explanation with information from IBM ADDI data source. The explain agent communicates with the existing large language model to provide an explanation of the code. It also takes in follow up questions from a user, and talks to the large language model to provide an answer. This answer is then sent to the orchestrator agent.
- What is the Application insights agent?
- The Application insights agent queries the ADDI database using a tool to get information about related programs and data that might be helpful when providing an explanation about code. If the agent does not find any relevant database entries, the Application insights agent returns no answer to the orchestrator agent.
For information on how to get started with the chat interface, see Enabling the chat interface.