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
|
|
/**
|
|
* 硅基流动 Provider
|
|
*
|
|
* @package WPMind
|
|
* @since 1.3.0
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMind\Providers\SiliconFlow;
|
|
|
|
use WPMind\Providers\AbstractOpenAiCompatibleProvider;
|
|
use WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface;
|
|
|
|
/**
|
|
* 硅基流动 AI Provider
|
|
*
|
|
* @since 1.3.0
|
|
*/
|
|
class SiliconFlowProvider extends AbstractOpenAiCompatibleProvider {
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function baseUrl(): string {
|
|
return 'https://api.siliconflow.cn/v1';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function providerId(): string {
|
|
return 'siliconflow';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function providerName(): string {
|
|
return '硅基流动';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function credentialsUrl(): ?string {
|
|
return 'https://cloud.siliconflow.cn/account/ak';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function textGenerationModelClass(): string {
|
|
return SiliconFlowTextGenerationModel::class;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function createModelMetadataDirectory(): ModelMetadataDirectoryInterface {
|
|
return new SiliconFlowModelMetadataDirectory();
|
|
}
|
|
}
|