diff --git a/.vscode/settings.json b/.vscode/settings.json index 58c9ef4..4361a33 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,6 @@ "microbots", "ollama", "qwen" - ] -} \ No newline at end of file + ], + "python.testing.pytestEnabled": true +} diff --git a/README.md b/README.md index 43ec527..3c8f474 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ MicroBots is a lightweight, extensible AI agent for code comprehension and contr into automation pipelines, mounting a target directory with explicit read-only or read/write modes so LLMs can safely inspect, refactor, or generate files with least‑privilege access. - ```py from microbots import WritingBot @@ -35,7 +34,6 @@ This project is currently **under active development**. Features, APIs, and inte pip install microbots ``` - ## ✨LLM Support Azure OpenAI Models - Add the below environment variables in a `.env` file in the root of your application @@ -43,6 +41,7 @@ Azure OpenAI Models - Add the below environment variables in a `.env` file in th ```env OPEN_AI_END_POINT=XXXXXXXXXXXXXXXXXXXXXXXXXX OPEN_AI_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +AZURE_OPENAI_DEPLOYMENT_NAME=XXXXXXXXXXXXXXXXXXXXXX ``` ## 🤖 Bots & Usage Examples @@ -50,10 +49,8 @@ OPEN_AI_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Pre-requisite for the below example code of Bots: From the root of your application, Create a folder called `code` inside which clone the repo `https://github.com/swe-agent/test-repo/`. Now run the code - ### 📖 ReadingBot - ```py from microbots import ReadingBot @@ -69,7 +66,6 @@ print(runResult) The `ReadingBot` will read the files inside `code` folder and will extract information based on specific instructions given to the bot. - ### ✍️ WritingBot Pre-requisite for the example code: @@ -90,7 +86,61 @@ The `WritingBot` will read and write the files inside `code` folder based on spe ## ⚙️ How it works - ![Overall Architecture Image](./docs/images/overall_architecture.png) -The MicroBots create a containerized environment and mount the specified directory with restricting the permissions to read-only or read/write based on Bot used. It ensures that the AI agents operate within defined boundaries which enhances security and control over code modifications as well as protecting the local environment. \ No newline at end of file +The MicroBots create a containerized environment and mount the specified directory with restricting the permissions to read-only or read/write based on Bot used. It ensures that the AI agents operate within defined boundaries which enhances security and control over code modifications as well as protecting the local environment. + +## 🛠️ Local Development Setup + +**Prerequisites:** Python 3.11+, Docker + +**Setup:** + +```bash +git clone https://github.com/microsoft/minions.git +cd minions +python -m venv .venv +source .venv/bin/activate +pip install -e ".[dev]" +``` + +**LLM Provider (choose any combination):** + +```env +# Azure OpenAI +OPEN_AI_END_POINT=https://your-endpoint.openai.azure.com/openai/v1/ +OPEN_AI_KEY=your-api-key +AZURE_OPENAI_DEPLOYMENT_NAME=gpt-5 +OPEN_AI_DEPLOYMENT_NAME=gpt-5 + +# Anthropic +ANTHROPIC_API_KEY=your-api-key +ANTHROPIC_END_POINT=https://api.anthropic.com/ +ANTHROPIC_DEPLOYMENT_NAME=claude-3-5-sonnet-20241022 + +# Ollama (local) - see test/llm/README_OLLAMA_TESTING.md +LOCAL_MODEL_NAME=qwen2.5-coder:latest +LOCAL_MODEL_PORT=11434 +``` + +```env +# Required for basic tests +LOCAL_MODEL_NAME=fake_model +LOCAL_MODEL_PORT=12345 + +# Required for BrowserBot tests +BROWSER_USE_LLM_MODEL="gpt-5" +BROWSER_USE_LLM_TEMPERATURE=1 +AZURE_OPENAI_API_KEY=your-api-key +AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/ +AZURE_OPENAI_API_VERSION="2025-01-01-preview" +``` + +**Run tests:** + +```bash +pytest -m unit # Fast unit tests (no Docker) +pytest -m integration # Integration tests (requires Docker) +pytest -m "not slow" # Skip slow tests +pytest # Run all tests +``` diff --git a/pyproject.toml b/pyproject.toml index e926116..e64662e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "microbots" -dynamic = ["version", "dependencies"] +dynamic = ["version", "dependencies", "optional-dependencies"] description = "container-based autonomous agent framework" readme = "README.md" license = { file = "LICENSE" } @@ -23,6 +23,7 @@ requires-python = ">=3.11" [tool.setuptools.dynamic] dependencies = { file = ["requirements.txt"] } +optional-dependencies.dev = { file = ["requirements-dev.txt"] } [tool.setuptools_scm] # This tells setuptools-scm to get version from git tags @@ -32,4 +33,4 @@ where = ["src"] [project.urls] "Source Repo" = "https://github.com/microsoft/minions" -Issues = "https://github.com/microsoft/minions/issues" \ No newline at end of file +Issues = "https://github.com/microsoft/minions/issues" diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..ee4ba01 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +pytest +pytest-asyncio