ai: add api key indicator

This commit is contained in:
end-4
2025-07-24 19:28:45 +07:00
parent baa17c304b
commit eb6b21e7e6
2 changed files with 18 additions and 5 deletions
+9
View File
@@ -23,6 +23,13 @@ Singleton {
property var messageByID: ({})
readonly property var apiKeys: KeyringStorage.keyringData?.apiKeys ?? {}
readonly property var apiKeysLoaded: KeyringStorage.loaded
readonly property bool currentModelHasApiKey: {
const model = models[currentModelId];
if (!model || !model.requires_key) return true;
if (!apiKeysLoaded) return false;
const key = apiKeys[model.key_id];
return (key?.length > 0);
}
property var postResponseHook
property real temperature: Persistent.states?.ai?.temperature ?? 0.5
property QtObject tokenCount: QtObject {
@@ -45,6 +52,8 @@ Singleton {
property list<var> promptFiles: [...defaultPrompts, ...userPrompts]
property list<var> savedChats: []
// Gemini: https://ai.google.dev/gemini-api/docs/function-calling
// OpenAI: https://platform.openai.com/docs/guides/function-calling
property var tools: {
"gemini": [{"functionDeclarations": [
{