오류수정
This commit is contained in:
@@ -46,7 +46,7 @@ public class ChatConfig
|
||||
/// <summary>Gemini API 키. 비우면 환경 변수 GEMINI_API_KEY 를 쓴다.</summary>
|
||||
public string geminiApiKey = "";
|
||||
|
||||
public string geminiModel = "gemini-3.7-flash";
|
||||
public string geminiModel = "gemini-3.6-flash";
|
||||
|
||||
// --- 공통 ---
|
||||
|
||||
@@ -132,10 +132,33 @@ public bool Save()
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>손으로 고친 설정 파일에 모르는 값이 적혀 있을 수 있다. 아는 값으로 되돌린다.</summary>
|
||||
/// <summary>
|
||||
/// 설정 파일에 모르는 값이 적혀 있을 수 있다. 아는 값으로 되돌린다.
|
||||
///
|
||||
/// 특히 모델 이름은 제공자가 언제든 없앤다(예: gemini-2.5-flash 는 신규 사용자에게
|
||||
/// 제공 중단됐다). 설정 화면의 선택지에 없는 값이 파일에 남아 있으면, 화면은
|
||||
/// 첫 항목을 칠해 보여주는데 실제 요청은 예전 값으로 나간다 — 보이는 것과
|
||||
/// 쓰이는 것이 어긋난다. 그 상태가 제일 찾기 어렵다.
|
||||
/// </summary>
|
||||
void Normalize()
|
||||
{
|
||||
if (provider != ProviderGemini) provider = ProviderAnthropic;
|
||||
|
||||
model = Coerce(model, AnthropicChatBackend.SelectableModels, "model");
|
||||
effort = Coerce(effort, AnthropicChatBackend.SelectableEfforts, "effort");
|
||||
geminiModel = Coerce(geminiModel, GeminiChatBackend.SelectableModels, "geminiModel");
|
||||
}
|
||||
|
||||
static string Coerce(string value, (string Label, string Id)[] options, string field)
|
||||
{
|
||||
foreach (var option in options)
|
||||
{
|
||||
if (option.Id == value) return value;
|
||||
}
|
||||
|
||||
Debug.LogWarning($"[ChatConfig] {field} 의 '{value}' 는 선택지에 없어 " +
|
||||
$"'{options[0].Id}' 로 되돌립니다.");
|
||||
return options[0].Id;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------ 제공자
|
||||
|
||||
Reference in New Issue
Block a user