| 1 | /* |
| 2 | * Copyright 2024 KylinSoft Co., Ltd. |
| 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify it under |
| 5 | * the terms of the GNU General Public License as published by the Free Software |
| 6 | * Foundation, either version 3 of the License, or (at your option) any later |
| 7 | * version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 12 | * details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef ASSISTANTSERVICEPROXY_H |
| 19 | #define ASSISTANTSERVICEPROXY_Hcxx . . $ `ai-assistant/assistantserviceproxy.h:19:9`! |
| 20 | |
| 21 | #include "assistantserviceglue.h"cxx . . $ `<file>/build/ai-assistant/assistantserviceglue.h`/ |
| 22 | #include "osassistant/error.h"cxx . . $ `<file>/ai-assistant/include/kylin-ai/private/osassistant/error.h`/ |
| 23 | #include "osassistant/osassistant.h"cxx . . $ `<file>/ai-assistant/include/kylin-ai/private/osassistant/osassistant.h`/ |
| 24 | #include "promptidmanager.h"cxx . . $ `<file>/ai-assistant/promptidmanager.h`/ |
| 25 | |
| 26 | namespace kyaicxx . . $ kyai/ { |
| 27 | namespace assistantcxx . . $ kyai/assistant/ { |
| 28 | |
| 29 | class AssistantServiceProxycxx . . $ kyai/assistant/AssistantServiceProxy# { |
| 30 | public: |
| 31 | AssistantServiceProxycxx . . $ kyai/assistant/AssistantServiceProxy#AssistantServiceProxy(49f6e7a06ebc5aa8).(); |
| 32 | ~cxx . . $ kyai/assistant/AssistantServiceProxy#`~AssistantServiceProxy`(ced63f7c635d850d).AssistantServiceProxycxx . . $ kyai/assistant/AssistantServiceProxy#(); |
| 33 | |
| 34 | void initServerProxycxx . . $ kyai/assistant/AssistantServiceProxy#initServerProxy(49f6e7a06ebc5aa8).(); |
| 35 | Errorcxx . . $ kyai/assistant/Error# initcxx . . $ kyai/assistant/AssistantServiceProxy#init(38836760a050db30).(); |
| 36 | Errorcxx . . $ kyai/assistant/Error# initWithChatHistorycxx . . $ kyai/assistant/AssistantServiceProxy#initWithChatHistory(dd6be9b428e4dac3).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<Messagecxx . . $ kyai/assistant/Message#> &messages, |
| 37 | int promptId); |
| 38 | void setChatResultCallbackcxx . . $ kyai/assistant/AssistantServiceProxy#setChatResultCallback(5ad084ba32470c75).(ChatResultCallbackcxx . . $ kyai/assistant/ChatResultCallback# callback); |
| 39 | Featurescxx . . $ kyai/assistant/Features# supportedFeaturescxx . . $ kyai/assistant/AssistantServiceProxy#supportedFeatures(622f18c6d73e521b).() const; |
| 40 | |
| 41 | void chatAsynccxx . . $ kyai/assistant/AssistantServiceProxy#chatAsync(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string# &message); |
| 42 | void stopChatcxx . . $ kyai/assistant/AssistantServiceProxy#stopChat(49f6e7a06ebc5aa8).(); |
| 43 | void setPromptIdcxx . . $ kyai/assistant/AssistantServiceProxy#setPromptId(d4f767463ce0a6b3).(int id); |
| 44 | void clearContextcxx . . $ kyai/assistant/AssistantServiceProxy#clearContext(49f6e7a06ebc5aa8).(); |
| 45 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Promptcxx . . $ kyai/assistant/Prompt#> promptscxx . . $ kyai/assistant/AssistantServiceProxy#prompts(9afe68a92c41c47e).(); |
| 46 | bool setPromptOrdercxx . . $ kyai/assistant/AssistantServiceProxy#setPromptOrder(9d0978c01a59a339).(stdcxx . . $ std/::listcxx . . $ std/__cxx11/list#<int> promptIdList); |
| 47 | int createPromptcxx . . $ kyai/assistant/AssistantServiceProxy#createPrompt(ff1c98e35c114d02).(const stdcxx . . $ std/::stringcxx . . $ std/string# &name, const stdcxx . . $ std/::stringcxx . . $ std/string# &content); |
| 48 | bool deletePromptcxx . . $ kyai/assistant/AssistantServiceProxy#deletePrompt(83c267b20bac841a).(int promptId); |
| 49 | bool updatePromptcxx . . $ kyai/assistant/AssistantServiceProxy#updatePrompt(8c875451cbcadfcc).(int promptId, const stdcxx . . $ std/::stringcxx . . $ std/string# &name, |
| 50 | const stdcxx . . $ std/::stringcxx . . $ std/string# &content); |
| 51 | |
| 52 | stdcxx . . $ std/::stringcxx . . $ std/string# getConfiguredNlpModelInfoscxx . . $ kyai/assistant/AssistantServiceProxy#getConfiguredNlpModelInfos(219584694fe2b248).() const; |
| 53 | void setCurrentNlpModelcxx . . $ kyai/assistant/AssistantServiceProxy#setCurrentNlpModel(cb8fe47b7f91129d).(const stdcxx . . $ std/::stringcxx . . $ std/string# &modelName) const; |
| 54 | |
| 55 | private: |
| 56 | void connectSignalcxx . . $ kyai/assistant/AssistantServiceProxy#connectSignal(49f6e7a06ebc5aa8).(); |
| 57 | void createDelegatecxx . . $ kyai/assistant/AssistantServiceProxy#createDelegate(49f6e7a06ebc5aa8).(); |
| 58 | void handleServerClosedcxx . . $ kyai/assistant/AssistantServiceProxy#handleServerClosed(49f6e7a06ebc5aa8).(); |
| 59 | bool retryConnectToServercxx . . $ kyai/assistant/AssistantServiceProxy#retryConnectToServer(c9857a73d68e59ba).(); |
| 60 | void setDefaultPromptIdListcxx . . $ kyai/assistant/AssistantServiceProxy#setDefaultPromptIdList(e46b1b6342afe341).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<Promptcxx . . $ kyai/assistant/Prompt#> prompts); |
| 61 | static void onChatResultcxx . . $ kyai/assistant/AssistantServiceProxy#onChatResult(72eba080aa42f612).(GDBusConnection *connection, |
| 62 | const gchar *sender_name, const gchar *object_path, |
| 63 | const gchar *interface_name, |
| 64 | const gchar *signal_name, GVariant *parameters, |
| 65 | gpointer user_data); |
| 66 | static void onCallFinishedcxx . . $ kyai/assistant/AssistantServiceProxy#onCallFinished(aa1d200d824d915d).(GObject *source_object, GAsyncResult *res, |
| 67 | gpointer user_data); |
| 68 | |
| 69 | void parseJsonStringToVectorcxx . . $ kyai/assistant/AssistantServiceProxy#parseJsonStringToVector(d00116ab781b1e1a).(const stdcxx . . $ std/::stringcxx . . $ std/string# &jsonString, |
| 70 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Promptcxx . . $ kyai/assistant/Prompt#> &prompts); |
| 71 | stdcxx . . $ std/::stringcxx . . $ std/string# messageVectorToJsoncxx . . $ kyai/assistant/AssistantServiceProxy#messageVectorToJson(65f0bce1c3d868a8).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<Messagecxx . . $ kyai/assistant/Message#> &messages); |
| 72 | void adjustPromptOrdercxx . . $ kyai/assistant/AssistantServiceProxy#adjustPromptOrder(cf5340c203aef2c3).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<Promptcxx . . $ kyai/assistant/Prompt#> &prompts); |
| 73 | |
| 74 | private: |
| 75 | struct EngineConfigcxx . . $ kyai/assistant/AssistantServiceProxy#EngineConfig# { |
| 76 | stdcxx . . $ std/::stringcxx . . $ std/string# nlpEngineNamecxx . . $ kyai/assistant/AssistantServiceProxy#EngineConfig#nlpEngineName.; |
| 77 | stdcxx . . $ std/::stringcxx . . $ std/string# nlpConfigcxx . . $ kyai/assistant/AssistantServiceProxy#EngineConfig#nlpConfig.; |
| 78 | stdcxx . . $ std/::stringcxx . . $ std/string# visionEngineNamecxx . . $ kyai/assistant/AssistantServiceProxy#EngineConfig#visionEngineName.; |
| 79 | stdcxx . . $ std/::stringcxx . . $ std/string# visionConfigcxx . . $ kyai/assistant/AssistantServiceProxy#EngineConfig#visionConfig.; |
| 80 | }; |
| 81 | |
| 82 | private: |
| 83 | AiRuntimeAssistant *delegate_cxx . . $ kyai/assistant/AssistantServiceProxy#delegate_.{nullptr}; |
| 84 | int sessionId_cxx . . $ kyai/assistant/AssistantServiceProxy#sessionId_.{0}; |
| 85 | ChatResultCallbackcxx . . $ kyai/assistant/ChatResultCallback# chatResultCallback_cxx . . $ kyai/assistant/AssistantServiceProxy#chatResultCallback_.; |
| 86 | stdcxx . . $ std/::stringcxx . . $ std/string# currentMessage_cxx . . $ kyai/assistant/AssistantServiceProxy#currentMessage_.; |
| 87 | int currentActorId_cxx . . $ kyai/assistant/AssistantServiceProxy#currentActorId_.{-1}; |
| 88 | PromptIdManagercxx . . $ PromptIdManager# promptIdManager_cxx . . $ kyai/assistant/AssistantServiceProxy#promptIdManager_.; |
| 89 | }; |
| 90 | |
| 91 | } // namespace assistant |
| 92 | } // namespace kyai |
| 93 | |
| 94 | #endif // ASSISTANTSERVICEPROXY_H |