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 64.95% 64.95%
=======================================
Files 34 34
Lines 2374 2374
=======================================
Hits 1542 1542
Misses 832 832
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.
There was a problem hiding this comment.
There was issue with logAnalysisBot in windows. I have removed all windows instruction and created new ticket for windows microbots issue. Directly in windows it is not working https://github.com/microsoft/microbots/issues/138
.
But it works in wsl. Verified with Fedora 42 in windows with docker installed inside the wsl
| 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.
There was a problem hiding this comment.
Already python-3-venv is not mentioned as installation dependency in fodora. It is only mentioned for ubuntu and debian.
.
Also verified this example of microbots in fedora and ubuntu
| 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.
There was a problem hiding this comment.
Converted the endpoints with Double quotes
| ├── 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?
There was a problem hiding this comment.
Yes. app.js will be present even if 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
There was a problem hiding this comment.
Removed. Conveyed microbots will load variables in .env automatically in place. No need to explicitly load environment variables unless having a .env file
| |----------|------|----------|-------------| | ||
| | `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.
There was a problem hiding this comment.
Added references to LogAnalysisBot Class
| | 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
There was a problem hiding this comment.
Removed max_iterations, Direct reference to the method
|
|
||
| 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.
There was a problem hiding this comment.
Removed, Just added the reference to run Method
| ``` | ||
| 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.
There was a problem hiding this comment.
Added references to "BotRunResult
| ```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
There was a problem hiding this comment.
Added addition step with snippets of log out along with note conveying "they skip the step if not required"
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
I appreciate this document. It's a good start for anyone who wants to write a blog. Also, these points will be helpful while reviewing or setting-up an AI auto-reviewer.
There was a problem hiding this comment.
Good idea. Should have a AI auto-reviewer for blogs with this Technical Writing Guidelines document being as reference. Will keep in pipeline of one of the microbots blog management task
|
|
||
| ## Step 1 — Create the Sample Project | ||
|
|
||
| From the root of your `microbots-introduction` project, create a `code/` folder: |
There was a problem hiding this comment.
Please mention that this sample code and LogAnalysisBot code are available Microbot's example directory from where the user can download/clone and use it for following this document.
|
|
||
| `code/build.log` should contain: | ||
|
|
||
| ```log title="code/build.log" |
There was a problem hiding this comment.
Please enable line numbers for this file
| expected ';' before '}' token". Fix by adding a semicolon: `return a + b;`. | ||
| ``` | ||
|
|
||
| Continue with [Conclusion](../conclusion.md). |
There was a problem hiding this comment.
Please have a proper conclusion as such, "we have created a buggy code and successfully analyzed it with Microbots. As per the analysis, the LogAnalysisBot has correctly identified the bug in the code and and explained the solution too".
And give a starting point for the next article - "Please read the next article for understanding what happens behind the scene and how to debug Microbots code with Log"
There was a problem hiding this comment.
We can have a better name than "Conclusion". - depicting what this article actually discusses.
Additionally, have a section on how to enable Microbots logs with Python logging and how to read it. If you find it making the article longer, you can make it as the fifth page of this article series.
|
|
||
| ## Step 2 — Installing Docker | ||
|
|
||
| On macOS, install [Docker Desktop](https://www.docker.com/products/docker-desktop/) and launch it. |
There was a problem hiding this comment.
Please install Windows setup link too.
Also, please mention for Windows, they've to install docker on Windows, and run the code in WSL. A separate article will be add here for Windows setup later.
| ```bash title="Terminal" | ||
| sudo systemctl enable --now docker | ||
| sudo usermod -aG docker $USER | ||
| newgrp docker |
There was a problem hiding this comment.
Can you please confirm the steps. The previous command adds the user to docker group. But the new-group is created after adding a user to it!
|
|
||
| A "Hello from Docker!" message confirms the daemon is reachable. | ||
|
|
||
| Continue with the [Microbot Installation](installation-guide.md) guide. |
There was a problem hiding this comment.
A simple conclusion is appropriate here.
|
|
||
| ## ✨ LLM Support | ||
|
|
||
| Azure OpenAI Models — add environment variables in a `.env` file: |
There was a problem hiding this comment.
This section is misleading as if Microbots supports only Azure-OpenAI. Please mention all the LLMs supported by Microbots and link to the env variable page which specifies what set of env variables need to be set for what LLM provider.
There was a problem hiding this comment.
I think Introduction and ReadMe can be same file. Try using a softlink if git supports it.

Changes with this PR
Bots. Tools,
From : microbots/copilot-bot/
To : microbots/advanced/bots/copilot-bot/
From : microbots/blog/guides/tesseract_ocr_tool_use/
To : microbots/advanced/tools/tesseract_ocr_tool_use/
From : /microbots/authentication/
To : microbots/advanced/authentication/