feat(ux): fix a few bugs and improve ux#13
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves user experience by fixing proxy configuration logic and providing default base URLs for API endpoints. The changes aim to make the setup process smoother and more intuitive for users.
- Refactored proxy configuration check in Claude Anthropic client to use a more concise approach
- Added default base URLs for Anthropic, OpenAI, and OpenRouter APIs in the environment template
- Reorganized and improved documentation for setting up environment variables
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/miroflow/src/miroflow/llm/providers/claude_anthropic_client.py | Simplified proxy configuration logic using walrus operator |
| apps/run-agent/.env.template | Added default base URLs for API endpoints |
| README.md | Restructured environment setup documentation for better clarity |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 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", "???")) != "???": |
There was a problem hiding this comment.
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"):
| if (proxy := config.get("env.https_proxy", "???")) != "???": | |
| if proxy := config.get("env.https_proxy"): |
| 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", "???")) != "???": |
There was a problem hiding this comment.
[nitpick] The magic string '???' makes the code less readable. The original OmegaConf.is_missing() approach was more explicit about checking for missing configuration values.
| if (proxy := config.get("env.https_proxy", "???")) != "???": | |
| if not OmegaConf.is_missing(config, "env.https_proxy"): | |
| proxy = config.env.https_proxy |
* update default base url * update .env readme * fix https * lint code * lint --------- Co-authored-by: Yue Deng <yue.deng@miromind.com>
feat(agent): add regex boxed extractor
Describe this PR
Checklist for PR
Must Do
feat(agent): add pdf tool via mcp,perf: make llm client asyncandfix(utils): load custom config via importlibetc. CI jobcheck-pr-titleenforces Angular commit message format to PR title.make precommitlocally. CI joblintenforce ruff default format/lint rules on all new codes.make pytest. Check test summary (located atreport.html) and coverage report (located athtmlcov/index.html) on new codes.Nice To Have
/testsforfeatandtestPR./docsfordocsandciPR.