Add Comprehensive KDoc Comments and Dokka Documentation Setup#62
Add Comprehensive KDoc Comments and Dokka Documentation Setup#62JanhaviSingh2004 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
| * @param document The text content of the document to be added. | ||
| * @throws IllegalArgumentException If the document is blank. | ||
| */ | ||
| fun addDocument(document: String) { |
There was a problem hiding this comment.
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.
| fun addDocument(document: String) { | |
| fun addDocument(document: String) { | |
| if (document.isBlank()) { | |
| throw IllegalArgumentException("Document cannot be blank.") | |
| } |
| * | ||
| * @throws IllegalArgumentException if [topK] is less than 1 or if [queryVector] has zero length. | ||
| */ | ||
| fun search(queryVector: FloatArray, topK: Int): List<Pair<String, Float>> { |
There was a problem hiding this comment.
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.
| 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") | |
| } |
| * @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. |
There was a problem hiding this comment.
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.
| * @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. |
There was a problem hiding this comment.
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.
|
@JanhaviSingh2004 Check the review by copilot |
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/