Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/ai360/llms.txt

Use this file to discover all available pages before exploring further.

The Code Explainer sends any code snippet to Gemini 2.5 Flash with the prompt "Explain the following code step by step in simple, beginner-friendly terms". Gemini reads the snippet, walks through each meaningful section, and returns a detailed, approachable explanation rendered as formatted markdown — no jargon, no assumptions about prior experience.

How to use

1

Open the tool

Navigate to /utilities/code-explainer in your AI360 app.
2

Paste your code

In the Your Code panel on the left, paste any code snippet into the monospaced textarea.
3

Explain the code

Click Explain Code. A loading skeleton appears while Gemini 2.5 Flash analyses the snippet.
4

Read the explanation

The Explanation panel on the right renders the step-by-step breakdown as formatted markdown. Use the Copy button to copy the explanation to your clipboard.

API integration

Call the endpoint directly to integrate plain-English code explanations into your own tooling, bots, or IDE plugins.
const response = await fetch('/api/utilities/code-explainer', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    userPrompt: 'function fibonacci(n) { return n <= 1 ? n : fibonacci(n-1) + fibonacci(n-2); }'
  })
})
const { explanation } = await response.json()

Request & Response

POST /api/utilities/code-explainer

Request body

FieldTypeRequiredDescription
userPromptstring✅ YesThe raw code snippet to be explained

Response body

FieldTypeDescription
explanationstringThe explanation text. May contain markdown formatting.

Error responses

StatusCondition
400userPrompt is missing from the request body
500Gemini 2.5 Flash failed to generate a response

Supported languages

Gemini 2.5 Flash handles any programming language without configuration. Languages known to work well include JavaScript, TypeScript, Python, Java, Go, Rust, C/C++, SQL, Bash shell scripts, and more. Simply paste your code — the model detects the language automatically.

Tips for best results

  • Provide the full function or class, not a fragment. Incomplete snippets can yield vague or misleading explanations.
  • Include imports when they are relevant to understanding the code — for example, if you use a third-party library whose API is central to what the code does.
  • The more context, the better. A single expression like x++ gives Gemini little to work with; a complete function with variable names and control flow produces a far richer explanation.

Example

Input snippet
function fibonacci(n) {
  return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
}
Explanation (condensed) Gemini breaks this down into three logical points:
  1. Function signaturefibonacci accepts a single parameter n, representing the position in the sequence.
  2. Base case — the ternary condition n <= 1 ? n returns n directly when n is 0 or 1, stopping the recursion.
  3. Recursive case — for any n greater than 1, the function calls itself twice — once with n - 1 and once with n - 2 — and sums the results, mirroring the mathematical definition of the Fibonacci sequence.

Build docs developers (and LLMs) love