Skip to content

Comments

feat: add n1n.ai as a built-in provider#3404

Open
n1n-api wants to merge 2 commits intochatboxai:mainfrom
n1n-api:feat/add-n1n-provider
Open

feat: add n1n.ai as a built-in provider#3404
n1n-api wants to merge 2 commits intochatboxai:mainfrom
n1n-api:feat/add-n1n-provider

Conversation

@n1n-api
Copy link

@n1n-api n1n-api commented Jan 17, 2026

Integrated n1n.ai as a built-in provider with default models and settings.

Summary by CodeRabbit

  • New Features

    • Added support for the N1N AI provider with multiple models (including GPT‑4o, Claude 3.5 Sonnet, Gemini 1.5 Pro, and DeepSeek variants)
    • Added a visual indicator for the N1N provider in the UI
  • Localization

    • Added N1N translations for English and Simplified Chinese
  • Bug Fix / UI

    • Minor SVG icon formatting tweak for improved icon rendering

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Walkthrough

Adds a new provider "N1N" (id: n1n) across enum, system defaults (API host, models), OpenAI-compatible settings mapping, icon rendering, and English/zh-Hans localization entries.

Changes

Cohort / File(s) Summary
Provider Type Definition
src/shared/types/provider.ts
Added enum member N1N = 'n1n' to ModelProviderEnum.
Provider Configuration
src/shared/defaults.ts
Added a SystemProviders entry for N1N with urls.website, defaultSettings.apiHost = "https://api.n1n.ai/v1", and multiple OpenAI-compatible model entries (modelId, nickname, capabilities, contextWindow).
Provider Settings Mapping
src/renderer/packages/model-setting-utils/index.ts
Mapped ModelProviderEnum.N1N to OpenAISettingUtil so N1N uses OpenAI-compatible settings handling.
UI Icons
src/renderer/components/icons/ProviderIcon.tsx
Added JSX branch to render N1N provider icon; minor SVG path formatting tweak for MistralAI observed.
Localization
src/renderer/i18n/locales/en/translation.json, src/renderer/i18n/locales/zh-Hans/translation.json
Added translation key/value "n1n.ai": "n1n.ai" for English and Simplified Chinese locales.

Sequence Diagram(s)

(Skipped — changes add a provider and static assets/configurations without introducing a new multi-component runtime flow requiring a sequence diagram.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Adding MistralAI #2514: Adds MistralAI provider support with similar edits to ProviderIcon, model-setting-utils, SystemProviders, and ModelProviderEnum — closely related integration pattern.

Suggested reviewers

  • themez

Poem

🐰 A little hop, a tiny spin,
N1N arrives with a cheerful grin,
Models lined up, icons shown bright,
Translations set — the meadow's right! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding n1n.ai as a built-in provider, which aligns with all modifications across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@n1n-api
Copy link
Author

n1n-api commented Jan 17, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/renderer/components/icons/ProviderIcon.tsx`:
- Line 106: The SVG path in ProviderIcon.tsx contains a merge artifact
"1External 1" inside the d attribute; locate the <path> with the long d string
(the XAI provider icon) and remove the "External" artifact so the commands and
numbers are contiguous (e.g., change "...-1.829-1External 1A8.975..." to a valid
sequence like "...-1.829-1.1A8.975..." or whatever the original numeric token
was), ensuring the path uses only valid SVG commands and numbers; after editing,
validate the SVG by opening the component in the browser or running an SVG
linter/validator to confirm it renders correctly.

@n1n-api
Copy link
Author

n1n-api commented Jan 17, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

1 participant