mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
ai: fix invalid message when switching model
This commit is contained in:
@@ -8,6 +8,9 @@ import Quickshell.Io;
|
||||
import Qt.labs.platform
|
||||
import QtQuick;
|
||||
|
||||
/**
|
||||
* Basic service to handle LLM chats. Supports Google's and OpenAI's API formats.
|
||||
*/
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
@@ -184,7 +187,7 @@ Singleton {
|
||||
modelId = modelId.toLowerCase()
|
||||
if (modelList.indexOf(modelId) !== -1) {
|
||||
PersistentStateManager.setState("ai.model", modelId);
|
||||
if (feedback) root.addMessage(StringUtils.format(StringUtils.format("Model set to {0}"), models[modelId].name, Ai.interfaceRole))
|
||||
if (feedback) root.addMessage(StringUtils.format(StringUtils.format("Model set to {0}"), models[modelId].name), Ai.interfaceRole)
|
||||
if (models[modelId].requires_key) {
|
||||
// If key not there show advice
|
||||
if (root.apiKeysLoaded && (!root.apiKeys[models[modelId].key_id] || root.apiKeys[models[modelId].key_id].length === 0)) {
|
||||
|
||||
Reference in New Issue
Block a user