New Guide Article : "Microbots : Introduction, Installation Guide and Creating Your First MicroBot" and structural changes in blog#132
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
- Coverage 97.15% 97.08% -0.07%
==========================================
Files 30 30
Lines 1546 1546
==========================================
- Hits 1502 1501 -1
- Misses 44 45 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| @@ -0,0 +1,9 @@ | |||
| "use strict"; | |||
There was a problem hiding this comment.
We don't need to add output files and log files. Only initial source files are sufficient as it can be used by the reader
There was a problem hiding this comment.
Removed the build.log and app.js which was output of tsc app.ts
| !!! note | ||
| For advanced authentication options (Azure AD tokens, managed identity, service principals), see the [Authentication Guide](../advanced/authentication.md). | ||
|
|
||
| ## Install Microbots |
There was a problem hiding this comment.
This needs detailed walkthrough - Python installation, venv creation and microbots installation. Also, in Windows, we need to do it inside wsl.
There was a problem hiding this comment.
Added python installation in Install Microbots prerequisites Section
|
|
||
| ### Step 1: Prepare a sample project | ||
|
|
||
| Create a project folder with a TypeScript file that has a syntax error. When the TypeScript compiler (`tsc`) tries to convert it to JavaScript, it fails — and the error output is captured in a log file. |
There was a problem hiding this comment.
User can create it or they can simply clone your example folder and follow the instructions step-by-step
There was a problem hiding this comment.
Added detailed instruction on creating project and create files inside and expected project structure
|
|
||
| Create `code/app.ts` with a deliberate syntax error: | ||
|
|
||
| ```typescript title="code/app.ts" |
There was a problem hiding this comment.
Please use line number feature of snippet plugin
There was a problem hiding this comment.
Added line number feature in code/app.ts
|
|
||
| ```bash title="Terminal" | ||
| cd code | ||
| tsc app.ts > build.log 2>&1 |
There was a problem hiding this comment.
Log files are naturally ignored by .gitignore. So, it will not be visible after deployment. Because sharing original log file may explose system related information. So, please use snippet of the log file here.
There was a problem hiding this comment.
Removed build.log reference
| This produces the following build log: | ||
|
|
||
| ```log title="code/build.log" | ||
| --8<-- "docs/examples/microbots_introduction/code/build.log" |
There was a problem hiding this comment.
build.log will not be checke-in to the git repo
There was a problem hiding this comment.
Removed build.log reference
| └── build.log | ||
| ``` | ||
|
|
||
| ### Step 2: Analyze logs with a LogAnalysisBot |
There was a problem hiding this comment.
Considering this is going to be the very first blog for the user, we need to add more details here. The flow of agent creation and agent run. Individual arguments of Agent initialization and run function has to be explained.
There was a problem hiding this comment.
Added detailed code walkthrough which can be expanded which will have each function call and arguments which it will accept ( mainly the Microbots Instance creation and run function )
|
|
||
| 1. **Created a Docker container** with the `code` folder mounted using the appropriate permissions. | ||
| 2. **Sent your task** to the LLM along with a system prompt tailored to the bot type. | ||
| 3. **Executed commands** inside the container as directed by the LLM (e.g., `cat`, `grep`, `sed`). |
There was a problem hiding this comment.
Please import logging and set logging config to print INFO log in the LogAnalysisBot.py. So, user can see the individual command the LLM runs. Also, you can point them how to read the logs with some examples here.
|
|
||
| **Install Python:** | ||
|
|
||
| - **Windows:** Download the latest installer from [python.org](https://www.python.org/downloads/). During installation, check **"Add Python to PATH"**. |
There was a problem hiding this comment.
Did you verify running microbots on Windows without WSL. If not, you can only mention this guide for Linux setup. We'll update it soon for Windows setup.
| sudo apt update && sudo apt install python3 python3-pip python3-venv | ||
|
|
||
| # Fedora | ||
| sudo dnf install python3 python3-pip |
There was a problem hiding this comment.
python3-venv is missing for Fedora. Please create a simple Fedora container and verify your steps whether they are valid.
| Create a `.env` file in the root of your application with: | ||
|
|
||
| ```env title=".env" | ||
| OPEN_AI_END_POINT=https://your-resource-name.openai.azure.com |
There was a problem hiding this comment.
With reference Kavya's internal chat, END_POINT value should be enclosed in double quotes. Please verify.
| ├── log_analysis_bot.py | ||
| └── code/ | ||
| ├── app.ts | ||
| ├── app.js |
There was a problem hiding this comment.
Will app.js present if ts file compilation fails?
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| load_dotenv() |
There was a problem hiding this comment.
load_dotenv() will be used if environment variables are stored in a file named .env. As in your example, you are explicitely setting env variables, you may not need .env
| |----------|------|----------|-------------| | ||
| | `model` | `str` | Yes | The LLM to use, in the format `<provider>/<model_name>`. Supported providers include `azure-openai`, `anthropic`, and `ollama`. | | ||
| | `folder_to_mount` | `str` | Yes | Path to the local folder the bot can access. For `LogAnalysisBot`, this is mounted as **read-only** inside the Docker container so the bot can read source files but never modify them. | | ||
| | `environment` | `any` | No | A custom execution environment. Defaults to a `LocalDockerEnvironment` if not provided. | |
There was a problem hiding this comment.
You don't need to mention all the possible arguments here. Please explain only those arguments. In parallel, you can generate an auto documentation and link to the class definition of LogAnalysisBot.
| | Argument | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `file_name` | `str` | — | **(Required)** Path to the log file to analyze. The file is copied into the container as read-only. | | ||
| | `max_iterations` | `int` | `20` | Maximum number of LLM reasoning/command loops before the bot stops. Each iteration is one round of the LLM issuing a command and receiving its output. | |
There was a problem hiding this comment.
max_iteration can be removed from here as it is not used in the code
|
|
||
| When `run()` is called, it: | ||
|
|
||
| 1. Copies the log file into the Docker container at a dedicated `/var/log/` path. |
There was a problem hiding this comment.
This detailed explanation will not make sense until someone understood the agentic architecture and Microbot's internals. So, you can simply mention that the Agent is invoked by run. Once agent completes, the result will be available in result.result.
| ``` | ||
| Prints the bot's root-cause analysis. | ||
|
|
||
| The `my_bot.run()` method returns a `BotRunResult` object with the following fields: |
There was a problem hiding this comment.
BotRunResult should be a link to the BotRunResult class documentation. In python document generation is easier. That document you should create and make corresponding link.
| ```text title="Terminal output" | ||
| (.venv) $ python3 log_analysis_bot.py | ||
|
|
||
| INFO:microbots.environment.local_docker.LocalDockerEnvironment:🗂️ Created working directory at /home/sikannan/MICROBOTS_WORKDIR_18da47d7 |
There was a problem hiding this comment.
Giving the complete terminal output is not advised as it may reveal some machine related secrets. You can simply mention how to run the code, where the user can find the log and how to interpret the log with snippets of log

Changes with this PR
New article in guide section "Microbots : Introduction, Installation Guide and Creating Your First MicroBot"
Created index file in guide section
Creation of new sections in Guide
Bots. Tools, Advanced
Fix of paths
From : microbots/copilot-bot/
To : microbots/guides/bots/copilot-bot/
From : microbots/blog/guides/tesseract_ocr_tool_use/
To : microbots/guides/tools/tesseract_ocr_tool_use/
From : /microbots/authentication/
To : microbots/guides/advanced/authentication/