Skip to content

Add Comprehensive KDoc Comments and Dokka Documentation Setup#62

Open
JanhaviSingh2004 wants to merge 1 commit into
A-Akhil:mainfrom
JanhaviSingh2004:main
Open

Add Comprehensive KDoc Comments and Dokka Documentation Setup#62
JanhaviSingh2004 wants to merge 1 commit into
A-Akhil:mainfrom
JanhaviSingh2004:main

Conversation

@JanhaviSingh2004

Copy link
Copy Markdown

Closes #22

This pull request adds complete KDoc documentation to the entire codebase and integrates the Dokka plugin for HTML documentation generation. The following updates were made to fulfill the assigned task:

✅ Key Updates
📌 Added KDoc comments to all public classes, interfaces, and methods

🧾 Documented method parameters, return types, and exceptions

🧠 Provided class-level descriptions explaining purpose and usage

📚 Added usage examples for complex classes like MemoryRetriever

✅ Documented expected input formats and parameter validations

⚙️ Integrated Dokka into build.gradle.kts for generating HTML documentation

📄 Created a contributor-facing coding standards document

📂 Updated Files
LlamaClient.kt
MemoryManager.kt
Repository.kt
All ViewModel classes
MemoryRetriever.kt
build.gradle.kts (Dokka setup)

🧪 Dokka Usage
To generate the documentation in HTML format, run:

./gradlew dokkaHtml

The output will be available at:
build/dokka/html/

@A-Akhil A-Akhil requested a review from Copilot August 19, 2025 11:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds comprehensive KDoc documentation throughout the codebase and integrates the Dokka plugin for HTML documentation generation. The documentation improves code maintainability by providing clear explanations of classes, methods, parameters, and usage examples.

  • Enhanced all public classes, interfaces, and methods with detailed KDoc comments
  • Integrated Dokka plugin for generating HTML documentation
  • Updated system configuration (Java home path for Windows development environment)

Reviewed Changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.

File Description
gradle.properties Updates Java home path for Windows development environment
app/build.gradle.kts Adds Dokka plugin for HTML documentation generation
LlmClientTest.kt Adds comprehensive test documentation with clear explanations
Multiple source files Extensive KDoc documentation covering classes, methods, parameters, and usage examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

val eval_duration: Long? = null
)

data class OllamaResponse(

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two identical OllamaResponse data class declarations in this file. The second declaration starting at line 46 duplicates the first one and should be removed to avoid compilation errors.

Copilot uses AI. Check for mistakes.
* @param document The text content of the document to be added.
* @throws IllegalArgumentException If the document is blank.
*/
fun addDocument(document: String) {

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @throws documentation claims the method throws IllegalArgumentException for blank documents, but the implementation doesn't validate the input or throw any exceptions. Either add the validation or remove the incorrect documentation.

Suggested change
fun addDocument(document: String) {
fun addDocument(document: String) {
if (document.isBlank()) {
throw IllegalArgumentException("Document cannot be blank.")
}

Copilot uses AI. Check for mistakes.
*
* @throws IllegalArgumentException if [topK] is less than 1 or if [queryVector] has zero length.
*/
fun search(queryVector: FloatArray, topK: Int): List<Pair<String, Float>> {

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @throws documentation claims the method throws IllegalArgumentException for invalid parameters, but the implementation doesn't validate topK or queryVector length. Either add the validation or remove the incorrect documentation.

Suggested change
fun search(queryVector: FloatArray, topK: Int): List<Pair<String, Float>> {
fun search(queryVector: FloatArray, topK: Int): List<Pair<String, Float>> {
if (topK < 1) {
throw IllegalArgumentException("topK must be at least 1")
}
if (queryVector.isEmpty()) {
throw IllegalArgumentException("queryVector must have non-zero length")
}

Copilot uses AI. Check for mistakes.
* @param vecB The second vector.
* @return A float similarity score. Returns 0.0f if either vector has zero magnitude.
*
* @throws IllegalArgumentException if vectors have different lengths.

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @throws documentation claims the method throws IllegalArgumentException for vectors with different lengths, but the implementation doesn't validate vector lengths. Either add the validation or remove the incorrect documentation.

Copilot uses AI. Check for mistakes.
* @param recentMessages (Optional) Recent messages used to boost contextual relevance.
* @param maxResults The maximum number of relevant memory facts to return.
* @return A list of memory facts sorted by relevance.
* @throws IllegalArgumentException if maxResults is less than 1.

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @throws documentation claims the method throws IllegalArgumentException for invalid maxResults, but the implementation doesn't validate this parameter. Either add the validation or remove the incorrect documentation.

Copilot uses AI. Check for mistakes.
@A-Akhil

A-Akhil commented Aug 19, 2025

Copy link
Copy Markdown
Owner

@JanhaviSingh2004 Check the review by copilot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Comprehensive KDoc Documentation to All Classes and Methods

3 participants