@agentxin-ai/plugin-moonshot

中文文档
0.0.2发布于 2026/03/19AGPL-3.0TypeScriptES Module近 30 天下载 2501

@agentxin-ai/plugin-moonshot connects Moonshot AI (Kimi) models to the AgentXinAI platform. The plugin integrates Moonshot's OpenAI-compatible API so AgentXinAI agents can lever

原始使用文档
文档目录8 节
  1. Overview
  2. Core Features
  3. Installation
  4. Enabling in AgentXinAI
  5. Credentials & Model Configuration
  6. Model Capabilities
  7. Development & Debugging
  8. License

AgentXin Plugin: Moonshot AI

Overview

@agentxin-ai/plugin-moonshot connects Moonshot AI (Kimi) models to the AgentXinAI platform. The plugin integrates Moonshot's OpenAI-compatible API so AgentXinAI agents can leverage Kimi's powerful long-context language models with context windows up to 128K tokens, including the latest K2 series with advanced reasoning capabilities.

Core Features

  • Ships MoonshotModule, which registers the NestJS provider strategy, lifecycle hooks, and configuration schema required by the plugin runtime.
  • Implements MoonshotLargeLanguageModel, a LangChain-powered adapter built on ChatOpenAI that supports streaming chat completions, function calling, and token accounting callbacks for agent telemetry.
  • Shares a console-ready moonshot.yaml that drives the AgentXinAI UI forms (icons, help links, credential prompts) for quick operator onboarding.
  • Supports multiple Moonshot model variants including:
    • Moonshot V1 Series: moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k for various context length requirements
    • Kimi K2 Series: kimi-k2-0711-preview, kimi-k2-0905-preview, kimi-k2-turbo-preview for enhanced performance
    • Kimi K2 Thinking Series: kimi-k2-thinking, kimi-k2-thinking-turbo for advanced reasoning tasks

Installation

npm install @agentxin-ai/plugin-moonshot

Peer Dependencies: Ensure your host service also provides @agentxin-ai/plugin-sdk, @nestjs/common, @nestjs/config, @metad/contracts, @langchain/openai, chalk, and zod. Refer to package.json for exact versions.

Enabling in AgentXinAI

  1. Declare the plugin before bootstrapping the AgentXinAI server:
    PLUGINS=@agentxin-ai/plugin-moonshot
    
  2. In the AgentXinAI admin console (or config file), create a model provider pointing to moonshot, then add individual models that map to the specific Moonshot/Kimi versions you want to use.

Credentials & Model Configuration

The moonshot.yaml schema backs the form fields you see in the console:

FieldDescription
api_keyRequired. Your Moonshot API Key from platform.moonshot.cn/console/api-keys.
base_urlOptional. Base URL for API requests (defaults to https://api.moonshot.cn/v1). Useful for proxy configurations.

During validation, the plugin instantiates a ChatOpenAI client with your credentials and sends a test message ("你好") to ensure connectivity and permissions.

Model Capabilities

  • Long Context Support: All Moonshot models excel at handling long-context scenarios, with the V1-128K variant supporting up to 128,000 tokens of context.
  • Conversational Models: MoonshotLargeLanguageModel merges provider credentials with per-model overrides, enables streaming, and registers token usage callbacks so agent telemetry stays accurate.
  • Advanced Reasoning: The K2 Thinking series models provide enhanced reasoning capabilities for complex problem-solving tasks.
  • OpenAI Compatibility: Built on LangChain's ChatOpenAI, ensuring seamless integration with existing OpenAI-compatible workflows.

Development & Debugging

From the repo root, run Nx commands for this package:

cd agentxinai
npx nx build @agentxin-ai/plugin-moonshot
npx nx test @agentxin-ai/plugin-moonshot

Artifacts land in agentxinai/models/moonshot/dist. Jest settings live in jest.config.ts, and the asset copier runs via npm run prepack before publishing.

License

This plugin is distributed under the AGPL-3.0 License located at the repository root.

版本与发布记录

@agentxin-ai/plugin-moonshot 共发布 1 个版本,首次发布于 2026/03/19;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.0.2latest2026/03/197 个月前

关于 @agentxin-ai/plugin-moonshot 的常见问题

@agentxin-ai/plugin-moonshot 是什么?

@agentxin-ai/plugin-moonshot connects Moonshot AI (Kimi) models to the AgentXinAI platform. The plugin integrates Moonshot's OpenAI-compatible API so AgentXinAI agents can lever

如何安装 @agentxin-ai/plugin-moonshot?

在项目目录运行 npm install @agentxin-ai/plugin-moonshot,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@langchain/openai(0.6.9)、@metad/contracts(^3.6.1)、@nestjs/common(^11.1.6)、@nestjs/config(^4.0.2)、@agentxin-ai/plugin-sdk(^3.6.1)、chalk(4.1.2)、zod(3.25.67)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@agentxin-ai/plugin-moonshot 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentxin-ai/plugin-moonshot 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentxin-ai/plugin-moonshot 可以商用吗?

@agentxin-ai/plugin-moonshot 使用 AGPL-3.0 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@agentxin-ai/plugin-moonshot 的下载量有多少?

根据 npm 官方下载统计,@agentxin-ai/plugin-moonshot 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,501 次,日均约 83 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentxin-ai/plugin-moonshot 还在维护吗?

最新版本 0.0.2 发布于 2026/03/19(7 个月前);至今共发布 1 个版本,其中过去 12 个月发布了 1 个;首次发布于 2026/03/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。