## 新功能 - 提升为一级菜单"心思",使用心形图标 - 统一 API Key 管理界面,所有服务在同一页面管理 - 优化服务显示名称(ChatGPT、Claude、Gemini 等) ## Bug 修复 - 修复高级设置按钮无响应问题 - 修复 HTML 验证错误(label for 属性) - 修复样式丢失问题(hook suffix 更新) ## 技术改进 - 移除调试用 console.log 语句 - 为每个服务添加 display_name 字段 - 更新 hook suffix 从 settings_page_wpmind 到 toplevel_page_wpmind Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
70 lines
1.3 KiB
PHP
70 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* 豆包 (字节) Provider
|
|
*
|
|
* @package WPMind
|
|
* @since 1.3.0
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMind\Providers\Doubao;
|
|
|
|
use WPMind\Providers\AbstractOpenAiCompatibleProvider;
|
|
use WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface;
|
|
|
|
/**
|
|
* 豆包 (字节跳动) AI Provider
|
|
*
|
|
* @since 1.3.0
|
|
*/
|
|
class DoubaoProvider extends AbstractOpenAiCompatibleProvider
|
|
{
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function baseUrl(): string
|
|
{
|
|
return 'https://ark.cn-beijing.volces.com/api/v3';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function providerId(): string
|
|
{
|
|
return 'doubao';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function providerName(): string
|
|
{
|
|
return '豆包 (字节)';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function credentialsUrl(): ?string
|
|
{
|
|
return 'https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey';
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function textGenerationModelClass(): string
|
|
{
|
|
return DoubaoTextGenerationModel::class;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected static function createModelMetadataDirectory(): ModelMetadataDirectoryInterface
|
|
{
|
|
return new DoubaoModelMetadataDirectory();
|
|
}
|
|
}
|