-
Notifications
You must be signed in to change notification settings - Fork 9
API Documentation #135
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
Closed
Closed
API Documentation #135
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2e6b0a3
API Documentation
shivashanmugam a13d6e6
microbots doc update
shivashanmugam 52e659f
fix changed microbot class order
shivashanmugam fd9aa4a
fix format changes in microbot.py
shivashanmugam 2a04b8d
fix unwanted formatting issues
shivashanmugam ef742d5
remove comma added in timout_in_seconds parameter
shivashanmugam e5fef48
revert openai_api file changes
shivashanmugam 5b5db20
revert openai changes
shivashanmugam 2a6f484
fix mount class format issues
shivashanmugam 4a9b074
add log analysis bot parameters
shivashanmugam 792ecc7
remove unwanted format changes in log analysis bot .py
shivashanmugam d460b8a
add missed todo
shivashanmugam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Bots | ||
|
|
||
| This section covers the different types of bots that can be built with Microbots, along with detailed guides and examples for each type. | ||
|
|
||
| All bots extend the core [`MicroBot`](../components/bot.md) class with specialized system prompts, permissions, and tools. | ||
|
|
||
| | Bot | Purpose | Access Level | | ||
| |-----|---------|-------------| | ||
| | [LogAnalysisBot](log-analysis-bot.md) | Analyze log files and identify root causes | Read-only | | ||
| | ReadingBot | Code comprehension and analysis | Read-only | | ||
| | WritingBot | Controlled file edits | Read-write (restricted commands) | | ||
| | BrowsingBot | Web search and browsing | N/A | | ||
| | AgentBoss | Task decomposition and delegation | Read-write | | ||
| | CopilotBot | GitHub Copilot SDK wrapper | Configurable | | ||
|
|
||
| !!! note "Auto-generated API references" | ||
| The API references on these pages are **auto-generated from source code docstrings**. When the source code changes, the documentation updates automatically on the next build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # LogAnalysisBot | ||
|
|
||
| The `LogAnalysisBot` analyzes log files and identifies root causes of failures. It mounts a code directory as read-only context and copies the target log file into the container for analysis. | ||
|
|
||
| ## Quick Example | ||
|
|
||
| ```python | ||
| from microbots import LogAnalysisBot | ||
|
|
||
| bot = LogAnalysisBot( | ||
| model="azure-openai/gpt-4.1", | ||
| folder_to_mount="/path/to/source/code", | ||
| ) | ||
|
|
||
| result = bot.run(file_name="/path/to/error.log") | ||
| print(result.status, result.result) | ||
| ``` | ||
|
|
||
| ## How It Works | ||
|
|
||
| 1. The source code directory is mounted **read-only** at the sandbox path for context. | ||
| 2. The log file is **copied** into `/var/log/` inside the container. | ||
| 3. The bot analyzes the log, cross-references with the source code, and identifies the root cause. | ||
|
|
||
| ## API Reference | ||
|
|
||
| <!-- Auto-generated from source code --> | ||
|
|
||
| ::: microbots.bot.LogAnalysisBot.LogAnalysisBot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Bot | ||
|
|
||
| The `MicroBot` class is the core autonomous agent. All specialized bots (`ReadingBot`, `WritingBot`, etc.) extend this class. | ||
|
|
||
| You can use `MicroBot` directly for custom bots or subclass it for specialized behavior. | ||
|
|
||
| ## Quick Example | ||
|
|
||
| ```python | ||
| from microbots import MicroBot | ||
| from microbots.extras.mount import Mount, MountType, PermissionLabels | ||
|
|
||
| bot = MicroBot( | ||
| model="azure-openai/gpt-5-swe-agent", | ||
| system_prompt="You are a helpful coding assistant.", | ||
| folder_to_mount=Mount( | ||
| host_path="code", | ||
| sandbox_path="/home/user/code", | ||
| mount_type=MountType.MOUNT, | ||
| permission=PermissionLabels.READ_ONLY, | ||
| ), | ||
| ) | ||
|
|
||
| result = bot.run(task="Analyze the project structure") | ||
| print(result.status, result.result) | ||
| ``` | ||
|
|
||
| ## API Reference | ||
|
|
||
| <!-- Auto-generated from source code --> | ||
|
|
||
| !!! info "Parameters vs Attributes" | ||
| **Parameters** are the arguments you pass when creating an instance of a class (e.g., `MicroBot(model=..., system_prompt=...)`). | ||
| **Attributes** are the internal variables available on the instance after creation, used by the class during its operation. | ||
|
|
||
| ::: microbots.MicroBot.MicroBot | ||
| options: | ||
| show_source: false | ||
|
|
||
|
|
||
| ::: microbots.MicroBot.BotRunResult | ||
| options: | ||
| show_source: false | ||
|
|
||
| ::: microbots.constants.ModelProvider | ||
| options: | ||
| show_source: false | ||
|
|
||
| ::: microbots.extras.mount.MountType | ||
| options: | ||
| show_source: false | ||
|
|
||
| ::: microbots.extras.mount.Mount | ||
| options: | ||
| show_source: false | ||
|
|
||
| ::: microbots.constants.PermissionLabels | ||
| options: | ||
| show_source: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Components | ||
|
|
||
| This section covers the core components of Microbots, providing in-depth explanations and API references for each. | ||
|
|
||
| Microbots is built around these below foundational components: | ||
|
|
||
| - **[Bot](bot.md)** — The core `MicroBot` class that powers all autonomous agents. Every specialized bot extends this base class. | ||
|
|
||
| !!! note "Auto-generated API references" | ||
| The API references on these pages are **auto-generated from source code docstrings** using [mkdocstrings](https://mkdocstrings.github.io/). When the source code changes, the documentation updates automatically on the next build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # API Documentation | ||
|
|
||
| This section provides comprehensive API references for Microbots, auto-generated from source code docstrings. When the source code changes, the documentation updates automatically on the next build. | ||
|
|
||
| ## Components | ||
|
|
||
| The foundational building blocks of Microbots. | ||
|
|
||
| - **[Bot](components/bot.md)** — The core `MicroBot` class that powers all autonomous agents. Covers the base class, `BotRunResult`, `BotType`, and the agent execution loop. | ||
|
|
||
| ## Bots | ||
|
|
||
| Specialized bot implementations, each tailored for a specific use case. | ||
|
|
||
| - **[LogAnalysisBot](bots/log-analysis-bot.md)** — Analyzes log files inside a sandboxed container and identifies root causes by cross-referencing with source code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.