v1.2修复优化

This commit is contained in:
2026-05-08 10:05:31 +08:00
parent 80b71a973a
commit 4cf6bd4b4b
12 changed files with 238 additions and 128 deletions

View File

@@ -84,6 +84,9 @@ class ChatController
ob_end_flush();
}
// 使用供应商配置中的 type 字段确定实际驱动
$providerType = $providerConfig['type'] ?? 'newapi';
$options = [
'provider' => $providerConfig,
'systemPrompt' => $systemPrompt,
@@ -91,7 +94,7 @@ class ChatController
];
try {
AIService::streamChat($providerKey, $model, $messages, $options, function ($chunk, $type = 'content') {
AIService::streamChat($providerType, $model, $messages, $options, function ($chunk, $type = 'content') {
if ($type === 'thinking') {
self::sendSSE(['thinking' => $chunk]);
} else {