Skip to content

Commit 734af4e

Browse files
ntudyYue Deng
andauthored
feat(ux): fix a few bugs and improve ux (#13)
* update default base url * update .env readme * fix https * lint code * lint --------- Co-authored-by: Yue Deng <yue.deng@miromind.com>
1 parent a206951 commit 734af4e

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,28 @@ uv sync
160160

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

163+
a. Set up `MiroFlow/apps/prepare-benchmark/.env` by:
164+
```bash
165+
## copy environment variable template and prepare yours in .env file
166+
cd MiroFlow/apps/prepare-benchmark
167+
cp .env.template .env
168+
vim .env
169+
```
163170
Required environment variables:
164171
- `HF_TOKEN` (for downloading datasets from Hugging Face)
172+
173+
Optional environment variables:
174+
- `DATA_DIR` (Data loading directory, by default `../../data`)
175+
176+
177+
b. Set up `MiroFlow/apps/run-agent/.env` by:
178+
```bash
179+
## copy environment variable template and prepare yours in .env file
180+
cd MiroFlow/apps/run-agent
181+
cp .env.template .env
182+
vim .env
183+
```
184+
Required environment variables:
165185
- `OPENROUTER_API_KEY` (Using OpenRouter to provide primary agent model)
166186
- `ANTHROPIC_API_KEY` (for vision tools)
167187
- `OPENAI_API_KEY` (for audio tools, intent recognition, and answer extraction)
@@ -176,15 +196,6 @@ Optional environment variables:
176196

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

179-
```bash
180-
## copy environment variable template and prepare yours in .env file
181-
cd MiroFlow/apps/prepare-benchmark
182-
cp .env.template .env
183-
vim .env
184-
cd MiroFlow/apps/run-agent
185-
cp .env.template .env
186-
vim .env
187-
```
188199

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

apps/run-agent/.env.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ GEMINI_API_KEY=""
88

99
# Anthropic
1010
ANTHROPIC_API_KEY=""
11-
ANTHROPIC_BASE_URL=""
11+
ANTHROPIC_BASE_URL="https://api.anthropic.com"
1212

1313
# openAI
1414
OPENAI_API_KEY=""
15-
OPENAI_BASE_URL=""
15+
OPENAI_BASE_URL="https://api.openai.com/v1"
1616

1717
# openrouter
1818
OPENROUTER_API_KEY=""
19-
OPENROUTER_BASE_URL=""
19+
OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"
2020

2121
# NewAPI
2222
NEWAPI_API_KEY=""

libs/miroflow/src/miroflow/llm/providers/claude_anthropic_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
DefaultAsyncHttpxClient,
1313
DefaultHttpxClient,
1414
)
15-
from omegaconf import DictConfig, OmegaConf
15+
from omegaconf import DictConfig
1616
from tenacity import retry, stop_after_attempt, wait_fixed
1717

1818
from miroflow.llm.provider_client_base import LLMProviderClientBase
@@ -41,8 +41,8 @@ def _create_client(self, config: DictConfig):
4141
trace_id = get_trace_id()
4242
if trace_id is not None:
4343
http_client_args["headers"] = {"trace-id": trace_id}
44-
if not OmegaConf.is_missing(config, "https_proxy"):
45-
http_client_args["proxy"] = config.env.https_proxy
44+
if (proxy := config.get("env.https_proxy", "???")) != "???":
45+
http_client_args["proxy"] = proxy
4646
logger.debug(f"Info: Using proxy {http_client_args['proxy']}")
4747

4848
if self.async_client:

0 commit comments

Comments
 (0)