Update ChatActions to Assert Non-null Provider Name

- Modified the assignment of `providerName` in `ChatActions` to assert non-null, ensuring type safety and preventing potential runtime errors.
This commit is contained in:
AC 2025-04-06 17:22:45 +08:00
parent a5caf98db0
commit 9a865fd76f

View File

@ -741,7 +741,7 @@ export function ChatActions(props: {
// Only update if we found a valid provider
chatStore.updateTargetSession(session, (session) => {
session.mask.modelConfig.model = model as ModelType;
session.mask.modelConfig.providerName = targetProvider; // Use the Enum value
session.mask.modelConfig.providerName = targetProvider!; // Use the Enum value (Assert non-null)
session.mask.syncGlobalConfig = false;
console.log(
"[ChatActions] Updated session modelConfig:",