135 文件 19,211 处自动修复:空格→Tab 缩进、括号间距、 函数声明空格、前置自增、尾逗号等纯格式化改动。 零逻辑变更,php -l + token 级对比验证通过。 新增 phpcs.xml.dist / phpstan.neon.dist 项目配置。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
64 lines
1.2 KiB
PHP
64 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Moonshot (Kimi) Provider
|
|
*
|
|
* @package WPMind
|
|
* @since 1.3.0
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMind\Providers\Moonshot;
|
|
|
|
use WPMind\Providers\AbstractOpenAiCompatibleProvider;
|
|
use WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface;
|
|
|
|
/**
|
|
* Moonshot (Kimi) AI Provider
|
|
*
|
|
* @since 1.3.0
|
|
*/
|
|
class MoonshotProvider extends AbstractOpenAiCompatibleProvider {
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function baseUrl(): string {
|
|
return 'https://api.moonshot.cn/v1';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function providerId(): string {
|
|
return 'moonshot';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function providerName(): string {
|
|
return 'Moonshot (Kimi)';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function credentialsUrl(): ?string {
|
|
return 'https://platform.moonshot.cn/console/api-keys';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function textGenerationModelClass(): string {
|
|
return MoonshotTextGenerationModel::class;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function createModelMetadataDirectory(): ModelMetadataDirectoryInterface {
|
|
return new MoonshotModelMetadataDirectory();
|
|
}
|
|
}
|