Skip to content

feat(stage-ui): add n1n provider#968

Merged
nekomeowww merged 2 commits intomoeru-ai:mainfrom
n1n-api:feat/n1n-provider
Jan 22, 2026
Merged

feat(stage-ui): add n1n provider#968
nekomeowww merged 2 commits intomoeru-ai:mainfrom
n1n-api:feat/n1n-provider

Conversation

@n1n-api
Copy link
Contributor

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

Add n1n.ai as an OpenAI-compatible AI provider. Includes English and Simplified Chinese translations.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @n1n-api, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces n1n.ai as a new OpenAI-compatible AI provider, significantly expanding the range of available AI services within the application. It includes all necessary configurations, localization support for user-facing elements, and robust validation to ensure seamless integration and functionality.

Highlights

  • New AI Provider Integration: The n1n.ai service has been added as a new OpenAI-compatible AI provider, expanding the range of available AI services.
  • Configuration Schema: A dedicated configuration schema for n1n.ai has been implemented, allowing for an optional API key and providing a default base URL of https://api.n1n.ai/v1.
  • Localization Support: The new provider includes localized strings for its name, description, and configuration fields, supporting both English and Simplified Chinese.
  • Provider Validation: Comprehensive validation checks have been set up for the n1n.ai provider, covering connectivity, model listing, and chat completions to ensure proper functionality.
Ignored Files
  • Ignored by pattern: packages/i18n/src/** (2)
    • packages/i18n/src/locales/en/settings.yaml
    • packages/i18n/src/locales/zh-Hans/settings.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds n1n.ai as a new OpenAI-compatible provider. The implementation largely follows the pattern of existing providers in the codebase. My review identified a potential runtime error related to the handling of an optional API key during provider creation. I have provided a suggestion to make this more robust. Otherwise, the changes look good.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@n1n-api
Copy link
Contributor Author

n1n-api commented Jan 17, 2026

I have read the CLA Document and I hereby sign the CLA

lockrush-dev pushed a commit to lockrush-dev/airi that referenced this pull request Jan 18, 2026
…fineProvider pattern

Refactor OpenAI and OpenAI-compatible speech/transcription providers to use
the unified `defineProvider()` pattern (matching PR moeru-ai#968 n1n provider pattern)
instead of separate registries. This unifies all providers under a single
consistent API.

Changes:
- Refactor OpenAI speech/transcription providers to use `defineProvider()` with
  `tasks` and `extraMethods` instead of `defineSpeechProvider`/`defineTranscriptionProvider`
- Refactor OpenAI-compatible speech/transcription providers similarly
- Add `convertProviderDefinitionToMetadata()` converter function to bridge unified
  pattern with existing store's `ProviderMetadata` format
- Update store to use new converter function instead of old separate converters
- Mark old base interfaces and registry exports as deprecated for backward compatibility
- Fix settings index page to filter out routes with empty titles (preventing empty
  menu items from rendering)

BREAKING CHANGE: Speech and transcription providers now use the unified
`defineProvider()` pattern. Old `defineSpeechProvider` and `defineTranscriptionProvider`
functions are deprecated but still available for backward compatibility.

Refs: PR moeru-ai#961, PR moeru-ai#968
lockrush-dev added a commit to lockrush-dev/airi that referenced this pull request Jan 18, 2026
…fineProvider pattern

Refactor OpenAI and OpenAI-compatible speech/transcription providers to use
the unified `defineProvider()` pattern (matching PR moeru-ai#968 n1n provider pattern)
instead of separate registries. This unifies all providers under a single
consistent API.

Changes:
- Refactor OpenAI speech/transcription providers to use `defineProvider()` with
  `tasks` and `extraMethods` instead of `defineSpeechProvider`/`defineTranscriptionProvider`
- Refactor OpenAI-compatible speech/transcription providers similarly
- Add `convertProviderDefinitionToMetadata()` converter function to bridge unified
  pattern with existing store's `ProviderMetadata` format
- Update store to use new converter function instead of old separate converters
- Mark old base interfaces and registry exports as deprecated for backward compatibility
- Fix settings index page to filter out routes with empty titles (preventing empty
  menu items from rendering)

BREAKING CHANGE: Speech and transcription providers now use the unified
`defineProvider()` pattern. Old `defineSpeechProvider` and `defineTranscriptionProvider`
functions are deprecated but still available for backward compatibility.

Refs: PR moeru-ai#961, PR moeru-ai#968
@shinohara-rin
Copy link
Contributor

As of the current UI, the chat providers already take up a whole page.

I don't feel like it's a great idea to keep adding cards for every single provider out there, at least not for the OpenAI-compatible ones like this, since users can already use it with a trivial baseurl setup.

I think this PR can wait until we have a better UI to accommodate it

@n1n-api
Copy link
Contributor Author

n1n-api commented Jan 20, 2026

As of the current UI, the chat providers already take up a whole page.

I don't feel like it's a great idea to keep adding cards for every single provider out there, at least not for the OpenAI-compatible ones like this, since users can already use it with a trivial baseurl setup.

I think this PR can wait until we have a better UI to accommodate it

Thank you for considering us! Can not wait to see the new UI in the soon future :)

lockrush-dev added a commit to lockrush-dev/airi that referenced this pull request Jan 21, 2026
…nified defineProvider pattern

- Migrate all 7 speech providers to unified defineProvider() pattern:
  - elevenlabs
  - deepgram-tts
  - microsoft-speech
  - index-tts-vllm
  - alibaba-cloud-model-studio
  - volcengine
  - player2-speech

- Migrate all 2 transcription providers to unified defineProvider() pattern:
  - browser-web-speech-api
  - aliyun-nls-transcription

- Fix convertProviderDefinitionToMetadata bug where nameKey/descriptionKey
  were storing translated strings instead of i18n keys. Use identity function
  (keyExtractor) instead of translator (tWrapper) to extract i18n key strings.

- Update providers.ts to use convertProviderDefinitionToMetadata for all
  migrated providers instead of old pattern.

- Register all migrated providers in providers/index.ts

This completes the migration requested by Niko in PR moeru-ai#968 to unify provider
patterns across the codebase.
@nekomeowww nekomeowww changed the title feat: add n1n provider feat(stage-ui): add n1n provider Jan 22, 2026
@nekomeowww nekomeowww merged commit faea45e into moeru-ai:main Jan 22, 2026
Joker-of-Gotham pushed a commit to Joker-of-Gotham/airi that referenced this pull request Jan 29, 2026
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.

3 participants