-
-
Notifications
You must be signed in to change notification settings - Fork 19
Implemented API documentation using Sphinx #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks a lot for your work ! |
|
In the meantime, I'm going to close it for organization purposes. Feel free to reopen it if you add some work on it :) |
|
This would be useful. An updated or new PR would be appreciated! |
There was a problem hiding this comment.
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 replaces manually written API documentation with Sphinx automodule directives to automatically generate documentation from Python docstrings. The approach follows the Mesa documentation pattern and aims to reduce maintenance overhead while ensuring documentation stays synchronized with the codebase.
Key changes:
- Removed detailed manual API documentation (~500+ lines) from 7 markdown files
- Added Sphinx
automoduledirectives to auto-generate docs from source code docstrings - Restructured documentation files with clearer section headings for different module components
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/apis/tools.md | Replaced manual documentation of @tool decorator, ToolManager class, and built-in tools with automodule directives for inbuilt_tools, tool_manager, and tool_decorator modules |
| docs/apis/recording.md | Replaced detailed documentation of SimulationRecorder, @record_model decorator, SimulationEvent, and AgentViewer with automodule directives for simulation_recorder, agent_analysis, and record_model modules |
| docs/apis/reasoning.md | Replaced manual documentation of Observation, Plan, Reasoning base class, and strategy implementations (CoT, ReAct, ReWOO) with automodule directives organized by strategy type |
| docs/apis/parallel_stepping.md | Replaced extensive documentation about asyncio/threading modes and usage examples with a single automodule directive for the parallel_stepping module |
| docs/apis/module_llm.md | Replaced detailed ModuleLLM class documentation, provider information, and usage examples with a single automodule directive |
| docs/apis/memory.md | Replaced manual documentation of MemoryEntry, Memory base class, and memory implementations (STLTMemory, ShortTermMemory, EpisodicMemory) with automodule directives organized by memory type |
| docs/apis/llm_agent.md | Replaced detailed LLMAgent class documentation and usage examples with a single automodule directive including inherited members |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.reasoning.reasoning | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.reasoning.reasoning is missing the :undoc-members: option that is present in other sections. This inconsistency may result in incomplete documentation if there are members without docstrings. Consider adding :undoc-members: for consistency with the other reasoning module sections.
| from mesa_llm.reasoning.rewoo import ReWOOReasoning | ||
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.reasoning.react | ||
| :members: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.reasoning.react is missing the :undoc-members: option that is present in the main reasoning section. This inconsistency should be fixed - either add :undoc-members: here or remove it from the reasoning.reasoning section for consistency.
| :members: | |
| :members: | |
| :undoc-members: |
| ## Usage in Mesa Simulations | ||
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.memory.st_memory | ||
| :members: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.memory.st_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.
| :members: | |
| :members: | |
| :undoc-members: |
| ) | ||
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.memory.st_lt_memory | ||
| :members: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.memory.st_lt_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.
| :members: | |
| :members: | |
| :undoc-members: |
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.module_llm | ||
| :members: | ||
| ``` |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a brief introductory paragraph or sentence before the Sphinx automodule directive to explain what ModuleLLM provides. The old documentation had explanatory text that helped readers understand the unified interface for LLM providers. Even a single sentence would improve readability.
| self.apply_plan(plan) | ||
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.reasoning.rewoo | ||
| :members: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.reasoning.rewoo is missing the :undoc-members: option that is present in the main reasoning section. This inconsistency should be fixed - either add :undoc-members: here or remove it from the reasoning.reasoning section for consistency.
| :members: | |
| :members: | |
| :undoc-members: |
| from mesa_llm.memory.st_lt_memory import STLTMemory | ||
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.memory.lt_memory | ||
| :members: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.memory.lt_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.
| :members: | |
| :members: | |
| :undoc-members: |
|
|
||
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.memory.episodic_memory | ||
| :members: |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automodule directive for mesa_llm.memory.episodic_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.
| :members: | |
| :members: | |
| :undoc-members: |
| selected_tools=["move_one_step", "change_state"] # Restrict available tools for LLM calling | ||
| ) | ||
| self.apply_plan(plan) | ||
| ## Inbuilt Tools |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The section title "Inbuilt Tools" uses inconsistent terminology. The old documentation and other parts of the codebase refer to these as "Built-in Tools". Consider changing "Inbuilt" to "Built-in" for consistency with standard English terminology and the rest of the documentation.
| ## Inbuilt Tools | |
| ## Built-in Tools |
| ```{eval-rst} | ||
| .. automodule:: mesa_llm.parallel_stepping | ||
| :members: | ||
| ``` |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a brief introductory paragraph or sentence before the Sphinx automodule directive to explain what this module provides. The old documentation had explanatory text that helped readers understand the context before diving into the auto-generated API docs. Even a single sentence would improve readability.
|
updated the PR and resolved the conflict, this PR can be safely merged now! |
colinfrisch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this looks good. @EwoutH would you change anything ?
Added the missing API documentation as outlined in issue #31.
docs_mesa-llm.mp4
Note: Work on examples and other documentation requirements mentioned in the issue is still in progress.