Skip to content

Minds with byok#132

Open
tino097 wants to merge 5 commits intomainfrom
minds-with-byok
Open

Minds with byok#132
tino097 wants to merge 5 commits intomainfrom
minds-with-byok

Conversation

@tino097
Copy link
Copy Markdown
Contributor

@tino097 tino097 commented Apr 23, 2026

Allow users to use BYOK when querying minds

@entelligence-ai-pr-reviews
Copy link
Copy Markdown

EntelligenceAI PR Summary

This PR refactors LLM provider selection logic to respect existing BYOK configurations and ensures a reliable default Minds URL across the codebase.

  • anton/chat.py: Extracted _has_configured_byok and _switch_to_minds_as_llm helpers; replaced automatic provider override with an interactive user prompt; added BYOK detection for openai and openai-compatible providers via ANTON_OPENAI_API_KEY
  • anton/cli.py: _setup_other_provider now sets settings.minds_url to 'https://mdb.ai' instead of None
  • anton/minds_client.py: normalize_minds_url signature updated to str | None; returns 'https://mdb.ai' early when input is None or blank; simplified scheme-prefix guard

Confidence Score: 5/5 - Safe to Merge

Safe to merge — this PR cleanly refactors LLM provider selection logic in anton/chat.py by extracting _has_configured_byok and _switch_to_minds_as_llm helpers, replacing an implicit override with an explicit interactive prompt, and hardening _setup_other_provider in anton/cli.py with a reliable default minds_url of 'https://mdb.ai'. The changes are well-scoped, no review comments were generated, and the heuristic analysis found zero issues across all three changed files. The refactor improves both readability and user experience without introducing new risk surfaces.

Key Findings:

  • _has_configured_byok centralizes BYOK detection for both openai and openai-compatible providers using ANTON_OPENAI_API_KEY, eliminating scattered conditional logic and reducing the chance of missed detection paths.
  • Replacing the automatic provider override in anton/chat.py with an interactive user prompt is a safer UX pattern — it avoids silently mutating user configuration and gives users explicit control over their provider choice.
  • Pinning settings.minds_url to 'https://mdb.ai' in _setup_other_provider eliminates any risk of an unset or empty URL causing downstream failures when the Minds provider is selected.
  • All three changed files were reviewed with full coverage, and no critical, significant, or medium-severity issues were identified by the heuristic analysis.

Copy link
Copy Markdown
Member

@ZoranPandovski ZoranPandovski left a comment

Choose a reason for hiding this comment

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

I've just added two minor comments

Comment thread anton/chat.py
Comment thread anton/cli.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants