Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,28 @@ uv sync

**Step 2:** Set up environment dependencies:

a. Set up `MiroFlow/apps/prepare-benchmark/.env` by:
```bash
## copy environment variable template and prepare yours in .env file
cd MiroFlow/apps/prepare-benchmark
cp .env.template .env
vim .env
```
Required environment variables:
- `HF_TOKEN` (for downloading datasets from Hugging Face)

Optional environment variables:
- `DATA_DIR` (Data loading directory, by default `../../data`)


b. Set up `MiroFlow/apps/run-agent/.env` by:
```bash
## copy environment variable template and prepare yours in .env file
cd MiroFlow/apps/run-agent
cp .env.template .env
vim .env
```
Required environment variables:
- `OPENROUTER_API_KEY` (Using OpenRouter to provide primary agent model)
- `ANTHROPIC_API_KEY` (for vision tools)
- `OPENAI_API_KEY` (for audio tools, intent recognition, and answer extraction)
Expand All @@ -176,15 +196,6 @@ Optional environment variables:

If you wish to use a different LLM as the primary agent model, you will need to provide the corresponding API keys.

```bash
## copy environment variable template and prepare yours in .env file
cd MiroFlow/apps/prepare-benchmark
cp .env.template .env
vim .env
cd MiroFlow/apps/run-agent
cp .env.template .env
vim .env
```

**Step 3:** Prepare E2B Sandbox (Optional)

Expand Down
6 changes: 3 additions & 3 deletions apps/run-agent/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ GEMINI_API_KEY=""

# Anthropic
ANTHROPIC_API_KEY=""
ANTHROPIC_BASE_URL=""
ANTHROPIC_BASE_URL="https://api.anthropic.com"

# openAI
OPENAI_API_KEY=""
OPENAI_BASE_URL=""
OPENAI_BASE_URL="https://api.openai.com/v1"

# openrouter
OPENROUTER_API_KEY=""
OPENROUTER_BASE_URL=""
OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"

# NewAPI
NEWAPI_API_KEY=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
DefaultAsyncHttpxClient,
DefaultHttpxClient,
)
from omegaconf import DictConfig, OmegaConf
from omegaconf import DictConfig
from tenacity import retry, stop_after_attempt, wait_fixed

from miroflow.llm.provider_client_base import LLMProviderClientBase
Expand Down Expand Up @@ -41,8 +41,8 @@ def _create_client(self, config: DictConfig):
trace_id = get_trace_id()
if trace_id is not None:
http_client_args["headers"] = {"trace-id": trace_id}
if not OmegaConf.is_missing(config, "https_proxy"):
http_client_args["proxy"] = config.env.https_proxy
if (proxy := config.get("env.https_proxy", "???")) != "???":
Copy link

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using '???' as a sentinel value is unconventional and unclear. Consider using None as the default value and checking for truthiness: if proxy := config.get("env.https_proxy"):

Suggested change
if (proxy := config.get("env.https_proxy", "???")) != "???":
if proxy := config.get("env.https_proxy"):

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The magic string '???' makes the code less readable. The original OmegaConf.is_missing() approach was more explicit about checking for missing configuration values.

Suggested change
if (proxy := config.get("env.https_proxy", "???")) != "???":
if not OmegaConf.is_missing(config, "env.https_proxy"):
proxy = config.env.https_proxy

Copilot uses AI. Check for mistakes.
http_client_args["proxy"] = proxy
logger.debug(f"Info: Using proxy {http_client_args['proxy']}")

if self.async_client:
Expand Down