pax_global_header00006660000000000000000000000064152057657500014526gustar00rootroot0000000000000052 comment=9a4e0280ca392da2c2ca0a271452dc4901b34b46 kylin-ai-subsystem-plugin-1.0.0.2/000077500000000000000000000000001520576575000167315ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/.gitignore000066400000000000000000000015171520576575000207250ustar00rootroot00000000000000# This file is used to ignore files which are generated # ---------------------------------------------------------------------------- *~ *.autosave *.a *.core *.moc *.o *.obj *.orig *.rej *.so *.so.* *_pch.h.cpp *_resource.rc *.qm .#* *.*# core !core/ tags .DS_Store .directory *.debug Makefile* *.prl *.app moc_*.cpp ui_*.h qrc_*.cpp Thumbs.db *.res *.rc /.qmake.cache /.qmake.stash # qtcreator generated files *.pro.user* CMakeLists.txt.user* # xemacs temporary files *.flc # Vim temporary files .*.swp # Visual Studio generated files *.ib_pdb_index *.idb *.ilk *.pdb *.sln *.suo *.vcproj *vcproj.*.*.user *.ncb *.sdf *.opensdf *.vcxproj *vcxproj.* # MinGW generated files *.Debug *.Release # Python byte code *.pyc # Binaries # -------- *.dll *.exe build .vscode .cache .reuse # third-party third-party/llama.cpp/common/build-info.cppkylin-ai-subsystem-plugin-1.0.0.2/COPYING000066400000000000000000001045151520576575000177720ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . kylin-ai-subsystem-plugin-1.0.0.2/ai-subsystem-plugin.pro000066400000000000000000000077641520576575000234120ustar00rootroot00000000000000QT += core widgets dbus xml network TEMPLATE = lib DEFINES += LIBAISDKPLUGIN_LIBRARY TARGET = kylin-ai-subsystem-plugin CONFIG += plugin link_pkgconfig c++17 LIBS += -lukcc -lQApt -lukui-log4qt -lKF6WindowSystem -lKF6Screen -lkysdk-qtwidgets -lkysdk-kabase -lpolkit-qt6-core-1 -lcurl PKGCONFIG += kysdk-qtwidgets kysdk-sysinfo gsettings-qt6 kysdk-qtwidgets kysdk-waylandhelper glib-2.0\ kyai-config kysdk-ukenv libqapt INCLUDEPATH += /usr/include/KF6/KWindowSystem/ INCLUDEPATH += /usr/include/qapt/ include(modelconfigmanager/libukcc/widgets.pri) DEFINES += APP_PREFIX=\\\"$$PREFIX\\\" # 读取 KYLIN_RELEASE_ID 的值 SYSTEM_VERSION = $$system(cat /etc/os-release | grep KYLIN_RELEASE_ID | cut -d= -f2 | tr -d \'\"\') # 根据版本号定义宏 equals(SYSTEM_VERSION, 2403) { DEFINES += SYSTEM_VERSION_2403 } message(SYSTEM_VERSION: $$SYSTEM_VERSION) TARGET = $$qtLibraryTarget(kylinaisubsystemplugin) target.path = $$[QT_INSTALL_LIBS]/ukui-control-center interfaces.path = /usr/include/kylin-ai-subsystem-plugin/ interfaces.files = aisubsystemplugininterface.h schemas.files += $$PWD/data/org.kylin-ai-subsystem-plugin.gschema.xml schemas.path = /usr/share/glib-2.0/schemas/ polkitflie.files = data/org.kylin-ai-subsystem-modelconfig.policy polkitflie.path = /usr/share/polkit-1/actions INSTALLS += interfaces target schemas polkitflie TRANSLATIONS = \ translations/zh_CN.ts \ translations/en_US.ts \ translations/bo_CN.ts \ translations/mn.ts \ translations/kk.ts \ translations/ky.ts \ translations/mn.ts \ translations/zh_HK.ts \ translations/ug.ts TRANSLATIONS_FILES = qtPrepareTool(LRELEASE, lrelease) for(tsfile, TRANSLATIONS) { qmfile = $$shadowed($$tsfile) qmfile ~= s,.ts$,.qm, qmdir = $$dirname(qmfile) !exists($$qmdir) { mkpath($$qmdir)|error("Aborting.") } command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile system($$command)|error("Failed to run: $$command") TRANSLATIONS_FILES += $$qmfile } qmfile.path = $${PREFIX}/share/kylin-ai-subsystem-plugin/translations/ qmfile.files = $${TRANSLATIONS_FILES} DEFINES += KYLIN_AI_SUBSYSTEM_PLUGIN_PATH=\\\"$$[QT_INSTALL_LIBS]/kylin-ai-subsystem-plugin\\\" HEADERS += \ aisubsystemplugininterface.h \ configmanager.h \ modelconfigmanager/aisubsystem.h \ modelconfigmanager/appversionerrorwarningwidget.h \ modelconfigmanager/cloudmodelconfigwidget.h \ modelconfigmanager/cloudmodelitem.h \ modelconfigmanager/kaglobal.h \ modelconfigmanager/localmodelconfigwidget.h \ modelconfigmanager/localmodelitem.h \ modelconfigmanager/modelcallpriority.h \ modelconfigmanager/modelconfigdialog.h \ modelconfigmanager/modeldownload.h \ modelconfigmanager/modelordermanager.h \ modelconfigmanager/modelwidget.h \ modelconfigmanager/privatemodelconfigdialog.h \ modelconfigmanager/privatemodelconfigwidget.h \ modelconfigmanager/privatemodelitemwidget.h \ modelconfigmanager/updatenotificationwidget.h \ modelconfigmanager/util.h \ subsysteminstallmodule.h \ subsystempackagemanager.h \ subsystemwidget.h SOURCES += \ configmanager.cpp \ modelconfigmanager/aisubsystem.cpp \ modelconfigmanager/appversionerrorwarningwidget.cpp \ modelconfigmanager/cloudmodelconfigwidget.cpp \ modelconfigmanager/cloudmodelitem.cpp \ modelconfigmanager/kaglobal.cpp \ modelconfigmanager/localmodelconfigwidget.cpp \ modelconfigmanager/localmodelitem.cpp \ modelconfigmanager/modelcallpriority.cpp \ modelconfigmanager/modelconfigdialog.cpp \ modelconfigmanager/modeldownload.cpp \ modelconfigmanager/modelordermanager.cpp \ modelconfigmanager/modelwidget.cpp \ modelconfigmanager/privatemodelconfigdialog.cpp \ modelconfigmanager/privatemodelconfigwidget.cpp \ modelconfigmanager/privatemodelitemwidget.cpp \ modelconfigmanager/updatenotificationwidget.cpp \ subsysteminstallmodule.cpp \ subsystempackagemanager.cpp \ subsystemwidget.cpp RESOURCES += \ image.qrc kylin-ai-subsystem-plugin-1.0.0.2/aisubsystemplugininterface.h000066400000000000000000000022041520576575000245500ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef AISUBSYSTEMPLUGININTERFACE_H #define AISUBSYSTEMPLUGININTERFACE_H #include class KylinAiSubSystemPluginInterface { public: virtual ~KylinAiSubSystemPluginInterface() {} virtual QWidget *createModelConfigWidget() = 0; virtual QWidget *createComputePowerSharingWidget() = 0; }; Q_DECLARE_INTERFACE(KylinAiSubSystemPluginInterface, "org.kylinaisubsystem.PluginInterface") #endif // AISUBSYSTEMPLUGININTERFACE_H kylin-ai-subsystem-plugin-1.0.0.2/configmanager.cpp000066400000000000000000000052331520576575000222400ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "configmanager.h" #include #include namespace { const char *subsystemSchema = "org.kylin-ai-subsystem-plugin"; const char *installProgress = "install-progress"; const char *uninstallProgress = "uninstall-progress"; const char *lastDetectAndUpdateTime = "last-detect-install-time"; } // namespace ConfigManager::ConfigManager(QObject *parent) : QObject(parent) { initConfig(); } int ConfigManager::getInstallProgress() const { if (!config_) { qWarning() << "Failed to get install progress!"; return -1; } return config_->get(installProgress).toInt(); } int ConfigManager::getUninstallProgress() const { if (!config_) { qWarning() << "Failed to get uninstall progress!"; return -1; } return config_->get(uninstallProgress).toInt(); } QString ConfigManager::getLastDetectAndUpdateTime() const { if (!config_) { qWarning() << "Failed to get detect and update time!"; return ""; } return config_->get(lastDetectAndUpdateTime).toString(); } void ConfigManager::setInstallProgress(int progress) { if (config_->get(installProgress).toInt() == progress) { return; } config_->set(installProgress, progress); } void ConfigManager::setUninstallProgress(int progress) { if (config_->get(uninstallProgress).toInt() == progress) { return; } config_->set(uninstallProgress, progress); } void ConfigManager::setLastDetectAndUpdateTime(const QString &time) { if (config_->get(lastDetectAndUpdateTime).toString() == time) { return; } config_->set(lastDetectAndUpdateTime, time); } void ConfigManager::initConfig() { if (!QGSettings::isSchemaInstalled(subsystemSchema)) { qWarning() << "Kylin ai subsystem plugin Schema not installed"; return; } config_ = new QGSettings(subsystemSchema); if (config_ == nullptr) { qWarning() << "Failed to create kylin ai subsystem plugin GSettings"; return; } } kylin-ai-subsystem-plugin-1.0.0.2/configmanager.h000066400000000000000000000024231520576575000217030ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef CONFIGMANAGER_H #define CONFIGMANAGER_H #include #include class ConfigManager : public QObject { Q_OBJECT public: explicit ConfigManager(QObject *parent = nullptr); int getInstallProgress() const; int getUninstallProgress() const; QString getLastDetectAndUpdateTime() const; void setInstallProgress(int progress); void setUninstallProgress(int progress); void setLastDetectAndUpdateTime(const QString &time); private: void initConfig(); signals: private: QGSettings *config_ = nullptr; }; #endif // CONFIGMANAGER_H kylin-ai-subsystem-plugin-1.0.0.2/data/000077500000000000000000000000001520576575000176425ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/data/org.kylin-ai-subsystem-modelconfig.policy000066400000000000000000000031061520576575000277060ustar00rootroot00000000000000 KYLINOS http://www.kylinos.cn ues kylin-ai-subsystem-modelconfig 模型配置 模型配置 དཔེ་དབྱིབས་སྒྲིག་སྦྱོགས། ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ Authorization is required to edit model information 需要授权以编辑模型信息 需要授權以編輯模型信息 དཔེ་དབྱིབས་ཆ་འཕྲིན་རྩོམ་སྒྲིག་བྱེད་དབང་སྤྲོད་དགོས། ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠮᠡᠳᠡᠭᠡ ᠵᠠᠩᠭᠢ ᠶᠢ ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠬᠤ ᠡᠷᠬᠡ ᠣᠯᠭᠣᠬᠤ ᠴᠢᠬᠤᠯᠠ ᠲᠠᠶ ᠃ auth_admin auth_admin auth_admin kylin-ai-subsystem-plugin-1.0.0.2/data/org.kylin-ai-subsystem-plugin.gschema.xml000066400000000000000000000015311520576575000276250ustar00rootroot00000000000000 0 Package installation progress. Package installation progress. 0 Package uninstallation progress. Package uninstallation progress. "" Last detected update time. Last detected update time. kylin-ai-subsystem-plugin-1.0.0.2/image.qrc000066400000000000000000000010021520576575000205130ustar00rootroot00000000000000 image/ai-subsystem.svg image/ukui-model-configuration.svg image/ukui-private-model-symbolic.svg image/ukui-local-model-symbolic.svg image/ukui-cloud-model-symbolic.svg image/localConfigTitle.svg image/dialog-warning.svg image/couldConfigTitle.svg image/background.svg kylin-ai-subsystem-plugin-1.0.0.2/image/000077500000000000000000000000001520576575000200135ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/ai-subsystem.svg000066400000000000000000000132371520576575000231670ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/background.svg000066400000000000000000000432631520576575000226630ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/couldConfigTitle.svg000077500000000000000000001510071520576575000240010ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/dialog-warning.svg000066400000000000000000000006311520576575000234360ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/localConfigTitle.svg000077500000000000000000001531241520576575000237670ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/ukui-cloud-model-symbolic.svg000066400000000000000000000102311520576575000255270ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/ukui-local-model-symbolic.svg000077500000000000000000000133001520576575000255160ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/ukui-model-configuration.svg000066400000000000000000000054221520576575000254570ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/image/ukui-private-model-symbolic.svg000066400000000000000000000062401520576575000261000ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/000077500000000000000000000000001520576575000225525ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/aisubsystem.cpp000066400000000000000000000400331520576575000256260ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "aisubsystem.h" #include #include #include #include #include #include #include #include #include #include #include #include static CloudModelConfigWidget *g_cloudModelConfigPage = nullptr; static LocalModelConfigWidget *g_localModelConfigWidget = nullptr; static PrivateModelConfigWidget *g_privateModelConfigWidget = nullptr; TestAiSubSystem::TestAiSubSystem(QObject *parent) : QObject(parent) { } CloudModelConfigWidget* TestAiSubSystem::getCloudModelConfigPage() { return g_cloudModelConfigPage; } LocalModelConfigWidget *TestAiSubSystem::getLocalModelConfigPage() { return g_localModelConfigWidget; } PrivateModelConfigWidget *TestAiSubSystem::getPrivateModelConfigPage() { return g_privateModelConfigWidget; } QStringList translationsPaths() { QString binaryPath = QFileInfo(qApp->applicationDirPath()).absoluteFilePath(); QString trPath = QDir::toNativeSeparators(binaryPath + "/translations") ; #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) return QStringList() << QStringLiteral(APP_PREFIX) + "/share/kylin-ai-subsystem-plugin/kylin-ai-subsystem-modelconfig/translations" << trPath << QStringLiteral("/usr/share/kylin-ai-subsystem-plugin/kylin-ai-subsystem-modelconfig/translations") << QStringLiteral("/usr/local/share/kylin-ai-subsystem-plugin/kylin-ai-subsystem-modelconfig/translations"); #elif defined(Q_OS_WIN) return QStringList() << trPath; #endif } QWidget* TestAiSubSystem::createModelConfigWidget() { initUkuiLog4qt("ukui-control-center"); // 日志输出在 ~/.log/ukui-control-center.log KyInfo() << "Init AI model config."; m_translator = new QTranslator; QStringList trPaths = translationsPaths(); for (const QString &path: trPaths) { KyInfo() << "binaryPath" << path; bool match = m_translator->load(QLocale(), QStringLiteral("Internationalization"), QStringLiteral( "_"), path); if (match) { break; } } QCoreApplication::installTranslator(m_translator); m_mainWidget = new QWidget(); m_mainWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_mainWidget"); m_mainWidget->setContentsMargins(0, 0, 0, 0); // 模型配置 m_modelConfigLabel = new QLabel(m_mainWidget); m_modelConfigLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_modelConfigLabel"); m_modelConfigLabel->setContentsMargins(16, 8, 0, 8); m_modelConfigLabel->setText(tr("Model Configuration")); // 检查AI应用是否符合版本要求 m_tipsFrame = new QFrame; m_tipsFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_QFrame_m_tipsFrame"); m_tipsFrame->setMinimumSize(QSize(495, 56)); m_tipsFrame->setMaximumSize(QSize(16777215, 56)); m_tipsFrame->setFrameShape(QFrame::Box); m_tipsFrame->setContentsMargins(0, 0, 0, 0); m_appTipsWidget = new AppVersionErrorWarningWidget(m_mainWidget); m_appTipsWidget->setFixedHeight(56); m_appTipsWidget->setMinimumSize(QSize(495,56)); m_appTipsWidget->setMaximumSize(QSize(16777215, 56)); QHBoxLayout *tipsHLayout = new QHBoxLayout(m_tipsFrame); tipsHLayout->setContentsMargins(0, 0, 0, 0); tipsHLayout->setSpacing(0); tipsHLayout->addWidget(m_appTipsWidget); m_msgWidget = new QWidget(m_mainWidget); m_msgWidget->setFixedHeight(56); m_msgWidget->setMinimumSize(QSize(495,56)); m_msgWidget->setMaximumSize(QSize(16777215, 56)); m_msgWidget->setStyleSheet("background:rgba(255, 125, 0, 0.1);border-radius:6px;"); m_msgWidget->setLayout(tipsHLayout); QString warningTips = ModelDownload::getInstance()->isAppversionNeedUpdate() ; //提示语为空时无需显示提示 //v11版本麒麟速记、助手与子系统没有版本兼容问题,不需要显示提示 if(warningTips.isEmpty() || curSystemVersion() == SystemVersion::Version_V11) { m_msgWidget->setVisible(false); } else { m_msgWidget->setVisible(true); m_appTipsWidget->updateTips(warningTips); } // 云端模型 m_publicCloudModel = new ModelWidget( tr("Cloud Model (Kylin Certification)"), tr("Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network)"), DeployType::PublicCloud); m_publicCloudModel->setAccessibleName("kylin-ai-subsystem-modelconfig_ModelWidget_m_publicCloudModel"); // 设置父窗口为插件窗口类,然后调用exec实现模态窗口 g_cloudModelConfigPage = new CloudModelConfigWidget(m_mainWidget); g_cloudModelConfigPage->setAccessibleName("kylin-ai-subsystem-modelconfig_CloudModelConfigWidget_g_cloudModelConfigPage"); // 本地模型 bool shouldShowLocalModel = hasLocalModel(); if (shouldShowLocalModel == true) { m_ondeviceModel = new ModelWidget( tr("Local Model (Kylin Certification)"), tr("Configure a local model certified by Kylin (Installed on local equipment, it can run without network)"), DeployType::Ondevice); m_ondeviceModel->setAccessibleName("kylin-ai-subsystem-modelconfig_ModelWidget_m_ondeviceModel"); // 设置父窗口为插件窗口类,然后调用exec实现模态窗口 g_localModelConfigWidget = new LocalModelConfigWidget(m_mainWidget); g_localModelConfigWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_LocalModelConfigWidget_g_localModelConfigWidget"); } //自定义模型 m_privateModel = new ModelWidget( tr("Custom Model"), tr("Configure local model files, LAN, and public cloud model configurations without " "Kylin authentication (we apologize for any inconvenience causeds.)"), DeployType::Custom); // 设置父窗口为插件窗口类, 然后调用exec实现模态窗口 g_privateModelConfigWidget = new PrivateModelConfigWidget(m_mainWidget); m_modelGroup = new KBackgroundGroup; m_modelGroup->setMinimumWidth(495); m_modelGroup->setMaximumWidth(16777215); // 模型调度优先级 m_modelCallPriorityFrame = new QFrame(); m_modelCallPriorityFrame->setMinimumSize(QSize(495, 60)); m_modelCallPriorityFrame->setMaximumSize(QSize(16777215, 60)); m_modelCallPriorityFrame->setFrameShape(QFrame::Box); m_modelCallPriorityFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_QFrame_modelCallPriorityFrame"); m_modelCallPriorityWidget = new ModelCallPriority(hasLocalModel(), m_modelCallPriorityFrame); m_mainVLayout = new QVBoxLayout(); m_mainVLayout->setContentsMargins(0, 0, 0, 0); m_mainVLayout->setSpacing(0); m_mainVLayout->addWidget(m_modelConfigLabel); m_mainVLayout->addWidget(m_msgWidget); m_mainVLayout->addWidget(m_modelGroup); m_mainVLayout->addSpacing(8); m_mainVLayout->addWidget(m_modelCallPriorityFrame); m_mainVLayout->addStretch(); m_mainWidget->setLayout(m_mainVLayout); initConnect(); initModelGroup(); KyInfo() << "End AI model config."; return m_mainWidget; } QWidget* TestAiSubSystem::createComputePowerSharingWidget() { return nullptr; } void TestAiSubSystem::initModelGroup() { ModelConfig mc; int publicCloudValue = mc.getModelSchedulingPriority(DeployType::PublicCloud); int ondeviceValue = mc.getModelSchedulingPriority(DeployType::Ondevice); int customValue = mc.getModelSchedulingPriority(DeployType::Custom); m_modelPriorityList.clear(); m_modelPriorityList.append({publicCloudValue, DeployType::PublicCloud, m_publicCloudModel}); if (hasLocalModel()) { m_modelPriorityList.append({ondeviceValue, DeployType::Ondevice, m_ondeviceModel}); } m_modelPriorityList.append({customValue, DeployType::Custom, m_privateModel}); sortItemsByPriority(); updateUIOrder(); } void TestAiSubSystem::initConnect() { // 云端模型 connect(m_publicCloudModel, &ModelWidget::configClicked, this, [=]{ //重新初始化云端模型对话框界面 g_cloudModelConfigPage->deleteLater(); g_cloudModelConfigPage = nullptr; g_cloudModelConfigPage = new CloudModelConfigWidget(m_mainWidget); g_cloudModelConfigPage->setAccessibleName("kylin-ai-subsystem-modelconfig_CloudModelConfigWidget_g_cloudModelConfigPage"); g_cloudModelConfigPage->showCentered(); TestAiSubSystem::getCloudModelConfigPage()->exec(); }); connect(m_publicCloudModel, &ModelWidget::sortClicked, this, [=] { moveItemUp(DeployType::PublicCloud); }); // 本地模型 if (hasLocalModel() == true) { connect(m_ondeviceModel, &ModelWidget::configClicked, this, [=]{ //重新初始化本地模型对话框界面 g_localModelConfigWidget->deleteLater(); g_localModelConfigWidget = nullptr; g_localModelConfigWidget = new LocalModelConfigWidget(m_mainWidget); g_localModelConfigWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_LocalModelConfigWidget_g_localModelConfigWidget"); g_localModelConfigWidget->showCentered(); TestAiSubSystem::getLocalModelConfigPage()->exec(); }); connect(m_ondeviceModel, &ModelWidget::sortClicked, this, [=] { moveItemUp(DeployType::Ondevice); }); } // 自定义模型 connect(m_privateModel,&ModelWidget::configClicked,this, [=]{ //重新初始化自定义模型对话框界面 g_privateModelConfigWidget->deleteLater(); g_privateModelConfigWidget = nullptr; g_privateModelConfigWidget = new PrivateModelConfigWidget(m_mainWidget); g_privateModelConfigWidget->showCentered(); TestAiSubSystem::getPrivateModelConfigPage()->exec(); }); connect(m_privateModel, &ModelWidget::sortClicked, this, [=] { moveItemUp(DeployType::PrivateCloud); }); connect(m_modelCallPriorityWidget, &ModelCallPriority::topModelPriorityChanged, this, &TestAiSubSystem::onModelPriorityChanged); } void TestAiSubSystem::moveItemUp(DeployType deployType) { int currentIndex = -1; for (int i = 0; i < m_modelPriorityList.size(); i++) { if (m_modelPriorityList[i].deployType == deployType) { currentIndex = i; break; } } if (currentIndex > 0) { // 交换优先级值 std::swap(m_modelPriorityList[currentIndex].priority, m_modelPriorityList[currentIndex-1].priority); // 重新排序 sortItemsByPriority(); // 更新UI updateUIOrder(); saveModelPriority(); } } void TestAiSubSystem::updateUIOrder() { QList modelUIList; bool isFirstItem = true; for (const PriorityItem &item : m_modelPriorityList) { if (isFirstItem) { // 更新按钮状态 item.modelWidget->m_sortButton->setEnabled(false); // 更新模型调度优先级 m_modelCallPriorityWidget->setModelCallPriority(item.deployType); isFirstItem = false; } else { item.modelWidget->m_sortButton->setEnabled(true); } modelUIList.append(item.modelWidget); } m_modelGroup->removeWidgetList(m_modelGroup->widgetList()); m_modelGroup->addWidgetList(modelUIList); } void TestAiSubSystem::onModelPriorityChanged(DeployType topPriorityModelType) { PriorityItem itemToMove; int index = -1; for (int i = 0; i < m_modelPriorityList.size(); i++) { if (m_modelPriorityList[i].deployType == topPriorityModelType) { itemToMove = m_modelPriorityList[i]; index = i; break; } } if (index <= 0 || index >= m_modelPriorityList.size()) { return; } for (int i = index; i > 0; i--) { m_modelPriorityList[i] = m_modelPriorityList[i-1]; m_modelPriorityList[i].priority++; // 优先级递增 } itemToMove.priority = 1; m_modelPriorityList[0] = itemToMove; // 更新UI updateUIOrder(); saveModelPriority(); } void TestAiSubSystem::saveModelPriority() { QMap priorityMap; for (const PriorityItem &item : m_modelPriorityList) { priorityMap.insert(item.deployType, item.priority); } updateModelPriority(priorityMap); } void TestAiSubSystem::updateModelPriority(const QMap &priorityMap) { bool ret = false; bool shouldShowLocalModel = hasLocalModel(); // 遍历 priorityMap,设置每个模型的优先级 for (auto it = priorityMap.begin(); it != priorityMap.end(); ++it) { DeployType type = it.key(); int priority = it.value(); // 如果本地模型隐藏,则跳过 if (shouldShowLocalModel == false && type == DeployType::Ondevice) { continue; } ModelConfig mc; ret = mc.setModelSchedulingPriority(type, priority); if (ret == false) { switch (type) { case DeployType::PublicCloud: KyInfo() << "Failed to set the call priority for DeployType: PublicCloud with priority:" << priority; showErrorMessage(tr("Failed to set cloud model priority"),m_mainWidget); break; case DeployType::Ondevice: if (shouldShowLocalModel == true) { KyInfo() << "Failed to set the call priority for DeployType: Ondevice with priority:" << priority; showErrorMessage(tr("Failed to set local model priority"),m_mainWidget); } break; case DeployType::Custom: KyInfo() << "Failed to set the call priority for DeployType: Custom with priority:" << priority; showErrorMessage(tr("Failed to set custom model priority"),m_mainWidget); break; default: KyInfo() << "Unknown DeployType"; break; } } else { // 设置成功 switch (type) { case DeployType::PublicCloud: KyInfo() << "Successfully set the call priority for DeployType: PublicCloud with priority:" << priority; break; case DeployType::Ondevice: if (shouldShowLocalModel == true) { KyInfo() << "Successfully set the call priority for DeployType: Ondevice with priority:" << priority; } break; case DeployType::Custom: KyInfo() << "Successfully set the call priority for DeployType: Custom with priority:" << priority; break; default: KyInfo() << "Successfully set the call priority for Unknown DeployType with priority:" << priority; break; } } } } void TestAiSubSystem::sortItemsByPriority() { std::sort(m_modelPriorityList.begin(), m_modelPriorityList.end(), [](const PriorityItem& a, const PriorityItem& b) { return a.priority < b.priority; }); } bool TestAiSubSystem::hasLocalModel() { #if (defined(Q_PROCESSOR_X86) || (defined(Q_PROCESSOR_ARM))) return true; #else return false; #endif } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/aisubsystem.h000066400000000000000000000054701520576575000253010ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef AISUBSYSTEM_H #define AISUBSYSTEM_H #include #include #include #include #include #include #include #include #include "modelwidget.h" #include "modelcallpriority.h" #include "cloudmodelconfigwidget.h" #include "localmodelconfigwidget.h" #include "privatemodelconfigwidget.h" #include "appversionerrorwarningwidget.h" struct PriorityItem { int priority; DeployType deployType; ModelWidget *modelWidget; }; class TestAiSubSystem : public QObject { Q_OBJECT public: explicit TestAiSubSystem(QObject *parent = nullptr); //通过这个接口返回模型配置UI QWidget* createModelConfigWidget(); QWidget* createComputePowerSharingWidget(); static CloudModelConfigWidget* getCloudModelConfigPage(); static LocalModelConfigWidget* getLocalModelConfigPage(); static PrivateModelConfigWidget* getPrivateModelConfigPage(); private: void initConnect(); void initModelGroup(); void saveModelPriority(); void updateModelPriority(const QMap &priorityMap); void sortItemsByPriority(); void moveItemUp(DeployType deployType); void updateUIOrder(); DeployType getDeployTypeByFrame(QFrame *frame); bool hasLocalModel(); // 判断是否需要隐藏本地模型 public slots: void onModelPriorityChanged(DeployType topPriorityModelType); private: QTranslator *m_translator = nullptr; QLabel *m_modelConfigLabel = nullptr; QWidget *m_msgWidget; AppVersionErrorWarningWidget *m_appTipsWidget = nullptr; ModelWidget *m_publicCloudModel = nullptr; ModelWidget *m_ondeviceModel = nullptr; ModelWidget *m_privateModel = nullptr; QFrame *m_tipsFrame = nullptr; QFrame *m_modelCallPriorityFrame = nullptr; ModelCallPriority *m_modelCallPriorityWidget = nullptr; KBackgroundGroup *m_modelGroup = nullptr; QWidget *m_mainWidget = nullptr; QVBoxLayout *m_mainVLayout = nullptr; QMap m_priorityMap; QList m_modelPriorityList; }; #endif // AISUBSYSTEM_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/appversionerrorwarningwidget.cpp000066400000000000000000000074171520576575000313210ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "appversionerrorwarningwidget.h" #include #include AppVersionErrorWarningWidget::AppVersionErrorWarningWidget(QWidget *parent) : QWidget(parent) { //初始化布局 initLayout(); } void AppVersionErrorWarningWidget::initLayout() { //图标 m_iconLabel = new QLabel(this); m_iconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_iconLabel"); m_iconLabel-> setPixmap(QIcon::fromTheme("dialog-warning").pixmap(24,24)); m_iconLabel->setFixedSize(36, 36); m_iconLabel->setStyleSheet("background: transparent;"); m_iconLabel->setAlignment(Qt::AlignCenter); m_iconLabel->setContentsMargins(0, 0, 0, 0); //提醒 m_tipsLabel = new QLabel; m_tipsLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_descripLabel"); m_tipsLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); m_tipsLabel->setWordWrap(true); m_tipsLabel->setFixedHeight(40); m_tipsLabel->setMinimumWidth(456); m_tipsLabel->setMaximumWidth(16777215); m_tipsLabel->setContentsMargins( 0, 0, 0, 0); m_tipsLabel->setText(tr("which may lead limited functionality. Please upgrade to the latest version to ensure proper usage.")); m_tipsLabel->setStyleSheet("color: rgba(255, 125, 0, 1); background: transparent;padding-top:0px;padding-left:2px;padding-right:2px;"); //按钮 m_configButton = new QPushButton; // m_configButton->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_m_configButton"); m_configButton->setText(tr("Go to update")); m_configButton->setFixedSize(QSize(88,36)); m_configButton->setFocusPolicy(Qt::NoFocus); m_configButton->setStyleSheet("QPushButton {" "background-color:#FF7D00;;" "color: white;" "font-size:14px;" "border-radius: 6px;" "}" "QPushButton:hover {" "background-color:#F27700;;" "}" "QPushButton:pressed {" "background-color:#CC6400;;" "}"); connect(m_configButton,&kdk::KBorderlessButton::clicked,this,&AppVersionErrorWarningWidget::loadSoftwareStore); m_mainHLayout = new QHBoxLayout(); m_mainHLayout->setContentsMargins(8, 0, 16, 0); m_mainHLayout->setSpacing(0); m_mainHLayout->addWidget(m_iconLabel); m_mainHLayout->addSpacing(8); m_mainHLayout->addWidget(m_tipsLabel); m_mainHLayout->addSpacing(30); // m_mainHLayout->addStretch(); m_mainHLayout->addWidget(m_configButton); this->setLayout(m_mainHLayout); } void AppVersionErrorWarningWidget::loadSoftwareStore() { //打开软件商店 QString cmd = QString("/usr/bin/kylin-software-center -menuid=2 -tagid=709"); QProcess::startDetached(cmd); } void AppVersionErrorWarningWidget::updateTips(QString tips) { if(m_tipsLabel) { m_tipsLabel->setText(tips); } } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/appversionerrorwarningwidget.h000066400000000000000000000040001520576575000307470ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef APPVERSIONERRORWARNINGWIDGET_H #define APPVERSIONERRORWARNINGWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "kaglobal.h" #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include "ukui-log4qt.h" #include #include #include #include #include class AppVersionErrorWarningWidget : public QWidget { Q_OBJECT public: explicit AppVersionErrorWarningWidget(QWidget *parent = nullptr); void initLayout(); void loadSoftwareStore();//加载软件商店 void updateTips(QString tips); private: QHBoxLayout *m_mainHLayout; QLabel *m_iconLabel; QLabel *m_tipsLabel; QPushButton *m_configButton; }; #endif // APPVERSIONERRORWARNINGWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/cloudmodelconfigwidget.cpp000066400000000000000000001313131520576575000300010ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "cloudmodelconfigwidget.h" #include #include #include "util.h" CloudModelConfigWidget::CloudModelConfigWidget(QWidget *parent) : QDialog(parent) { // 初始化布局 initLayout(); // 加载已配置的模型并显示 loadModelConfig(); // 初始化信号槽 initConnect(); } CloudModelConfigWidget::~CloudModelConfigWidget() { m_nlpModelMap.clear(); m_visionModelMap.clear(); m_speechModelMap.clear(); // 删除ModelItem对象 for (ModelItem* item : m_nlpModelItemMap) { if (item) { delete item; item = nullptr; } } m_nlpModelItemMap.clear(); for (ModelItem* item : m_visionModelItemMap) { if (item) { delete item; item = nullptr; } } m_visionModelItemMap.clear(); for (ModelItem* item : m_speechModelItemMap) { if (item) { delete item; item = nullptr; } } m_speechModelItemMap.clear(); m_nlpModelItemList.clear(); m_visionModelItemList.clear(); m_speechModelItemList.clear(); m_nlpModelGroup->removeAndDeleteAllWidget(); m_visionModelGroup->removeAndDeleteAllWidget(); m_speechModelGroup->removeAndDeleteAllWidget(); m_nlpModelMapUI.clear(); m_visionModelMapUI.clear(); m_speechModelMapUI.clear(); } void CloudModelConfigWidget::initLayout() { this->setFixedSize(544, 610); this->setWindowTitle(tr("Cloud Model")); m_mainVLayout = new QVBoxLayout(); initModelTitleLayout(); initModellayout(); m_mainVLayout->setStretch(0,2); m_mainVLayout->setStretch(1,8); this->setLayout(m_mainVLayout); } void CloudModelConfigWidget::initModelTitleLayout() { QLabel* backgroundLabel = new QLabel(this); backgroundLabel->setFixedHeight(72); backgroundLabel->setPixmap(QPixmap(":/res/icon/background.svg")); backgroundLabel->setAlignment(Qt::AlignCenter); backgroundLabel->setScaledContents(false); backgroundLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_backgroundLabel"); m_titleHLayout = new QHBoxLayout(backgroundLabel); m_titleHLayout->setContentsMargins(24, 0, 24, 0); m_vLeftLayout = new QVBoxLayout(); m_iconLabel = new QLabel(backgroundLabel); m_iconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_iconLabel"); QPixmap iconPixmap(":/res/icon/ukui-cloud-model-symbolic.svg"); if(!iconPixmap.isNull()) { iconPixmap = iconPixmap.scaled(24, 24, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_iconLabel->setPixmap(iconPixmap); } m_iconLabel->setFixedSize(24, 24); m_vLeftLayout->addWidget(m_iconLabel); m_cloudHLayout = new QVBoxLayout(); m_cloudHLayout->setContentsMargins(0, 12, 0, 16); m_cloudLabel = new QLabel(backgroundLabel); m_cloudLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_cloudLabel"); m_cloudLabel->setMinimumSize(216, 24); m_cloudLabel->setText(tr("Cloud Model")); QFont cloudFont; cloudFont.setBold(true); m_cloudLabel->setFont(cloudFont); m_cloudLabel->setStyleSheet("color: #3790FA; background: transparent;"); m_descripLabel = new kdk::KLabel(backgroundLabel); m_descripLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_descripLabel"); m_descripLabel->setMinimumSize(450, 20); m_descripLabel->setText(tr("Deployed on the cloud server, access and use over the network")); QFont cloudDescripFont; cloudDescripFont.setPointSize(cloudFont.pointSize() - 2); m_descripLabel->setFont(cloudDescripFont); setKLabelFontColor(m_descripLabel, "#3790FA"); m_cloudHLayout->addWidget(m_cloudLabel); m_cloudHLayout->addWidget(m_descripLabel); m_titleHLayout->addLayout(m_vLeftLayout); m_titleHLayout->addLayout(m_cloudHLayout); m_mainVLayout->addWidget(backgroundLabel); } void CloudModelConfigWidget::initModellayout() { m_baseVLayout = new QVBoxLayout; m_baseVLayout->setContentsMargins(0, 30, 0, 0); // NLP大语言模型 m_nlpWidget = new QWidget; m_nlpWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_nlpWidget"); m_nlpVLayout = new QVBoxLayout; m_nlpVLayout->setContentsMargins(0, 0, 0, 0); m_nlpVLayout->setSpacing(1); m_nlpHLayout = new QHBoxLayout; m_nlpHLayout->setContentsMargins(16, 0, 16, 0); // NLP标题 QFont font; font.setBold(true); // 设置字体加粗 // 设置QLabel的字体 m_nlpLabel = new QLabel; m_nlpLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_nlpLabel"); m_nlpLabel->setText(tr("NLP Model")); m_nlpLabel->setFont(font); // NLP描述 m_nlpDescLabel = new kdk::KLabel(this); m_nlpDescLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_nlpDescLabel"); m_nlpDescLabel->setText(tr("Processing and generating text, such as understanding text and answering questions")); m_nlpDescLabel->setFixedWidth(402); setKLabelFontColor(m_nlpDescLabel, "#808080"); // 标题和描述放入布局 m_nlpDescVLayout = new QVBoxLayout(); m_nlpDescVLayout->setSpacing(0); m_nlpDescVLayout->addWidget(m_nlpLabel); m_nlpDescVLayout->addWidget(m_nlpDescLabel); // 添加按钮 m_nlpAddButton = new kdk::KBorderlessButton; m_nlpAddButton->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_m_nlpAddButton"); m_nlpAddButton->setFixedSize(60, 28); m_nlpAddButton->setIcon(QIcon::fromTheme("list-add-symbolic")); m_nlpAddButton->setIconSize(QSize(16, 16)); m_nlpAddButton->setText(tr("Add")); // 已配置模型 m_nlpModelGroup = new SettingGroup(m_nlpWidget); m_nlpModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_nlpModelGroup"); m_freeTrialModelGroup = new SettingGroup(m_nlpWidget); m_freeTrialModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_freeTrialModelGroup"); m_nlpHLayout->addLayout(m_nlpDescVLayout); m_nlpHLayout->addStretch(); m_nlpHLayout->addWidget(m_nlpAddButton); m_nlpVLayout->addLayout(m_nlpHLayout); m_nlpVLayout->addWidget(m_freeTrialModelGroup); m_nlpVLayout->addWidget(m_nlpModelGroup); m_nlpWidget->setLayout(m_nlpVLayout); // VISION视觉模型 m_visionWidget = new QWidget; m_visionWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_visionWidget"); m_visionVLayout = new QVBoxLayout; m_visionVLayout->setContentsMargins(0, 0, 0, 0); m_visionHLayout = new QHBoxLayout; m_visionHLayout->setContentsMargins(16, 0, 16, 0); // VISION标题 m_visionLabel = new QLabel; m_visionLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_visionLabel"); m_visionLabel->setText(tr("Visual Model")); m_visionLabel->setFont(font); // VISION描述 m_visionDescrLabel = new kdk::KLabel(this); m_visionDescrLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_visionDescrLabel"); m_visionDescrLabel->setText(tr("Processing and generating images, such as recognizing objects and analyzing scenes")); m_visionDescrLabel->setFixedWidth(402); setKLabelFontColor(m_visionDescrLabel, "#808080"); // 标题和描述放入布局 m_visionDescVLayout = new QVBoxLayout(); m_visionDescVLayout->setSpacing(0); m_visionDescVLayout->addWidget(m_visionLabel); m_visionDescVLayout->addWidget(m_visionDescrLabel); // 添加按钮 m_visionAddButton = new kdk::KBorderlessButton; m_visionAddButton->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_m_visionAddButton"); m_visionAddButton->setFixedSize(60, 28); m_visionAddButton->setIcon(QIcon::fromTheme("list-add-symbolic")); m_visionAddButton->setIconSize(QSize(16, 16)); m_visionAddButton->setText(tr("Add")); // 已配置模型 m_visionModelGroup = new SettingGroup; m_visionModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_visionModelGroup"); m_visionHLayout->addLayout(m_visionDescVLayout); m_visionHLayout->addStretch(); m_visionHLayout->addWidget(m_visionAddButton); m_visionVLayout->addLayout(m_visionHLayout); m_visionVLayout->addWidget(m_visionModelGroup); m_visionWidget->setLayout(m_visionVLayout); // SPEECH语音模型 m_speechWidget = new QWidget; m_speechWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_speechWidget"); m_speechVLayout = new QVBoxLayout; m_speechVLayout->setContentsMargins(0, 0, 0, 0); m_speechHLayout = new QHBoxLayout; m_speechHLayout->setContentsMargins(16, 0, 16, 0); // SPEECH标题 m_speechLabel = new QLabel; m_speechLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_speechLabel"); m_speechLabel->setText(tr("Speech Model")); m_speechLabel->setFont(font); // SPEECH描述 m_speechDescLabel = new kdk::KLabel(this); m_speechDescLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_speechDescLabel"); m_speechDescLabel->setText(tr("Processing sound and speech, such as recognizing speech and synthesizing speech")); m_speechDescLabel->setFixedWidth(402); setKLabelFontColor(m_speechDescLabel, "#808080"); // 标题和描述放入布局 m_speechDescVlayout = new QVBoxLayout(); m_speechDescVlayout->setSpacing(0); m_speechDescVlayout->addWidget(m_speechLabel); m_speechDescVlayout->addWidget(m_speechDescLabel); // 添加按钮 m_speechAddButton = new kdk::KBorderlessButton; m_speechAddButton->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_m_speechAddButton"); m_speechAddButton->setFixedSize(60, 28); m_speechAddButton->setIcon(QIcon::fromTheme("list-add-symbolic")); m_speechAddButton->setIconSize(QSize(16, 16)); m_speechAddButton->setText(tr("Add")); // 已配置模型 m_speechModelGroup = new SettingGroup; m_speechModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_speechModelGroup"); m_speechHLayout->addLayout(m_speechDescVlayout); m_speechHLayout->addStretch(); m_speechHLayout->addWidget(m_speechAddButton); m_speechVLayout->addLayout(m_speechHLayout); m_speechVLayout->addWidget(m_speechModelGroup); m_speechWidget->setLayout(m_speechVLayout); // 滚动区域 m_scrollVLayout = new QVBoxLayout; m_scrollVLayout->setContentsMargins(16, 20, 16, 0); m_scrollVLayout->addWidget(m_nlpWidget); m_scrollVLayout->addWidget(m_visionWidget); m_scrollVLayout->addWidget(m_speechWidget); m_scrollVLayout->addStretch(); m_scrollWidget = new QWidget; m_scrollWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_speechWidget"); m_scrollWidget->setContentsMargins(0, 0, 0, 0); m_scrollWidget->setLayout(m_scrollVLayout); m_scrollArea = new QScrollArea(this); m_scrollArea->setAccessibleName("kylin-ai-subsystem-modelconfig_QScrollArea_m_scrollArea"); m_scrollArea->setFixedHeight(420); m_scrollArea->setWidgetResizable(true); m_scrollArea->setFrameStyle(QFrame::NoFrame); // 无边框 m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // 不显示水平滚动条 m_scrollArea->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); m_scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove", false); m_scrollArea->setWidget(m_scrollWidget); m_mainVLayout->addWidget(m_scrollArea); m_confirmWidget = new QWidget(this); m_confirmWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_confirmWidget"); m_confirmButton = new QPushButton(tr("OK"), this); m_confirmButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_m_confirmButton"); m_confirmButton->setProperty("isImportant", true); m_confirmButtoLayout = new QHBoxLayout(); m_confirmButtoLayout->setContentsMargins(0, 0, 24, 24); m_confirmButtoLayout->addStretch(); m_confirmButtoLayout->addWidget(m_confirmButton); m_confirmWidget->setLayout(m_confirmButtoLayout); m_mainVLayout->addStretch(); m_mainVLayout->addWidget(m_confirmWidget); } void CloudModelConfigWidget::initConnect() { connect(m_nlpAddButton, &QPushButton::clicked, this, [this](){ this->nlpAddModelItem(); }); connect(m_visionAddButton, &QPushButton::clicked, this, [this](){ this->visionAddModelItem(); }); connect(m_speechAddButton, &QPushButton::clicked, this, [this](){ this->speechAddModelItem(); }); connect(m_confirmButton, &QPushButton::clicked, this, [this](){ this->close(); }); } void CloudModelConfigWidget::nlpAddModelItem() { // 设置为随父窗口居中 ModelConfigDialog settingDialog(this); settingDialog.initUIData(AiCapability::Nlp ,DeployType::PublicCloud); settingDialog.exec(); } void CloudModelConfigWidget::visionAddModelItem() { // 设置为随父窗口居中 ModelConfigDialog settingDialog(this); settingDialog.initUIData(AiCapability::Vision,DeployType::PublicCloud); settingDialog.exec(); } void CloudModelConfigWidget::speechAddModelItem() { ModelConfigDialog settingDialog(this); settingDialog.initUIData(AiCapability::Speech,DeployType::PublicCloud); settingDialog.exec(); } bool CloudModelConfigWidget::eventFilter(QObject *watched, QEvent *event) { Q_UNUSED(watched); // 模型配置 ModelItem *clickedModelItem = qobject_cast(watched); if (clickedModelItem) { if (event->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::LeftButton) { // 判断左键 // 切换模型 clickCloudModel(clickedModelItem->getAICapability(), clickedModelItem->getModelName()); return true; } } } return QWidget::eventFilter(watched,event); } void CloudModelConfigWidget::clickCloudModel(AiCapability capability, QString modelName) { //KyInfo() << "正要切换到" << static_cast(capability) << modelName ; //KyInfo() << "当前正在回答的选中模型为" << nlpSelectedModel; bool ret = checkModelSelection(capability, modelName); if (ret == true) { return; } else { if ((capability == AiCapability::Nlp && (getModelStatus(nlpSelectedModel) == ModelStatus::Running)) || (capability == AiCapability::Vision && (getModelStatus(visionSelectedModel) == ModelStatus::Running)) || (capability == AiCapability::Speech && (getModelStatus(speechSelectedModel) == ModelStatus::Running))) { // NLP or VISION or SPEECH 正在使用 KyInfo() << "正在使用" << static_cast(capability); bool canProceed = showModelInUseMessage(this); if (canProceed == true) { clickCloudModel(capability, modelName); } else { KyInfo() << "取消本次操作"; return; } } else { bool ret = setSelectCloudModelName(capability, DeployType::PublicCloud, modelName); if (ret == true) { switchModelItem(capability, modelName); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model switching failed"),this); KyInfo() << modelName << " 设置为选中模型失败"; } } } } void CloudModelConfigWidget::loadModelConfig() { // 清空modelmap所有控件 m_nlpModelMap.clear(); m_visionModelMap.clear(); m_speechModelMap.clear(); // 删除ModelItem对象 for (ModelItem* item : m_nlpModelItemMap) { if (item) { delete item; item = nullptr; } } m_nlpModelItemMap.clear(); for (ModelItem* item : m_visionModelItemMap) { if (item) { delete item; item = nullptr; } } m_visionModelItemMap.clear(); for (ModelItem* item : m_speechModelItemMap) { if (item) { delete item; item = nullptr; } } m_speechModelItemMap.clear(); m_nlpModelItemList.clear(); m_visionModelItemList.clear(); m_speechModelItemList.clear(); m_nlpModelGroup->removeAndDeleteAllWidget(); m_visionModelGroup->removeAndDeleteAllWidget(); m_speechModelGroup->removeAndDeleteAllWidget(); m_nlpModelMapUI.clear(); m_visionModelMapUI.clear(); m_speechModelMapUI.clear(); loadModels(); } void CloudModelConfigWidget::loadModels() { loadFreeTrialModels(); loadNoFreeModels(); } void CloudModelConfigWidget::loadNoFreeModels() { ModelConfig mc; std::string nlpModel = mc.getCurrentModelName(AiCapability::Nlp, DeployType::PublicCloud); std::string visionModel = mc.getCurrentModelName(AiCapability::Vision, DeployType::PublicCloud); std::string speechModel = mc.getCurrentModelName(AiCapability::Speech, DeployType::PublicCloud); KyInfo() << "loadModelConfig-------------getCurrentModelName" << "nlpModel" << QString::fromStdString(nlpModel) << "visionModel" << QString::fromStdString(visionModel) <<"speechModel" << QString::fromStdString(speechModel); nlpSelectedModel = QString::fromStdString(nlpModel); visionSelectedModel = QString::fromStdString(visionModel); speechSelectedModel = QString::fromStdString(speechModel); for (auto capability : {AiCapability::Nlp, AiCapability::Vision, AiCapability::Speech}) { std::vector models = mc.getExtendedModels(capability); processModelInfo(models, capability); for (const auto &model : models) { PublicCloudModel publicCloudModel; publicCloudModel.capability = model.capability; publicCloudModel.vendor = QString::fromStdString(model.vendor); publicCloudModel.modelName = QString::fromStdString(model.modelName); publicCloudModel.multiAuths = mc.getModelAuthentications(model.modelName); KyInfo() << "loadModelConfig模型名称" << QString::fromStdString(model.modelName); KyInfo() << "loadModelConfig厂商" << QString::fromStdString(model.vendor); for (const auto &authen : publicCloudModel.multiAuths) { for (const auto &au : authen.authentications) { if (au.key == "appIdContinuous" || au.key == "apiKeyContinuous" || au.key == "secretKeyContinuous") { if (au.value != "") { continuousSelected = true; } } else if (au.key == "appIdRealTime" || au.key == "apiKeyRealTime") { if (au.value != "") { realtimeSelected = true; } } } } switch (capability) { case AiCapability::Nlp: loadModelItem(publicCloudModel, nlpSelectedModel); break; case AiCapability::Vision: loadModelItem(publicCloudModel, visionSelectedModel); break; case AiCapability::Speech: loadModelItem(publicCloudModel, speechSelectedModel); break; default: break; } } } } void CloudModelConfigWidget::processModelInfo(std::vector& models, AiCapability aiCapability) { std::vector orderedList; std::vector unorderedList; // 保存云端模型信息 QMap unOrderedListMap; for (auto& model : models) { if (model.deployType == DeployType::PublicCloud && !keyIsEmpty(model.modelName.c_str())) { unOrderedListMap[model.modelName.c_str()] = model; unorderedList.push_back(model); } } if (unOrderedListMap.size() <= 1) { models = unorderedList; return; } QStringList modelNameOrderList = m_modelOrderManager.getModelOrder(aiCapability); if (modelNameOrderList.size() != unOrderedListMap.size()) { KyWarning() << "The number of models and the saved ones are different." << modelNameOrderList << unOrderedListMap.keys(); models = unorderedList; return; } // 按照配置文件保存的顺序显示模型 for (QString& modelName : modelNameOrderList) { if (!unOrderedListMap.keys().contains(modelName)) { KyWarning() << "The saved list does not contain the name of this model: " << modelName; models = unorderedList; return; } orderedList.push_back(unOrderedListMap.value(modelName)); } models = orderedList; } bool CloudModelConfigWidget::keyIsEmpty(const QString& modelName) { ModelConfig mc; std::vector multiAuths = mc.getModelAuthentications(modelName.toStdString()); bool isValueEmpty = false; bool isContinuousValueEmpty = false; bool isRealtimeValueEmpty = false; for (const auto &authen : multiAuths) { for (const auto &au : authen.authentications) { if (au.key == "appIdRealTime" || au.key == "apiKeyRealTime") { if (au.value == "") { isContinuousValueEmpty = true; } } else if (au.key == "appIdContinuous" || au.key == "apiKeyContinuous" || au.key == "secretKeyContinuous") { if (au.value == "") { isRealtimeValueEmpty = true; } } else { if (au.value == "") { isValueEmpty = true; } } } } if (modelName == "讯飞-语音大模型") { if (isContinuousValueEmpty && isRealtimeValueEmpty) { return true; } } else { if(isValueEmpty) { return true; } } return false; } void CloudModelConfigWidget::loadFreeTrialModels() { ModelConfig mc; std::vector models = mc.getFreeTrialModels(kyai::config::model::AiCapability::Nlp); QString curModelName = mc.getCurrentModelName(AiCapability::Nlp, DeployType::PublicCloud).c_str(); for (const auto &model : models) { PublicCloudModel publicCloudModel; publicCloudModel.modelName = QString::fromStdString(model.modelName); if (publicCloudModel.modelName.isEmpty()) { KyInfo() << "Free trial account model name is empty !"; continue; } loadFreeTrialModelItem(publicCloudModel, publicCloudModel.modelName == curModelName); } } void CloudModelConfigWidget::loadFreeTrialModelItem(PublicCloudModel model, bool isSelected) { QString modelName = model.modelName; UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_UkccFrame_itemFrame"); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); itemFrame->setObjectName(modelName); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(0, 0, 0, 0); ModelItem *item = new ModelItem(AiCapability::Nlp, modelName, true, itemFrame); item->setAccessibleName("kylin-ai-subsystem-modelconfig_ModelItem_item"); if (isSelected) { item->showSelectedIcon(true); } item->installEventFilter(this); layItem->addWidget(item); // 删除被选中模型后,剩下模型中设置列表第一个为选中 // 点击免费账号显示隐藏按钮,从列表获取免费模型,设置显示与隐藏 m_nlpModelItemList.append(item); // 点击切换模型时,需要通过m_nlpModelItemMap保存的modelName进行确认 m_nlpModelItemMap[modelName] = item; m_freeTrialModelGroup->addWidget(itemFrame); } void CloudModelConfigWidget::loadModelItem(PublicCloudModel model, QString curSelectedName) { KyInfo() << "loadModelConfig modelName:" << model.modelName; UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_UkccFrame_itemFrame"); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); itemFrame->setObjectName(model.modelName); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(0, 0, 0, 0); ModelItem *item = new ModelItem(model.capability, model.modelName, false, itemFrame); item->setAccessibleName("kylin-ai-subsystem-modelconfig_ModelItem_item"); item->installEventFilter(this); connect(item, &ModelItem::sigEdit, this, &CloudModelConfigWidget::onEditModelItem); connect(item, &ModelItem::sigDelete, this, &CloudModelConfigWidget::onDeleteModelItem); layItem->addWidget(item); if (model.capability == AiCapability::Nlp) { m_nlpModelItemList.append(item); m_nlpModelMap[model.modelName] = model; m_nlpModelItemMap[model.modelName] = item; m_nlpModelMapUI[model.modelName] = itemFrame; m_nlpModelGroup->addWidget(itemFrame); // 设置为选中 if (model.modelName == curSelectedName) { item->showSelectedIcon(true); nlpSelectedModel = model.modelName; } } else if (model.capability == AiCapability::Vision) { m_visionModelItemList.append(item); m_visionModelMap[model.modelName] = model; m_visionModelItemMap[model.modelName] = item; m_visionModelMapUI[model.modelName] = itemFrame; m_visionModelGroup->addWidget(itemFrame); // 设置为选中 if (model.modelName == curSelectedName) { item->showSelectedIcon(true); visionSelectedModel = model.modelName; } } else if (model.capability == AiCapability::Speech) { m_speechModelItemList.append(item); m_speechModelMap[model.modelName] = model; m_speechModelItemMap[model.modelName] = item; m_speechModelMapUI[model.modelName] = itemFrame; m_speechModelGroup->addWidget(itemFrame); // 设置为选中 if (model.modelName == curSelectedName) { item->showSelectedIcon(true); speechSelectedModel = model.modelName; } } } void CloudModelConfigWidget::addModelItem(PublicCloudModel model) { UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_UkccFrame_itemFrame"); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); itemFrame->setObjectName(model.modelName); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(0, 0, 0, 0); ModelItem *item = new ModelItem(model.capability, model.modelName, false, itemFrame); item->setAccessibleName("kylin-ai-subsystem-modelconfig_ModelItem_item"); item->installEventFilter(this); connect(item, &ModelItem::sigEdit, this, &CloudModelConfigWidget::onEditModelItem); connect(item, &ModelItem::sigDelete, this, &CloudModelConfigWidget::onDeleteModelItem); layItem->addWidget(item); if (model.capability == AiCapability::Nlp) { m_nlpModelItemList.append(item); m_nlpModelMap[model.modelName] = model; m_nlpModelItemMap[model.modelName] = item; m_nlpModelMapUI[model.modelName] = itemFrame; m_nlpModelGroup->addWidget(itemFrame); // 第一个添加的模型,设置为选中 if (m_nlpModelItemMap.count() == 1) { item->showSelectedIcon(true); nlpSelectedModel = model.modelName; } } else if (model.capability == AiCapability::Vision) { m_visionModelItemList.append(item); m_visionModelMap[model.modelName] = model; m_visionModelItemMap[model.modelName] = item; m_visionModelMapUI[model.modelName] = itemFrame; m_visionModelGroup->addWidget(itemFrame); // 第一个添加的模型,设置为选中 if (m_visionModelItemMap.count() == 1) { item->showSelectedIcon(true); visionSelectedModel = model.modelName; } } else if (model.capability == AiCapability::Speech) { m_speechModelItemList.append(item); m_speechModelMap[model.modelName] = model; m_speechModelItemMap[model.modelName] = item; m_speechModelMapUI[model.modelName] = itemFrame; m_speechModelGroup->addWidget(itemFrame); // 第一个添加的模型,设置为选中 if (m_speechModelItemMap.count() == 1) { item->showSelectedIcon(true); speechSelectedModel = model.modelName; } } m_modelOrderManager.addModel(model.capability, model.modelName); } void CloudModelConfigWidget::onEditModelItem(AiCapability capability, QString modelName) { KyInfo() << QString("AiCapability=%0, ModelName=%1").arg((qint32)capability).arg(modelName); if (!polkit()) { return; } if (capability == AiCapability::Nlp) { // 随父窗口居中 ModelConfigDialog settingDialog(m_nlpModelMap[modelName], this); settingDialog.exec(); } else if (capability == AiCapability::Vision) { // 随父窗口居中 ModelConfigDialog settingDialog(m_visionModelMap[modelName], this); settingDialog.exec(); } else if (capability == AiCapability::Speech) { // 随父窗口居中 ModelConfigDialog settingDialog(m_speechModelMap[modelName], this); settingDialog.exec(); } } void CloudModelConfigWidget::onDeleteModelItem(AiCapability capability, QString modelName) { if (getModelStatus(modelName) == ModelStatus::Running) { // NLP or VISION or SPEECH 正在使用,重试弹窗 KyInfo() << "正在使用" << static_cast(capability) << modelName; bool canProceed = showModelInUseMessage(this); if (canProceed == true) { onDeleteModelItem(capability, modelName); } } else { // 未使用,确认弹窗 bool canProceed = showConfirmMessage(this); if (canProceed == true) { bool ret = clearModelMultiAuths(capability, modelName); if (ret == true) { deleteModelItem(capability, modelName); m_modelOrderManager.deleteModel(capability, modelName); KyInfo() << modelName << " 验证信息clear成功"; } else { showErrorMessage(tr("Failed to delete model"), this); KyInfo() << modelName << " 验证信息clear失败, 删除失败"; } } } } void CloudModelConfigWidget::deleteModelItem(AiCapability capability, QString modelName) { ModelConfig mc; QString curModelName = QString::fromStdString(mc.getCurrentModelName(capability,DeployType::PublicCloud)); bool isCheckSelected = checkModelSelection(capability, modelName); KyInfo() << "currentmodelname" << curModelName << "要删除的modelname" << modelName << "isCheckSelected" << isCheckSelected; if (capability == AiCapability::Nlp) { // 手动删除 ModelItem 对象 if (m_nlpModelItemMap.contains(modelName)) { if (m_nlpModelItemMap[modelName]) { m_nlpModelItemList.removeOne(m_nlpModelItemMap[modelName]); delete m_nlpModelItemMap[modelName]; m_nlpModelItemMap[modelName] = nullptr; } } m_nlpModelMap.remove(modelName); m_nlpModelItemMap.remove(modelName); m_nlpModelGroup->removeWidget(m_nlpModelMapUI[modelName]); m_nlpModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_nlpModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 ModelItem* firstItem = m_nlpModelItemList.first(); QString firstModelName = firstItem->getModelName(); KyInfo() << "============删除后 nlp firstModelName" << firstModelName; bool ret = setSelectCloudModelName(capability, DeployType::PublicCloud, firstModelName); // set sdk if (ret == true) { switchModelItem(firstItem->getAICapability(), firstItem->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " nlpModelItemMap为空"; nlpSelectedModel = ""; } } } else if (capability == AiCapability::Vision) { // 手动删除 ModelItem 对象 auto item = m_visionModelItemList.takeAt(m_visionModelItemList.indexOf(m_visionModelItemMap[modelName])); if (m_visionModelItemMap.contains(modelName)) { if (m_visionModelItemMap[modelName]) { delete m_visionModelItemMap[modelName]; m_visionModelItemMap[modelName] = nullptr; } } m_visionModelMap.remove(modelName); m_visionModelItemMap.remove(modelName); m_visionModelGroup->removeWidget(m_visionModelMapUI[modelName]); m_visionModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_visionModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 ModelItem* firstItem = m_visionModelItemList.first(); QString firstModelName = firstItem->getModelName(); KyInfo() << "============删除后 vision firstModelName" << firstModelName; bool ret = setSelectCloudModelName(capability, DeployType::PublicCloud, firstModelName); // set sdk if (ret == true) { switchModelItem(firstItem->getAICapability(), firstItem->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " visionModelItemMap为空"; visionSelectedModel = ""; } } } else if (capability == AiCapability::Speech) { // 手动删除 ModelItem 对象 auto item = m_speechModelItemList.takeAt(m_speechModelItemList.indexOf(m_speechModelItemMap[modelName])); if (m_speechModelItemMap.contains(modelName)) { if (m_speechModelItemMap[modelName]) { delete m_speechModelItemMap[modelName]; m_speechModelItemMap[modelName] = nullptr; } } m_speechModelMap.remove(modelName); m_speechModelItemMap.remove(modelName); m_speechModelGroup->removeWidget(m_speechModelMapUI[modelName]); m_speechModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_speechModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 ModelItem* firstItem = m_speechModelItemList.first(); QString firstModelName = firstItem->getModelName(); KyInfo() << "============删除后 speech firstModelName" << firstModelName; bool ret = setSelectCloudModelName(capability, DeployType::PublicCloud, firstModelName); // set sdk if (ret == true) { switchModelItem(firstItem->getAICapability(), firstItem->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " speechModelItemMap为空"; speechSelectedModel = ""; } } } } bool CloudModelConfigWidget::checkModelSelection(AiCapability capability, QString modelName) { if (capability == AiCapability::Nlp) { if (modelName == nlpSelectedModel) { return true; } else { return false; } } else if (capability == AiCapability::Vision) { if (modelName == visionSelectedModel) { return true; } else { return false; } } else if (capability == AiCapability::Speech) { if (modelName == speechSelectedModel) { return true; } else { return false; } } else { return false; } } bool CloudModelConfigWidget::setSelectCloudModelConfig(PublicCloudModel model) { KyInfo() << "setSelectCloudModelConfig----" << model.modelName; bool isValueEmpty = false; for (const auto &authen : model.multiAuths) { for (const auto &au : authen.authentications) { if (au.key == "appIdRealTime" || au.key == "apiKeyRealTime") { if (au.value == "" && realtimeSelected == true) { isValueEmpty = true; } } else if (au.key == "appIdContinuous" || au.key == "apiKeyContinuous" || au.key == "secretKeyContinuous") { if (au.value == "" && continuousSelected == true) { isValueEmpty = true; } } else { if (au.value == "") { isValueEmpty = true; } } } } if (isValueEmpty == true) { KyInfo() << model.modelName << "验证信息为空,设置失败"; return false; } ModelConfig mc; bool ret1 = mc.setModelAuthentications(model.modelName.toStdString(), model.multiAuths); if (ret1 == true) { bool ret2 = setSelectCloudModelName(model.capability, DeployType::PublicCloud, model.modelName); if (ret2 == false) { return false; } } else { KyInfo() << "setModelAuthentications failed:" << ret1; return false; } return true; } bool CloudModelConfigWidget::setSelectCloudModelName(AiCapability capability, DeployType deployType, QString modelName) { KyInfo() << "setSelectCloudModelName" << modelName; ModelConfig mc; bool ret2 = mc.setCurrentModelName(capability, deployType, modelName.toStdString()); if ( ret2 == true) { KyInfo() << "setCurrentModelName success:"<< ret2; } else { KyInfo() << "setCurrentModelName failed:"<< ret2; } return ret2; } bool CloudModelConfigWidget::editSelectCloudModel(PublicCloudModel model, bool isContinuousSelected, bool isRealTimeSelected, bool isValueChanged, QDialog *parentDialog) { bool isSwitchStateChanged = false; if (model.capability == AiCapability::Speech && model.modelName == "讯飞-语音大模型") { if (continuousSelected != isContinuousSelected) { isSwitchStateChanged = true; } if (realtimeSelected != isRealTimeSelected) { isSwitchStateChanged = true; } } while (getModelStatus(model.modelName) == ModelStatus::Running) { // NLP or VISION or SPEECH 正在使用,重试弹窗 KyInfo() << "正在使用" << static_cast(model.capability); if (isValueChanged == false && isSwitchStateChanged == false) { KyInfo() << "检查无修改内容,仅查看,关闭弹窗"; return true; } bool canProceed = showModelInUseMessage(parentDialog); if (canProceed == true) { continue; } else { KyInfo() << "取消本次操作"; return false; } } // 未使用 ModelConfig mc; // 当前选中的,无需再setCurrentModelName bool ret = mc.setModelAuthentications(model.modelName.toStdString(), model.multiAuths); if (ret == true) { // 发送信号告知已设置模型,重新创建会话 if (model.capability == AiCapability::Nlp) { m_nlpModelMap[model.modelName] = model; } else if (model.capability== AiCapability::Vision) { m_visionModelMap[model.modelName] = model; } else if (model.capability== AiCapability::Speech) { m_speechModelMap[model.modelName] = model; } if (model.capability == AiCapability::Speech) { // 同步两个开关的状态 continuousSelected = isContinuousSelected; realtimeSelected = isRealTimeSelected; } } else { showErrorMessage(tr("Model Editing failed"), parentDialog); KyInfo() << "编辑模型" << model.modelName << "失败"; return false; } return true; } void CloudModelConfigWidget::switchModelItem(AiCapability capability, QString modelName) { QMap *modelItemMap = nullptr; if (capability == AiCapability::Nlp) { modelItemMap = &m_nlpModelItemMap; } else if (capability == AiCapability::Vision) { modelItemMap = &m_visionModelItemMap; } else if (capability == AiCapability::Speech) { modelItemMap = &m_speechModelItemMap; } if (modelItemMap) { foreach (const auto& modelItemName, modelItemMap->keys()) { ModelItem* modelItem = modelItemMap->value(modelItemName); if (modelItem->getModelName() == modelName) { KyInfo() << "匹配成功,展示图标"; modelItem->showSelectedIcon(true); if (capability == AiCapability::Nlp) { nlpSelectedModel = modelName; } else if (capability == AiCapability::Vision) { visionSelectedModel = modelName; } else if (capability == AiCapability::Speech) { speechSelectedModel = modelName; } } else { // 不匹配,隐藏图标 KyInfo() << "不匹配,隐藏图标"; modelItem->showSelectedIcon(false); } } } } bool CloudModelConfigWidget::clearModelMultiAuths(AiCapability capability, QString modelName) { ModelConfig mc; bool ret = mc.clearModelAuthentications(modelName.toStdString()); return ret; } /* 通过polkit提权 */ bool CloudModelConfigWidget::polkit() { PolkitQt1::Authority::Result result; result = PolkitQt1::Authority::instance()->checkAuthorizationSync( "org.kylin-ai-subsystem-modelconfig.policy", PolkitQt1::UnixProcessSubject(QCoreApplication::applicationPid()), PolkitQt1::Authority::AllowUserInteraction); KyInfo() << "PolkitQt1 Authority result:" << result; if (result == PolkitQt1::Authority::Yes) { //认证通过 return true; } return false; } QMap& CloudModelConfigWidget::getModelItemMap(AiCapability capability) { if (capability == AiCapability::Nlp) { return m_nlpModelItemMap; } else if (capability == AiCapability::Vision) { return m_visionModelItemMap; } else if (capability == AiCapability::Speech) { return m_speechModelItemMap; } } ModelStatus CloudModelConfigWidget::getModelStatus(QString modelName) { ModelConfig mc; ModelStatus ret = mc.getModelStatus(modelName.toStdString()); KyInfo() << QString("%1 ModelStatus = %2").arg(modelName).arg((qint32)ret); return ret; } void CloudModelConfigWidget::showCentered() { if (QWidget* mainWindow = QApplication::activeWindow()) { QRect mainGeom = mainWindow->geometry(); move(mainGeom.x() + (mainGeom.width() - width()) / 2, mainGeom.y() + (mainGeom.height() - height()) / 2+ 15); } adjustPosition(this); // 调用内部调整逻辑 } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/cloudmodelconfigwidget.h000066400000000000000000000153161520576575000274520ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef CLOUDMODELCONFIGWIDGET_H #define CLOUDMODELCONFIGWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cloudmodelitem.h" #include "modelconfigdialog.h" #include "modelordermanager.h" #include "kaglobal.h" #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include #include #include #include #include using namespace std; using namespace kdk; using namespace kyai::config::model; class CloudModelConfigWidget : public QDialog { Q_OBJECT friend class ModelConfigDialog; public: explicit CloudModelConfigWidget(QWidget *parent = nullptr); ~CloudModelConfigWidget(); void initLayout(); void initModelTitleLayout(); void initModellayout(); ModelStatus getModelStatus(QString modelName); void showCentered(); signals: void sigSetSelectCloudModel(AiCapability capability, QString modelName); public slots: void onEditModelItem(AiCapability capability, QString modelName); void onDeleteModelItem(AiCapability capability, QString modelName); protected: bool eventFilter(QObject *watched, QEvent *event) override; private slots: void nlpAddModelItem(); void visionAddModelItem(); void speechAddModelItem(); private: // 从sdk加载数据 void loadModelConfig(); // 信号槽 void initConnect(); // 添加模型 void addModelItem(PublicCloudModel model); void loadModels(); void loadNoFreeModels(); void processModelInfo(std::vector& models, AiCapability aiCapability); bool keyIsEmpty(const QString& modelName); void loadFreeTrialModels(); void loadFreeTrialModelItem(PublicCloudModel model, bool isSelected); // 加载模型 void loadModelItem(PublicCloudModel model, QString curSelectedName); // 删除模型 void deleteModelItem(AiCapability capability, QString modelName); // 切换选中模型 void switchModelItem(AiCapability capability, QString modelName); // 设置选中模型 bool setSelectCloudModelConfig(PublicCloudModel model); // 设置选中模型名称 bool setSelectCloudModelName(AiCapability capability, DeployType deployType, QString modelName); // 编辑选中模型 // 返回值表示是否需要关闭当前正在编辑的窗口 bool editSelectCloudModel(PublicCloudModel model, bool isContinuousSelected, bool isRealTimeSelected, bool isValueChanged, QDialog *parentDialog); // 点击模型 void clickCloudModel(AiCapability capability, QString modelName); // 恢复模型key默认值 bool clearModelMultiAuths(AiCapability capability, QString modelName); // 检查该模型是否已选择 bool checkModelSelection(AiCapability capability, QString modelName); // 授权弹窗 bool polkit(); // 获取ModelItemMap QMap& getModelItemMap(AiCapability capability); private: QVBoxLayout *m_mainVLayout = nullptr; QHBoxLayout *m_titleHLayout = nullptr; QLabel *m_iconLabel = nullptr; QLabel *m_cloudLabel = nullptr; kdk::KLabel *m_descripLabel = nullptr; QVBoxLayout *m_cloudHLayout = nullptr; QVBoxLayout *m_vLeftLayout = nullptr; QVBoxLayout *m_baseVLayout = nullptr; QScrollArea *m_scrollArea = nullptr; QWidget *m_scrollWidget = nullptr; QVBoxLayout *m_scrollVLayout = nullptr; //NLP大语言模型 QWidget *m_nlpWidget = nullptr; QVBoxLayout *m_nlpDescVLayout = nullptr; QHBoxLayout *m_nlpHLayout = nullptr; QVBoxLayout *m_nlpVLayout = nullptr; QLabel * m_nlpLabel = nullptr; kdk::KLabel * m_nlpDescLabel = nullptr; KBorderlessButton *m_nlpAddButton = nullptr; // VISION视觉模型 QWidget *m_visionWidget = nullptr; QVBoxLayout *m_visionDescVLayout = nullptr; QHBoxLayout *m_visionHLayout = nullptr; QVBoxLayout *m_visionVLayout = nullptr; QLabel *m_visionLabel = nullptr; kdk::KLabel *m_visionDescrLabel = nullptr; KBorderlessButton *m_visionAddButton = nullptr; // SPEECH语音模型 QWidget *m_speechWidget = nullptr; QVBoxLayout *m_speechDescVlayout =nullptr; QHBoxLayout *m_speechHLayout = nullptr; QVBoxLayout *m_speechVLayout = nullptr; QLabel * m_speechLabel = nullptr; kdk::KLabel * m_speechDescLabel = nullptr; KBorderlessButton *m_speechAddButton = nullptr; // 确定按钮 QWidget *m_confirmWidget = nullptr; QPushButton *m_confirmButton = nullptr; QHBoxLayout *m_confirmButtoLayout = nullptr; public: QMap m_nlpModelMap; QMap m_visionModelMap; QMap m_speechModelMap; QMap m_nlpModelItemMap; QMap m_visionModelItemMap; QMap m_speechModelItemMap; QList m_nlpModelItemList; QList m_visionModelItemList; QList m_speechModelItemList; QMap m_nlpModelMapUI; QMap m_visionModelMapUI; QMap m_speechModelMapUI; SettingGroup *m_nlpModelGroup = nullptr; SettingGroup *m_visionModelGroup = nullptr; SettingGroup *m_speechModelGroup = nullptr; SettingGroup *m_freeTrialModelGroup = nullptr; QString nlpSelectedModel; QString visionSelectedModel; QString speechSelectedModel; bool continuousSelected = false; bool realtimeSelected = false; ModelOrderManager m_modelOrderManager; }; #endif // CLOUDMODELCONFIGWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/cloudmodelitem.cpp000066400000000000000000000104611520576575000262660ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "cloudmodelitem.h" ModelItem::ModelItem(kyai::config::model::AiCapability capability, QString modelName, bool isTrialAccount, QWidget *parent) : QWidget(parent), m_capability(capability), m_modelName(modelName), m_isTrialAccount(isTrialAccount) { initLayout(); if (!m_isTrialAccount) { initMenu(); } } ModelItem::~ModelItem() {} void ModelItem::initLayout() { initNameLabel(); if (!m_isTrialAccount) { initMoreButton(); } initSelectedIconLabel(); QFrame *frame = new QFrame(this); frame->setAccessibleName("kylin-ai-subsystem-modelconfig_QFrame_frame"); frame->setFixedSize(16,16); QHBoxLayout *frameLayout = new QHBoxLayout(frame); frameLayout->setContentsMargins(0, 0, 0, 0); frame->setLayout(frameLayout); frameLayout->addWidget(m_selectedIconLabel); m_selectedIconLabel->setVisible(false); QHBoxLayout *hLayout = new QHBoxLayout(this); hLayout->setContentsMargins(16, 10, 16, 10); hLayout->addWidget(m_nameLabel); hLayout->addStretch(); if (!m_isTrialAccount) { hLayout->addWidget(m_moreButton); } hLayout->addWidget(frame); this->setLayout(hLayout); } void ModelItem::initNameLabel() { m_nameLabel = new QLabel(this); m_nameLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_nameLabel"); m_nameLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); m_nameLabel->setText(m_modelName); } void ModelItem::initMoreButton() { m_moreButton = new QToolButton(this); m_moreButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QToolButton_m_moreButton"); m_moreButton->setFixedSize(38, 38); m_moreButton->setProperty("useButtonPalette", true); m_moreButton->setAutoRaise(true); m_moreButton->setPopupMode(QToolButton::InstantPopup); m_moreButton->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); m_moreButton->setFocusPolicy(Qt::NoFocus); } void ModelItem::initSelectedIconLabel() { m_selectedIconLabel = new QLabel(); m_selectedIconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_selectedIconLabel"); QIcon selectIcon = QIcon::fromTheme("ukui-selected"); m_selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); const QByteArray id(THEME_QT_SCHEMA); QGSettings *mQtSettings = new QGSettings(id, QByteArray(), this); connect(mQtSettings, &QGSettings::changed, this, [=](QString key) { if (key == "iconThemeName") m_selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); }); } void ModelItem::initMenu() { m_menu = new QMenu(); m_menu->setAccessibleName("kylin-ai-subsystem-modelconfig_QMenu_m_menu"); m_moreButton->setMenu(m_menu); QAction *actionEdit = new QAction(QIcon::fromTheme("document-edit-symbolic"), tr("Edit")); //actionEdit->setDisabled(true); connect(actionEdit, &QAction::triggered, [this]{Q_EMIT sigEdit(m_capability, m_modelName);}); QAction *actionDelete = new QAction(QIcon::fromTheme("edit-delete-symbolic"), tr("Delete")); connect(actionDelete, &QAction::triggered, [this]{Q_EMIT sigDelete(m_capability, m_modelName);}); m_menu->addAction(actionEdit); m_menu->addAction(actionDelete); } void ModelItem::showSelectedIcon(bool flag) { m_selectedIconLabel->setVisible(flag); } bool ModelItem::isSelected() { return m_selectedIconLabel->isVisible(); } AiCapability ModelItem::getAICapability() { return m_capability; } QString ModelItem::getModelName() { return m_modelName; } bool ModelItem::isTrialModel() { return m_isTrialAccount; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/cloudmodelitem.h000066400000000000000000000040201520576575000257250ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef CLOUDMODELITEM_H #define CLOUDMODELITEM_H #include #include #include #include #include #include #include #include #include #define THEME_QT_SCHEMA "org.ukui.style" using namespace std; using namespace kyai::config::model; class ModelItem : public QWidget { Q_OBJECT public: explicit ModelItem(AiCapability capability, QString modelName, bool isTrialAccount, QWidget *parent = nullptr); ~ModelItem(); void showSelectedIcon(bool flag); bool isSelected(); AiCapability getAICapability(); QString getModelName(); bool isTrialModel(); signals: void sigEdit(AiCapability capability, QString modelName); void sigDelete(AiCapability capability, QString modelName); private slots: private: void initLayout(); void initNameLabel(); void initMoreButton(); void initSelectedIconLabel(); void initMenu(); QLabel *m_nameLabel = nullptr; // 模型名称 QToolButton *m_moreButton = nullptr; // 更多 QMenu *m_menu = nullptr; // 菜单 QLabel *m_selectedIconLabel = nullptr;// 已选择状态 kyai::config::model::AiCapability m_capability; QString m_modelName; bool m_isTrialAccount; }; #endif // CLOUDMODELITEM_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/kaglobal.cpp000066400000000000000000000027771520576575000250470ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "kaglobal.h" QUrl kaglobal::openLink = QUrl(QString("https://docs.openkylin.top/zh/07_%E5%85%B3%E4%BA%8E%E7%A4%BE%E5%8C%BA/" "%E7%A4%BE%E5%8C%BA%E5%B9%B3%E5%8F%B0%E4%BB%8B%E7%BB%8D/AI%E6%A8%A1%E5%9E%8B%E8%B4%A6%E5%8F%B7%E8%8E%B7%E5%8F%96%E5%8F%8A%E9%85%8D%E7%BD%AE%E6%8C%87%E5%8D%97")); QString kaglobal::ondeviceModelInstallPath = "/usr/share/kylin-ai/model-repository/qwen_fastllm/1/qwen2.5_3b_int4g.flm"; QString kaglobal::aiAssistantPkgName = "kylin-aiassistant"; QString kaglobal::aiAssistantMinVersion = "2.0.0.0-0k2.26"; QString kaglobal::aiNotePkgName = "kylin-note"; QString kaglobal::aiNoteMinVersion = "1.0.0.1-0k2.15"; QString kaglobal::launchpadUrl = "archive.launchpad.dev"; QString kaglobal::archiveUrl = "archive2.kylinos.cn"; QString kaglobal::baiduUrl = "www.baidu.com"; kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/kaglobal.h000066400000000000000000000051721520576575000245040ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef KAGLOBAL_H #define KAGLOBAL_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include #include #include #include #include using namespace kyai::config::model; typedef struct { AiCapability capability; QString vendor; QString modelName; std::vector multiAuths; } PublicCloudModel; typedef struct { AiCapability capability; QString vendor; QString modelName; std::vector multiAuths; QString debName; } PublicLocalModel; typedef struct { AiCapability capability; QString vendor; QString modelName; QString modelVersion; QString apiKey; QString apiUrl; std::vector multiAuths; } PrivateModel; enum LocalModelInstallStatus { InstallSuccess, RebootLater, Uninstall, Downloding, }; enum PkgInstallStatus { PkgNotFound, PkgFoundNotInstall, PkgFoundNewVersion, PkgLastestVersion }; class kaglobal { public: static QUrl openLink; // 帮助文档链接 static QString ondeviceModelInstallPath; static QString aiAssistantPkgName; static QString aiAssistantMinVersion; static QString aiNotePkgName; static QString aiNoteMinVersion; static QString launchpadUrl; static QString archiveUrl; static QString baiduUrl; }; #endif // KAGLOBAL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/000077500000000000000000000000001520576575000241665ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/interface.pri000066400000000000000000000003611520576575000266420ustar00rootroot00000000000000INCLUDEPATH += $$PWD $$PWD/interface QT += dbus CONFIG += link_pkgconfig PKGCONFIG += kysdk-diagnostics SOURCES += \ $$PWD/interface/ukcccommon.cpp HEADERS += \ $$PWD/interface/interface.h \ $$PWD/interface/ukcccommon.h kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/interface/000077500000000000000000000000001520576575000261265ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/interface/interface.h000066400000000000000000000044531520576575000302450ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef INTERFACE_H #define INTERFACE_H #include #include #include "libukcc_global.h" class QString; class QWidget; class QStringLiteral; enum FunType { ACCOUNT, SYSTEM, DEVICES, NETWORK, PERSONALIZED, DATETIME, UPDATE, SECURITY, APPLICATION, SEARCH_F, COMMONINFO, TOTALMODULES, }; class LIBUKCC_EXPORT CommonInterface{ public: virtual ~CommonInterface(){} virtual QString plugini18nName() = 0; // 插件名字 virtual int pluginTypes() = 0; // 插件类型 virtual QWidget * pluginUi() = 0; // 插件主界面 virtual bool isShowOnHomePage() const = 0; // 是否显示在首页 virtual QIcon icon() const = 0; // 图标 virtual bool isEnable() const = 0; // 插件是否启用 virtual const QString name() const = 0; // 模块名称 virtual QString translationPath() const { // 获取多语言文件路径,用于搜索 return QStringLiteral("/usr/share/ukui-control-center/shell/res/i18n/%1.ts"); } QPushButton *pluginBtn = nullptr; bool isIntel(){ QString sysVersion = "/etc/apt/ota_version"; QFile file(sysVersion); return file.exists(); } virtual void plugin_leave() { return ; } }; #define CommonInterface_iid "org.ukcc.CommonInterface" Q_DECLARE_INTERFACE(CommonInterface, CommonInterface_iid) #endif // INTERFACE_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/interface/ukcccommon.cpp000066400000000000000000000305351520576575000307760ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "ukcccommon.h" #include #include #include #include #include #include #include #define KWIN_SERVICE "org.ukui.KWin" #define KWIN_PATH "/Compositor" #define KWIN_INTERFACE "org.ukui.kwin.Compositing" using namespace ukcc; UkccCommon::UkccCommon() { } UkccCommon::~UkccCommon() { } void UkccCommon::centerToScreen(QWidget* widget) { if (!widget) return; QDesktopWidget* m = QApplication::desktop(); QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos())); int desk_x = desk_rect.width(); int desk_y = desk_rect.height(); int x = widget->width(); int y = widget->height(); widget->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 2 - y / 2 + desk_rect.top()); } QVariantMap UkccCommon::getModuleHideStatus() { QDBusInterface m_interface( "org.ukui.ukcc.session", "/", "org.ukui.ukcc.session.interface", QDBusConnection::sessionBus()); QDBusReply obj_reply = m_interface.call("getModuleHideStatus"); if (!obj_reply.isValid()) { qDebug()<<"execute dbus method getModuleHideStatus failed"; } return obj_reply.value(); } QString UkccCommon::getCpuInfo() { QFile file("/proc/cpuinfo"); if (file.open(QIODevice::ReadOnly)) { QString buffer = file.readAll(); QStringList modelLine = buffer.split('\n').filter(QRegularExpression("^model name")); QStringList modelLineWayland = buffer.split('\n').filter(QRegularExpression("^Hardware")); QStringList lines = buffer.split('\n'); if (modelLine.isEmpty()) { if (modelLineWayland.isEmpty()) { return "Unknown"; } modelLine = modelLineWayland; } int count = lines.filter(QRegularExpression("^processor")).count(); QString result; result.append(modelLine.first().split(':').at(1)); result = result.trimmed(); return result; } return QString(); } QString UkccCommon::getCpuArchitecture() { QString cpuArchitecture; // 设置系统环境变量 QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("LANG","en_US"); QProcess *process = new QProcess; process->setProcessEnvironment(env); process->start("lscpu"); process->waitForFinished(); QByteArray ba = process->readAllStandardOutput(); delete process; QString cpuinfo = QString(ba.data()); QStringList cpuinfo_list = cpuinfo.split("\n"); for (int i = 0; i < cpuinfo_list.count(); i++) { QString mstring = cpuinfo_list.at(i); if (mstring.contains("Architecture")) { // 去除空格 mstring = mstring.remove(QRegExp("\\s")); QStringList list = mstring.split(":"); cpuArchitecture = list.at(1); break; } } return cpuArchitecture; } bool UkccCommon::isSupportsEffect() { QDBusInterface kwin("org.ukui.KWin", "/Effects", "org.ukui.kwin.Effects", QDBusConnection::sessionBus()); QDBusReply res = kwin.call("isEffectSupported", "blur"); return res; } void UkccCommon::setKwinMouseSize(int size) { QString filename = QDir::homePath() + "/.config/kcminputrc"; QSettings *mouseSettings = new QSettings(filename, QSettings::IniFormat); mouseSettings->beginGroup("Mouse"); mouseSettings->setValue("cursorSize", size); mouseSettings->endGroup(); delete mouseSettings; mouseSettings = nullptr; QDBusMessage message = QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "notifyChange"); QList args; args.append(5); args.append(0); message.setArguments(args); QDBusConnection::sessionBus().send(message); } bool UkccCommon::isWayland() { QString sessionType = getenv("XDG_SESSION_TYPE"); if (!sessionType.compare("wayland", Qt::CaseSensitive)) { return true; } else { return false; } } bool UkccCommon::isOpenkylin() { QString systemName = QString(QLatin1String(kdk_system_get_systemName())); if (systemName.compare("openkylin", Qt::CaseInsensitive) == 0) { return true; } return false; } bool UkccCommon::isCommunity() { QString filename = "/etc/os-release"; QSettings osSettings(filename, QSettings::IniFormat); QString versionID = osSettings.value("VERSION_ID").toString(); if (versionID.compare("22.04", Qt::CaseSensitive)) { return false; } return true; } QRect UkccCommon::sizeOnCursor() { QDesktopWidget* m = QApplication::desktop(); QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos())); return desk_rect; } bool UkccCommon::isTablet() { QString projectName = QString(QLatin1String(kdk_system_get_projectSubName())); if (projectName.compare("mavis", Qt::CaseInsensitive) == 0) { return true; } return false; } bool UkccCommon::isExitBattery() { /* 默认机器没有电池 */ bool hasBat = false; QDBusInterface *brightnessInterface = new QDBusInterface("org.freedesktop.UPower", "/org/freedesktop/UPower/devices/DisplayDevice", "org.freedesktop.DBus.Properties", QDBusConnection::systemBus()); if (!brightnessInterface->isValid()) { qDebug() << "Create UPower Interface Failed : " << QDBusConnection::systemBus().lastError(); return false; } QDBusReply briginfo; briginfo = brightnessInterface ->call("Get", "org.freedesktop.UPower.Device", "PowerSupply"); if (briginfo.value().toBool()) { hasBat = true ; } delete brightnessInterface; return hasBat; } QString UkccCommon::getHostName() { QString hostname; // 设置系统环境变量 QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("LANG","en_US"); QProcess *process = new QProcess; process->setProcessEnvironment(env); process->start("hostname"); process->waitForFinished(); QByteArray ba = process->readAllStandardOutput(); delete process; hostname = ba.data(); hostname.replace(QString("\n"),QString("")); return hostname; } bool UkccCommon::isZJY() { QString filename = "/etc/os-release"; QSettings osSettings(filename, QSettings::IniFormat); QString versionID = osSettings.value("PROJECT_CODENAME").toString(); if (versionID.compare("v10sp1-zyj", Qt::CaseSensitive)) { return false; } return true; } bool UkccCommon::buriedSettings(QString pluginName, QString settingsName, QString action, QString value) { // 埋点数据 char appName[] = "ukui-control-center"; QByteArray actiontr = action.toLocal8Bit(); // toLocal8Bit 支持中文 char *messageType = actiontr.data(); KBuriedPoint pt[3]; pt[0].key = "pluginName"; std::string pluginStr = pluginName.toStdString(); pt[0].value = pluginStr.c_str(); pt[1].key = "settingsName"; std::string settingStr = settingsName.toStdString(); pt[1].value = settingStr.c_str(); pt[2].key = "value"; std::string valueStr = value.toStdString(); pt[2].value = valueStr.c_str(); if (kdk_buried_point(appName , messageType , pt , 3) == -1) { qDebug() << __FUNCTION__ << "messageType:" << action << "pluginName:" << pluginName << "settingsName:" << settingsName << "value:" << value << "buried point fail !" << __LINE__; return false; } return true; } QString UkccCommon::boolToString(bool b) { if (b) { return QString("true"); } else { return QString("false"); } } QString UkccCommon::getUkccVersion() { FILE *pp = NULL; char *line = NULL; size_t len = 0; ssize_t read; char *q = NULL; QString version = "none"; pp = popen("dpkg -l ukui-control-center | grep ukui-control-center", "r"); if(NULL == pp) return version; while((read = getline(&line, &len, pp)) != -1){ q = strrchr(line, '\n'); *q = '\0'; QString content = line; QStringList list = content.split(" "); list.removeAll(""); if (list.size() >= 3) version = list.at(2); } free(line); line = NULL; pclose(pp); return version; } bool UkccCommon::checkCompositorRunning() { QDBusInterface dbus_iface (KWIN_SERVICE, KWIN_PATH, KWIN_INTERFACE, QDBusConnection::sessionBus()); QVariant reply = dbus_iface.property ("active"); bool isfoundCompositingManger = false; if (reply.toBool()) { isfoundCompositingManger = true; } if(!isfoundCompositingManger) { if(QGSettings::isSchemaInstalled("org.gnome.metacity")) { QProcess process; process.start("sh -c \"ps -e |grep metacity\""); if(process.waitForStarted(100)&&process.waitForFinished(100) && process.readAllStandardOutput().contains("metacity")) { QGSettings metacityGSettings("org.gnome.metacity", "/org/gnome/metacity/"); isfoundCompositingManger = metacityGSettings.get("compositing-manager").toBool(); } } } if(!isfoundCompositingManger) { if(QGSettings::isSchemaInstalled("org.mate.Marco.general")) { QProcess process; process.start("sh -c \"ps -e |grep marco\""); if(process.waitForStarted(100)&&process.waitForFinished(100) && process.readAllStandardOutput().contains("marco")) { QGSettings marcoGSettings("org.mate.Marco.general", "/org/mate/marco/general/"); isfoundCompositingManger = marcoGSettings.get("compositing-manager").toBool(); } } } return isfoundCompositingManger; } QString UkccCommon::getProductName() { QDBusInterface ifc("com.control.center.qt.systemdbus", "/", "com.control.center.interface", QDBusConnection::systemBus()); QDBusReply res = ifc.call("getDmiDecodeRes", "-s system-product-name"); return res.value().trimmed(); } QString UkccCommon::getGpuName() { QProcess process; QString gpuName; QString cmd = QString("lshw -C display"); process.start(cmd); process.waitForFinished(); QByteArray ba = process.readAllStandardOutput(); QStringList result = QString::fromStdString(ba.toStdString()).split("\n"); for (QString line : result) { if (line.contains("product")) { gpuName = line.split(":").at(1); } } qDebug() << Q_FUNC_INFO << gpuName.trimmed(); return gpuName.trimmed(); } bool UkccCommon::isHuawei() { return (getCpuInfo().contains("HUAWEI", Qt::CaseInsensitive) || getCpuInfo().contains("PANGU", Qt::CaseInsensitive)) && isWayland(); } /* * 判断用户是否为域用户 * 和/etc/passwd文件中用户做对比 * 1:域用户,0:非域用户 */ bool UkccCommon::isDomainUser(const char* username) { FILE *fp; fp=fopen("/etc/passwd","r"); if(fp == NULL) { return true; } char buf[1024], name[128]; while(!feof(fp)) { if(fgets(buf,sizeof (buf),fp) == NULL) { break; } sscanf(buf,"%[^:]",name); if(strcmp(name,username) == 0) { fclose(fp); return false; } } fclose(fp); return true; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/interface/ukcccommon.h000066400000000000000000000115511520576575000304400ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef UKCCCOMMON_H #define UKCCCOMMON_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libukcc_global.h" namespace ukcc { /** * @brief 提供判断、获取信息等功能性接口 * */ class LIBUKCC_EXPORT UkccCommon : public QObject { Q_OBJECT public: /** * @brief * */ explicit UkccCommon(); /** * @brief * */ ~UkccCommon(); public: /** * @brief 将 widget 移动到屏幕中间 * * @param widget 需要移动的窗口 */ static void centerToScreen(QWidget *widget); /** * @brief 获取鼠标所在屏幕大小 * * @return 鼠标所在屏幕大小 */ static QRect sizeOnCursor(); /** * @brief 根据 ukui-control-center-security-config.json 获取插件隐藏状态 * * @return QVariantMap 插件隐藏状态列表 */ static QVariantMap getModuleHideStatus(); /** * @brief 获取 CPU 信息 * * @return QString */ static QString getCpuInfo(); /** * @brief 获取 CPU 架构 * * @return QString CPU 架构 */ static QString getCpuArchitecture(); /** * @brief 是否存在电池 * * @return bool 是:true,否:false */ static bool isExitBattery(); /** * @brief set kwin cursorSize * * @param size 大小 */ static void setKwinMouseSize(int size); /** * @brief 是否 wayland * * @return bool 是:true,否:false */ static bool isWayland(); /** * @brief 是否 openkylin * * @return bool 是:true,否:false */ static bool isOpenkylin(); /** * @brief 是否 22.04 社区版 * * @return bool 是:true,否:false */ static bool isCommunity(); /** * @brief 是否 mavis 平板 * * @return bool 是:true,否:false */ static bool isTablet(); /** * @brief 是否 v10sp1-zyj * * @return bool 是:true,否:false */ static bool isZJY(); /** * @brief 获取主机名 * * @return QString hostname */ static QString getHostName(); /** * @brief 埋点 * * @param pluginName 插件名 * @param settingsName 设置名 * @param action 操作 * @param value 设置的值 * @return bool 是否埋点成功 */ static bool buriedSettings(QString pluginName, QString settingsName, QString action, QString value = nullptr); /** * @brief bool 转换为 string * * @param b true or false * @return QString "true" or "false" */ static QString boolToString(bool b); /** * @brief 获取控制面板版本 * * @return QString 版本号 */ static QString getUkccVersion(); /** * @brief * * @return bool 是:true,否:false */ static bool checkCompositorRunning(); /** * @brief 获取system-product-name * * @return QString system-product-name */ static QString getProductName(); /** * @brief 是否支持特效模式 * * @return bool 是:true,否:false */ static bool isSupportsEffect(); /** * @brief 获取GPU * * @return QString gpuName */ static QString getGpuName(); /** * @brief 判断是否华为 * * @return bool 是:true,否:false */ static bool isHuawei(); /** * @brief 判断用户是否为域用户, 和/etc/passwd文件中用户做对比 * @param username * @return bool 域用户:true,非域用户:false */ static bool isDomainUser(const char* username); }; } #endif // UKCCCOMMON_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/libukcc_global.h000066400000000000000000000016321520576575000272750ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef LIBUKCC_GLOBAL_H #define LIBUKCC_GLOBAL_H #include #if defined(LIBUKCC_LIBRARY) # define LIBUKCC_EXPORT Q_DECL_EXPORT #else # define LIBUKCC_EXPORT Q_DECL_IMPORT #endif #endif // LIBUKCC_GLOBAL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/000077500000000000000000000000001520576575000264415ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/plugin-test.pro000066400000000000000000000011111520576575000314300ustar00rootroot00000000000000QT += widgets TEMPLATE = lib CONFIG += plugin \ link_pkgconfig LIBS += -lukcc TARGET = $$qtLibraryTarget(plugin-test) target.path = $$[QT_INSTALL_LIBS]/ukui-control-center TRANSLATIONS += translations/zh_CN.ts isEmpty(PREFIX) { PREFIX = /usr } qm_files.path = $${PREFIX}/share/plugin-test/translations qm_files.files = translations/* CONFIG(release, debug|release) { !system($$PWD/translate_generation.sh): error("Failed to generate translation") } INSTALLS += target \ qm_files \ HEADERS += \ ukccplugin.h SOURCES += \ ukccplugin.cpp kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/translate_generation.sh000077500000000000000000000005221520576575000332070ustar00rootroot00000000000000#!/bin/bash ts_list=(`ls translations/*.ts`) source /etc/os-release version=(`echo $ID`) for ts in "${ts_list[@]}" do printf "\nprocess ${ts}\n" if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then lrelease-qt5 "${ts}" else lrelease "${ts}" fi done kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/translations/000077500000000000000000000000001520576575000311625ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/translations/zh_CN.ts000066400000000000000000000013071520576575000325340ustar00rootroot00000000000000 UkccPlugin UkccPlugin 测试插件 /UkccPlugin/UkccPlugin ukccplugin test 插件翻译测试 /UkccPlugin/ukccplugin test kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/ukccplugin.cpp000066400000000000000000000037321520576575000313160ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "ukccplugin.h" #include UkccPlugin::UkccPlugin() : mFirstLoad(true) { QTranslator *translator = new QTranslator(this); translator->load("/usr/share/plugin-test/translations/" + QLocale::system().name()); QApplication::installTranslator(translator); pluginName = tr("UkccPlugin"); pluginType = SYSTEM; } UkccPlugin::~UkccPlugin() { } QString UkccPlugin::plugini18nName() { return pluginName; } int UkccPlugin::pluginTypes() { return pluginType; } QWidget *UkccPlugin::pluginUi() { // 需要加上这个判断标志位,否则每次点击都会新建一个QWidget(只加载一次) if (mFirstLoad) { widget = new QWidget; mFirstLoad = false; } return widget; } bool UkccPlugin::isEnable() const { return true; } const QString UkccPlugin::name() const { return QStringLiteral("UkccPlugin"); } bool UkccPlugin::isShowOnHomePage() const { return true; } QIcon UkccPlugin::icon() const { return QIcon(); } QString UkccPlugin::translationPath() const { return "/usr/share/plugin-test/translations/%1.ts"; } void UkccPlugin::initSearchText() { //~ contents_path /UkccPlugin/UkccPlugin tr("UkccPlugin"); //~ contents_path /UkccPlugin/ukccplugin test tr("ukccplugin test"); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/plugin-test/ukccplugin.h000066400000000000000000000032511520576575000307570ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef UKCCPLUGIN_H #define UKCCPLUGIN_H #include #include #include #include #include #include #include class UkccPlugin : public QObject, CommonInterface { Q_OBJECT Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface") Q_INTERFACES(CommonInterface) public: UkccPlugin(); ~UkccPlugin(); QString plugini18nName() Q_DECL_OVERRIDE; int pluginTypes() Q_DECL_OVERRIDE; QWidget *pluginUi() Q_DECL_OVERRIDE; bool isEnable() const Q_DECL_OVERRIDE; const QString name() const Q_DECL_OVERRIDE; bool isShowOnHomePage() const Q_DECL_OVERRIDE; QIcon icon() const Q_DECL_OVERRIDE; QString translationPath() const Q_DECL_OVERRIDE; private: QString pluginName; int pluginType; QWidget *widget; bool mFirstLoad; private: void initSearchText(); // 搜索翻译 }; #endif // UKCCPLUGIN_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets.pri000066400000000000000000000001511520576575000263450ustar00rootroot00000000000000INCLUDEPATH += $$PWD include(widgets/Label/label.pri) include(widgets/SettingWidget/settingwidget.pri) kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/000077500000000000000000000000001520576575000256345ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/000077500000000000000000000000001520576575000266535ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/fixlabel.cpp000066400000000000000000000032341520576575000311470ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "fixlabel.h" #include #include FixLabel::FixLabel(QWidget *parent): QLabel(parent) { } FixLabel::FixLabel(QString text , QWidget *parent): QLabel(parent) { this->setText(text); } FixLabel::~FixLabel() { } void FixLabel::paintEvent(QPaintEvent *event) { QFontMetrics fontMetrics(this->font()); int fontSize = fontMetrics.horizontalAdvance(mStr); if (fontSize > this->width()) { this->setText(fontMetrics.elidedText(mStr, Qt::ElideRight, this->width()), false); this->setToolTip(mStr); } else { this->setText(mStr, false); this->setToolTip(""); } QLabel::paintEvent(event); } void FixLabel::setText(const QString & text, bool saveTextFlag) { if (saveTextFlag) mStr = text; QLabel::setText(text); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/fixlabel.h000066400000000000000000000025311520576575000306130ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef FIXLABEL_H #define FIXLABEL_H #include #include "libukcc_global.h" //文本长自动省略并添加悬浮 class LIBUKCC_EXPORT FixLabel : public QLabel { Q_OBJECT public: explicit FixLabel(QWidget *parent = nullptr); explicit FixLabel(QString text, QWidget *parent = nullptr); ~FixLabel(); void setText(const QString &text, bool saveTextFlag = true); protected: void paintEvent(QPaintEvent *event); private: QString mStr; }; #endif // FIXLABEL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/iconlabel.cpp000066400000000000000000000017651520576575000313200ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "iconlabel.h" #include IconLabel::IconLabel(QWidget *parent): QLabel(parent) { } void IconLabel::enterEvent(QEnterEvent * event){ Q_EMIT enterWidget(); QLabel::enterEvent(event); } void IconLabel::leaveEvent(QEvent *event){ Q_EMIT leaveWidget(); QLabel::leaveEvent(event); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/iconlabel.h000066400000000000000000000021471520576575000307600ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef ICONLABEL_H #define ICONLABEL_H #include #include #include #include "libukcc_global.h" class LIBUKCC_EXPORT IconLabel : public QLabel { Q_OBJECT public: IconLabel(QWidget *parent = nullptr); protected: virtual void leaveEvent(QEvent * event); virtual void enterEvent(QEnterEvent * event); Q_SIGNALS: void enterWidget(); void leaveWidget(); }; #endif // ICONLABEL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/label.pri000066400000000000000000000006351520576575000304520ustar00rootroot00000000000000INCLUDEPATH += $$PWD SOURCES += \ $$PWD/fixlabel.cpp \ $$PWD/iconlabel.cpp \ $$PWD/lightlabel.cpp \ $$PWD/passwordlabel.cpp \ $$PWD/titlelabel.cpp \ $$PWD/tristatelabel.cpp HEADERS += \ $$PWD/fixlabel.h \ $$PWD/iconlabel.h \ $$PWD/lightlabel.h \ $$PWD/passwordlabel.h \ $$PWD/titlelabel.h \ $$PWD/tristatelabel.h \ kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/lightlabel.cpp000066400000000000000000000021771520576575000314750ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "lightlabel.h" LightLabel::LightLabel(QWidget *parent): FixLabel(parent) { } LightLabel::LightLabel(QString text , QWidget *parent): FixLabel(parent) { this->setText(text); } LightLabel::~LightLabel() { } void LightLabel::paintEvent(QPaintEvent *event) { QPalette paltte; paltte.setColor(QPalette::WindowText, paltte.placeholderText().color()); this->setPalette(paltte); FixLabel::paintEvent(event); return; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/lightlabel.h000066400000000000000000000021101520576575000311250ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef LIGHTLABEL_H #define LIGHTLABEL_H #include #include "libukcc_global.h" #include "fixlabel.h" class LIBUKCC_EXPORT LightLabel : public FixLabel { Q_OBJECT public: explicit LightLabel(QWidget *parent = nullptr); explicit LightLabel(QString text , QWidget *parent = nullptr); ~LightLabel(); protected: void paintEvent(QPaintEvent *event); }; #endif // LIGHTLABEL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/passwordlabel.cpp000066400000000000000000000102161520576575000322210ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "passwordlabel.h" #include #include #include #include #include #define THEME_QT_SCHEMA "org.ukui.style" #define MODE_QT_KEY "style-name" EyeBtn::EyeBtn(QWidget *parent) :QLabel(parent) { this->setPixmap(QIcon::fromTheme("ukui-eye-hidden-symbolic").pixmap(24,24)); this->setProperty("useIconHighlightEffect", 0x2); this->setFixedSize(36, 36); this->setAlignment(Qt::AlignCenter); } EyeBtn::~EyeBtn() { } void EyeBtn::setIconStatus(bool isHidden) { if (isHidden) { this->setPixmap(QIcon::fromTheme("ukui-eye-hidden-symbolic").pixmap(24,24)); } else { this->setPixmap(QIcon::fromTheme("ukui-eye-display-symbolic").pixmap(24,24)); } mIsHidden = isHidden; } void EyeBtn::mousePressEvent(QMouseEvent * event) { } void EyeBtn::mouseReleaseEvent(QMouseEvent *event) { setIconStatus(!mIsHidden); Q_EMIT clicked(mIsHidden); } PasswordLabel::PasswordLabel(QWidget *parent) :QWidget(parent) { mPassword = new QLineEdit(this); mPassword->setEnabled(false); mPassword->setEchoMode(QLineEdit::Password); mPassword->installEventFilter(this); QPalette palette = mPassword->palette(); QColor color = palette.color(QPalette::Active, QPalette::Text); palette.setColor(QPalette::Disabled, QPalette::Button, Qt::transparent); palette.setColor(QPalette::Disabled, QPalette::Text, color); mPassword->setPalette(palette); mPassword->setContentsMargins(0,0,0,0); mPassword->setMinimumWidth(0); mEyesBtn = new EyeBtn(this); QHBoxLayout *mainHLayout = new QHBoxLayout(); mainHLayout->setContentsMargins(0,0,0,0); mainHLayout->setSpacing(0); mainHLayout->addWidget(mPassword); mainHLayout->addWidget(mEyesBtn); mainHLayout->addStretch(); this->setLayout(mainHLayout); const QByteArray idd(THEME_QT_SCHEMA); QGSettings *qtSettings = new QGSettings(idd, QByteArray(), this); connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { if (key == "styleName") { QPalette textPal = mEyesBtn->palette(); QColor color1 = textPal.color(QPalette::Active, QPalette::Text); textPal.setColor(QPalette::Disabled, QPalette::Button, Qt::transparent); textPal.setColor(QPalette::Disabled, QPalette::Text, color1); mPassword->setPalette(textPal); } }); connect(mEyesBtn, &EyeBtn::clicked, this, [=](bool isHidden){ if (isHidden) { mPassword->setEchoMode(QLineEdit::Password); } else { mPassword->setEchoMode(QLineEdit::Normal); } }); } PasswordLabel::~PasswordLabel() { } void PasswordLabel::setStatus(bool isPassword) { if (isPassword && mPassword->echoMode() == QLineEdit::Normal) { mPassword->setEchoMode(QLineEdit::Password); mEyesBtn->setIconStatus(isPassword); } } void PasswordLabel::setText(const QString &str) { mPassword->setText(str); } QString PasswordLabel::text() const { return mPassword->text(); } void PasswordLabel::paintEvent(QPaintEvent *event) { QFontMetrics fontMetrics(this->font()); if (mPassword->echoMode() == QLineEdit::Password) { QFontInfo fInfo(this->font()); int charWidth = fInfo.pixelSize(); mPassword->setFixedWidth(charWidth*mPassword->text().size() + 16); } else { int fontSize = fontMetrics.horizontalAdvance(mPassword->text()); mPassword->setFixedWidth(fontSize+16); } } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/passwordlabel.h000066400000000000000000000031151520576575000316660ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef PASSWORDLABEL_H #define PASSWORDLABEL_H #include #include #include #include #include #include "libukcc_global.h" class LIBUKCC_EXPORT EyeBtn: public QLabel { Q_OBJECT public: EyeBtn(QWidget *parent = nullptr); ~EyeBtn(); void setIconStatus(bool isHidden); protected: void mousePressEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent *event); private: bool mIsHidden = true; Q_SIGNALS: void clicked(bool isHidden); }; class LIBUKCC_EXPORT PasswordLabel : public QWidget { Q_OBJECT public: PasswordLabel(QWidget *parent = nullptr); ~PasswordLabel(); void setStatus(bool isPassword); void setText(const QString &); QString text() const; protected: void paintEvent(QPaintEvent *event); private: QLineEdit *mPassword; EyeBtn *mEyesBtn; }; #endif // PASSWORDLABEL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/titlelabel.cpp000066400000000000000000000021011520576575000314720ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "titlelabel.h" #include #include #include TitleLabel::TitleLabel(QWidget *parent): QLabel(parent) { this->setContentsMargins(16,0,0,0); } TitleLabel::~TitleLabel() { } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/titlelabel.h000066400000000000000000000021461520576575000311500ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef TITLE_LABEL_H #define TITLE_LABEL_H #include #include "libukcc_global.h" class LIBUKCC_EXPORT TitleLabel : public QLabel { Q_OBJECT public: TitleLabel(QWidget *parent = nullptr); ~TitleLabel(); }; #endif // TITLE_LABEL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/tristatelabel.cpp000066400000000000000000000121101520576575000322110ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "tristatelabel.h" static inline qreal mixQreal(qreal a, qreal b, qreal bias) { return a + (b - a) * bias; } QColor mixColor(const QColor &c1, const QColor &c2, qreal bias) { if (bias <= 0.0) { return c1; } if (bias >= 1.0) { return c2; } if (qIsNaN(bias)) { return c1; } qreal r = mixQreal(c1.redF(), c2.redF(), bias); qreal g = mixQreal(c1.greenF(), c2.greenF(), bias); qreal b = mixQreal(c1.blueF(), c2.blueF(), bias); qreal a = mixQreal(c1.alphaF(), c2.alphaF(), bias); return QColor::fromRgbF(r, g, b, a); } TristateLabel::TristateLabel(const QString &text, QWidget *parent) { setText(abridge(text)); adjustSize(); QPalette pal; QBrush brush = pal.placeholderText(); QColor textColor = brush.color(); QString stringColor = QString("color: rgba(%1,%2,%3,%4)") .arg(textColor.red()) .arg(textColor.green()) .arg(textColor.blue()) .arg(textColor.alphaF()); this->setStyleSheet(stringColor); const QByteArray idd(THEME_QT_SCHEMA); QGSettings *qtSettings = new QGSettings(idd, QByteArray(), this); connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { if ("styleName" == key) { QPalette pal; QBrush brush = pal.placeholderText(); QColor textColor = brush.color(); QString stringColor = QString("color: rgba(%1,%2,%3,%4)") .arg(textColor.red()) .arg(textColor.green()) .arg(textColor.blue()) .arg(textColor.alphaF()); this->setStyleSheet(stringColor); } }); } TristateLabel::~TristateLabel() { } QString TristateLabel::abridge(QString text) { /* 设计要求,部分首页显示插件名和导航显示名不一致*/ if (text == "时间和日期") { text = "时间日期"; } else if (text == "区域语言") { text = "语言"; } return text; } void TristateLabel::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { QPalette pal; QBrush brush = pal.placeholderText(); QColor textColor = brush.color(); QPushButton *button = new QPushButton; QColor highlight = button->palette().color(QPalette::Active, QPalette::Highlight); QColor mix = button->palette().color(QPalette::Active, QPalette::BrightText); textColor = mixColor(highlight, mix, 0.2); QString stringColor = QString("color: rgba(%1,%2,%3,%4)") .arg(textColor.red()) .arg(textColor.green()) .arg(textColor.blue()) .arg(textColor.alphaF()); this->setStyleSheet(stringColor); mClicked = true; } } void TristateLabel::mouseReleaseEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { mClicked = false; QPalette pal; QBrush brush = pal.placeholderText(); QColor textColor = brush.color(); QString stringColor = QString("color: rgba(%1,%2,%3,%4)") .arg(textColor.red()) .arg(textColor.green()) .arg(textColor.blue()) .arg(textColor.alphaF()); this->setStyleSheet(stringColor); Q_EMIT clicked(); } } void TristateLabel::enterEvent(QEnterEvent *e) { Q_UNUSED(e) QPalette pal; QBrush brush = pal.placeholderText(); QColor textColor = brush.color(); QPushButton *button = new QPushButton; QColor highlight = button->palette().color(QPalette::Active, QPalette::Highlight); QColor mix = button->palette().color(QPalette::Active, QPalette::BrightText); textColor = mixColor(highlight, mix, 0.05); QString stringColor = QString("color: rgba(%1,%2,%3,%4)") .arg(textColor.red()) .arg(textColor.green()) .arg(textColor.blue()) .arg(textColor.alphaF()); this->setStyleSheet(stringColor); mMoved = true; } void TristateLabel::leaveEvent(QEvent *e) { Q_UNUSED(e) mMoved = false; QPalette pal; QBrush brush = pal.placeholderText(); QColor textColor = brush.color(); QString stringColor = QString("color: rgba(%1,%2,%3,%4)") .arg(textColor.red()) .arg(textColor.green()) .arg(textColor.blue()) .arg(textColor.alphaF()); this->setStyleSheet(stringColor); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/Label/tristatelabel.h000066400000000000000000000026301520576575000316640ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef TRISTATELABEL_H #define TRISTATELABEL_H #include #include #include #include #define THEME_QT_SCHEMA "org.ukui.style" #define MODE_QT_KEY "style-name" class TristateLabel : public QLabel { Q_OBJECT public: TristateLabel(const QString &text, QWidget *parent); ~TristateLabel(); QString abridge(QString text); // 简写英文多长的应用名称 void enterEvent(QEnterEvent *e); void leaveEvent(QEvent *e); protected: void mousePressEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent *event); private: bool mMoved = false; bool mClicked = false; signals: void clicked(); }; #endif // TRISTATELABEL_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/000077500000000000000000000000001520576575000304155ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/addbutton.cpp000066400000000000000000000140411520576575000331050ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "addbutton.h" #include #include #include #include #include #include #include #include AddButton::AddButton(QWidget *parent, UkccFrame::BorderRadiusStyle style, bool heightAdaptive) : QPushButton(parent), m_radiusType(style), m_heightAdaptive(heightAdaptive) { this->setObjectName("AddButton"); this->setProperty("useButtonPalette", true); this->setProperty("needTranslucent", true); this->setFlat(true); QHBoxLayout *addLyt = new QHBoxLayout; QLabel *iconLabel = new QLabel(); QLabel *textLabel = new QLabel(tr("Add")); QIcon mAddIcon = QIcon::fromTheme("list-add-symbolic"); iconLabel->setPixmap(mAddIcon.pixmap(mAddIcon.actualSize(QSize(16, 16)))); iconLabel->setProperty("iconHighlightEffectMode", 1); const QByteArray idd(THEME_QT_SCHEMA); QGSettings *qtSettings = new QGSettings(idd, QByteArray(), this); QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); if ("ukui-dark" == currentThemeMode || "ukui-black" == currentThemeMode){ iconLabel->setProperty("useIconHighlightEffect", true); } connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { if (key == "styleName") { QString currentThemeMode = qtSettings->get(key).toString(); if ("ukui-black" == currentThemeMode || "ukui-dark" == currentThemeMode) { iconLabel->setProperty("useIconHighlightEffect", true); } else if("ukui-white" == currentThemeMode || "ukui-default" == currentThemeMode) { iconLabel->setProperty("useIconHighlightEffect", false); } } }); m_statusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", "/", "com.kylin.statusmanager.interface", QDBusConnection::sessionBus(), this); if (m_statusSessionDbus->isValid()) { QDBusReply is_tabletmode = m_statusSessionDbus->call("get_current_tabletmode"); mode_change_signal_slots(is_tabletmode.isValid() ? is_tabletmode.value() : false); connect(m_statusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mode_change_signal_slots(bool))); } else { mode_change_signal_slots(false); qWarning() << "Create com.kylin.statusmanager.interface Interface Failed When : " << QDBusConnection::systemBus().lastError(); } addLyt->addStretch(); addLyt->addWidget(iconLabel); addLyt->addWidget(textLabel); addLyt->addStretch(); this->setLayout(addLyt); } AddButton::~AddButton() { } void AddButton::mode_change_signal_slots(bool b) { if (m_heightAdaptive) { if (b) { this->setMinimumSize(550, TABLET_HEIGHT); this->setMaximumSize(16777215, TABLET_HEIGHT); } else { this->setMinimumSize(550, PC_HEIGHT); this->setMaximumSize(16777215, PC_HEIGHT); } } m_isTabletMode = b; Q_EMIT tabletModeChanged(b); } void AddButton::setRadiusType(UkccFrame::BorderRadiusStyle style) { m_radiusType = style; update(); } void AddButton::paintEvent(QPaintEvent *event) { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; painter.setClipping(true); painter.setPen(Qt::transparent); painter.setBrush(qApp->palette().base()); QPainterPath painterPath = getPaintrPath(); painter.setClipPath(painterPath); painter.drawPath(painterPath); QPushButton::paintEvent(event); } QPainterPath AddButton::getPaintrPath() { const QRect rect = this->rect(); int radius = RADIUS_VALUE; int corner = 0; if (m_radiusType == UkccFrame::BorderRadiusStyle::None) { corner = 0; } else if (m_radiusType == UkccFrame::BorderRadiusStyle::Top) { corner = TOP_LEFT_CORNER + TOP_RIGHT_CORNER; } else if (m_radiusType == UkccFrame::BorderRadiusStyle::Bottom) { corner = BOTTOM_LEFT_CORNER + BOTTOM_RIGHT_CORNER; } else { corner = TOP_LEFT_CORNER + TOP_RIGHT_CORNER + BOTTOM_LEFT_CORNER + BOTTOM_RIGHT_CORNER; } QPainterPath path; if(corner & TOP_LEFT_CORNER) { path.moveTo(rect.x() + radius, rect.y()); path.arcTo(rect.x(), rect.y(), radius * 2, radius * 2, 90.f, 90.f);//画左上圆角 } else { path.moveTo(rect.x(), rect.y()); } if(corner & BOTTOM_LEFT_CORNER) { path.lineTo(rect.x(), rect.y() + rect.height() -radius); path.arcTo(rect.x(), rect.y() + rect.height() - radius * 2, radius * 2, radius * 2, 180.0f, 90.f); } else { path.lineTo(rect.x(), rect.y() + rect.height()); } if(corner & BOTTOM_RIGHT_CORNER) { path.lineTo(rect.x() + rect.width() - radius,rect.y() + rect.height()); path.arcTo(rect.x() + rect.width() - 2 * radius, rect.y() + rect.height() - 2 * radius,radius*2, radius * 2, 270.0f, 90.f); } else { path.lineTo(rect.x()+ rect.width(), rect.y() + rect.height()); } if(corner & TOP_RIGHT_CORNER) { path.lineTo(rect.x() + rect.width(), rect.y() + radius); path.arcTo(rect.x() + rect.width() - 2 * radius, rect.y(), radius * 2, radius * 2, 0.f, 90.f); } else { path.lineTo(rect.x()+ rect.width(), rect.y()); } return path; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/addbutton.h000066400000000000000000000036601520576575000325570ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef ADDBUTTON_H #define ADDBUTTON_H #include #include #include #include #include #include "libukcc_global.h" #include "ukccframe.h" #define TOP_LEFT_CORNER 1 #define TOP_RIGHT_CORNER 2 #define BOTTOM_RIGHT_CORNER 4 #define BOTTOM_LEFT_CORNER 8 #define THEME_QT_SCHEMA "org.ukui.style" #define MODE_QT_KEY "style-name" class LIBUKCC_EXPORT AddButton : public QPushButton { Q_OBJECT public: explicit AddButton(QWidget* parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::BorderRadiusStyle::Bottom, bool heightAdaptive = true); ~AddButton(); void setRadiusType(UkccFrame::BorderRadiusStyle style); /** * @brief 获取平板模式 * * @return bool 是否是平板模式 */ inline bool getTabletMode() { return m_isTabletMode; } protected: void paintEvent(QPaintEvent *event); QPainterPath getPaintrPath(); Q_SIGNALS: void tabletModeChanged(bool b); private Q_SLOTS: void mode_change_signal_slots(bool b); private: UkccFrame::BorderRadiusStyle m_radiusType; bool m_isTabletMode = false; QDBusInterface *m_statusSessionDbus = nullptr; bool m_heightAdaptive = false; }; #endif // ADDBUTTON_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/comboxwidget.cpp000066400000000000000000000045711520576575000336230ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "comboxwidget.h" #include #include ComboxWidget::ComboxWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) : UkccFrame(parent, style, true) { m_settingName = new FixLabel(title, this); m_combox = new QComboBox(this); init(); } ComboxWidget::~ComboxWidget() { } void ComboxWidget::init() { mainLayout = new QHBoxLayout(); mainLayout->setContentsMargins(16, 0, 16, 0); m_settingName->setFixedWidth(214); mainLayout->addWidget(m_settingName); mainLayout->setSpacing(16); mainLayout->addWidget(m_combox); this->setLayout(mainLayout); connect(m_combox, QOverload::of(&QComboBox::currentIndexChanged), this, &ComboxWidget::currentIndexChanged); connect(m_combox, &QComboBox::currentTextChanged, this, &ComboxWidget::currentTextChanged); } void ComboxWidget::setEnabled(const bool checked) { if (m_combox) { m_combox->setEnabled(checked); } } bool ComboxWidget::isEnabled() const { return m_combox->isEnabled(); } void ComboxWidget::setTitle(const QString &title) { if (m_settingName) { m_settingName->setText(title); } this->setAccessibleName(title); m_combox->setAccessibleName(title); } QString ComboxWidget::title() const { if (m_settingName) { return m_settingName->text(); } return QString(); } void ComboxWidget::setCurrentText(const QString &text) { m_combox->setCurrentText(text); } void ComboxWidget::setCurrentIndex(int index) { m_combox->setCurrentIndex(index); } void ComboxWidget::setTitleFixedWidth(int w) { m_settingName->setFixedWidth(w); } QComboBox *ComboxWidget::comboBox() const { return m_combox; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/comboxwidget.h000066400000000000000000000054741520576575000332730ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef COMBOXWIDGET_H #define COMBOXWIDGET_H #include #include #include #include "fixlabel.h" #include "libukcc_global.h" #include "ukccframe.h" /** * @brief 创建一个带 QComboBox 的 Frame * */ class LIBUKCC_EXPORT ComboxWidget : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个带 QComboBox 的 Frame * * @param title: text of m_settingName * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ explicit ComboxWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); /** * @brief * */ ~ComboxWidget(); /** * @brief 设置 m_combox 是否可选 * @param checked */ void setEnabled(const bool checked = true); /** * @brief m_combox 是否 enabled * * @return bool 是:true,否:false */ bool isEnabled() const; /** * @brief 设置 m_settingName text * @param title */ void setTitle(const QString &title); /** * @brief 获取 m_settingName text * @return */ QString title() const; /** * @brief 设置 m_settingName label 宽度 * * @param w */ void setTitleFixedWidth(int w); /** * @brief 设置 QComboBox 当前 text * * @param text */ void setCurrentText(const QString &text); /** * @brief 设置 QComboBox 当前 index * * @param index */ void setCurrentIndex(int index); /** * @brief 获取 m_combox * * @return QComboBox: m_combox */ QComboBox *comboBox() const; private: void init(); QHBoxLayout *mainLayout; FixLabel *m_settingName; QComboBox *m_combox; private Q_SLOTS: Q_SIGNALS: /** * @brief QComboBox 当前 index 改变信号 * * @param index */ void currentIndexChanged(int index); /** * @brief QComboBox 当前 text 改变信号 * * @param index */ void currentTextChanged(const QString &text); }; #endif // COMBOXWIDGET_H lineeditwidget.cpp000066400000000000000000000037601520576575000340510ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "lineeditwidget.h" #include LineEditWidget::LineEditWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) : UkccFrame(parent, style, true) { m_settingName = new FixLabel(title, this); m_lineEdit = new QLineEdit(this); init(); } LineEditWidget::~LineEditWidget() { } void LineEditWidget::init() { mainLayout = new QHBoxLayout(this); mainLayout->setContentsMargins(16, 0, 16, 0); m_settingName->setFixedWidth(214); mainLayout->addWidget(m_settingName); mainLayout->setSpacing(16); mainLayout->addWidget(m_lineEdit); this->setLayout(mainLayout); } void LineEditWidget::setEnabled(const bool checked) { if (m_lineEdit) { m_lineEdit->setEnabled(checked); } } bool LineEditWidget::isEnabled() const { return m_lineEdit->isEnabled(); } void LineEditWidget::setTitle(const QString &title) { if (m_settingName) { m_settingName->setText(title); } this->setAccessibleName(title); m_lineEdit->setAccessibleName(title); } QString LineEditWidget::title() const { if (m_settingName) { return m_settingName->text(); } return QString(); } void LineEditWidget::setTitleFixedWidth(int w) { m_settingName->setFixedWidth(w); } QLineEdit *LineEditWidget::lineEdit() { return m_lineEdit; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/lineeditwidget.h000066400000000000000000000045711520576575000335760ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef LINEEDITWIDGET_H #define LINEEDITWIDGET_H #include #include #include #include #include "fixlabel.h" #include "libukcc_global.h" #include "ukccframe.h" #include /** * @brief 创建一个带 QLineEdit 的 Frame * */ class LIBUKCC_EXPORT LineEditWidget : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个带 QLineEdit 的 Frame * * @param title: text of m_settingName * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ explicit LineEditWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); /** * @brief * */ ~LineEditWidget(); /** * @brief 设置 m_lineEdit 是否可点击 * * @param checked */ void setEnabled(const bool checked); /** * @brief 获取 m_lineEdit 是否 Enabled * * @return bool 是:true,否:false */ bool isEnabled() const; /** * @brief 设置 m_settingName text * * @param title */ void setTitle(const QString &title); /** * @brief 获取 m_settingName text * * @return QString */ QString title() const; /** * @brief 设置 m_settingName label 宽度 * * @param w */ void setTitleFixedWidth(int w); /** * @brief 获取 m_lineEdit * * @return QLineEdit: m_lineEdit */ QLineEdit *lineEdit(); private: void init(); QHBoxLayout *mainLayout; FixLabel *m_settingName; QLineEdit *m_lineEdit; private Q_SLOTS: Q_SIGNALS: }; #endif // LINEEDITWIDGET_H pushbuttonwidget.cpp000066400000000000000000000050431520576575000344630ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "pushbuttonwidget.h" #include PushButtonWidget::PushButtonWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) : UkccFrame(parent, style, true) { m_settingName = new FixLabel(title, this); m_pushButton = new QPushButton(this); m_iconLabel = new QLabel(this); init(); } PushButtonWidget::~PushButtonWidget() { } void PushButtonWidget::init() { m_iconLabel->setVisible(false); mainLayout = new QHBoxLayout(this); mainLayout->setContentsMargins(16, 0, 16, 0); m_pushButton->setFixedWidth(100); mainLayout->addWidget(m_iconLabel); mainLayout->addWidget(m_settingName); mainLayout->addStretch(); mainLayout->addWidget(m_pushButton); this->setLayout(mainLayout); connect(m_pushButton, &QPushButton::clicked, this, &PushButtonWidget::clicked); } void PushButtonWidget::setEnabled(const bool checked) { if (m_pushButton) { m_pushButton->setEnabled(checked); } } bool PushButtonWidget::isEnabled() const { return m_pushButton->isEnabled(); } void PushButtonWidget::setTitle(const QString &title) { if (m_settingName) { m_settingName->setText(title); } this->setAccessibleName(title); m_pushButton->setAccessibleName(title); } QString PushButtonWidget::title() const { if (m_settingName) { return m_settingName->text(); } return QString(); } void PushButtonWidget::setTitleFixedWidth(int w) { m_settingName->setFixedWidth(w); } void PushButtonWidget::setButtonText(const QString &text) { m_pushButton->setText(text); } void PushButtonWidget::setButtonFixedWidth(int w) { m_pushButton->setFixedWidth(w); } QPushButton *PushButtonWidget::pushButton() { return m_pushButton; } void PushButtonWidget::setIconLabel(QIcon icon) { m_iconLabel->setPixmap(icon.pixmap(16, 16)); m_iconLabel->setVisible(true); } pushbuttonwidget.h000066400000000000000000000056151520576575000341350ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef PUSHBUTTONWIDGET_H #define PUSHBUTTONWIDGET_H #include #include #include #include #include "fixlabel.h" #include "libukcc_global.h" #include "ukccframe.h" /** * @brief 创建一个带 QPushButton 的 Frame * */ class LIBUKCC_EXPORT PushButtonWidget : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个带 QPushButton 的 Frame * * @param title: text of m_settingName * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ explicit PushButtonWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); /** * @brief * */ ~PushButtonWidget(); /** * @brief 设置 m_pushButton 是否可点击 * * @param checked */ void setEnabled(const bool checked); /** * @brief 获取 m_pushButton 是否可点击 * * @return bool 是:true,否:false */ bool isEnabled() const; /** * @brief 设置 m_settingName text * * @param title */ void setTitle(const QString &title); /** * @brief 获取 m_settingName text * * @return QString */ QString title() const; /** * @brief 设置 m_settingName label 宽度 * * @param w */ void setTitleFixedWidth(int w); /** * @brief 设置 m_pushButton text * * @param text */ void setButtonText(const QString & text); /** * @brief 设置 m_pushButton 宽度 * * @param w */ void setButtonFixedWidth(int w); /** * @brief 设置 m_iconLabel 图标 * * @param icon */ void setIconLabel(QIcon icon); /** * @brief 获取 m_pushButton * * @return QPushButton: m_pushButton */ QPushButton *pushButton(); private: void init(); QHBoxLayout *mainLayout; FixLabel *m_settingName; QPushButton *m_pushButton; QLabel *m_iconLabel; private Q_SLOTS: Q_SIGNALS: /** * @brief m_pushButton 点击信号 * * @param checked */ void clicked(bool checked = false); }; #endif // PUSHBUTTONWIDGET_H radiobuttonwidget.cpp000066400000000000000000000046071520576575000346070ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "radiobuttonwidget.h" #include RadioButtonWidget::RadioButtonWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) : UkccFrame(parent, style, true) { m_settingName = new FixLabel(title, this); m_buttonGroup = new QButtonGroup(this); init(); } RadioButtonWidget::~RadioButtonWidget() { } void RadioButtonWidget::init() { mainLayout = new QHBoxLayout(); radioLayout = new QHBoxLayout(); radioLayout->setContentsMargins(0, 0, 0, 0); radioLayout->setSpacing(80); mainLayout->setContentsMargins(16, 0, 16, 0); m_settingName->setFixedWidth(214); mainLayout->addWidget(m_settingName); mainLayout->setSpacing(16); mainLayout->addLayout(radioLayout); mainLayout->addStretch(); this->setLayout(mainLayout); connect(m_buttonGroup, &QButtonGroup::idClicked, this, &RadioButtonWidget::buttonClicked); } void RadioButtonWidget::setTitle(const QString &title) { if (m_settingName) { m_settingName->setText(title); } this->setAccessibleName(title); } QString RadioButtonWidget::title() const { if (m_settingName) { return m_settingName->text(); } return QString(); } void RadioButtonWidget::setTitleFixedWidth(int w) { m_settingName->setFixedWidth(w); } void RadioButtonWidget::addButton(QRadioButton *button, int id, bool addStretch) { m_buttonGroup->addButton(button, id); radioLayout->addWidget(button, 0, Qt::AlignLeft | Qt::AlignVCenter); if (addStretch) { radioLayout->addStretch(); } } void RadioButtonWidget::setButtonSpacing(int spacing) { radioLayout->setSpacing(spacing); } QButtonGroup *RadioButtonWidget::buttonGroup() const { return m_buttonGroup; } radiobuttonwidget.h000066400000000000000000000055031520576575000342500ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef RADIOBUTTONWIDGET_H #define RADIOBUTTONWIDGET_H #include #include #include #include #include #include "fixlabel.h" #include "libukcc_global.h" #include "ukccframe.h" /** * @brief 创建一个带 QButtonGroup 的 Frame * */ class LIBUKCC_EXPORT RadioButtonWidget : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个带 QButtonGroup 的 Frame * * @param title: text of m_settingName * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ explicit RadioButtonWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); /** * @brief * */ ~RadioButtonWidget(); /** * @brief 设置 m_settingName text * * @param title */ void setTitle(const QString &title); /** * @brief 获取 m_settingName text * * @return QString */ QString title() const; /** * @brief 设置 m_settingName label 宽度 * * @param w */ void setTitleFixedWidth(int w); /** * @brief 添加一个 id = id 的 QRadioButton 到 m_buttonGroup,并放到 radioLayout 中 * * @param button: 需要添加的 QRadioButton * @param id: 用于 buttonClicked 信号传递的参数 * @param addStretch: 是否 addStretch */ void addButton(QRadioButton *button, int id = -1, bool addStretch = false); /** * @brief setSpacing of radioLayout * * @param spacing */ void setButtonSpacing(int spacing); /** * @brief 获取 m_buttonGroup * * @return QButtonGroup: m_buttonGroup */ QButtonGroup *buttonGroup() const; private: void init(); QHBoxLayout *mainLayout; FixLabel *m_settingName; QButtonGroup *m_buttonGroup; QHBoxLayout *radioLayout; private Q_SLOTS: Q_SIGNALS: /** * @brief 点击 QButtonGroup 中的 QRadioButton 信号 * * @param int: addButton 时的 id */ void buttonClicked(int); }; #endif // RADIOBUTTONWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/settinggroup.cpp000066400000000000000000000123421520576575000336550ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "settinggroup.h" #include SettingGroup::SettingGroup(QWidget *parent, Shape shape, UkccFrame::BorderRadiusStyle style, int spacing) : UkccFrame(parent, style, false) { mainLayout = new QVBoxLayout(this); mainLayout->setSpacing(spacing); mainLayout->setContentsMargins(0, 0, 0, 0); this->setLayout(mainLayout); this->setFrameShape(shape); qApp->installEventFilter(this); this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); } SettingGroup::~SettingGroup() { } void SettingGroup::addWidget(QFrame *item, bool autoUpdateShape, bool visible) { mainLayout->addWidget(item, autoUpdateShape); item->setVisible(visible); if (autoUpdateShape) { updateShape(); } } void SettingGroup::insertWidget(int index, QFrame *item, bool autoUpdateShape, bool visible) { mainLayout->insertWidget(index, item); item->setVisible(visible); if (autoUpdateShape) { updateShape(); } } void SettingGroup::removeWidget(QWidget *w, bool autoUpdateShape) { mainLayout->removeWidget(w); if (autoUpdateShape) { updateShape(); } } void SettingGroup::updateAllItemList(UkccFrame *frame) { if (frame->iscontainer() && frame->frameShape() == QFrame::NoFrame && frame->layout()) { for (int i = 0; i < frame->layout()->count(); i++) { QLayoutItem *it = frame->layout()->itemAt(i); UkccFrame *item = qobject_cast(it->widget()); if (!item) { continue; } updateAllItemList(item); } } else { allItemList.append(frame); return; } } void SettingGroup::updateShowItemList(UkccFrame *frame) { if (frame->iscontainer() && frame->frameShape() == QFrame::NoFrame && frame->layout()) { for (int i = 0; i < frame->layout()->count(); i++) { QLayoutItem *it = frame->layout()->itemAt(i); UkccFrame *item = qobject_cast(it->widget()); if (!item) { continue; } updateShowItemList(item); } } else { if (frame->isVisibleTo(this)) { showItemList.append(frame); } return; } } void SettingGroup::updateShape() { showItemList.clear(); for (int i = 0; i < mainLayout->count(); i++) { QLayoutItem *it = mainLayout->itemAt(i); UkccFrame *item = qobject_cast(it->widget()); if (!item) { continue; } updateShowItemList(item); } for (int i = 0; i < showItemList.size(); i++) { UkccFrame *item = showItemList.at(i); if (showItemList.size() == 1) { item->setRadiusType(m_OneRadiusStyle); } else if (i == 0) { item->setRadiusType(UkccFrame::Top); } else if (i == showItemList.size() - 1) { item->setRadiusType(m_lastRadiusStyle); } else { item->setRadiusType(UkccFrame::None); } } } QVBoxLayout *SettingGroup::layout() { return mainLayout; } void SettingGroup::setLastRadiusStyle(UkccFrame::BorderRadiusStyle style) { m_lastRadiusStyle = style; } void SettingGroup::setOneRadiusStyle(UkccFrame::BorderRadiusStyle style) { m_OneRadiusStyle = style; } bool SettingGroup::eventFilter(QObject *watched, QEvent *event) { if (event->type() == QEvent::Hide || event->type() == QEvent::Show) { allItemList.clear(); for (int i = 0; i < mainLayout->count(); i++) { QLayoutItem *it = mainLayout->itemAt(i); UkccFrame *item = qobject_cast(it->widget()); updateAllItemList(item); } for (int i = 0; i < allItemList.size(); i++) { if (allItemList.at(i) == watched) { updateShape(); } } } return UkccFrame::eventFilter(watched, event); } int SettingGroup::showItemsCount() { showItemList.clear(); for (int i = 0; i < mainLayout->count(); i++) { QLayoutItem *it = mainLayout->itemAt(i); UkccFrame *item = qobject_cast(it->widget()); if (!item) { continue; } updateShowItemList(item); } return showItemList.size(); } void SettingGroup::removeAndDeleteAllWidget() { while (mainLayout->count() > 0) { QLayoutItem *it = mainLayout->itemAt(0); UkccFrame *item = qobject_cast(it->widget()); if (!item) { continue; } mainLayout->removeWidget(item); item->deleteLater(); item = nullptr; } return; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/settinggroup.h000066400000000000000000000102021520576575000333130ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef SETTINGGROUP_H #define SETTINGGROUP_H #include #include #include #include #include #include #include "libukcc_global.h" #include "ukccframe.h" #include /** * @brief 创建一个可以设置 Spacing 的垂直布局 Frame * */ class LIBUKCC_EXPORT SettingGroup : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个 Spacing 为 1 的垂直布局 Frame * * @param Shape: 设置frameShap * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ explicit SettingGroup(QWidget *parent = nullptr, Shape shape = QFrame::NoFrame, UkccFrame::BorderRadiusStyle style = UkccFrame::None, int spacing = 1); /** * @brief * */ ~SettingGroup(); /** * @brief 为 mainLayout 添加控件并更新圆角 * * @param item: 需要添加的控件 * @param autoUpdateShape: 是否自动更新item圆角样式 * @param visible 实际未show控件时isVisible总是false,导致圆角无法正常,因此重新设置,应为Qt的BUG */ void addWidget(QFrame *item, bool autoUpdateShape = true, bool visible = true); /** * @brief 为 mainLayout 添加控件并更新圆角 * * @param index: 序号 * @param item: 需要添加的控件 * @param autoUpdateShape: 是否自动更新item圆角样式 * @param visible 实际未show控件时isVisible总是false,导致圆角无法正常,因此重新设置,应为Qt的BUG */ void insertWidget(int index, QFrame *item, bool autoUpdateShape = true, bool visible = true); /** * @brief 为 mainLayout 移除控件并更新圆角 * * @param w: 需要移除的控件 * @param autoUpdateShape: 是否自动更新item圆角样式 */ void removeWidget(QWidget *w, bool autoUpdateShape = true); /** * @brief 更新圆角 * */ void updateShape(); /** * @brief 获取 mainLayout * * @return QVBoxLayout mainLayout */ QVBoxLayout *layout(); /** * @brief 设置最后一个frame的圆角风格 * * @param style 圆角风格 */ void setLastRadiusStyle(UkccFrame::BorderRadiusStyle style); /** * @brief 设置仅一个frame时的圆角风格 * * @param style */ void setOneRadiusStyle(UkccFrame::BorderRadiusStyle style); /** * @brief 获取显示的子控件个数 * * @return int 显示的子控件个数 */ int showItemsCount(); /** * @brief 移除并删除所有子控件 * */ void removeAndDeleteAllWidget(); private: /** * @brief 递归添加显示出来的ukccFrame * * @param frame */ void updateShowItemList(UkccFrame *frame); /** * @brief 递归获取所有ukccFrame * * @param frame */ void updateAllItemList(UkccFrame *frame); protected: bool eventFilter(QObject *watched, QEvent *event); private: QDBusInterface *m_statusSessionDbus = nullptr; QVBoxLayout *mainLayout; UkccFrame::BorderRadiusStyle m_lastRadiusStyle = UkccFrame::BorderRadiusStyle::Bottom; UkccFrame::BorderRadiusStyle m_OneRadiusStyle = UkccFrame::BorderRadiusStyle::Around; QListshowItemList; QListallItemList; private Q_SLOTS: Q_SIGNALS: }; #endif // SETTINGGROUP_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/settingwidget.pri000066400000000000000000000013121520576575000340070ustar00rootroot00000000000000QT += dbus INCLUDEPATH += $$PWD $$PWD/../label CONFIG += link_pkgconfig PKGCONFIG += kysdk-qtwidgets SOURCES += \ $$PWD/addbutton.cpp \ $$PWD/comboxwidget.cpp \ $$PWD/lineeditwidget.cpp \ $$PWD/pushbuttonwidget.cpp \ $$PWD/radiobuttonwidget.cpp \ $$PWD/settinggroup.cpp \ $$PWD/sliderwidget.cpp \ $$PWD/switchwidget.cpp \ $$PWD/ukccframe.cpp HEADERS += \ $$PWD/addbutton.h \ $$PWD/comboxwidget.h \ $$PWD/lineeditwidget.h \ $$PWD/pushbuttonwidget.h \ $$PWD/radiobuttonwidget.h \ $$PWD/settinggroup.h \ $$PWD/sliderwidget.h \ $$PWD/switchwidget.h \ $$PWD/ukccframe.h kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/sliderwidget.cpp000066400000000000000000000063151520576575000336140ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "sliderwidget.h" #include SliderWidget::SliderWidget(QString title, bool hasNode, QWidget *parent, UkccFrame::BorderRadiusStyle style, Qt::Orientation orientation): UkccFrame(parent, style, true) { m_settingName = new FixLabel(title, this); m_slider = new KSlider(orientation, this); m_slider->setNodeVisible(hasNode); init(); } SliderWidget::~SliderWidget() { } void SliderWidget::init() { mainLayout = new QHBoxLayout(); mainLayout->setContentsMargins(16, 0, 16, 0); m_leftLabel = new QLabel(this); m_leftLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); m_rightLabel = new QLabel(this); m_rightLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); m_settingName->setFixedWidth(214); mainLayout->addWidget(m_settingName); mainLayout->addSpacing(8); mainLayout->addWidget(m_leftLabel); mainLayout->addWidget(m_slider); mainLayout->addWidget(m_rightLabel); this->setLayout(mainLayout); connect(m_slider, &KSlider::valueChanged, this, &SliderWidget::valueChanged); } void SliderWidget::setEnabled(const bool checked) { if (m_slider) { m_slider->setEnabled(checked); } } bool SliderWidget::isEnabled() const { return m_slider->isEnabled(); } void SliderWidget::setValue(const int value) { m_slider->setValue(value); } void SliderWidget::setTitle(const QString &title) { if (m_settingName) { m_settingName->setText(title); } this->setAccessibleName(title); m_slider->setAccessibleName(title); } void SliderWidget::setLeftText(const QString text) { m_leftLabel->setText(text); } void SliderWidget::setRightText(const QString text) { m_rightLabel->setText(text); } QString SliderWidget::title() const { if (m_settingName) { return m_settingName->text(); } return QString(); } void SliderWidget::setTitleFixedWidth(int w) { m_settingName->setFixedWidth(w); } int SliderWidget::value() const { return m_slider->value(); } KSlider *SliderWidget::slider() const { return m_slider; } QLabel *SliderWidget::leftLabel() const { return m_leftLabel; } QLabel *SliderWidget::rightLabel() const { return m_rightLabel; } void SliderWidget::insertWidget(int index, QWidget *widget, int stretch, Qt::Alignment alignment) { mainLayout->insertWidget(index, widget, stretch, alignment); } void SliderWidget::setLeftPixmap(const QPixmap &pixmap) { m_leftLabel->setPixmap(pixmap); } void SliderWidget::setRightPixmap(const QPixmap &pixmap) { m_rightLabel->setPixmap(pixmap); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/sliderwidget.h000066400000000000000000000075321520576575000332630ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef SLIDERWIDGET_H #define SLIDERWIDGET_H #include #include #include #include #include "fixlabel.h" #include #include "libukcc_global.h" #include "ukccframe.h" using namespace kdk; /** * @brief 创建一个带 KSlider 的 Frame * */ class LIBUKCC_EXPORT SliderWidget : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个带 KSlider 的 Frame * * @param title: text of m_settingName * @param hasNode: 是否带节点 * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ SliderWidget(QString title, bool hasNode, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None, Qt::Orientation orientation = Qt::Horizontal); /** * @brief * */ ~SliderWidget(); /** * @brief 设置是否可点击 * @param checked */ void setEnabled(const bool checked = true); /** * @brief * * @return bool */ bool isEnabled() const; /** * @brief 设置滑动条值 * @param value */ void setValue(const int value); /** * @brief 设置 m_settingName text * @param title */ void setTitle(const QString &title); /** * @brief 设置 m_leftLabel text * @param text */ void setLeftText(const QString text); /** * @brief 设置 m_rightLabel text * @param text */ void setRightText(const QString text); /** * @brief 设置 m_leftLabel pixmap * * @param pixmap */ void setLeftPixmap(const QPixmap &pixmap); /** * @brief 设置 m_rightLabel pixmap * * @param pixmap */ void setRightPixmap(const QPixmap &pixmap); /** * @brief 获取 m_settingName text * @return */ QString title() const; /** * @brief 设置 m_settingName label 宽度 * * @param w */ void setTitleFixedWidth(int w); /** * @brief 获取 m_slider 值 * @return int */ int value() const; /** * @brief 获取 m_slider * @return KSlider: m_slider */ KSlider *slider() const; /** * @brief 获取 m_leftLabel * @return QLabel: m_leftLabel */ QLabel *leftLabel() const; /** * @brief 获取 m_rightLabel * @return QLabel: m_rightLabel */ QLabel *rightLabel() const; /** * @brief 在 mainLayout 中插入序号为 index 的 widget * * @param index: 插入序号 * @param widget: 插入控件 * @param stretch: stretch factor * @param alignment:alignment */ void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment()); private: void init(); QHBoxLayout *mainLayout; FixLabel *m_settingName; KSlider *m_slider; QLabel *m_leftLabel; QLabel *m_rightLabel; private Q_SLOTS: Q_SIGNALS: /** * @brief This signal is emitted when the slider value has changed * * @param value: the new slider value */ void valueChanged(int value); }; #endif // SLIDERWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/switchwidget.cpp000066400000000000000000000056111520576575000336310ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "switchwidget.h" #include SwitchWidget::SwitchWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style, const QString hintText) : UkccFrame(parent, style, true) { m_settingName = new FixLabel(title, this); m_hintText = new LightLabel(hintText, this); m_switchButton = new KSwitchButton(this); init(); } SwitchWidget::~SwitchWidget() { } void SwitchWidget::init() { mainLayout = new QHBoxLayout(); m_vLayout = new QVBoxLayout(); mainLayout->setContentsMargins(16, 0, 16, 0); m_vLayout->addWidget(m_settingName); if (!m_hintText->text().isEmpty()) { m_vLayout->addWidget(m_hintText); } mainLayout->addLayout(m_vLayout); mainLayout->addStretch(); mainLayout->addWidget(m_switchButton); setLayout(mainLayout); connect(m_switchButton, &KSwitchButton::stateChanged, this, &SwitchWidget::stateChanged); } void SwitchWidget::setHintTextVisible(bool visible) { m_hintText->setVisible(visible); } void SwitchWidget::setEnabled(const bool checked) { if (m_switchButton) { m_switchButton->setEnabled(checked); } } void SwitchWidget::setChecked(const bool checked) { m_switchButton->setChecked(checked); } bool SwitchWidget::isChecked() const { return m_switchButton->isChecked(); } bool SwitchWidget::isEnabled() const { return m_switchButton->isEnabled(); } void SwitchWidget::setTitle(const QString &title) { if (m_settingName) { m_settingName->setText(title); } this->setAccessibleName(title); m_switchButton->setAccessibleName(title); } QString SwitchWidget::title() const { if (m_settingName) { return m_settingName->text(); } return QString(); } bool SwitchWidget::blockSignals(bool b) { return m_switchButton->blockSignals(b); } void SwitchWidget::insertWidget(int index, QWidget *widget, int stretch, Qt::Alignment alignment) { mainLayout->insertWidget(index, widget, stretch, alignment); } KSwitchButton *SwitchWidget::switchButton() const { return m_switchButton; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/switchwidget.h000066400000000000000000000066141520576575000333020ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef SWITCHWIDGET_H #define SWITCHWIDGET_H #include #include #include "fixlabel.h" #include "lightlabel.h" #include "libukcc_global.h" #include "ukccframe.h" #include using namespace kdk; /** * @brief 创建一个带 KSwitchButton 的 Frame * */ class LIBUKCC_EXPORT SwitchWidget : public UkccFrame { Q_OBJECT public: /** * @brief 创建一个带 KSwitchButton 的 Frame * * @param title: text of m_settingName * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) * @param parent */ explicit SwitchWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None, const QString hintText = QString()); /** * @brief * */ ~SwitchWidget(); /** * @brief 设置提示文案是否可见 * @param visible */ void setHintTextVisible(bool visible); /** * @brief 设置是否可点击 * @param checked */ void setEnabled(const bool checked = true); /** * @brief * * @return bool */ bool isEnabled() const; /** * @brief 设置开启状态 * @param checked */ void setChecked(const bool checked = true); /** * @brief 返回是否选中 * @return */ bool isChecked() const; /** * @brief 设置 m_settingName text * @param title */ void setTitle(const QString &title); /** * @brief 获取 m_settingName text * @return */ QString title() const; /** * @brief blockSignals of m_switchButton * @param b * @return bool */ bool blockSignals(bool b); /** * @brief 在 mainLayout 中插入序号为 index 的 widget * * @param index: 插入序号 * @param widget: 插入控件 * @param stretch: stretch factor * @param alignment:alignment */ void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment()); /** * @brief 获取 m_slider * @return KSlider: m_slider */ KSwitchButton *switchButton() const; private: void init(); QHBoxLayout *mainLayout; QVBoxLayout *m_vLayout; FixLabel *m_settingName; LightLabel *m_hintText; KSwitchButton *m_switchButton; private Q_SLOTS: Q_SIGNALS: /** * @brief m_switchButton 状态改变信号 * * @param checked */ void stateChanged(const bool checked); }; #endif // SWITCHWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/ukccframe.cpp000066400000000000000000000067051520576575000330710ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "ukccframe.h" #include #include #include #include UkccFrame::UkccFrame(QWidget *parent, BorderRadiusStyle style, bool heightAdaptive) : QFrame(parent), mRadiusType(style), mHeightAdaptive(heightAdaptive), mIscontainer(false) { this->setFrameShape(QFrame::Box); mStatusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", "/", "com.kylin.statusmanager.interface", QDBusConnection::sessionBus(), this); if (mStatusSessionDbus->isValid()) { QDBusReply is_tabletmode = mStatusSessionDbus->call("get_current_tabletmode"); mode_change_signal_slots(is_tabletmode.isValid() ? is_tabletmode.value() : false); connect(mStatusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mode_change_signal_slots(bool))); } else { mode_change_signal_slots(false); // qWarning() << "Create com.kylin.statusmanager.interface Interface Failed When : " << QDBusConnection::systemBus().lastError(); } } UkccFrame::~UkccFrame() { } void UkccFrame::mode_change_signal_slots(bool b) { if (mHeightAdaptive) { if (b) { this->setMinimumSize(550, TABLET_HEIGHT); this->setMaximumSize(16777215, TABLET_HEIGHT); } else { this->setMinimumSize(550, PC_HEIGHT); this->setMaximumSize(16777215, PC_HEIGHT); } } mIsTabletMode = b; Q_EMIT tabletModeChanged(b); } void UkccFrame::setRadiusType(BorderRadiusStyle style) { mRadiusType = style; update(); } void UkccFrame::paintEvent(QPaintEvent *e) { Q_UNUSED(e); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; if (this->frameShape() != QFrame::NoFrame) { painter.setBrush(qApp->palette().window()); } painter.setPen(Qt::transparent); QRect rect = this->rect(); if (mRadiusType == UkccFrame::None) { painter.drawRoundedRect(rect, 0, 0); } else { QPainterPath painterPath; painterPath.addRoundedRect(rect, RADIUS_VALUE, RADIUS_VALUE); painterPath.setFillRule(Qt::WindingFill); if (mRadiusType == UkccFrame::Bottom) { painterPath.addRect(rect.width() - RADIUS_VALUE, 0, RADIUS_VALUE, RADIUS_VALUE); painterPath.addRect(0, 0, RADIUS_VALUE, RADIUS_VALUE); } else if (mRadiusType == UkccFrame::Top) { painterPath.addRect(0, rect.height() - RADIUS_VALUE, RADIUS_VALUE, RADIUS_VALUE); painterPath.addRect(rect.width() - RADIUS_VALUE, rect.height() - RADIUS_VALUE, RADIUS_VALUE, RADIUS_VALUE); } painter.drawPath(painterPath); } } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/libukcc/widgets/SettingWidget/ukccframe.h000066400000000000000000000054161520576575000325340ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef UKCCFRAME_H #define UKCCFRAME_H #include #include #include "libukcc_global.h" #include #define RADIUS_VALUE 6 /**< 圆角数值 */ #define PC_HEIGHT 60 /**< pc模式下高度 */ #define TABLET_HEIGHT 64 /**< 平板模式下高度 */ class LIBUKCC_EXPORT UkccFrame : public QFrame { Q_OBJECT public: enum BorderRadiusStyle { Top, /**< 顶部有圆角 */ None, /**< 没有圆角 */ Bottom, /**< 底部有圆角 */ Around /**< 四周都有圆角 */ }; /** * @brief 构造函数 * * @param parent 父对象 * @param style 圆角风格枚举值 * @param heightAdaptive 是否自动调整高度,默认PC下60,平板模式64 */ explicit UkccFrame(QWidget* parent = nullptr, BorderRadiusStyle style = Around, bool heightAdaptive = false); ~UkccFrame(); /** * @brief 设置圆角风格 * * @param style 圆角风格枚举值 */ void setRadiusType(BorderRadiusStyle style); /** * @brief 获取平板模式 * * @return bool 是否是平板模式 */ inline bool getTabletMode() { return mIsTabletMode; } /** * @brief 获取是否是一个容器frame,此时settinggroup需要设置的是其子frame的圆角 * * @return bool 是/不是 */ inline bool iscontainer() { return mIscontainer; } /** * @brief 设置该frame是否是一个容器frame,如果是同时setFrameShape(NoFrame); * * @param b 是/不是 */ inline void setContainer(bool b = false) { mIscontainer = b; if (b) { this->setFrameShape(QFrame::NoFrame); } } Q_SIGNALS: void tabletModeChanged(bool b); private Q_SLOTS: void mode_change_signal_slots(bool b); protected: void paintEvent(QPaintEvent *e); private: BorderRadiusStyle mRadiusType; bool mIsTabletMode = false; QDBusInterface *mStatusSessionDbus = nullptr; bool mHeightAdaptive = false; bool mIscontainer = false; }; #endif // UKCCFRAME_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/localmodelconfigwidget.cpp000066400000000000000000001034521520576575000277700ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "localmodelconfigwidget.h" LocalModelConfigWidget::LocalModelConfigWidget(QWidget *parent) : QDialog(parent) { getCurSystemVersion(); //初始化布局 initLayout(); //初始化本地模型能力 loadNlpModelConfig(); loadOtherModelConfig(); //初始化信号槽 initConnect(); } void LocalModelConfigWidget::initLayout() { this->setFixedSize(540,610); this->setWindowTitle(tr("Local Model")); m_mainVLayout = new QVBoxLayout(); initModelTitleLayout(); initModellayout(); m_mainVLayout->setStretch(0,2); m_mainVLayout->setStretch(1,8); this->setLayout(m_mainVLayout); } void LocalModelConfigWidget::initModelTitleLayout() { QLabel* backgroundLabel = new QLabel(this); backgroundLabel->setFixedHeight(72); backgroundLabel->setPixmap(QPixmap(":/res/icon/background.svg")); backgroundLabel->setAlignment(Qt::AlignCenter); backgroundLabel->setScaledContents(false); backgroundLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_backgroundLabel"); // 创建水平布局 m_titleHLayout = new QHBoxLayout(backgroundLabel); m_titleHLayout->setContentsMargins(24, 0, 24, 0); // 左侧图标布局 m_vLeftLayout = new QVBoxLayout(); m_iconLabel = new QLabel(backgroundLabel); m_iconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_iconLabel"); QPixmap iconPixmap(":/res/icon/ukui-local-model-symbolic.svg"); // 替换成本地模型图标 if(!iconPixmap.isNull()) { iconPixmap = iconPixmap.scaled(24, 24, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_iconLabel->setPixmap(iconPixmap); } m_iconLabel->setFixedSize(24, 24); m_vLeftLayout->addWidget(m_iconLabel); // 右侧文本布局 m_localHLayout = new QVBoxLayout(); m_localHLayout->setContentsMargins(0, 12, 0, 16); m_localLabel = new QLabel(backgroundLabel); m_localLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_localLabel"); m_localLabel->setMinimumSize(216, 24); m_localLabel->setText(tr("Local Model")); QFont localFont; localFont.setBold(true); m_localLabel->setFont(localFont); m_localLabel->setStyleSheet("color: #3790FA; background: transparent;"); m_descripLabel = new kdk::KLabel(backgroundLabel); m_descripLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_descripLabel"); m_descripLabel->setMinimumSize(450, 20); m_descripLabel->setText(tr("Installed on local equipment, it can run without network")); QFont localDescripFont; localDescripFont.setPointSize(localFont.pointSize() - 2); m_descripLabel->setFont(localDescripFont); setKLabelFontColor(m_descripLabel, "#3790FA"); m_localHLayout->addWidget(m_localLabel); m_localHLayout->addWidget(m_descripLabel); // 组合布局 m_titleHLayout->addLayout(m_vLeftLayout); m_titleHLayout->addLayout(m_localHLayout); // 添加到主垂直布局 m_mainVLayout->addWidget(backgroundLabel); } void LocalModelConfigWidget::getCurSystemVersion() { m_curSystemVersion = curSystemVersion(); } void LocalModelConfigWidget::initOtherModelLayout() { // 安装/卸载需注销提示 m_tipHLayout = new QHBoxLayout(); m_tipHLayout->setSpacing(0); m_tipLabel = new kdk::KLabel(m_nlpWidget); m_tipLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_KLabel_tipLabel"); m_tipLabel->setText(tr("(Installing/uninstalling models requires a reboot to take effect)")); m_tipLabel->setMinimumWidth(140); setKLabelFontColor(m_tipLabel, "red"); m_tipHLayout->addWidget(m_tipLabel); m_nlpLabelHLayout = new QHBoxLayout; m_nlpLabelHLayout->setSpacing(4); // 安装按钮 m_installButton = new KBorderlessButton(m_nlpWidget); m_installButton->setAccessibleName("kylin-ai-subsystem-modelconfig_KBorderlessButton_installButton"); m_installButton->setIcon(QIcon::fromTheme("browser-download-symbolic")); m_installButton->setIconSize(QSize(16, 16)); m_installButton->setText(tr("Install")); m_installButton->setVisible(false); m_installButton->setMinimumWidth(80); m_installButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); // 更新/卸载按钮 m_updateOrUninstallBtn = new KBorderlessButton(m_nlpWidget); m_updateOrUninstallBtn->setAccessibleName("kylin-ai-subsystem-modelconfig_KBorderlessButton_updateAndUninstallBtn"); m_updateOrUninstallBtn->setIcon(QIcon::fromTheme("software-update-available-symbolic")); m_updateOrUninstallBtn->setIconSize(QSize(16, 16)); m_updateOrUninstallBtn->setText(tr("Update/Uninstall")); m_updateOrUninstallBtn->setVisible(false); m_updateOrUninstallBtn->setMinimumWidth(110); m_updateOrUninstallBtn->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); // 系统内置模型 图像识别、向量化、语音处理等其他系统运行所需的模型 m_otherVLayout = new QVBoxLayout(); m_otherVLayout->setContentsMargins(0, 0, 0, 0); m_otherDescVLayout = new QVBoxLayout(); m_otherDescVLayout->setSpacing(0); m_otherDescVLayout->setContentsMargins(16, 0, 16, 0); QFont font; font.setBold(true); // 设置字体加粗 m_otherLabel = new QLabel(m_nlpWidget); m_otherLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_otherLabel"); m_otherLabel->setText(tr("Built in model of the system")); m_otherLabel->setFont(font); m_otherDescLabel = new kdk::KLabel(m_nlpWidget); m_otherDescLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_otherDescLabel"); m_otherDescLabel->setText(tr("The system has built-in models for image recognition, vectorization, speech processing, " "and other necessary models for system operation")); m_otherDescLabel->setFixedWidth(450); setKLabelFontColor(m_otherDescLabel, "#808080"); } void LocalModelConfigWidget::initModellayout() { initOtherModelLayout(); m_baseVLayout = new QVBoxLayout(this); m_baseVLayout->setContentsMargins(0, 0, 0, 0); // NLP大语言模型 m_nlpWidget = new QWidget(this); m_nlpWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_nlpWidget"); m_nlpWidget->setLayout(m_baseVLayout); m_nlpVLayout = new QVBoxLayout; m_nlpVLayout->setContentsMargins(0, 0, 0, 0); m_nlpHLayout = new QHBoxLayout; m_nlpHLayout->setContentsMargins(16, 0, 16, 0); m_nlpHLayout->setSpacing(10); // NLP标题 QFont font; font.setBold(true); // 设置字体加粗 m_nlpLabel = new QLabel(m_nlpWidget); m_nlpLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_nlpLabel"); m_nlpLabel->setText(tr("NLP Model")); m_nlpLabel->setFont(font); // NLP描述 m_nlpDescLabel = new kdk::KLabel(m_nlpWidget); m_nlpDescLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_nlpDescLabel"); m_nlpDescLabel->setText(tr("Processing and generating text, such as understanding text and answering questions")); m_nlpDescLabel->setMinimumWidth(260); setKLabelFontColor(m_nlpDescLabel, "#808080"); // 标题和描述放入布局 m_nlpDescVLayout = new QVBoxLayout(); m_nlpDescVLayout->setSpacing(0); m_nlpDescVLayout->setContentsMargins(0, 0, 0, 0); // 已配置模型 m_nlpLocalModelGroup = new SettingGroup(m_nlpWidget); m_nlpLocalModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_nlpLocalModelGroup"); // '文本类模型'放入布局 m_nlpLabelHLayout->addWidget(m_nlpLabel); if (m_curSystemVersion == SystemVersion::Version_2403 || m_curSystemVersion == SystemVersion::Version_V11) { // '下载安装后需注销生效'放入布局 m_nlpLabelHLayout->addLayout(m_tipHLayout); m_nlpLabelHLayout->addStretch(0); } m_nlpDescVLayout->addLayout(m_nlpLabelHLayout); m_nlpDescVLayout->addWidget(m_nlpDescLabel); m_nlpHLayout->addLayout(m_nlpDescVLayout); m_nlpHLayout->addStretch(); m_nlpVLayout->addLayout(m_nlpHLayout); m_nlpVLayout->addWidget(m_nlpLocalModelGroup); m_baseVLayout->addLayout(m_nlpVLayout); m_otherModelGroup = new SettingGroup(m_nlpWidget); m_otherModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_otherModelGroup"); if (m_curSystemVersion == SystemVersion::Version_2403 || m_curSystemVersion == SystemVersion::Version_V11) { m_nlpHLayout->addWidget(m_installButton); m_nlpHLayout->addWidget(m_updateOrUninstallBtn); } m_otherDescVLayout->addWidget(m_otherLabel); m_otherDescVLayout->addWidget(m_otherDescLabel); m_otherVLayout->addLayout(m_otherDescVLayout); m_otherVLayout->addWidget(m_otherModelGroup); m_baseVLayout->addLayout(m_otherVLayout); // VISION视觉模型 m_visionWidget = new QWidget; m_visionWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_visionWidget"); m_visionVLayout = new QVBoxLayout; m_visionVLayout->setContentsMargins(0, 0, 0, 0); m_visionHLayout = new QHBoxLayout; m_visionHLayout->setContentsMargins(16, 0, 16, 0); // VISION标题 m_visionLabel = new QLabel; m_visionLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_visionLabel"); // m_visionLabel->setText(tr("Visual Model")); m_visionLabel->setFont(font); // VISION描述 // m_visionDescrLabel = new kdk::KLabel; // m_visionDescrLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_visionDescrLabel"); // m_visionDescrLabel->setText(tr("Processing and generating images, such as recognizing objects and analyzing scenes")); // m_visionDescrLabel->setFixedWidth(400); // m_visionDescrLabel->setStyleSheet("color: #808080;"); // 标题和描述放入布局 m_visionDescVLayout = new QVBoxLayout(); m_visionDescVLayout->addWidget(m_visionLabel); m_visionDescVLayout->addWidget(m_visionDescrLabel); // 已配置模型 m_visionLocalModelGroup = new SettingGroup; m_visionLocalModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_visionLocalModelGroup"); m_visionHLayout->addLayout(m_visionDescVLayout); m_visionHLayout->addStretch(); m_visionVLayout->addLayout(m_visionHLayout); m_visionVLayout->addWidget(m_visionLocalModelGroup); m_visionWidget->setLayout(m_visionVLayout); // SPEECH语音模型 m_speechWidget = new QWidget; m_speechWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_speechWidget"); m_speechVLayout = new QVBoxLayout; m_speechVLayout->setContentsMargins(0, 0, 0, 0); m_speechHLayout = new QHBoxLayout; m_speechHLayout->setContentsMargins(16, 0, 16, 0); // SPEECH标题 m_speechLabel = new QLabel; m_speechLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_speechLabel"); // m_speechLabel->setText(tr("Speech Model")); m_speechLabel->setFont(font); // SPEECH描述 // m_speechDescLabel = new kdk::KLabel; // m_speechDescLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_speechDescLabel"); // m_speechDescLabel->setText(tr("Processing sound and speech, such as recognizing speech and synthesizing speech")); // m_speechDescLabel->setFixedWidth(400); // m_speechDescLabel->setStyleSheet("color: #808080;"); // 标题和描述放入布局 m_speechDescVlayout = new QVBoxLayout(); m_speechDescVlayout->addWidget(m_speechLabel); m_speechDescVlayout->addWidget(m_speechDescLabel); // 已配置模型 m_speechLocalModelGroup = new SettingGroup; m_speechLocalModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_speechLocalModelGroup"); m_speechHLayout->addLayout(m_speechDescVlayout); m_speechHLayout->addStretch(); m_speechVLayout->addLayout(m_speechHLayout); m_speechVLayout->addWidget(m_speechLocalModelGroup); m_speechWidget->setLayout(m_speechVLayout); // 滚动区域 m_scrollVLayout = new QVBoxLayout; m_scrollVLayout->setContentsMargins(16, 20, 16, 0); m_scrollVLayout->addWidget(m_nlpWidget); m_scrollVLayout->addWidget(m_visionWidget); m_scrollVLayout->addWidget(m_speechWidget); m_scrollVLayout->addStretch(); m_scrollWidget = new QWidget; m_scrollWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_scrollWidget"); m_scrollWidget->setContentsMargins(0, 0, 0, 0); m_scrollWidget->setLayout(m_scrollVLayout); m_scrollArea = new QScrollArea(this); m_scrollArea->setAccessibleName("kylin-ai-subsystem-modelconfig_QScrollArea_m_scrollArea"); m_scrollArea->setFixedHeight(420); m_scrollArea->setWidgetResizable(true); m_scrollArea->setFrameStyle(QFrame::NoFrame); // 无边框 m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // 不显示水平滚动条 m_scrollArea->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); m_scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove", false); m_scrollArea->setWidget(m_scrollWidget); m_mainVLayout->addWidget(m_scrollArea); m_confirmLocalButton = new QPushButton(tr("OK"), this); m_confirmLocalButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_m_confirmLocalButton"); m_confirmLocalButton->setProperty("isImportant", true); m_confirmLocalButtoLayout = new QHBoxLayout(); m_confirmLocalButtoLayout->setContentsMargins(0, 0, 24, 24); m_confirmLocalButtoLayout->addStretch(); m_confirmLocalButtoLayout->addWidget(m_confirmLocalButton); m_mainVLayout->addStretch(); m_mainVLayout->addLayout(m_confirmLocalButtoLayout); } ModelStatus LocalModelConfigWidget::getModelStatus(QString modelName) { ModelConfig mc; ModelStatus ret = mc.getModelStatus(modelName.toStdString()); KyInfo() << QString("ModelStatus = %0").arg((qint32)ret); return ret; } bool LocalModelConfigWidget::eventFilter(QObject *watched, QEvent *event) { // 模型配置 LocalModelItem *clickedModelItem = qobject_cast(watched); if (clickedModelItem) { if (event->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::LeftButton) { // 判断左键 // 切换模型 clickLocalModel(clickedModelItem->getAICapability(), clickedModelItem->getModelName()); return true; } } } return QWidget::eventFilter(watched,event); } void LocalModelConfigWidget::closeEvent(QCloseEvent *event) { bool isdownloading = ModelDownload::getInstance()->getDownloadingStatus(); KyInfo() << " close event -----1----:current model is downloading :" << isdownloading; //检查是否正在初始化下载阶段 bool isStartDownloading = ModelDownload::getInstance()->getStartDownloadingStatus(); KyInfo() << " close event -----2----:current model is start downloading:" << isStartDownloading; //判断当前是否正在安装中,正在安装中则提示用户是否退出 bool isInstalling = ModelDownload::getInstance()->getCurrentInstallStatus(); KyInfo() << " close event -----3----:current model is installing:" << isInstalling; //非正在下载状态则直接关闭界面 if(isdownloading == false && isStartDownloading == false && isInstalling == false){ event->accept(); return; }else { //正在初始化安装中 if(isStartDownloading) { //正在初始化下载过程中弹出二次确认窗口 QMessageBox *msgBox = new QMessageBox(this); msgBox->setIcon(QMessageBox::Question); // 标题加粗并为黑色字体(使用 HTML) QString title = "" + tr("Are you sure you want to exit?") + ""; msgBox->setText(title); // 说明文字也设为黑色 QString infoText = "" + tr("The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit?") + ""; msgBox->setInformativeText(infoText); QPushButton *cancelButton = msgBox->addButton(tr("Cancel"), QMessageBox::RejectRole); QPushButton *quitButton = msgBox->addButton(tr("Quit"), QMessageBox::AcceptRole); connect(msgBox,&QMessageBox::finished,this,[=](){ msgBox->close(); event->ignore(); return; }); connect(quitButton,&QPushButton::clicked,this,[=](){ bool cancelFlag = ModelDownload::getInstance()->cancelDownloading(); if(cancelFlag) { event->accept(); this->hide(); return; } else{ event->ignore(); return; } }); connect(cancelButton,&QPushButton::clicked,this,[=](){ event->ignore(); return; }); msgBox->setDefaultButton(cancelButton); msgBox->exec(); } //正在安装中 else if(isInstalling) { QMessageBox *msgBox = new QMessageBox(this); msgBox->setIcon(QMessageBox::Question); // 标题加粗并为黑色字体(使用 HTML) QString title = "" + tr("Exit current window?") + ""; msgBox->setText(title); QString infoText = "" + tr("The model installation will continue to run in the background. A restart is required for the changes to take effect once completed.") + ""; msgBox->setInformativeText(infoText); QPushButton *cancelButton = msgBox->addButton(tr("Cancel"), QMessageBox::RejectRole); QPushButton *quitButton = msgBox->addButton(tr("Quit"), QMessageBox::AcceptRole); connect(msgBox,&QMessageBox::finished,this,[=](){ msgBox->close(); event->ignore(); return; }); connect(quitButton,&QPushButton::clicked,this,[=](){ event->accept(); this->hide(); return; }); connect(cancelButton,&QPushButton::clicked,this,[=](){ event->ignore(); return; }); msgBox->setDefaultButton(quitButton); msgBox->exec(); } else if(isdownloading) { //正在下载过程中则弹出二次确认窗口 QMessageBox *msgBox = new QMessageBox(this); msgBox->setIcon(QMessageBox::Question); // 标题加粗并为黑色字体(使用 HTML) QString title = "" + tr("Are you sure you want to exit?") + ""; msgBox->setText(title); // 说明文字也设为黑色 QString infoText = "" + tr("The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit?") + ""; msgBox->setInformativeText(infoText); QPushButton *cancelButton = msgBox->addButton(tr("Cancel"), QMessageBox::RejectRole); QPushButton *quitButton = msgBox->addButton(tr("Quit"), QMessageBox::AcceptRole); connect(msgBox,&QMessageBox::finished,this,[=](){ msgBox->close(); event->ignore(); return; }); connect(quitButton,&QPushButton::clicked,this,[=](){ bool cancelFlag = ModelDownload::getInstance()->cancelDownloading(); if(cancelFlag) { event->accept(); this->hide(); return; } else{ event->ignore(); return; } }); connect(cancelButton,&QPushButton::clicked,this,[=](){ event->ignore(); return; }); msgBox->setDefaultButton(cancelButton); msgBox->exec(); } } } void LocalModelConfigWidget::loadNlpModelConfig() { ModelConfig mc; std::string curNlpModelName = mc.getCurrentModelName(AiCapability::Nlp, DeployType::Ondevice); bool isExistLocalModel = false; const auto models = mc.getExtendedModels(AiCapability::Nlp); for (const auto &model : models) { if(model.deployType != DeployType:: Ondevice) { continue; } UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_UkccFrame_itemFrame"); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); itemFrame->installEventFilter(this); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(0, 0, 0, 0); PublicLocalModel publicLocalModel; publicLocalModel.capability = model.capability; publicLocalModel.vendor = QString::fromStdString(model.vendor); publicLocalModel.modelName = QString::fromStdString(model.modelName); publicLocalModel.multiAuths = mc.getModelAuthentications(model.modelName); publicLocalModel.debName = QString::fromStdString(model.debName); LocalModelItem *item = new LocalModelItem(publicLocalModel, m_curSystemVersion, itemFrame); item->setAccessibleName("kylin-ai-subsystem-modelconfig_LocalModelItem_item"); item->installEventFilter(this); layItem->addWidget(item); isExistLocalModel = true; m_nlpLocalModelGroup->addWidget(itemFrame); m_nlpLocalModelItemMap[publicLocalModel.modelName] = item; if (model.modelName == curNlpModelName) { item->showSelectedIcon(true); } } if (m_curSystemVersion == SystemVersion::Version_2403 || m_curSystemVersion == SystemVersion::Version_V11) { isExistLocalModel ? m_updateOrUninstallBtn->setVisible(true) : m_installButton->setVisible(true); } } void LocalModelConfigWidget::loadOtherModelConfig() { UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_UkccFrame_itemFrame"); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(16, 0, 0, 0); m_otherFrameLabelText = new QLabel(itemFrame); m_otherFrameLabelText->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_frameLabel"); m_otherFrameLabelText->setText(tr("Built in model group")); layItem->addWidget(m_otherFrameLabelText); m_otherModelGroup->addWidget(itemFrame); } void LocalModelConfigWidget::initConnect() { connect(m_confirmLocalButton, &QPushButton::clicked, this, [this](){ this->close(); }); connect(m_installButton, &QPushButton::clicked, this, &LocalModelConfigWidget::openSoftwareStore); connect(m_updateOrUninstallBtn, &QPushButton::clicked, this, &LocalModelConfigWidget::openSoftwareStore); } void LocalModelConfigWidget::openSoftwareStore() { //打开软件商店 QString cmd = QString("/usr/bin/kylin-software-center -menuid=2 -tagid=712"); QProcess::startDetached(cmd); } void LocalModelConfigWidget::deleteModelItem(AiCapability capability, QString modelName) { ModelConfig mc; QString curModelName = QString::fromStdString(mc.getCurrentModelName(capability,DeployType::Ondevice)); bool isCheckSelected = checkModelSelection(capability, modelName); //KyInfo() << "currentmodelname" << curModelName << "要删除的modelname" << modelName << "isCheckSelected" << isCheckSelected; if (capability == AiCapability::Nlp) { m_nlpLocalModelMap.remove(modelName); m_nlpLocalModelItemMap.remove(modelName); m_nlpLocalModelGroup->removeWidget(m_nlpLocalModelMapUI[modelName]); m_nlpLocalModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_nlpLocalModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 auto remainingModelItems = m_nlpLocalModelItemMap.values(); QString firstModelName = remainingModelItems.first()->getModelName(); bool ret = setSelectLocalModelName(capability, DeployType::Ondevice, firstModelName); // set sdk if (ret == true) { switchModelItem(remainingModelItems.first()->getAICapability(), remainingModelItems.first()->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " nlpModelItemMap为空"; nlpSelectedLocalModel = ""; } } } else if (capability == AiCapability::Vision) { m_visionLocalModelMap.remove(modelName); m_visionLocalModelItemMap.remove(modelName); m_visionLocalModelGroup->removeWidget(m_visionLocalModelMapUI[modelName]); m_visionLocalModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_visionLocalModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 auto remainingModelItems = m_visionLocalModelItemMap.values(); QString firstModelName = remainingModelItems.first()->getModelName(); bool ret = setSelectLocalModelName(capability, DeployType::Ondevice, firstModelName); // set sdk if (ret == true) { switchModelItem(remainingModelItems.first()->getAICapability(), remainingModelItems.first()->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " visionModelItemMap为空"; visionSelectedLocalModel = ""; } } } else if (capability == AiCapability::Speech) { m_speechLocalModelMap.remove(modelName); m_speechLocalModelItemMap.remove(modelName); m_speechLocalModelGroup->removeWidget(m_speechLocalModelMapUI[modelName]); m_speechLocalModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_speechLocalModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 auto remainingModelItems = m_speechLocalModelItemMap.values(); QString firstModelName = remainingModelItems.first()->getModelName(); bool ret = setSelectLocalModelName(capability, DeployType::Ondevice, firstModelName); // set sdk if (ret == true) { switchModelItem(remainingModelItems.first()->getAICapability(), remainingModelItems.first()->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " speechModelItemMap为空"; speechSelectedLocalModel = ""; } } } } void LocalModelConfigWidget::switchModelItem(AiCapability capability, QString modelName) { QMap *localModelItemMap = nullptr; if (capability == AiCapability::Nlp) { localModelItemMap = &m_nlpLocalModelItemMap; } else if (capability == AiCapability::Vision) { localModelItemMap = &m_visionLocalModelItemMap; } else if (capability == AiCapability::Speech) { localModelItemMap = &m_speechLocalModelItemMap; } if (localModelItemMap) { foreach (const auto& modelItemName, localModelItemMap->keys()) { LocalModelItem* modelItem = localModelItemMap->value(modelItemName); if (modelItem->getModelName() == modelName) { KyInfo() << "匹配成功,展示图标"; modelItem->showSelectedIcon(true); if (capability == AiCapability::Nlp) { nlpSelectedLocalModel = modelName; } else if (capability == AiCapability::Vision) { visionSelectedLocalModel = modelName; } else if (capability == AiCapability::Speech) { speechSelectedLocalModel = modelName; } } else { // 不匹配,隐藏图标 KyInfo() << "不匹配,隐藏图标"; modelItem->showSelectedIcon(false); } } } } bool LocalModelConfigWidget::setSelectLocalModelName(AiCapability capability, DeployType deployType, QString modelName) { ModelConfig mc; bool ret2 = mc.setCurrentModelName(capability, deployType, modelName.toStdString()); //bool isInstall = checkCurrentLocalModelInstall(kaglobal::ondeviceModelInstallPath) && modelName == "qwen_fastllm"; //KyInfo() << "setSelectLocalModelName" << modelName; if ( ret2 == true ) { KyInfo() << "setCurrentModelName success:"<< ret2 ; } else { KyInfo() << "setCurrentModelName failed:"<< ret2 ; } return ret2 ; } void LocalModelConfigWidget::clickLocalModel(AiCapability capability, QString modelName) { //判断当前模型是否已选中 bool ret = checkModelSelection(capability, modelName); if (ret == true) { return; } else { //如果模型正在使用 if ((capability == AiCapability::Nlp && (getModelStatus(modelName) == ModelStatus::Running)) || (capability == AiCapability::Nlp && (getModelStatus(modelName) == ModelStatus::Running)) || (capability == AiCapability::Vision && (getModelStatus(modelName) == ModelStatus::Running)) || (capability == AiCapability::Speech && (getModelStatus(modelName) == ModelStatus::Running)) || (capability == AiCapability::Speech && (getModelStatus(modelName) == ModelStatus::Running)) || (capability == AiCapability::Speech && (getModelStatus(modelName) == ModelStatus::Running))) { // NLP or VISION or SPEECH 正在使用 KyInfo() << "正在使用" << static_cast(capability); bool canProceed = showModelInUseMessage(this); if (canProceed == true) { clickLocalModel(capability, modelName); } else { KyInfo() << "取消本次操作"; return; } //当前模型未选中则进行切换 } else { KyInfo() << "aaa:" << static_cast(capability) << modelName; //判断当前模型是否已经安装可切换,否则直接返回 bool ret = setSelectLocalModelName(capability, DeployType::Ondevice, modelName); if (ret == true) { switchModelItem(capability, modelName); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model switching failed"),this); KyInfo() << modelName << " 设置为选中模型失败"; } } } } bool LocalModelConfigWidget::checkModelSelection(AiCapability capability, QString modelName) { if (capability == AiCapability::Nlp) { if (modelName == nlpSelectedLocalModel) { return true; } else { return false; } } else if (capability == AiCapability::Vision) { if (modelName == visionSelectedLocalModel) { return true; } else { return false; } } else if (capability == AiCapability::Speech) { if (modelName == speechSelectedLocalModel) { return true; } else { return false; } } else { return false; } } bool LocalModelConfigWidget::checkCurrentLocalModelInstall(const QString &filePath) { //检查当前本地模型是否已经安装 QFileInfo fileInfo(filePath); return fileInfo.exists(); } void LocalModelConfigWidget::showCentered() { if (QWidget* mainWindow = QApplication::activeWindow()) { QRect mainGeom = mainWindow->geometry(); move(mainGeom.x() + (mainGeom.width() - width()) / 2, mainGeom.y() + (mainGeom.height() - height()) / 2 + 15); } adjustPosition(this); // 调用内部调整逻辑 } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/localmodelconfigwidget.h000066400000000000000000000144351520576575000274370ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef LOCALMODELCONFIGWIDGET_H #define LOCALMODELCONFIGWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "localmodelitem.h" #include "kaglobal.h" #include "util.h" #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include "ukui-log4qt.h" #include #include #include #include #include #include using namespace std; using namespace kdk; using namespace kyai::config::model; class LocalModelConfigWidget : public QDialog { Q_OBJECT public: explicit LocalModelConfigWidget(QWidget *parent = nullptr); void initLayout(); void initModelTitleLayout(); void initModellayout(); void showCentered(); ModelStatus getModelStatus(QString modelName); signals: void sigSetSelectLocalModel(AiCapability capability, QString modelName); protected: bool eventFilter(QObject *watched, QEvent *event) override; void closeEvent(QCloseEvent *event) override; private: void getCurSystemVersion(); void initOtherModelLayout(); // 加载nlp模型 void loadNlpModelConfig(); // 加载除nlp以外的其他模型 void loadOtherModelConfig(); // 信号槽 void initConnect(); void openSoftwareStore(); // 加载模型 void loadModelItem(PublicLocalModel model,QString curSelectedName); // 删除模型 void deleteModelItem(AiCapability capability, QString modelName); // 切换选中模型 void switchModelItem(AiCapability capability, QString modelName); // 设置选中模型名称 bool setSelectLocalModelName(AiCapability capability, DeployType deployType, QString modelName); // 点击模型 void clickLocalModel(AiCapability capability, QString modelName); // 检查该模型是否已选择 bool checkModelSelection(AiCapability capability, QString modelName); // 检查当前本地模型是否安装 bool checkCurrentLocalModelInstall(const QString &filePath); private: SystemVersion m_curSystemVersion; QVBoxLayout *m_mainVLayout; QHBoxLayout *m_titleHLayout; QLabel *m_titleLabel; QVBoxLayout *m_vLeftLayout = nullptr; QLabel *m_iconLabel = nullptr; QVBoxLayout *m_localHLayout = nullptr; QLabel *m_localLabel = nullptr; kdk::KLabel *m_descripLabel = nullptr; QVBoxLayout *m_baseVLayout = nullptr; QScrollArea *m_scrollArea = nullptr; QWidget *m_scrollWidget = nullptr; QVBoxLayout *m_scrollVLayout = nullptr; //NLP大语言模型 QWidget *m_nlpWidget = nullptr; QVBoxLayout *m_nlpDescVLayout = nullptr; QHBoxLayout *m_nlpHLayout = nullptr; QVBoxLayout *m_nlpVLayout = nullptr; KBorderlessButton *m_installButton = nullptr; KBorderlessButton *m_updateOrUninstallBtn = nullptr; QHBoxLayout *m_nlpLabelHLayout = nullptr; QLabel * m_nlpLabel = nullptr; QHBoxLayout *m_tipHLayout = nullptr; kdk::KLabel *m_tipLabel = nullptr; kdk::KLabel * m_nlpDescLabel = nullptr; QHBoxLayout *m_nlpFrameHLayout = nullptr; QLabel *m_nlpFrameLabelText = nullptr; QLabel *m_nlpFrameSelectedIcon = nullptr; // 系统内置模型 图像识别、向量化、语音处理等其他系统运行所需的模型 QVBoxLayout *m_otherVLayout = nullptr; QVBoxLayout *m_otherDescVLayout = nullptr; QLabel *m_otherLabel = nullptr; kdk::KLabel *m_otherDescLabel = nullptr; QLabel *m_otherFrameLabelText = nullptr; // VISION视觉模型 QWidget *m_visionWidget = nullptr; QVBoxLayout *m_visionDescVLayout = nullptr; QHBoxLayout *m_visionHLayout = nullptr; QVBoxLayout *m_visionVLayout = nullptr; QLabel *m_visionLabel = nullptr; kdk::KLabel *m_visionDescrLabel = nullptr; // SPEECH语音模型 QWidget *m_speechWidget = nullptr; QVBoxLayout *m_speechDescVlayout =nullptr; QHBoxLayout *m_speechHLayout = nullptr; QVBoxLayout *m_speechVLayout = nullptr; QLabel * m_speechLabel = nullptr; kdk::KLabel * m_speechDescLabel = nullptr; //确定按钮 QPushButton *m_confirmLocalButton = nullptr; QHBoxLayout *m_confirmLocalButtoLayout = nullptr; public: QMap m_nlpLocalModelMap; QMap m_visionLocalModelMap; QMap m_speechLocalModelMap; QMap m_nlpLocalModelItemMap; QMap m_visionLocalModelItemMap; QMap m_speechLocalModelItemMap; QMap m_nlpLocalModelMapUI; QMap m_visionLocalModelMapUI; QMap m_speechLocalModelMapUI; SettingGroup *m_nlpLocalModelGroup = nullptr; SettingGroup *m_visionLocalModelGroup = nullptr; SettingGroup *m_speechLocalModelGroup = nullptr; SettingGroup *m_otherModelGroup = nullptr; QString nlpSelectedLocalModel; QString visionSelectedLocalModel; QString speechSelectedLocalModel; bool continuousSelected = false; bool realtimeSelected = false; }; #endif // LOCALMODELCONFIGWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/localmodelitem.cpp000066400000000000000000000447661520576575000262710ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "localmodelitem.h" LocalModelItem::LocalModelItem(PublicLocalModel model, SystemVersion curSystemVersion, QWidget *parent) { m_curSystemVersion = curSystemVersion; m_capability = model.capability; m_modelName = model.modelName; m_model = model; initLayout(); if (m_curSystemVersion == SystemVersion::Version_2503) { initConnect(); initMenu(); initInstallSuccessMsgBox(); //如果存在临时文件,提示用户需要重启电脑 if(checkHasRebootTempFile()) { showMessageTips(MessageTipType::PersistentMessage,tr("Effective after reboot"),0); } } } LocalModelItem::~LocalModelItem(){ } void LocalModelItem::showSelectedIcon(bool flag) { m_selectedIconLabel->setVisible(flag); } bool LocalModelItem::isSelected() { return m_selectedIconLabel->isVisible(); } AiCapability LocalModelItem::getAICapability() { return m_capability; } QString LocalModelItem::getModelName() { return m_modelName; } QString LocalModelItem::getModelDebName() { return m_model.debName; } bool LocalModelItem::getIsStartDownloading() { return isStartDownloading; } void LocalModelItem::showMessageTips(MessageTipType type, const QString &msg, const int &duration) { // 重置定时器 if (type == MessageTipType::InfoMessage && m_infoTimer) { m_infoTimer->stop(); m_infoTimer->deleteLater(); m_infoTimer = nullptr; } else if (type == MessageTipType::WarningMessage && m_warningTimer) { m_warningTimer->stop(); m_warningTimer->deleteLater(); m_warningTimer = nullptr; } //设置状态 if(m_tipsLabel->isVisible() == false) { m_tipsLabel->setVisible(true); } switch (type) { case MessageTipType::InfoMessage: m_tipsLabel->setStyleSheet("color:#808080;"); m_tipsLabel->setText(msg); m_currentInfoMessage = msg; m_infoTimer = new QTimer(this); m_infoTimer->setSingleShot(true); connect(m_infoTimer, &QTimer::timeout, this, [this, msg](){ KyInfo() << "===========showMessageTips===========InfoMessage============QTimer==========text:" << m_tipsLabel->text() << "==========msg===========" << m_currentInfoMessage; if (m_tipsLabel->text() == m_currentInfoMessage) { m_tipsLabel->setStyleSheet("color:black"); m_tipsLabel->setText(""); m_tipsLabel->setVisible(false); } }); m_infoTimer->start(duration); break; case MessageTipType::WarningMessage: m_tipsLabel->setStyleSheet("color:red;"); m_tipsLabel->setText(msg); m_currentWarningMessage = msg; m_warningTimer = new QTimer(this); m_warningTimer->setSingleShot(true); connect(m_warningTimer, &QTimer::timeout, this, [this, msg](){ KyInfo() << "===========showMessageTips===========WarningMessage============QTimer==========text:" << m_tipsLabel->text() << "=========msg===========" << m_currentWarningMessage; if (m_tipsLabel->text() == m_currentWarningMessage) { m_tipsLabel->setStyleSheet("color:black"); m_tipsLabel->setText(""); m_tipsLabel->setVisible(false); } }); m_warningTimer->start(duration); break; case MessageTipType::PersistentMessage: m_tipsLabel->setStyleSheet("color:#808080;"); m_tipsLabel->setText(msg); break; default: break; } } void LocalModelItem::initModelDownloadLayout() { //模型面板 m_panelHLayout = new QHBoxLayout(); //模型信息 m_messageHLayout = new QHBoxLayout(); m_messageWidget = new QWidget(this); m_messageWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_messageWidget"); //更新和状态信息提示 m_tipsLabel = new QLabel(m_messageWidget); m_tipsLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_tipsLabel"); m_tipsLabel->setVisible(false); if(checkHasRebootTempFile()) { m_tipsLabel->setVisible(true); showMessageTips(MessageTipType::PersistentMessage,tr("Effective after reboot ."),0); } m_messageHLayout->addWidget(m_tipsLabel); //更多按钮 m_moreButton = new QToolButton(m_messageWidget); m_moreButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QToolButton_m_moreButton"); m_moreButton->setFixedSize(32, 32); m_moreButton->setProperty("useButtonPalette", true); m_moreButton->setAutoRaise(true); m_moreButton->setPopupMode(QToolButton::InstantPopup); m_moreButton->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); m_moreButton->setFocusPolicy(Qt::NoFocus); m_moreButton->setVisible(true); m_messageHLayout->addWidget(m_moreButton); //下载按钮 m_downButton = new QToolButton(m_messageWidget); m_downButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QToolButton_m_downButton"); m_downButton->setFixedSize(32, 32); m_downButton->setProperty("useButtonPalette", true); m_downButton->setAutoRaise(true); m_downButton->setPopupMode(QToolButton::InstantPopup); m_downButton->setIcon(QIcon::fromTheme("browser-download-symbolic")); m_downButton->setFocusPolicy(Qt::NoFocus); m_downButton->hide(); connect(m_downButton,&KToolButton::clicked,this,&LocalModelItem::sldownModel); m_messageHLayout->addWidget(m_downButton); m_loadButton = new KToolButton(m_messageWidget); m_loadButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QToolButton_m_loadButton"); m_loadButton->setLoading(true); m_loadButton->setFixedSize(38,38); m_loadButton->hide(); m_messageHLayout->addWidget(m_loadButton); m_messageWidget->setLayout(m_messageHLayout); m_messageWidget->setVisible(true); m_panelHLayout->addWidget(m_messageWidget); //进度条 m_progressHLayout = new QHBoxLayout(); updateProgressBar = new UpdateNotificationWidget(m_model, this); updateProgressBar->setAccessibleName("kylin-ai-subsystem-modelconfig_UpdateNotificationWidget_updateProgressBar"); updateProgressBar->setVisible(false); m_progressHLayout->addWidget(updateProgressBar); m_panelHLayout->addLayout(m_progressHLayout); } void LocalModelItem::initLayout() { if (m_curSystemVersion == SystemVersion::Version_2503) { initModelDownloadLayout(); } m_mainHLayout = new QHBoxLayout(); //模型名称 m_modelNameLabel = new QLabel(this); m_modelNameLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_modelNameLabel"); m_modelNameLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); m_modelNameLabel->setText(m_modelName); //选中判断框 m_selectedIconLabel = new QLabel(this); m_selectedIconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QToolButton_m_selectedIconLabel"); QIcon selectIcon = QIcon::fromTheme("ukui-selected"); m_selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); m_selectedIconLabel->setVisible(false); // 适配主题 const QByteArray id(THEME_QT_SCHEMA); QGSettings *mQtSettings = new QGSettings(id, QByteArray(), this); connect(mQtSettings, &QGSettings::changed, this, [=](QString key) { if (key == "iconThemeName") m_selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); }); QFrame *frame = new QFrame(this); frame->setAccessibleName("kylin-ai-subsystem-modelconfig_QFrame_frame"); frame->setFixedSize(16,16); QHBoxLayout *frameLayout = new QHBoxLayout; frameLayout->setContentsMargins(0, 0, 0, 0); frame->setLayout(frameLayout); frameLayout->addWidget(m_selectedIconLabel); m_selectedIconLabel->setVisible(false); m_mainHLayout->setContentsMargins(16,0,16,0); m_mainHLayout->addWidget(m_modelNameLabel); m_mainHLayout->addStretch(); if (m_curSystemVersion == SystemVersion::Version_2503) { m_mainHLayout->addLayout(m_panelHLayout); } m_mainHLayout->addWidget(frame); this->setLayout(m_mainHLayout); } void LocalModelItem::initMenu(){ m_menu = new QMenu(); m_menu->setAccessibleName("kylin-ai-subsystem-modelconfig_QMenu_m_menu"); m_moreButton->setMenu(m_menu); QAction *actionUpdate = new QAction(tr("Detect Updates")); //检测更新 connect(actionUpdate,&QAction::triggered,this,&LocalModelItem::checkHasNewVersion); m_menu->addAction(actionUpdate); } void LocalModelItem::initInstallSuccessMsgBox() { m_installSuccessMsgBox = new QMessageBox(this); m_installSuccessMsgBox->setAccessibleName("kylin-ai-subsystem-modelconfig_QMessageBox_m_installSuccessMsgBox"); m_installSuccessMsgBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(24,24)); // 标题加粗并为黑色字体(使用 HTML) QString title = "" + tr("Install success!") + ""; m_installSuccessMsgBox->setText(title); // 说明文字也设为黑色 QString infoText = "" + tr("The ondevice model has been installed and needs to be restarted " "before it can take effect. Do you want to restart it?") + ""; m_installSuccessMsgBox->setInformativeText(infoText); QPushButton *rebootLater = m_installSuccessMsgBox->addButton(tr("Reboot Later"), QMessageBox::RejectRole); QPushButton *rebootImmediately = m_installSuccessMsgBox->addButton(tr("Reboot Immediately"), QMessageBox::AcceptRole); m_installSuccessMsgBox->setDefaultButton(rebootImmediately); // 立即重启 connect(rebootImmediately, &QPushButton::clicked, this, [=]{ QDBusInterface interface("org.gnome.SessionManager", "/org/gnome/SessionManager", "org.gnome.SessionManager", QDBusConnection::sessionBus()); interface.call("reboot"); }); // 稍后重启 connect(rebootLater, &QPushButton::clicked, this, [=]{ m_modelStatus = LocalModelInstallStatus::RebootLater; m_messageWidget->setVisible(true); showMessageTips(MessageTipType::PersistentMessage,tr("Take effect after rebooting"),0); m_moreButton->setVisible(true); }); m_installSuccessMsgBox->setVisible(false); } void LocalModelItem::initConnect() { connect(updateProgressBar,&UpdateNotificationWidget::sigShowIsInstalling,this,[&]{ m_messageWidget->setVisible(true); showMessageTips(MessageTipType::PersistentMessage,tr("installing..."),0); }); } void LocalModelItem::checkHasNewVersion() { m_moreButton->hide(); m_tipsLabel->hide(); m_loadButton->setVisible(true); QCoreApplication::processEvents(); //断网检查 bool isOnline = updateProgressBar->checkNetWorkOnline(); if(!isOnline) { m_loadButton->setVisible(false); m_moreButton->setVisible(true); showMessageTips(MessageTipType::WarningMessage,tr("Net is error,Please check and try again"),6000); m_downButton->setVisible(false); return; } //进行新版本检查并切换到下载界面 KyInfo() << "current download model deb Name:" << this->getModelDebName(); QString pkgName = this->getModelDebName(); QString tips; PkgInstallStatus status = ModelDownload::getInstance()->getPkgStatus(pkgName); switch (status) { //安装包未找到 case PkgInstallStatus::PkgNotFound: tips = QString(tr("The installation package for the specified model was not found:% 1. Please check the software source and network status and try again!")).arg(pkgName); m_loadButton->setVisible(false); m_tipsLabel->setVisible(false); m_downButton->setVisible(false); m_moreButton->setVisible(true); break; //安装包已找到未安装 case PkgInstallStatus::PkgFoundNotInstall: tips = QString(tr("The current model installation package is not installed, it can be downloaded and installed")); m_loadButton->setVisible(false); m_tipsLabel->setVisible(true); m_downButton->setVisible(true); break; //安装包发现新版本需要更新 case PkgInstallStatus::PkgFoundNewVersion: tips = QString(tr("New version needs to be updated upon discovery")); m_loadButton->setVisible(false); showMessageTips(MessageTipType::InfoMessage,tr("New version needs to be updated upon discovery"),6000); m_downButton->setVisible(true); break; //安装包已经是最新版本 case PkgInstallStatus::PkgLastestVersion: tips = QString(tr("The current model is already the latest model")); m_loadButton->setVisible(false); showMessageTips(MessageTipType::InfoMessage,tr("Current model version is the lastest version"),6000); m_downButton->setVisible(false); m_moreButton->setVisible(true); break; default: break; } KyInfo() << "current check deb result:" <setVisible(false); m_messageWidget->setVisible(false); //如果成功开始下载则跳转到下载界面 if(ModelDownload::getInstance()->downloadModelPkg(m_model.debName)) { updateProgressBar->setVisible(true); updateProgressBar->setProgressBarVisible(true); updateProgressBar->setCancelDownloadButtenEnabled(false); //设置开始下载标志 isStartDownloading = true; ModelDownload::getInstance()->setIsStartDownloading(true); //更新下载进度 connect(ModelDownload::getInstance(),&ModelDownload::sigUpdateModelInstallStatus,this,&LocalModelItem::slUpdateModelInstallStatus,Qt::UniqueConnection); //更新下载状态 connect(ModelDownload::getInstance(),&ModelDownload::sigUpdateModelInstallFinished,this,&LocalModelItem::slUpdateModelInstallFinished,Qt::UniqueConnection); //更新取消下载按钮 connect(ModelDownload::getInstance(),&ModelDownload::sigCancelExitButton,this,&LocalModelItem::slUpdateCancelButton,Qt::UniqueConnection); } } void LocalModelItem::startNetErrorTips() { if(m_tipsLabel->isVisible() == true) { m_tipsLabel->setStyleSheet("color:red;"); m_timer = new QTimer(this); m_timer->setInterval(3000); m_timer->start(); connect(m_timer, &QTimer::timeout, this, [&]{ m_timer->stop(); m_tipsLabel->setStyleSheet("color:black;"); m_tipsLabel->setText(""); m_tipsLabel->setVisible(false); }); } } void LocalModelItem::slUpdateModelInstallStatus(int value, QString status, QString details) { if(isStartDownloading) { KyInfo() << "clear start downloading flag:" << m_downButton->isVisible(); isDownLoading = true; ModelDownload::getInstance()->setDownloadingStatus(true); updateProgressBar->setCancelDownloadButtenEnabled(true); ModelDownload::getInstance()->setIsStartDownloading(false); } //下载过程中时再进行下载进度条的更新 if(isDownLoading) { updateProgressBar->slUpdateProgressValue(value); } } void LocalModelItem::slUpdateModelInstallFinished(bool isSuccess, QStringList upgradeGroup, QString errorStr, QString errorDesc) { //安装成功 if(isSuccess) { //创建临时文件,检查是否重启过电脑 createRebootTempFile(); //如果存在临时文件,提示用户需要重启电脑 if(checkHasRebootTempFile()) { showMessageTips(MessageTipType::PersistentMessage,tr("Effective after reboot"),0); } //下载完成,如果当前界面显示时则显示是否重启对话框 if(this->isVisible()) { m_installSuccessMsgBox->setVisible(true); } } //安装失败 else { QString errorTips =QString("current model deb:%0 install failed.\n errorStr:%1.\n errorDesc:%2").arg(upgradeGroup.at(0)).arg(errorStr).arg(errorDesc); KyInfo() << errorTips; showMessageTips(MessageTipType::WarningMessage,tr("Current model install failed,please install manually."),6000); } //设置下载状态 isDownLoading = false; ModelDownload::getInstance()->setDownloadingStatus(false); //设置安装状态 ModelDownload::getInstance()->setInstallingStatus(false); //清除下载进度 updateProgressBar->setVisible(false); updateProgressBar->resetProgressBar(); m_messageWidget->setVisible(true); m_moreButton->setVisible(true); isStartDownloading = false; //断开信号槽的链接 //更新下载进度 disconnect(ModelDownload::getInstance(),&ModelDownload::sigUpdateModelInstallStatus,this,&LocalModelItem::slUpdateModelInstallStatus); //更新下载状态 disconnect(ModelDownload::getInstance(),&ModelDownload::sigUpdateModelInstallFinished,this,&LocalModelItem::slUpdateModelInstallFinished); //更新取消下载按钮 disconnect(ModelDownload::getInstance(),&ModelDownload::sigCancelExitButton,this,&LocalModelItem::slUpdateCancelButton); } void LocalModelItem::slUpdateCancelButton(bool isInstalling) { if(isInstalling) { updateProgressBar->setCancelDownloadButtonVisible(false); } } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/localmodelitem.h000066400000000000000000000071651520576575000257260ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef LOCALMODELITEM_H #define LOCALMODELITEM_H #include #include #include #include #include #include #include #include #include "ktoolbutton.h" #include "kaglobal.h" #include #include "updatenotificationwidget.h" #include "util.h" #define THEME_QT_SCHEMA "org.ukui.style" #define TEMP_REBOOT_FILE "/tmp/temp_reboot_file.txt" using namespace std; using namespace kyai::config::model; enum MessageTipType{ InfoMessage =0x0, WarningMessage, PersistentMessage }; class LocalModelItem :public QWidget { Q_OBJECT public: explicit LocalModelItem(PublicLocalModel model, SystemVersion curSystemVersion, QWidget *parent = nullptr); ~LocalModelItem(); void showSelectedIcon(bool flag); bool isSelected(); AiCapability getAICapability(); QString getModelName(); QString getModelDebName(); bool getIsStartDownloading(); void showMessageTips(MessageTipType type,const QString &msg,const int &duration); private: void initModelDownloadLayout(); void initLayout(); void initMenu(); void initInstallSuccessMsgBox(); void initConnect(); signals: void sigEdit(AiCapability capability, QString modelName); void sigDelete(AiCapability capability, QString modelName); public slots: void checkHasNewVersion(); bool createRebootTempFile(); bool checkHasRebootTempFile(); void sldownModel(); void startNetErrorTips(); void slUpdateModelInstallStatus(int value,QString status ,QString details); void slUpdateModelInstallFinished(bool isSuccess,QStringList upgradeGroup,QString errorStr,QString errorDesc); void slUpdateCancelButton(bool isInstalling); private: QHBoxLayout *m_mainHLayout; //模型名称 QLabel *m_modelNameLabel; //模型面板 QHBoxLayout *m_panelHLayout; //信息 QHBoxLayout *m_messageHLayout; QWidget *m_messageWidget; QLabel *m_tipsLabel; QToolButton *m_moreButton = nullptr; // 更多 QToolButton *m_downButton = nullptr; //下载 KToolButton *m_loadButton = nullptr; // 加载 QMenu *m_menu; //下载进度条 QHBoxLayout *m_progressHLayout; UpdateNotificationWidget *updateProgressBar =nullptr; //选择框 QLabel *m_selectedIconLabel = nullptr;// 已选择状态 //下载成功对话框 QMessageBox *m_installSuccessMsgBox; //当前提示信息 QString m_currentTipsMsg; private: kyai::config::model::AiCapability m_capability; QString m_modelName; PublicLocalModel m_model; LocalModelInstallStatus m_modelStatus; bool isModelSelected; bool isDownLoading =false; bool isStartDownloading = false; QTimer *m_timer; QString m_currentInfoMessage = ""; QString m_currentWarningMessage = ""; QTimer* m_infoTimer = nullptr; QTimer* m_warningTimer = nullptr; SystemVersion m_curSystemVersion; }; #endif // LOCALMODELITEM_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelcallpriority.cpp000066400000000000000000000071051520576575000270170ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "modelcallpriority.h" #include #include #include using namespace kyai::config::model; namespace { const QString& cloudModelText() { static const QString text = QObject::tr("Cloud Model First (Kylin Certification)"); return text; } const QString& localModelText() { static const QString text = QObject::tr("Local Model First (Kylin Certification)"); return text; } const QString& privateModelText() { static const QString text = QObject::tr("Custom Model First"); return text; } const QMap& modelTypeMap() { static const QMap map = {{cloudModelText(), DeployType::PublicCloud}, {localModelText(), DeployType::Ondevice}, {privateModelText(), DeployType::Custom}}; return map; } } // namespace ModelCallPriority::ModelCallPriority(bool hasLocalModel, QWidget* parent) : m_hasLocalModel(hasLocalModel), QWidget(parent) { m_modelCallPriorityLabel = new kdk::KLabel(parent); m_modelCallPriorityLabel->setText(tr("Model Call Priority")); m_modelCallPriorityLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_modelCallPriorityLabel"); m_modelPriorityComboBox = new QComboBox(parent); m_modelPriorityComboBox->setAccessibleName("kylin-ai-subsystem-modelconfig_QComboBox_m_modelCallPriorityLabel"); m_modelPriorityComboBox->setMinimumSize(320, 36); m_modelPriorityComboBox->addItem(cloudModelText()); if (m_hasLocalModel) { m_modelPriorityComboBox->addItem(localModelText()); } m_modelPriorityComboBox->addItem(privateModelText()); QHBoxLayout* modelCellPriLayout = new QHBoxLayout(); modelCellPriLayout->setContentsMargins(16, 0, 16, 0); modelCellPriLayout->setSpacing(2); modelCellPriLayout->addWidget(m_modelCallPriorityLabel); modelCellPriLayout->addWidget(m_modelPriorityComboBox); parent->setLayout(modelCellPriLayout); initConnections(); } void ModelCallPriority::setModelCallPriority(kyai::config::model::DeployType deployType) { if (deployType == DeployType::PublicCloud) { m_modelPriorityComboBox->setCurrentText(cloudModelText()); } else if (deployType == DeployType::Ondevice) { m_modelPriorityComboBox->setCurrentText(localModelText()); } else if (deployType == DeployType::Custom) { m_modelPriorityComboBox->setCurrentText(privateModelText()); } } void ModelCallPriority::initConnections() { connect(m_modelPriorityComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(modelPriorityChanged(int))); } void ModelCallPriority::modelPriorityChanged(int index) { Q_UNUSED(index); QString comboBoxCurText = m_modelPriorityComboBox->currentText(); DeployType type = modelTypeMap().value(comboBoxCurText, DeployType::PublicCloud); emit topModelPriorityChanged(type); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelcallpriority.h000066400000000000000000000030511520576575000264600ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef MODELCALLPRIORITY_H #define MODELCALLPRIORITY_H #include #include #include #include #include #include #include class ModelCallPriority : public QWidget { Q_OBJECT public: ModelCallPriority(bool hasLocalModel, QWidget *parent = nullptr); void setModelCallPriority(kyai::config::model::DeployType deployType); signals: void topModelPriorityChanged(kyai::config::model::DeployType topPriorityModelType); public Q_SLOTS: void modelPriorityChanged(int index); private: void initConnections(); private: bool m_hasLocalModel; kdk::KLabel *m_modelCallPriorityLabel = nullptr; // 模型调用优先级排序标签 QComboBox *m_modelPriorityComboBox = nullptr; // 模型调用优先级下拉列表 }; #endif // MODELCALLPRIORITY_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelconfigdialog.cpp000066400000000000000000001376701520576575000267420ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "modelconfigdialog.h" #include "aisubsystem.h" #include #include ModelConfigDialog::ModelConfigDialog(PublicCloudModel model, QWidget *parent): QDialog(parent) { isEdit = true; initLayout(); initConnect(); changeTheme(); ModelConfig mc; const auto models = mc.getExtendedModels(model.capability); for (const auto &model : models) { QString modelName = QString::fromStdString(model.modelName); comboboxModelName->addItem(modelName); } comboboxModelName->setCurrentText(model.modelName); comboboxModelName->setEnabled(false); buttonAccept->setText(tr("Ok")); loadModelData(model); } ModelConfigDialog::ModelConfigDialog(QWidget *parent): QDialog(parent) { isEdit = false; initLayout(); initConnect(); changeTheme(); } ModelConfigDialog::~ModelConfigDialog() { } void ModelConfigDialog::initLayout() { setFixedSize(420, 276); labelModelName = new kdk::KLabel; labelModelName->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_labelModelName"); labelModelName->setText(tr("Model Type")); labelModelName->setFixedWidth(80); labelAPPID = new QLabel("APPID"); labelAPPID->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelAPPID"); labelAPPID->setFixedWidth(80); labelApiKey = new QLabel("APIKey"); labelApiKey->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelApiKey"); labelApiKey->setFixedWidth(80); labelSecretKey = new kdk::KLabel; labelSecretKey->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_labelSecretKey"); labelSecretKey->setText("APISecret"); labelSecretKey->setFixedWidth(80); comboboxModelName = new QComboBox; // baidu,xunfei comboboxModelName->setAccessibleName("kylin-ai-subsystem-modelconfig_QComboBox_comboboxModelName"); comboboxModelName->setFixedHeight(36); passwordAPPID = new kdk::KPasswordEdit(nullptr); connect(passwordAPPID, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { passwordAPPID->setState(LoginState::LoginFailed); } else { passwordAPPID->setState(LoginState::Ordinary); } }); passwordAPPID->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_passwordAPPID"); passwordAPPID->setFocusPolicy(Qt::WheelFocus); passwordAPPID->setFixedHeight(36); passwordEditApi = new kdk::KPasswordEdit(nullptr); connect(passwordEditApi, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { passwordEditApi->setState(LoginState::LoginFailed); } else { passwordEditApi->setState(LoginState::Ordinary); } }); passwordEditApi->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_passwordEditApi"); passwordEditApi->setFocusPolicy(Qt::WheelFocus); passwordEditApi->setFixedHeight(36); passwordEditSecret = new kdk::KPasswordEdit(nullptr); connect(passwordEditSecret, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { passwordEditSecret->setState(LoginState::LoginFailed); } else { passwordEditSecret->setState(LoginState::Ordinary); } }); passwordEditSecret->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_passwordEditSecret"); passwordEditSecret->setFocusPolicy(Qt::WheelFocus); passwordEditSecret->setFixedHeight(36); // 语音听写&在线语音合成(流式版) lineSeparator1 = new QFrame(this); lineSeparator1->setAccessibleName("kylin-ai-subsystem-modelconfig_QFrame_lineSeparator1"); lineSeparator1->setFrameShape(QFrame::HLine); // 横线 lineSeparator1->setFixedHeight(1); labelSpeechContinuous = new QLabel(tr("Voice dictation & online voice synthesis (streaming version)")); labelSpeechContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelSpeechContinuous"); labelAPPIDContinuous = new QLabel("APPID"); labelAPPIDContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelAPPIDContinuous"); labelAPPIDContinuous->setFixedWidth(80); labelApiKeyContinuous = new QLabel("APIKey"); labelApiKeyContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelApiKeyContinuous"); labelApiKeyContinuous->setFixedWidth(80); labelSecretKeyContinuous = new kdk::KLabel; labelSecretKeyContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_labelSecretKeyContinuous"); labelSecretKeyContinuous->setText("APISecret"); labelSecretKeyContinuous->setFixedWidth(80); switchContinuous = new kdk::KSwitchButton(nullptr); switchContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KSwitchButton_switchContinuous"); switchContinuous->setChecked(true); switchContinuous->setFixedSize(44, 24); pwdAppIdContinuous = new kdk::KPasswordEdit(nullptr); connect(pwdAppIdContinuous, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { pwdAppIdContinuous->setState(LoginState::LoginFailed); } else { pwdAppIdContinuous->setState(LoginState::Ordinary); } }); pwdAppIdContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_pwdAppIdContinuous"); pwdAppIdContinuous->setFocusPolicy(Qt::WheelFocus); pwdAppIdContinuous->setFixedHeight(36); pwdEditApiContinuous = new kdk::KPasswordEdit(nullptr); connect(pwdEditApiContinuous, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { pwdEditApiContinuous->setState(LoginState::LoginFailed); } else { pwdEditApiContinuous->setState(LoginState::Ordinary); } }); pwdEditApiContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_pwdEditApiContinuous"); pwdEditApiContinuous->setFocusPolicy(Qt::WheelFocus); pwdEditApiContinuous->setFixedHeight(36); pwdEditSecretContinuous = new kdk::KPasswordEdit(nullptr); connect(pwdEditSecretContinuous, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { pwdEditSecretContinuous->setState(LoginState::LoginFailed); } else { pwdEditSecretContinuous->setState(LoginState::Ordinary); } }); pwdEditSecretContinuous->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_pwdEditSecretContinuous"); pwdEditSecretContinuous->setFocusPolicy(Qt::WheelFocus); pwdEditSecretContinuous->setFixedHeight(36); // 实时语音转写 lineSeparator2 = new QFrame(this); lineSeparator2->setAccessibleName("kylin-ai-subsystem-modelconfig_QFrame_lineSeparator2"); lineSeparator2->setFrameShape(QFrame::HLine); // 横线 lineSeparator2->setFixedHeight(1); labelSpeechRealTime = new QLabel(tr("Real time voice transcription")); labelSpeechRealTime->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelSpeechRealTime"); labelAPPIDRealTime = new QLabel("APPID"); labelAPPIDRealTime->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelAPPIDRealTime"); labelAPPIDRealTime->setFixedWidth(80); labelApiKeyRealTime = new QLabel("APIKey"); labelApiKeyRealTime->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelApiKeyRealTime"); labelApiKeyRealTime->setFixedWidth(80); switchRealTime = new kdk::KSwitchButton(nullptr); switchRealTime->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KSwitchButton_switchRealTime"); switchRealTime->setChecked(true); switchRealTime->setFixedSize(44, 24); pwdAppIdRealTime = new kdk::KPasswordEdit(nullptr); connect(pwdAppIdRealTime, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { pwdAppIdRealTime->setState(LoginState::LoginFailed); } else { pwdAppIdRealTime->setState(LoginState::Ordinary); } }); pwdAppIdRealTime->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_pwdAppIdRealTime"); pwdAppIdRealTime->setFocusPolicy(Qt::WheelFocus); pwdAppIdRealTime->setFixedHeight(36); pwdEditApiRealTime = new kdk::KPasswordEdit(nullptr); connect(pwdEditApiRealTime, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { pwdEditApiRealTime->setState(LoginState::LoginFailed); } else { pwdEditApiRealTime->setState(LoginState::Ordinary); } }); pwdEditApiRealTime->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_pwdEditApiRealTime"); pwdEditApiRealTime->setFocusPolicy(Qt::WheelFocus); pwdEditApiRealTime->setFixedHeight(36); QGridLayout *gridLayout = new QGridLayout(); gridLayout->setVerticalSpacing(8); gridLayout->addWidget(labelModelName, 0, 0); // 第一行第一列 gridLayout->addWidget(labelAPPID, 1, 0); gridLayout->addWidget(labelApiKey, 2, 0); gridLayout->addWidget(labelSecretKey, 3, 0); gridLayout->addWidget(comboboxModelName, 0, 1); // 第一行第二列 gridLayout->addWidget(passwordAPPID, 1, 1); gridLayout->addWidget(passwordEditApi, 2, 1); gridLayout->addWidget(passwordEditSecret, 3, 1); // 语音听写&在线语音合成(流式版) continuousWidget = new QWidget; continuousWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_continuousWidget"); // continuousWidget->setContentsMargins(0, 6, 0, 6); continuousWidget->setContentsMargins(0, 4, 0, 4); QHBoxLayout *continuousLayout = new QHBoxLayout; continuousLayout->setContentsMargins(0, 0, 0, 0); labelSpeechContinuous->setAlignment(Qt::AlignVCenter); continuousLayout->addWidget(labelSpeechContinuous); continuousLayout->addStretch(); continuousLayout->addWidget(switchContinuous); continuousWidget->setLayout(continuousLayout); QGridLayout *gridContinuousLayout = new QGridLayout(); gridContinuousLayout->setVerticalSpacing(8); gridContinuousLayout->addWidget(labelAPPIDContinuous, 0, 0); // 第一行第一列 gridContinuousLayout->addWidget(labelApiKeyContinuous, 1, 0); gridContinuousLayout->addWidget(labelSecretKeyContinuous, 2, 0); gridContinuousLayout->addWidget(pwdAppIdContinuous, 0, 1); // 第一行第二列 gridContinuousLayout->addWidget(pwdEditApiContinuous, 1, 1); gridContinuousLayout->addWidget(pwdEditSecretContinuous, 2, 1); lineSeparator1->setVisible(false); labelSpeechContinuous->setVisible(false); labelAPPIDContinuous->setVisible(false); labelApiKeyContinuous->setVisible(false); labelSecretKeyContinuous->setVisible(false); switchContinuous->setVisible(false); pwdAppIdContinuous->setVisible(false); pwdEditApiContinuous->setVisible(false); pwdEditSecretContinuous->setVisible(false); continuousWidget->setVisible(false); // 实时语音转写 realTimeWidget = new QWidget; realTimeWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_realTimeWidget"); // realTimeWidget->setContentsMargins(0, 6, 0, 6); realTimeWidget->setContentsMargins(0, 4, 0, 4); QHBoxLayout *realTimeLayout = new QHBoxLayout; realTimeLayout->setContentsMargins(0, 0, 0, 0); labelSpeechRealTime->setAlignment(Qt::AlignVCenter); realTimeLayout->addWidget(labelSpeechRealTime); realTimeLayout->addStretch(); realTimeLayout->addWidget(switchRealTime); realTimeWidget->setLayout(realTimeLayout); QGridLayout *gridRealTimeLayout = new QGridLayout(); gridRealTimeLayout->setVerticalSpacing(8); gridRealTimeLayout->setHorizontalSpacing(8); gridRealTimeLayout->addWidget(labelAPPIDRealTime, 0, 0); // 第一行第一列 gridRealTimeLayout->addWidget(labelApiKeyRealTime, 1, 0); gridRealTimeLayout->addWidget(pwdAppIdRealTime, 0, 1); // 第一行第二列 gridRealTimeLayout->addWidget(pwdEditApiRealTime, 1, 1); lineSeparator2->setVisible(false); labelSpeechRealTime->setVisible(false); labelAPPIDRealTime->setVisible(false); labelApiKeyRealTime->setVisible(false); switchRealTime->setVisible(false); pwdAppIdRealTime->setVisible(false); pwdEditApiRealTime->setVisible(false); realTimeWidget->setVisible(false); labelErrorInfo = new QLabel(); labelErrorInfo->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelErrorInfo"); labelErrorInfo->setStyleSheet("color:red; font-size: 14px; font-weight: 400; line-height: 20px;"); QHBoxLayout *errorInfoLayout = new QHBoxLayout; errorInfoLayout->setContentsMargins(90, 0, 0, 0); errorInfoLayout->addWidget(labelErrorInfo); errorInfoLayout->addStretch(); btnHelpLink = new kdk::KBorderlessButton(tr("Model Configuration Tutorial")); btnHelpLink->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_btnHelpLink"); buttonCancel = new QPushButton(tr("Cancel")); buttonCancel->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_buttonCancel"); buttonCancel->setFixedHeight(36); buttonCancel->setFocusPolicy(Qt::NoFocus); buttonCancel->setProperty("useButtonPalette", true); buttonAccept = new QPushButton(tr("Accept")); buttonAccept->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_buttonAccept"); buttonAccept->setFixedHeight(36); buttonAccept->setFocusPolicy(Qt::NoFocus); buttonAccept->setEnabled(false); QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->addWidget(btnHelpLink); buttonLayout->addStretch(); buttonLayout->addWidget(buttonCancel); buttonLayout->setSpacing(16); buttonLayout->addWidget(buttonAccept); QVBoxLayout *contentLayout = new QVBoxLayout; contentLayout->setContentsMargins(24, 16, 24, 24); contentLayout->addLayout(gridLayout); contentLayout->addWidget(lineSeparator1); contentLayout->addWidget(continuousWidget); contentLayout->addLayout(gridContinuousLayout); contentLayout->addSpacing(4); contentLayout->addWidget(lineSeparator2); contentLayout->addWidget(realTimeWidget); contentLayout->addLayout(gridRealTimeLayout); contentLayout->addLayout(errorInfoLayout); contentLayout->addStretch(); contentLayout->addLayout(buttonLayout); contentWidget = new QWidget; contentWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_contentWidget"); contentWidget->setContentsMargins(0, 0, 0, 0); contentWidget->setLayout(contentLayout); QVBoxLayout *vLayout = new QVBoxLayout; vLayout->setContentsMargins(0, 0, 0, 0); vLayout->setSpacing(0); vLayout->addWidget(contentWidget); this->setLayout(vLayout); } void ModelConfigDialog::initConnect() { connect(comboboxModelName, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLayout(int))); connect(btnHelpLink, &QPushButton::clicked, [this](){ QDesktopServices::openUrl(kaglobal::openLink); }); connect(buttonCancel, &QPushButton::clicked, [this](){reject();}); connect(buttonAccept, &QPushButton::clicked, [this](){accept();}); connect(switchContinuous, &KSwitchButton::stateChanged, this, &ModelConfigDialog::onSwitchContinuousChanged); connect(switchRealTime, &KSwitchButton::stateChanged, this, &ModelConfigDialog::onSwitchRealTimeChanged); connect(passwordAPPID, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordAPPID); }); connect(passwordEditApi, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordEditApi); }); connect(passwordEditSecret, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordEditSecret); }); connect(pwdAppIdContinuous, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordAPPID); }); connect(pwdEditApiContinuous, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordEditApi); }); connect(pwdEditSecretContinuous, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordEditSecret); }); connect(pwdAppIdRealTime, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordAPPID); }); connect(pwdEditApiRealTime, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordEditApi); }); connect(passwordAPPID, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(passwordEditApi, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(passwordEditSecret, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(pwdAppIdContinuous, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(pwdEditApiContinuous, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(pwdEditSecretContinuous, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(pwdAppIdRealTime, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); connect(pwdEditApiRealTime, &KPasswordEdit::textChanged, this, [this]() { checkIsHasSpaces(); }); } void ModelConfigDialog::changeTheme() { KyInfo() << "changetheme"; QPalette p = this->palette(); QColor color = p.color(QPalette::Base); p.setColor(QPalette::Window, color); this->setPalette(p); } void ModelConfigDialog::updateLayout(int index) { if (parentWidget()) { if (isEdit == false) { // 添加时 buttonAccept->setText(tr("Add")); passwordAPPID->setText(""); passwordEditApi->setText(""); passwordEditSecret->setText(""); labelErrorInfo->setText(""); pwdAppIdContinuous->setText(""); pwdEditApiContinuous->setText(""); pwdEditSecretContinuous->setText(""); pwdAppIdRealTime->setText(""); pwdEditApiRealTime->setText(""); } // 全部隐藏 labelAPPID->setVisible(false); labelApiKey->setVisible(false); labelSecretKey->setVisible(false); passwordAPPID->setVisible(false); passwordEditApi->setVisible(false); passwordEditSecret->setVisible(false); lineSeparator1->setVisible(false); labelSpeechContinuous->setVisible(false); labelAPPIDContinuous->setVisible(false); labelApiKeyContinuous->setVisible(false); labelSecretKeyContinuous->setVisible(false); switchContinuous->setVisible(false); pwdAppIdContinuous->setVisible(false); pwdEditApiContinuous->setVisible(false); pwdEditSecretContinuous->setVisible(false); continuousWidget->setVisible(false); lineSeparator2->setVisible(false); labelSpeechRealTime->setVisible(false); labelAPPIDRealTime->setVisible(false); labelApiKeyRealTime->setVisible(false); switchRealTime->setVisible(false); pwdAppIdRealTime->setVisible(false); pwdEditApiRealTime->setVisible(false); realTimeWidget->setVisible(false); // 遍历验证信息,根据字段设置是否可见 ModelConfig mc; QString currentText = comboboxModelName->itemText(index); std::vector multiAuths = mc.getModelAuthentications(currentText.toStdString()); for (const auto &authen : multiAuths) { for (const auto &au : authen.authentications) { if (au.key == "appId") { labelAPPID->setVisible(true); passwordAPPID->setVisible(true); } if (au.key == "apiKey") { labelApiKey->setVisible(true); passwordEditApi->setVisible(true); } if (au.key == "secretKey") { labelSecretKey->setVisible(true); passwordEditSecret->setVisible(true); } if (au.key == "appIdContinuous") { lineSeparator1->setVisible(true); labelSpeechContinuous->setVisible(true); switchContinuous->setVisible(true); continuousWidget->setVisible(true); labelAPPIDContinuous->setVisible(true); pwdAppIdContinuous->setVisible(true); } if (au.key == "apiKeyContinuous") { lineSeparator1->setVisible(true); labelSpeechContinuous->setVisible(true); switchContinuous->setVisible(true); continuousWidget->setVisible(true); labelApiKeyContinuous->setVisible(true); pwdEditApiContinuous->setVisible(true); } if (au.key == "secretKeyContinuous") { lineSeparator1->setVisible(true); labelSpeechContinuous->setVisible(true); switchContinuous->setVisible(true); continuousWidget->setVisible(true); labelSecretKeyContinuous->setVisible(true); pwdEditSecretContinuous->setVisible(true); } if (au.key == "appIdRealTime") { lineSeparator2->setVisible(true); labelSpeechRealTime->setVisible(true); switchRealTime->setVisible(true); realTimeWidget->setVisible(true); labelAPPIDRealTime->setVisible(true); pwdAppIdRealTime->setVisible(true); } if (au.key == "apiKeyRealTime") { lineSeparator2->setVisible(true); labelSpeechRealTime->setVisible(true); switchRealTime->setVisible(true); realTimeWidget->setVisible(true); labelApiKeyRealTime->setVisible(true); pwdEditApiRealTime->setVisible(true); } } } if (m_capability == AiCapability::Nlp || m_capability == AiCapability::Vision) { this->setFixedSize(420, 316); } else if (m_capability == AiCapability::Speech) { if (currentText == "讯飞-语音大模型") { this->setFixedSize(420, 502); } else { this->setFixedSize(420, 316); } } moveToCenter(); } } void ModelConfigDialog::updateButtonState() { if (passwordAPPID->isVisible() == false) { // 深度求索,百度的自然语言和文生图不需要appid if(passwordEditSecret->isVisible() == false && passwordEditApi->isVisible() == true && passwordEditApi->text().length() > 0) { buttonAccept->setEnabled(true); buttonAccept->setProperty("isImportant", true); return; } else if (passwordEditApi->text().length()>= 12 && passwordEditSecret->text().length() >= 12) { buttonAccept->setEnabled(true); buttonAccept->setProperty("isImportant", true); } else { buttonAccept->setEnabled(false); } } else if (passwordEditSecret->isVisible()) { // AppId必填,ApiKey和SecrectKey大于等于12 if (passwordAPPID->text().length() > 0 && passwordEditApi->text().length()>= 12 && passwordEditSecret->text().length() >= 12) { buttonAccept->setEnabled(true); buttonAccept->setProperty("isImportant", true); } else { buttonAccept->setEnabled(false); } } else { // 不需要SecrectKey的话,AppId必填,ApiKey大于等于12 if (passwordAPPID->text().length() > 0 && passwordEditApi->text().length()>= 12) { buttonAccept->setEnabled(true); buttonAccept->setProperty("isImportant", true); } else { buttonAccept->setEnabled(false); } } // 在已选择的没填完之前,置灰;在无选择的时候,置灰 if (switchContinuous->isVisible() && switchRealTime->isVisible()) { bool bothSwitchesChecked = switchRealTime->isChecked() && switchContinuous->isChecked(); bool realTimeChecked = switchRealTime->isChecked(); bool continuousChecked = switchContinuous->isChecked(); bool enableButton = false; bool isImportant = false; // 如果两个开关都被选择 if (bothSwitchesChecked) { if (pwdAppIdContinuous->text().length() > 0 && pwdAppIdRealTime->text().length() > 0 && pwdEditApiRealTime->text().length() >= 12 && pwdEditApiContinuous->text().length() >= 12 && pwdEditSecretContinuous->text().length() >= 12) { enableButton = true; isImportant = true; } } // 如果只有一个开关被选择 else if (realTimeChecked || continuousChecked) { if (realTimeChecked && pwdAppIdRealTime->text().length() > 0 && pwdEditApiRealTime->text().length() >= 12) { enableButton = true; isImportant = true; } else if (continuousChecked && pwdAppIdContinuous->text().length() > 0 && pwdEditApiContinuous->text().length() >= 12 && pwdEditSecretContinuous->text().length() >= 12) { enableButton = true; isImportant = true; } } // 没有开关被选择 else { enableButton = false; isImportant = false; } buttonAccept->setEnabled(enableButton); buttonAccept->setProperty("isImportant", isImportant); } } bool ModelConfigDialog::checkIsHasSpaces() { bool flag = false; QList passwordEdits = this->findChildren(); if(passwordEdits.isEmpty()) { return flag; } else { for(int i = 0; i text().contains(" ") || currentEdit->text().contains('\n')) { this->labelErrorInfo->setText(tr("Cannot contain spaces, please re-enter!")); flag = true; buttonAccept->setEnabled(false); break; } else { this->labelErrorInfo->setText(""); } } } return flag; } void ModelConfigDialog::onPasswordEditChanged(KPasswordEdit *passwordEdit) { if (passwordEdit->text().length() == 0) { passwordEdit->setEchoModeBtnVisible(true); } updateButtonState(); } void ModelConfigDialog::onSwitchContinuousChanged(bool isVisible) { labelAPPIDContinuous->setVisible(isVisible); labelApiKeyContinuous->setVisible(isVisible); labelSecretKeyContinuous->setVisible(isVisible); pwdAppIdContinuous->setVisible(isVisible); pwdEditApiContinuous->setVisible(isVisible); pwdEditSecretContinuous->setVisible(isVisible); adjustDialogSize(); updateButtonState(); isContinuousSelected = isVisible; } void ModelConfigDialog::onSwitchRealTimeChanged(bool isVisible) { labelAPPIDRealTime->setVisible(isVisible); labelApiKeyRealTime->setVisible(isVisible); pwdAppIdRealTime->setVisible(isVisible); pwdEditApiRealTime->setVisible(isVisible); adjustDialogSize(); updateButtonState(); isRealTimeSelected = isVisible; } void ModelConfigDialog::adjustDialogSize() { if (switchContinuous->isVisible() && switchRealTime->isVisible()) { bool bothSwitchesChecked = switchRealTime->isChecked() && switchContinuous->isChecked(); bool realTimeChecked = switchRealTime->isChecked(); bool continuousChecked = switchContinuous->isChecked(); // 如果两个开关都被选择 if (bothSwitchesChecked) { this->setFixedSize(420, 502); } // 如果只有一个开关被选择 else if (realTimeChecked || continuousChecked) { this->setFixedSize(420, 414); } // 没有开关被选择 else { this->setFixedSize(420, 316); } } } /** * @brief ModelConfigDialog::initUIData * 初始化所有模型数据 */ void ModelConfigDialog::initUIData(const AiCapability capability,const DeployType deployType) { m_capability = capability; if(m_capability == AiCapability::Nlp){ this->setWindowTitle(tr("Add-NLP Model")); //添加-语言大模型 }else if(m_capability == AiCapability::Vision){ this->setWindowTitle(tr("Add-Visual Model")); //添加-视觉大模型 }else if(m_capability == AiCapability::Speech){ this->setWindowTitle(tr("Add-Speech Model")); //添加-语音大模型 } ModelConfig mc; const auto models = mc.getExtendedModels(capability); for (const auto &model : models) { QString modelName = QString::fromStdString(model.modelName); //根据部署类别,当前内容只显示云端模型 if(model.deployType == DeployType::PublicCloud ) { comboboxModelName->addItem(modelName); } KyInfo() << modelName <(deployType); } QString passwdTip = tr("Required"); passwordAPPID->setPlaceholderText(passwdTip); passwordEditApi->setPlaceholderText(passwdTip); passwordEditSecret->setPlaceholderText(passwdTip); pwdAppIdContinuous->setPlaceholderText(passwdTip); pwdEditApiContinuous->setPlaceholderText(passwdTip); pwdEditSecretContinuous->setPlaceholderText(passwdTip); pwdAppIdRealTime->setPlaceholderText(passwdTip); pwdEditApiRealTime->setPlaceholderText(passwdTip); } // 编辑 - 加载对应模型数据 void ModelConfigDialog::loadModelData(PublicCloudModel model) { m_model = model; m_capability = model.capability; std::vector modelsAuthens = model.multiAuths; if(m_capability == AiCapability::Nlp){ this->setWindowTitle(tr("Edit-NLP Model")); // 编辑-语言大模型 }else if(m_capability == AiCapability::Vision){ this->setWindowTitle(tr("Edit-Visual Model")); //编辑-视觉大模型 }else if(m_capability == AiCapability::Speech){ this->setWindowTitle(tr("Edit-Speech Model")); //编辑-语音大模型 } if (parentWidget()) { CloudModelConfigWidget *cloudModelConfigPage = TestAiSubSystem::getCloudModelConfigPage(); if (cloudModelConfigPage) { passwordAPPID->setEchoMode(QLineEdit::Password); passwordAPPID->setEchoModeBtnVisible(true); passwordEditApi->setEchoMode(QLineEdit::Password); passwordEditApi->setEchoModeBtnVisible(true); passwordEditSecret->setEchoMode(QLineEdit::Password); passwordEditSecret->setEchoModeBtnVisible(true); pwdAppIdContinuous->setEchoMode(QLineEdit::Password); pwdAppIdContinuous->setEchoModeBtnVisible(true); pwdEditApiContinuous->setEchoMode(QLineEdit::Password); pwdEditApiContinuous->setEchoModeBtnVisible(true); pwdEditSecretContinuous->setEchoMode(QLineEdit::Password); pwdEditSecretContinuous->setEchoModeBtnVisible(true); pwdEditSecretContinuous->setEchoMode(QLineEdit::Password); pwdEditSecretContinuous->setEchoModeBtnVisible(true); pwdEditApiRealTime->setEchoMode(QLineEdit::Password); pwdEditApiRealTime->setEchoModeBtnVisible(true); // 全部隐藏 labelAPPID->setVisible(false); labelApiKey->setVisible(false); labelSecretKey->setVisible(false); passwordAPPID->setVisible(false); passwordEditApi->setVisible(false); passwordEditSecret->setVisible(false); lineSeparator1->setVisible(false); labelSpeechContinuous->setVisible(false); labelAPPIDContinuous->setVisible(false); labelApiKeyContinuous->setVisible(false); labelSecretKeyContinuous->setVisible(false); switchContinuous->setVisible(false); pwdAppIdContinuous->setVisible(false); pwdEditApiContinuous->setVisible(false); pwdEditSecretContinuous->setVisible(false); continuousWidget->setVisible(false); lineSeparator2->setVisible(false); labelSpeechRealTime->setVisible(false); labelAPPIDRealTime->setVisible(false); labelApiKeyRealTime->setVisible(false); switchRealTime->setVisible(false); pwdAppIdRealTime->setVisible(false); pwdEditApiRealTime->setVisible(false); realTimeWidget->setVisible(false); for (const auto &authen : modelsAuthens) { for (const auto &au : authen.authentications) { if (au.key == "appId") { labelAPPID->setVisible(true); passwordAPPID->setVisible(true); passwordAPPID->setText(QString::fromStdString(au.value)); } if (au.key == "apiKey") { labelApiKey->setVisible(true); passwordEditApi->setVisible(true); passwordEditApi->setText(QString::fromStdString(au.value)); } if (au.key == "secretKey") { labelSecretKey->setVisible(true); passwordEditSecret->setVisible(true); passwordEditSecret->setText(QString::fromStdString(au.value)); } if (au.key == "appIdContinuous") { lineSeparator1->setVisible(true); labelSpeechContinuous->setVisible(true); switchContinuous->setVisible(true); continuousWidget->setVisible(true); labelAPPIDContinuous->setVisible(true); pwdAppIdContinuous->setVisible(true); pwdAppIdContinuous->setText(QString::fromStdString(au.value)); } if (au.key == "apiKeyContinuous") { lineSeparator1->setVisible(true); labelSpeechContinuous->setVisible(true); switchContinuous->setVisible(true); continuousWidget->setVisible(true); labelApiKeyContinuous->setVisible(true); pwdEditApiContinuous->setVisible(true); pwdEditApiContinuous->setText(QString::fromStdString(au.value)); } if (au.key == "secretKeyContinuous") { lineSeparator1->setVisible(true); labelSpeechContinuous->setVisible(true); switchContinuous->setVisible(true); continuousWidget->setVisible(true); labelSecretKeyContinuous->setVisible(true); pwdEditSecretContinuous->setVisible(true); pwdEditSecretContinuous->setText(QString::fromStdString(au.value)); } if (au.key == "appIdRealTime") { lineSeparator2->setVisible(true); labelSpeechRealTime->setVisible(true); switchRealTime->setVisible(true); realTimeWidget->setVisible(true); labelAPPIDRealTime->setVisible(true); pwdAppIdRealTime->setVisible(true); pwdAppIdRealTime->setText(QString::fromStdString(au.value)); } if (au.key == "apiKeyRealTime") { lineSeparator2->setVisible(true); labelSpeechRealTime->setVisible(true); switchRealTime->setVisible(true); realTimeWidget->setVisible(true); labelApiKeyRealTime->setVisible(true); pwdEditApiRealTime->setVisible(true); pwdEditApiRealTime->setText(QString::fromStdString(au.value)); } } } if (m_capability == AiCapability::Nlp || m_capability == AiCapability::Vision) { this->setFixedSize(420, 316); } else if (m_capability == AiCapability::Speech) { if (model.modelName == "讯飞-语音大模型") { bool continuousChecked = cloudModelConfigPage->continuousSelected; bool realTimeChecked = cloudModelConfigPage->realtimeSelected; switchContinuous->setChecked(continuousChecked); switchRealTime->setChecked(realTimeChecked); isContinuousSelected = continuousChecked; isRealTimeSelected = realTimeChecked; // 如果两个开关都被选择 if (continuousChecked && realTimeChecked) { // KyInfo() << "两个都选择了"; this->setFixedSize(420, 502); onSwitchContinuousChanged(true); onSwitchRealTimeChanged(true); } // 如果只有一个开关被选择 else if (realTimeChecked || continuousChecked) { // KyInfo() << "只有一个被选择"; this->setFixedSize(420, 414); if (continuousChecked) { onSwitchContinuousChanged(true); onSwitchRealTimeChanged(false); } else { onSwitchContinuousChanged(false); onSwitchRealTimeChanged(true); } } // 没有开关被选择 else { // KyInfo() << "无选择"; this->setFixedSize(420, 316); onSwitchContinuousChanged(false); onSwitchRealTimeChanged(false); } } else { // KyInfo() << "百度"; this->setFixedSize(420, 316); } } moveToCenter(); } } // 编辑模型, 能够编辑,说明key值在添加时都符合要求,编辑模型时‘确定’按钮默认是启用状态 buttonAccept->setEnabled(true); buttonAccept->setProperty("isImportant", true); } void ModelConfigDialog::moveToCenter() { if (parentWidget()) { // 获取父窗口的几何信息 QRect parentGeometry = parentWidget()->geometry(); // 计算窗口应该放置的位置,以使其在父窗口中心 int x = parentGeometry.x() + (parentGeometry.width() - this->width()) / 2; int y = parentGeometry.y() + (parentGeometry.height() - this->height()) / 2; // 移动窗口到计算出的位置 this->move(x, y); } } void ModelConfigDialog::accept() { if(checkIsHasSpaces()){//未检查到空格则继续进行 return ; } KyInfo() << isEdit; if (parentWidget()) { CloudModelConfigWidget *cloudModelConfigPage = TestAiSubSystem::getCloudModelConfigPage(); if (cloudModelConfigPage) { //判断是否存在该模型 if (isEdit == false) { // 判断是否存在该模型 if (m_capability == AiCapability::Nlp) { if (cloudModelConfigPage->m_nlpModelItemMap.contains(comboboxModelName->currentText())) { KyInfo() << "nlp already exist"; labelErrorInfo->setText(tr("The model type already exists. Cannot be repeated!")); return; } } else if (m_capability == AiCapability::Vision) { if (cloudModelConfigPage->m_visionModelItemMap.contains(comboboxModelName->currentText())) { KyInfo() << "vision already exist"; labelErrorInfo->setText(tr("The model type already exists. Cannot be repeated!")); return; } } else if (m_capability == AiCapability::Speech) { if (cloudModelConfigPage->m_speechModelItemMap.contains(comboboxModelName->currentText())) { KyInfo() << "speech already exist"; labelErrorInfo->setText(tr("The model type already exists. Cannot be repeated!")); return; } } } PublicCloudModel model; model.capability = m_capability; model.modelName = comboboxModelName->currentText(); ModelConfig mc; std::vector auths = mc.getModelAuthentications(model.modelName.toStdString()); bool isValueChanged = false; for (auto &authen : auths) { for (auto &au : authen.authentications) { if (au.key == "appId") { if (au.value != passwordAPPID->text().toStdString()) { isValueChanged = true; } au.value = passwordAPPID->text().toStdString(); } if (au.key == "apiKey") { if (au.value != passwordEditApi->text().toStdString()) { isValueChanged = true; } au.value = passwordEditApi->text().toStdString(); } if (au.key == "secretKey") { if (au.value != passwordEditSecret->text().toStdString()) { isValueChanged = true; } au.value = passwordEditSecret->text().toStdString(); } if (au.key == "appIdContinuous") { if (au.value != pwdAppIdContinuous->text().toStdString()) { isValueChanged = true; } au.value = pwdAppIdContinuous->text().toStdString(); } if (au.key == "apiKeyContinuous") { if (au.value != pwdEditApiContinuous->text().toStdString()) { isValueChanged = true; } au.value = pwdEditApiContinuous->text().toStdString(); } if (au.key == "secretKeyContinuous") { if (au.value != pwdEditSecretContinuous->text().toStdString()) { isValueChanged = true; } au.value = pwdEditSecretContinuous->text().toStdString(); } if (au.key == "appIdRealTime") { if (au.value != pwdAppIdRealTime->text().toStdString()) { isValueChanged = true; } au.value = pwdAppIdRealTime->text().toStdString(); } if (au.key == "apiKeyRealTime") { if (au.value != pwdEditApiRealTime->text().toStdString()) { isValueChanged = true; } au.value = pwdEditApiRealTime->text().toStdString(); } } } model.multiAuths = auths; bool isValueEmpty = false; for (const auto &authen : model.multiAuths) { for (const auto &au : authen.authentications) { if (au.key == "appIdRealTime" || au.key == "apiKeyRealTime") { if (au.value == "" && isRealTimeSelected == true) { isValueEmpty = true; } } else if (au.key == "appIdContinuous" || au.key == "apiKeyContinuous" || au.key == "secretKeyContinuous") { if (au.value == "" && isContinuousSelected == true) { isValueEmpty = true; } } else { if (au.value == "") { isValueEmpty = true; } } } } if (isValueEmpty) { if (isEdit == true) { showErrorMessage(tr("Model Editing failed"), this); } else { showErrorMessage(tr("Adding model failed"), this); } KyInfo() << model.modelName << "验证信息为空,不允许设置模型"; return; } if (isEdit == true) { // 编辑模型 KyInfo() << "要编辑的modelname" << model.modelName << "isValueChanged" << isValueChanged << "isContinuousSelected" << isContinuousSelected << "isRealTimeSelected" << isRealTimeSelected ; bool isCloseEditWindow = cloudModelConfigPage->editSelectCloudModel( model, isContinuousSelected, isRealTimeSelected, isValueChanged, this); if (!isCloseEditWindow) { return; } } else { // 添加模型 if (cloudModelConfigPage->getModelItemMap(m_capability).count() == 0) { // 第一个添加的模型,设为选中 bool ret = cloudModelConfigPage->setSelectCloudModelConfig(model); if (ret == true) { cloudModelConfigPage->addModelItem(model); KyInfo() << model.modelName << " 添加选中模型成功"; } else { showErrorMessage(tr("Adding model failed"), this); KyInfo() << model.modelName << " 添加选中模型失败"; return; } } else { // 已有选中模型,只更新验证信息和UI bool ret = mc.setModelAuthentications(model.modelName.toStdString(), model.multiAuths); if (ret == true) { cloudModelConfigPage->addModelItem(model); KyInfo() << model.modelName << " 添加模型验证信息成功"; } else { showErrorMessage(tr("Adding model failed"), this); KyInfo() << model.modelName << " 添加模型验证信息失败"; return; } } if (m_capability == AiCapability::Speech) { // 同步两个开关的状态 cloudModelConfigPage->continuousSelected = isContinuousSelected; cloudModelConfigPage->realtimeSelected = isRealTimeSelected; } } } } labelErrorInfo->setText(""); return QDialog::accept(); } void ModelConfigDialog::keyPressEvent(QKeyEvent *event) { // Key_Enter是小键盘的确认键,Key_Return是大键盘的回车键 if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) { if (buttonAccept->isEnabled()) { emit accept(); } } } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelconfigdialog.h000066400000000000000000000111511520576575000263700ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef MODELCONFIGDIALOG_H #define MODELCONFIGDIALOG_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cloudmodelconfigwidget.h" #include "kaglobal.h" #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include #include #include #include #include #include #include using namespace std; using namespace kdk; using namespace kyai::config::model; class ModelConfigDialog : public QDialog { Q_OBJECT public: explicit ModelConfigDialog(PublicCloudModel model, QWidget *parent = nullptr); explicit ModelConfigDialog(QWidget *parent = nullptr); ~ModelConfigDialog(); // 添加模型-初始化模型UI void initUIData(AiCapability capability, const DeployType deployType); // 编辑模型-加载模型数据 void loadModelData(PublicCloudModel model); void moveToCenter(); protected: void keyPressEvent(QKeyEvent* event) override; signals: public slots: private slots: void onPasswordEditChanged(KPasswordEdit *passwordEdit); void onSwitchContinuousChanged(bool isVisible); void onSwitchRealTimeChanged(bool isVisible); void updateLayout(int index); void changeTheme(); private: // 布局 void initLayout(); // 信号槽 void initConnect(); // 根据模型需填内容改变尺寸 void adjustDialogSize(); // 根据所填内容更新按钮状态 void updateButtonState(); // 检查输入框中是否存在空格 bool checkIsHasSpaces(); // 添加model到map void addModelToMap(AiCapability capability, const PublicCloudModel &model); void accept() override; bool isEdit = false; AiCapability m_capability; PublicCloudModel m_model; kdk::KLabel *labelModelName = nullptr; // 模型类型 QLabel *labelAPPID = nullptr; QLabel *labelApiKey = nullptr; kdk::KLabel *labelSecretKey = nullptr; QLabel *labelErrorInfo = nullptr; QComboBox *comboboxModelName = nullptr; kdk::KPasswordEdit *passwordAPPID = nullptr; kdk::KPasswordEdit *passwordEditApi = nullptr; kdk::KPasswordEdit *passwordEditSecret = nullptr; // 流式 QFrame *lineSeparator1 = nullptr; QLabel *labelSpeechContinuous = nullptr; QLabel *labelAPPIDContinuous = nullptr; QLabel *labelApiKeyContinuous = nullptr; kdk::KLabel *labelSecretKeyContinuous = nullptr; kdk::KSwitchButton *switchContinuous = nullptr; // 开启:必填 kdk::KPasswordEdit *pwdAppIdContinuous = nullptr; kdk::KPasswordEdit *pwdEditApiContinuous = nullptr; kdk::KPasswordEdit *pwdEditSecretContinuous = nullptr; QWidget *continuousWidget = nullptr; // 实时 QFrame *lineSeparator2 = nullptr; QLabel *labelSpeechRealTime = nullptr; QLabel *labelAPPIDRealTime = nullptr; QLabel *labelApiKeyRealTime = nullptr; kdk::KSwitchButton *switchRealTime = nullptr; // 开启:必填 kdk::KPasswordEdit *pwdAppIdRealTime = nullptr; kdk::KPasswordEdit *pwdEditApiRealTime = nullptr; QWidget *realTimeWidget = nullptr; kdk::KBorderlessButton *btnHelpLink= nullptr; QPushButton *buttonCancel = nullptr; QPushButton *buttonAccept = nullptr; QWidget *contentWidget = nullptr; bool isContinuousSelected = true; bool isRealTimeSelected = true; QMap> mapAllModel; }; #endif // MODELCONFIGDIALOG_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modeldownload.cpp000066400000000000000000000241441520576575000261130ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "modeldownload.h" ModelDownload *ModelDownload::m_instance = nullptr; ModelDownload *ModelDownload::getInstance() { if(!m_instance) { m_instance = new ModelDownload(); } return m_instance; } PkgInstallStatus ModelDownload::getPkgStatus(QString pkgName) { QCoreApplication::processEvents(); PkgInstallStatus status; return status; QString curVersion = getCurPkgVersion(pkgName); QString lastVersion = getLastestVersion(pkgName); bool isInstalled = isPkgInstalled(pkgName); KyInfo()<<"pkgName=====:"<package(pkgName); if(package == nullptr){ QString msg = "PkgNotFound"; return msg; } if(package->isInstalled()){ return package->version(); }else { return QString(); } } QString ModelDownload::getLastestVersion(QString pkgName) { return ""; initQaptBackend(); if(!m_backend) { KyInfo() << "qapt backend init failed ,can not load package message ."; return QString(); } auto updatePackageList = m_backend->upgradeablePackages(); for (auto tmpPkg : updatePackageList) { QCoreApplication::processEvents(); if (tmpPkg->name() == pkgName) { return tmpPkg->availableVersion(); } } return QString(); } bool ModelDownload::isPkgInstalled(QString pkgName) { return false; QCoreApplication::processEvents(); initQaptBackend(); if(!m_backend) { KyInfo() << "qapt backend init failed ,can not load package message ."; return false; } auto package = m_backend->package(pkgName); if(package == nullptr){ return false; } return package->isInstalled(); } bool ModelDownload::downloadModelPkg(const QString pkgName) { return false; if (m_dbusDownloadInterface == nullptr){ m_dbusDownloadInterface = new QDBusInterface( "com.kylin.systemupgrade","/com/kylin/systemupgrade" , "com.kylin.systemupgrade.interface", QDBusConnection::systemBus(),this); } if(m_dbusDownloadInterface->isValid()) { QStringList downloadDebNameList; downloadDebNameList.append(pkgName); QVariantList list; list << downloadDebNameList; QDBusPendingCall replyCall = m_dbusDownloadInterface->asyncCall("InstallPackages", downloadDebNameList); QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(replyCall); connect(m_dbusDownloadInterface,SIGNAL(InstalldebStatusChanged(int,QString,QString)),this,SLOT(slUpdateModelInstallStatus(int,QString,QString)),Qt::UniqueConnection); connect(m_dbusDownloadInterface,SIGNAL(UpdateInstallFinished(bool,QStringList,QString,QString)),this,SLOT(slUpdateModelInstallFinished(bool,QStringList,QString,QString)),Qt::UniqueConnection); connect(m_dbusDownloadInterface,SIGNAL(Cancelable(bool)),this,SLOT(slUpdateModelInstallFlag(bool))); connect(callWatcher, &QDBusPendingCallWatcher::finished, this,&ModelDownload::sigUpdateModelDownloadFinished,Qt::UniqueConnection); return true; } else { QMessageBox::warning(nullptr,tr(""),tr("The current environment's dbus interface is abnormal")); return false ; } } bool ModelDownload::getDownloadingStatus() { return isDownloading; } void ModelDownload::setDownloadingStatus(bool downloading) { isDownloading = downloading; } void ModelDownload::setIsStartDownloading(bool isStartDownloading) { m_isStartDownloading = isStartDownloading; } bool ModelDownload::getStartDownloadingStatus() { return m_isStartDownloading; } bool ModelDownload::getCurrentInstallStatus() { return m_isInstalling; } void ModelDownload::setInstallingStatus(bool installing) { m_isInstalling = installing; } bool ModelDownload::cancelDownloading() { return true; if(!isDownloading) { return true; } if (m_dbusDownloadInterface == nullptr){ m_dbusDownloadInterface = new QDBusInterface( "com.kylin.systemupgrade","/com/kylin/systemupgrade" , "com.kylin.systemupgrade.interface", QDBusConnection::systemBus(),this); } if(m_dbusDownloadInterface->isValid()) { //执行取消下载 QDBusReply reply = m_dbusDownloadInterface->asyncCall("CancelDownload"); if (reply.isValid()) { if(reply){ KyInfo() << "cancel download successful:"; return true; } else { KyInfo() << "Cancel download failed:" << reply.error().message(); return false; } } else { KyInfo() << "Failed to call CancelDownload:" << reply.error().message(); return false; } } } void ModelDownload::initQaptBackend() { /* if(m_backend) { m_backend->deleteLater(); m_backend = nullptr; m_backend = new QApt::Backend(this); m_backend->init(); }*/ } QString ModelDownload::isAppversionNeedUpdate() { return ""; //ai助手是否需要更新 bool aiassistantFlag = this->compareCurrentPkgVersion(this->getCurPkgVersion(kaglobal::aiAssistantPkgName),kaglobal::aiAssistantMinVersion); //麒麟速记是否需要更新 bool aiNoteFlag = compareCurrentPkgVersion(this->getCurPkgVersion(kaglobal::aiNotePkgName),kaglobal::aiNoteMinVersion); //如果两个应用的版本 QString tips = ""; if(aiassistantFlag == true && aiNoteFlag == false) { //提示助手需要更新 tips = tr("The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage."); } else if(aiassistantFlag == false && aiNoteFlag == true) { //提示速记需要更新 tips = tr("The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage."); } else if(aiassistantFlag == true && aiNoteFlag == true) { //提示助手和速记都需要更新 tips = tr("The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage."); } else if(aiassistantFlag == false && aiNoteFlag == false) { //都不需要更新 tips = ""; } KyInfo()<< "fffffffffffffffffffffffffffffffff:是否需要显示软件包提示信息:" < tarVersion); return result; } void ModelDownload::slUpdateModelInstallStatus(int value, QString status, QString details) { KyInfo() << "current model downloading value : "<< value; m_currentValue = value; emit sigUpdateModelInstallStatus(value,status,details); } void ModelDownload::slUpdateModelInstallFinished(bool isSuccess, QStringList upgradeGroup, QString errorStr, QString errorDesc) { KyInfo() << "status " << isSuccess < 50 || m_currentValue == 50)) { m_isInstalling = true; KyInfo() << "current model is installing ,could not cancel download"; emit sigCancelExitButton(m_isInstalling); } } ModelDownload::ModelDownload(QObject *parent) { QCoreApplication::processEvents(); // m_backend = new QApt::Backend(this); // if(!m_backend->init()){ // QMessageBox::warning(nullptr,tr("Tips"),tr("Backend init failed")); // } qaptInited = true; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modeldownload.h000066400000000000000000000057761520576575000255720ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef MODELDOWNLOAD_H #define MODELDOWNLOAD_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include "kaglobal.h" #include namespace QApt { class Backend; class Package; class Transaction; class DownloadProgress; } class ModelDownload : public QObject { Q_OBJECT public: static ModelDownload *getInstance(); PkgInstallStatus getPkgStatus(QString pkgName); QString getCurPkgVersion(QString pkgName); QString getLastestVersion(QString pkgName); bool isPkgInstalled(QString pkgName); bool downloadModelPkg(const QString pkgName); bool getDownloadingStatus(); void setDownloadingStatus(bool downloading); void setIsStartDownloading(bool isStartDownloading); bool getStartDownloadingStatus(); bool getCurrentInstallStatus(); void setInstallingStatus(bool installing); bool cancelDownloading(); void initQaptBackend(); QString isAppversionNeedUpdate(); bool compareCurrentPkgVersion(QString curVersion,QString tarVersion); signals: void sigUpdateModelInstallStatus(int,QString,QString); void sigUpdateModelInstallFinished(bool isSuccess,QStringList upgradeGroup,QString errorStr,QString errorDesc); void sigUpdateModelDownloadFinished(); void sigCancelExitButton(bool isInstalling); public slots: void slUpdateModelInstallStatus(int value , QString status, QString details); void slUpdateModelInstallFinished(bool isSuccess,QStringList upgradeGroup,QString errorStr,QString errorDesc); void slUpdateModelInstallFlag(bool cancelDownloadFlag); private: explicit ModelDownload(QObject *parent = nullptr); ModelDownload(const ModelDownload &other) =delete; ModelDownload &operator =(const ModelDownload &other) =delete; //实例 static ModelDownload *m_instance; private: QApt::Backend *m_backend; std::atomic_bool qaptInited{false}; private: QDBusInterface *m_dbusDownloadInterface = nullptr; int m_currentValue = 0; bool isDownloading = false; bool m_isInstalling = false; bool m_isStartDownloading = false; }; #endif // MODELDOWNLOAD_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelordermanager.cpp000066400000000000000000000073541520576575000267560ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "modelordermanager.h" #include #include #include namespace { const QMap modelTypeMap { {(int)kyai::config::model::AiCapability::Nlp, "nlp"}, {(int)kyai::config::model::AiCapability::Speech, "speech"}, {(int)kyai::config::model::AiCapability::Vision, "vision"} }; } ModelOrderManager::ModelOrderManager(QObject *parent) : QObject(parent) { checkConfigFile(); initSettings(); getModelOrderFormConfigFile(); } ModelOrderManager::~ModelOrderManager() { if (m_settings) { delete m_settings; m_settings = nullptr; } } void ModelOrderManager::addModel(kyai::config::model::AiCapability aiCapability, const QString& modelName) { QStringList modelList = m_modelOrders.value(getModelTypeString(aiCapability)); if (modelList.contains(modelName)) { return; } modelList.push_back(modelName); saveModelOrder(aiCapability, modelList); } void ModelOrderManager::deleteModel(kyai::config::model::AiCapability aiCapability, const QString& modelName) { QStringList modelList = m_modelOrders.value(getModelTypeString(aiCapability)); if (!modelList.contains(modelName)) { return; } modelList.removeOne(modelName); saveModelOrder(aiCapability, modelList); } QString ModelOrderManager::getModelTypeString(kyai::config::model::AiCapability aiCapability) { return modelTypeMap.value((int)aiCapability); } void ModelOrderManager::saveModelOrder(kyai::config::model::AiCapability aiCapability, const QStringList& order) { m_modelOrders[getModelTypeString(aiCapability)] = order; checkConfigFile(); m_settings->setValue(getModelTypeString(aiCapability), order.join(",")); m_settings->sync(); } QStringList ModelOrderManager::getModelOrder(kyai::config::model::AiCapability aiCapability) { QString modelType = getModelTypeString(aiCapability); if (m_modelOrders.keys().contains(modelType)) { return m_modelOrders.value(modelType); } qWarning() << "Failed to obtain model order. Model type is " << modelType; return {}; } void ModelOrderManager::checkConfigFile() { QFile file(m_configFile.c_str()); if (file.exists()) { return; } createDefaultConfig(); } void ModelOrderManager::initSettings() { m_settings = new QSettings(m_configFile.c_str(), QSettings::IniFormat); } void ModelOrderManager::getModelOrderFormConfigFile() { QStringList keys = m_settings->allKeys(); for (const QString& key : keys) { QString value = m_settings->value(key).toString(); m_modelOrders[key] = value.split(",", Qt::SkipEmptyParts); } } void ModelOrderManager::createDefaultConfig() { QDir dir(m_configDir.c_str()); if (!dir.exists()) { if (!dir.mkpath(".")) { qWarning() << "Failed to create config file " << m_configDir.c_str(); return; } } QFile file(m_configFile.c_str()); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { qWarning() << "Cannot create default config file " << m_configFile.c_str(); } file.close(); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelordermanager.h000066400000000000000000000036431520576575000264200ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef MODELORDERMANAGER_H #define MODELORDERMANAGER_H #include #include #include #include class ModelOrderManager : public QObject { Q_OBJECT public: explicit ModelOrderManager(QObject *parent = nullptr); ~ModelOrderManager(); void addModel(kyai::config::model::AiCapability aiCapability, const QString& modelName); void deleteModel(kyai::config::model::AiCapability aiCapability, const QString& modelName); QStringList getModelOrder(kyai::config::model::AiCapability aiCapability); private: QString getModelTypeString(kyai::config::model::AiCapability aiCapability); void checkConfigFile(); void initSettings(); void getModelOrderFormConfigFile(); void createDefaultConfig(); void saveModelOrder(kyai::config::model::AiCapability aiCapability, const QStringList& order); signals: private: QSettings* m_settings; QMap m_modelOrders; const std::string m_configDir = std::string(getenv("HOME")) + "/.config/kylin-ai-subsystem-modelconfig"; const std::string m_configFile = std::string(getenv("HOME")) + "/.config/kylin-ai-subsystem-modelconfig/modelOrder.conf"; }; #endif // MODELORDERMANAGER_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelwidget.cpp000066400000000000000000000123221520576575000255620ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "modelwidget.h" #include #include #include #include #include #include #include #include #include #include #include #include "util.h" #define THEME_QT_SCHEMA "org.ukui.style" ModelWidget::ModelWidget(const QString &modelName, const QString &modelIntro, DeployType deployType, QWidget *parent) : QWidget(parent), m_deployType(deployType) { this->setAttribute(Qt::WA_DeleteOnClose); m_modelLayout = new QVBoxLayout; m_modelLayout->setSpacing(0); m_modelLayout->setContentsMargins(0, 0, 0, 0); m_sortButton = new QPushButton(this); m_sortButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_m_sortButton"); m_sortButton->setFixedSize(QSize(36, 36)); m_sortButton->setToolTip(tr("Increase Priority")); m_sortButton->setFocusPolicy(Qt::NoFocus); m_sortButton->setIcon(QIcon::fromTheme("go-up-symbolic")); m_sortButton->setProperty("useIconHighlightEffect", 0x2); m_sortButton->setFlat(true); modelNameLabel = new QLabel(modelName, this); modelNameLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_modelNameLabel"); modelNameLabel->setAlignment(Qt::AlignLeft); modelIntroLabel = new kdk::KLabel(this); modelIntroLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_modelIntroLabel"); modelIntroLabel->setText(modelIntro); modelIntroLabel->setAlignment(Qt::AlignLeft); setKLabelFontColor(modelIntroLabel, "#808080"); m_modelLayout->addStretch(); m_modelLayout->addWidget(modelNameLabel); m_modelLayout->addWidget(modelIntroLabel); m_modelLayout->addStretch(); configButton = new kdk::KBorderlessButton; // bug #288117 加大小设置会导致切换字体/字体大小显示"..." configButton->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_configButton"); configButton->setText(tr("Configure")); modelSwitchBtn = new KSwitchButton(this); modelSwitchBtn->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KSwitchButton_modelSwitchBtn"); modelSwitchBtn->setCheckable(true); modelSwitchBtn->setFixedSize(50, 24); ModelConfig mc; // 获取当前模型的部署是否使能 modelSwitchBtn->setChecked(mc.getModelDeployEnabled(deployType)); m_layout = new QHBoxLayout(this); m_layout->setContentsMargins(8, 0, 16, 0); m_layout->setSpacing(0); m_layout->addWidget(m_sortButton); m_layout->addSpacing(8); m_layout->addLayout(m_modelLayout); m_layout->addStretch(); m_layout->addSpacing(24); m_layout->addWidget(configButton); m_layout->addSpacing(8); m_layout->addWidget(modelSwitchBtn); setLayout(m_layout); QFontMetrics modelNameLabelFontMetrics(modelNameLabel->font()); QFontMetrics modelIntroLabelFontMetrics(modelIntroLabel->font()); this->setFixedHeight(modelIntroLabelFontMetrics.height() + modelNameLabelFontMetrics.height() + 32); initConnect(); } ModelWidget::~ModelWidget() { } QSize ModelWidget::sizeHint() const { return this->size(); } void ModelWidget::initConnect() { connect(m_sortButton, &QPushButton::clicked, this, &ModelWidget::onSortButtonClicked); connect(modelSwitchBtn, &KSwitchButton::stateChanged, this, &ModelWidget::onTransModelDeployStatusChanged); connect(configButton, &QPushButton::clicked, this, [this](){ emit configClicked(modelWidgetName); }); const QByteArray idd(THEME_QT_SCHEMA); if (!QGSettings::isSchemaInstalled(idd)) { qWarning() << idd << " is not installed."; return; } QGSettings *qtSettings = new QGSettings(idd, QByteArray(), this); connect(qtSettings, &QGSettings::changed, this, [this](const QString &key) { if (key == "systemFontSize") { QFontMetrics modelNameLabelFontMetrics(modelNameLabel->font()); QFontMetrics modelIntroLabelFontMetrics(modelIntroLabel->font()); this->setFixedHeight(modelIntroLabelFontMetrics.height() + modelNameLabelFontMetrics.height() + 32); } }); } void ModelWidget::onTransModelDeployStatusChanged(bool enable) { ModelConfig mc; // 设置部署策略并检查是否成功 bool ret = mc.setModelDeployEnabled(m_deployType, enable); //错误处理 if (!ret) { KyInfo() << "Error: Failed to modify PublicCloud model deployment strategy."; } return; } void ModelWidget::onSortButtonClicked() { emit sortClicked(); // 发送排序点击信号 } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/modelwidget.h000066400000000000000000000040761520576575000252360ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef MODELWIDGET_H #define MODELWIDGET_H #include #include #include #include #include #include #include #include using namespace kdk; using namespace kyai::config::model; // 自定义模型Widget类 class ModelWidget : public QWidget { Q_OBJECT public: explicit ModelWidget(const QString &modelName, const QString &modelIntro, DeployType deployType, QWidget *parent = nullptr); ~ModelWidget(); QSize sizeHint() const override; void initConnect(); public slots: void onTransModelDeployStatusChanged(bool enable); void onSortButtonClicked(); signals: void configClicked(const QString &modelName); void sortClicked(); // 添加一个排序点击信号 public: QPushButton *m_sortButton; // 排序按钮 QLabel *modelNameLabel; // 模型名称标签 kdk::KLabel *modelIntroLabel; // 模型简介标签 kdk::KBorderlessButton *configButton; // 配置按钮 KSwitchButton *modelSwitchBtn; // 自定义的开关按钮 QVBoxLayout *m_modelLayout = nullptr; QHBoxLayout *m_layout = nullptr; QString modelWidgetName; int m_priority; // 优先级属性 DeployType m_deployType; // 标识是云端模型还是本地模型 }; #endif // MODELWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/privatemodelconfigdialog.cpp000066400000000000000000000400041520576575000303150ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "privatemodelconfigdialog.h" #include "aisubsystem.h" #include "util.h" PrivateModelConfigDialog::PrivateModelConfigDialog(PrivateModel model, QWidget *parent) : QDialog(parent) { isEdit = true; initLayout(); initConnect(); changeTheme(); buttonAccept->setText(tr("Ok")); loadModelData(model); } PrivateModelConfigDialog::PrivateModelConfigDialog(QWidget *parent) : QDialog(parent) { isEdit = false; initLayout(); initConnect(); changeTheme(); } PrivateModelConfigDialog::~PrivateModelConfigDialog() { } void PrivateModelConfigDialog::initUIData(AiCapability capability, const DeployType deployType) { m_capability = capability; if(m_capability == AiCapability::Nlp){ this->setWindowTitle(tr("Add-NLP Model")); //添加-语言大模型 }else if(m_capability == AiCapability::Vision){ this->setWindowTitle(tr("Add-Visual Model")); //添加-视觉大模型 }else if(m_capability == AiCapability::Speech){ this->setWindowTitle(tr("Add-Speech Model")); //添加-语音大模型 } } // 编辑- 加载对应模型数据 void PrivateModelConfigDialog::loadModelData(PrivateModel model) { m_model = model; m_capability = model.capability; std::vector modelsAuthens = model.multiAuths; if(m_capability == AiCapability::Nlp){ this->setWindowTitle(tr("Edit-NLP Model")); // 编辑-语言大模型 }else if(m_capability == AiCapability::Vision){ this->setWindowTitle(tr("Edit-Visual Model")); //编辑-视觉大模型 }else if(m_capability == AiCapability::Speech){ this->setWindowTitle(tr("Edit-Speech Model")); //编辑-语音大模型 } for (const auto &authen : modelsAuthens) { for (const auto &au : authen.authentications) { if (au.key == "apiKey") { passwordEditApi->setText(QString::fromStdString(au.value)); } } } lineeditCustomName->setText(model.modelName); lineeditModelName->setText(model.modelVersion); passwordEditApi->setText(model.apiKey); lineeditRequestUrl->setText(model.apiUrl); passwordEditApi->setEchoMode(QLineEdit::Password); passwordEditApi->setEchoModeBtnVisible(true); //moveToCenter(); } void PrivateModelConfigDialog::keyPressEvent(QKeyEvent *event) { // Key_Enter是小键盘的确认键,Key_Return是大键盘的回车键 if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) { if (buttonAccept->isEnabled()) { emit accept(); } } } void PrivateModelConfigDialog::onPasswordEditChanged(KPasswordEdit *passwordEdit) { if (passwordEdit->text().length() == 0) { passwordEdit->setEchoModeBtnVisible(true); } // updateButtonState(); } void PrivateModelConfigDialog::changeTheme() { } void PrivateModelConfigDialog::initLayout() { setFixedSize(420, 276); labelCustomName = new kdk::KLabel; labelCustomName->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelAccountName"); labelCustomName->setText(tr("CustomName")); labelCustomName->setFixedWidth(80); labelModelName = new kdk::KLabel; labelModelName->setText(tr("ModelName")); labelModelName->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelModelName"); labelModelName->setFixedWidth(80); labelApiKey = new QLabel("APIKey"); labelApiKey->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelApiKey"); labelApiKey->setFixedWidth(80); labelRequestUrl = new kdk::KLabel; labelRequestUrl->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_labelRequestUrl"); labelRequestUrl->setText(tr("RequestUrl")); labelRequestUrl->setFixedWidth(80); lineeditCustomName = new QLineEdit; lineeditCustomName->setAccessibleName("kylin-ai-subsystem-modelconfig_QLineEdit_lineeditAccountName"); lineeditCustomName->setFixedHeight(36); lineeditCustomName->setFocusPolicy(Qt::WheelFocus); lineeditCustomName->setPlaceholderText(tr("Required (To distinguish models)")); //编辑状态下禁止修改此内容 if(isEdit){ lineeditCustomName->setEnabled(false); } lineeditModelName = new QLineEdit; lineeditModelName->setAccessibleName("kylin-ai-subsystem-modelconfig_QLineEdit_lineeditModelName"); lineeditModelName->setFixedHeight(36); lineeditModelName->setPlaceholderText(tr("Optional")); lineeditModelName->setFocusPolicy(Qt::WheelFocus); passwordEditApi = new kdk::KPasswordEdit(nullptr); connect(passwordEditApi, &QLineEdit::textChanged, [=](const QString &text) { if (text.contains(' ')) { passwordEditApi->setState(LoginState::LoginFailed); } else { passwordEditApi->setState(LoginState::Ordinary); } }); passwordEditApi->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KPasswordEdit_passwordEditApi"); passwordEditApi->setFocusPolicy(Qt::WheelFocus); passwordEditApi->setFixedHeight(36); QString tip = QString(tr("Optional (Required for cloud services)")); passwordEditApi->setPlaceholderText(tip); lineeditRequestUrl = new QLineEdit; lineeditRequestUrl->setAccessibleName("kylin-ai-subsystem-modelconfig_QLineEdit_lineeditRequestUrl"); lineeditRequestUrl->setFixedHeight(36); lineeditRequestUrl->setPlaceholderText(tr("Required")); QGridLayout *gridLayout = new QGridLayout(); gridLayout->setVerticalSpacing(8); gridLayout->addWidget(labelCustomName, 0, 0); // 第一行第一列 gridLayout->addWidget(labelModelName, 1, 0); gridLayout->addWidget(labelApiKey, 2, 0); gridLayout->addWidget(labelRequestUrl, 3, 0); gridLayout->addWidget(lineeditCustomName, 0, 1); // 第一行第二列 gridLayout->addWidget(lineeditModelName, 1, 1); gridLayout->addWidget(passwordEditApi, 2, 1); gridLayout->addWidget(lineeditRequestUrl, 3, 1); labelErrorInfo = new QLabel(); labelErrorInfo->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_labelErrorInfo"); labelErrorInfo->setStyleSheet("color:red; font-size: 14px; font-weight: 400; line-height: 20px;"); QHBoxLayout *errorInfoLayout = new QHBoxLayout; errorInfoLayout->setContentsMargins(90, 0, 0, 0); errorInfoLayout->addWidget(labelErrorInfo); errorInfoLayout->addStretch(); buttonCancel = new QPushButton(tr("Cancel")); buttonCancel->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_buttonCancel"); buttonCancel->setFixedHeight(36); buttonCancel->setFixedWidth(94); buttonCancel->setFocusPolicy(Qt::NoFocus); buttonCancel->setProperty("useButtonPalette", true); buttonAccept = new QPushButton(tr("Accept")); buttonAccept->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_buttonAccept"); buttonAccept->setFixedHeight(36); buttonAccept->setFixedWidth(94); buttonAccept->setFocusPolicy(Qt::NoFocus); buttonAccept->setEnabled(false); QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->addStretch(1); buttonLayout->addWidget(buttonCancel); buttonLayout->setSpacing(16); buttonLayout->addWidget(buttonAccept); QVBoxLayout *contentLayout = new QVBoxLayout; contentLayout->setContentsMargins(24, 16, 24, 24); contentLayout->addLayout(gridLayout); contentLayout->addLayout(errorInfoLayout); contentLayout->addStretch(); contentLayout->addLayout(buttonLayout); contentWidget = new QWidget; contentWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_contentWidget"); contentWidget->setContentsMargins(0, 0, 0, 0); contentWidget->setLayout(contentLayout); QVBoxLayout *vLayout = new QVBoxLayout; vLayout->setContentsMargins(0, 0, 0, 0); vLayout->setSpacing(0); vLayout->addWidget(contentWidget); this->setLayout(vLayout); } void PrivateModelConfigDialog::initConnect() { connect(buttonCancel, &QPushButton::clicked, [this](){reject();}); connect(buttonAccept,&QPushButton::clicked,this,&PrivateModelConfigDialog::accept); connect(passwordEditApi, &KPasswordEdit::textChanged, this, [this]() { onPasswordEditChanged(passwordEditApi); }); connect(passwordEditApi,&KPasswordEdit::textChanged,this,&PrivateModelConfigDialog::updateButtonState); connect(lineeditRequestUrl,&QLineEdit::textChanged,this,&PrivateModelConfigDialog::updateButtonState); connect(lineeditCustomName,&QLineEdit::textChanged,this,&PrivateModelConfigDialog::updateButtonState); connect(lineeditCustomName,&QLineEdit::textChanged,this, [=](const QString &text){ int totalUnits = 0; QString truncatedText; for (int i = 0; i < text.length(); ++i) { QChar currentChar = text[i]; // 中文、英文或其他字符占用 1 个单位 totalUnits += 1; // 如果超出最大长度,就截取到此为止 if (totalUnits > MAX_NAME_COUNT) { break; } truncatedText.append(currentChar); } if (text != truncatedText) { labelErrorInfo->setText(tr("The length must not exceed 32 characters")); lineeditCustomName->setText(truncatedText); } if (totalUnits < MAX_NAME_COUNT) { labelErrorInfo->setText(""); } updateButtonState(); }); } void PrivateModelConfigDialog::updateButtonState() { bool enableButton = true; if(!lineeditCustomName->text().isEmpty() && !lineeditRequestUrl->text().isEmpty()) { if(passwordEditApi->text().contains(" ") || lineeditRequestUrl->text().contains(" ")) { enableButton = false; labelErrorInfo->setText(tr("Cannot contain spaces, please re-enter!")); } else { enableButton = true; this->labelErrorInfo->setText(""); } } else { if(passwordEditApi->text().contains(" ") || lineeditRequestUrl->text().contains(" ")) { labelErrorInfo->setText(tr("Cannot contain spaces, please re-enter!")); } else { this->labelErrorInfo->setText(""); } enableButton = false; } buttonAccept->setEnabled(enableButton); buttonAccept->setProperty("isImportant",enableButton); } bool PrivateModelConfigDialog::checkIsHasSpaces() { bool flag = false; QList passwordEdits = this->findChildren(); if(passwordEdits.isEmpty()) { return flag; } else { for(int i = 0; i text().contains(" ")) { //this->m_labelErrorInfo->setText(tr("Cannot contain spaces, please re-enter!")); flag = true; break; } } } return flag; } void PrivateModelConfigDialog::accept() { if(checkIsHasSpaces()){//未检查到空格则继续进行 return; } PrivateModelConfigWidget *privateModelConfigPage = TestAiSubSystem::getPrivateModelConfigPage(); if (privateModelConfigPage) { //判断是否编辑模型 if (isEdit == false) { // 判断是否存在该模型 if (m_capability == AiCapability::Nlp) { if (privateModelConfigPage->m_nlpPrivateModelItemMap.contains(lineeditCustomName->text())) { KyInfo() << "nlp already exist"; labelErrorInfo->setText(tr("Duplicate name, please re-enter!")); return; } } else if (m_capability == AiCapability::Vision) { if (privateModelConfigPage->m_nlpPrivateModelItemMap.contains(lineeditCustomName->text())) { KyInfo() << "vision already exist"; labelErrorInfo->setText(tr("Duplicate name, please re-enter!")); return; } } else if (m_capability == AiCapability::Speech) { if (privateModelConfigPage->m_nlpPrivateModelItemMap.contains(lineeditCustomName->text())) { KyInfo() << "speech already exist"; labelErrorInfo->setText(tr("Duplicate name, please re-enter!")); return; } } } PrivateModel model; model.capability = m_capability; model.modelName = lineeditCustomName ->text(); model.modelVersion = lineeditModelName ->text(); model.apiKey = passwordEditApi ->text(); model.apiUrl = lineeditRequestUrl->text(); if (model.modelName == "" || model.apiUrl == "") { if (isEdit == true) { showErrorMessage(tr("Model Editing failed"), this); } else { showErrorMessage(tr("Adding model failed"), this); } KyInfo() << model.modelName << "必填信息为空,不允许设置模型"; return; } ModelConfig mc; std::vector auths = mc.getModelAuthentications(model.modelName.toStdString()); bool isValueChanged = true; for (auto &authen : auths) { for (auto &au : authen.authentications) { if (au.key == "apiKey") { if (au.value != passwordEditApi->text().toStdString()) { isValueChanged = true; } au.value = passwordEditApi->text().toStdString(); } } } model.multiAuths = auths; if (isEdit == true) { // 编辑模型 bool isCheckSelected = privateModelConfigPage->checkModelSelection(model.capability, model.modelName); KyInfo() << "Editing modelname" << model.modelName << "isCheckSelected" << isCheckSelected << "isValueChanged" << isValueChanged; bool isCloseEditWindow = privateModelConfigPage->editSelectPrivateModel(model, false, false, isValueChanged, this); if (!isCloseEditWindow) { return; } } else { // 添加模型 if (privateModelConfigPage->getModelItemMap(m_capability).count() == 0) { // 第一个添加的模型,设为选中 bool ret = privateModelConfigPage->setSelectPrivateModelConfig(model); if (ret == true) { privateModelConfigPage->addModelItem(model); KyInfo() << model.modelName << " 添加选中模型成功"; } else { showErrorMessage(tr("Adding model failed"), this); KyInfo() << model.modelName << " 添加选中模型失败"; return; } } else { // 已有选中模型,只更新验证信息和UI bool ret = privateModelConfigPage->addPrivateModel(model); if (ret == true) { privateModelConfigPage->addModelItem(model); KyInfo() << model.modelName << " 更新模型验证信息成功"; } else { showErrorMessage(tr("Adding model failed"), this); KyInfo() << model.modelName << " 更新模型验证信息失败"; return; } } } } labelErrorInfo->setText(""); return QDialog::accept(); } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/privatemodelconfigdialog.h000066400000000000000000000064301520576575000277670ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef PRIVATEMODELCONFIGDIALOG_H #define PRIVATEMODELCONFIGDIALOG_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "privatemodelconfigwidget.h" #include "kaglobal.h" #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include #include #include #include #include #include #include #define MAX_NAME_COUNT 32 using namespace std; using namespace kdk; using namespace kyai::config::model; class PrivateModelConfigDialog : public QDialog { Q_OBJECT public: explicit PrivateModelConfigDialog(PrivateModel model,QWidget *parent = nullptr); explicit PrivateModelConfigDialog(QWidget *parent = nullptr); ~PrivateModelConfigDialog(); // 添加模型-初始化模型UI void initUIData(AiCapability capability, const DeployType deployType); // 编辑模型-加载模型数据 void loadModelData(PrivateModel model); signals: protected: void keyPressEvent(QKeyEvent* event) override; private slots: void onPasswordEditChanged(KPasswordEdit *passwordEdit); void changeTheme(); private: // 布局 void initLayout(); // 信号槽 void initConnect(); // 根据所填内容更新按钮状态 void updateButtonState(); // 检查输入框中是否存在空格 bool checkIsHasSpaces(); void accept() override; bool isEdit = false; AiCapability m_capability; PrivateModel m_model; kdk::KLabel *labelCustomName = nullptr; QLabel *labelModelName = nullptr; // 模型名称 QLabel *labelApiKey = nullptr; kdk::KLabel *labelRequestUrl = nullptr; QLabel *labelErrorInfo = nullptr; QLineEdit *lineeditCustomName = nullptr; QLineEdit *lineeditModelName = nullptr; kdk::KPasswordEdit *passwordEditApi = nullptr; QLineEdit *lineeditRequestUrl = nullptr; QPushButton *buttonCancel = nullptr; QPushButton *buttonAccept = nullptr; QWidget *contentWidget = nullptr; QMap> mapAllModel; }; #endif // PRIVATEMODELCONFIGDIALOG_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/privatemodelconfigwidget.cpp000066400000000000000000001102311520576575000303410ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "privatemodelconfigwidget.h" #include "util.h" PrivateModelConfigWidget::PrivateModelConfigWidget(QWidget *parent) :QDialog(parent) { //初始化布局 initLayout(); //初始化私有模型能力 loadModelConfig(); //初始化信号槽 initConnect(); } void PrivateModelConfigWidget::initLayout() { this->setFixedSize(540, 610); this->setWindowTitle(tr("Private Model")); m_mainVLayout = new QVBoxLayout(); initModelTitleLayout(); initModelLayout(); m_mainVLayout->setStretch(0,2); m_mainVLayout->setStretch(1,8); this->setLayout(m_mainVLayout); } void PrivateModelConfigWidget::initModelTitleLayout() { QLabel* backgroundLabel = new QLabel(this); backgroundLabel->setFixedHeight(72); backgroundLabel->setPixmap(QPixmap(":/res/icon/background.svg")); backgroundLabel->setAlignment(Qt::AlignCenter); backgroundLabel->setScaledContents(false); backgroundLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_backgroundLabel"); // 创建水平布局 m_titleHLayout = new QHBoxLayout(backgroundLabel); m_titleHLayout->setContentsMargins(24, 0, 24, 0); // 左侧图标布局 m_vLeftLayout = new QVBoxLayout(); m_iconLabel = new QLabel(backgroundLabel); m_iconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_iconLabel"); QPixmap iconPixmap(":/res/icon/ukui-private-model-symbolic.svg"); // 替换成自定义模型图标 if(!iconPixmap.isNull()){ iconPixmap = iconPixmap.scaled(24, 24, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_iconLabel->setPixmap(iconPixmap); } m_iconLabel->setFixedSize(24, 24); m_vLeftLayout->addWidget(m_iconLabel); // 右侧文本布局 m_privateHLayout = new QVBoxLayout(); m_privateHLayout->setContentsMargins(0, 12, 0, 16); m_privateLabel = new QLabel(backgroundLabel); m_privateLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_privatLabel"); m_privateLabel->setMinimumSize(216, 24); m_privateLabel->setText(tr("Private Model")); QFont privateFont; privateFont.setBold(true); m_privateLabel->setFont(privateFont); m_privateLabel->setStyleSheet("color: #3790FA; background: transparent;"); m_descripLabel = new kdk::KLabel(backgroundLabel); m_descripLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_descripLabel"); m_descripLabel->setMinimumSize(450, 20); m_descripLabel->setText(tr("Flexible model management to meet personalized usage scenarios")); QFont privateDescripFont; privateDescripFont.setPointSize(privateFont.pointSize() - 2); m_descripLabel->setFont(privateDescripFont); setKLabelFontColor(m_descripLabel, "#3790FA"); m_privateHLayout->addWidget(m_privateLabel); m_privateHLayout->addWidget(m_descripLabel); // 组合布局 m_titleHLayout->addLayout(m_vLeftLayout); m_titleHLayout->addLayout(m_privateHLayout); // 添加到主垂直布局 m_mainVLayout->addWidget(backgroundLabel); } void PrivateModelConfigWidget::initModelLayout() { m_baseVLayout = new QVBoxLayout; m_baseVLayout->setContentsMargins(0, 30, 0, 0); // NLP大语言模型 m_nlpWidget = new QWidget; m_nlpWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_nlpWidget"); m_nlpVLayout = new QVBoxLayout; m_nlpVLayout->setContentsMargins(0, 0, 0, 0); m_nlpHLayout = new QHBoxLayout; m_nlpHLayout->setContentsMargins(16, 0, 16, 0); // NLP标题 QFont font; font.setBold(true); // 设置字体加粗 m_nlpLabel = new QLabel; m_nlpLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_nlpLabel"); m_nlpLabel->setText(tr("NLP Model")); m_nlpLabel->setFont(font); // NLP描述 m_nlpDescLabel = new kdk::KLabel(this); m_nlpDescLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KLabel_m_nlpDescLabel"); m_nlpDescLabel->setText(tr("Processing and generating text, such as understanding text and answering questions")); m_nlpDescLabel->setFixedWidth(400); setKLabelFontColor(m_nlpDescLabel, "#808080"); // 标题和描述放入布局 m_nlpDescVLayout = new QVBoxLayout(); m_nlpDescVLayout->setSpacing(0); m_nlpDescVLayout->addWidget(m_nlpLabel); m_nlpDescVLayout->addWidget(m_nlpDescLabel); // 添加按钮 m_nlpAddButton = new kdk::KBorderlessButton; m_nlpAddButton->setAccessibleName("kylin-ai-subsystem-modelconfig_kdk::KBorderlessButton_m_nlpAddButton"); m_nlpAddButton->setFixedSize(60, 28); m_nlpAddButton->setIcon(QIcon::fromTheme("list-add-symbolic")); m_nlpAddButton->setIconSize(QSize(16, 16)); m_nlpAddButton->setText(tr("Add")); // 已配置模型 m_nlpPrivateModelGroup = new SettingGroup; m_nlpPrivateModelGroup->setAccessibleName("kylin-ai-subsystem-modelconfig_SettingGroup_m_nlpPrivateModelGroup"); m_nlpHLayout->addLayout(m_nlpDescVLayout); m_nlpHLayout->addStretch(); m_nlpHLayout->addWidget(m_nlpAddButton); m_nlpVLayout->addLayout(m_nlpHLayout); m_nlpVLayout->addWidget(m_nlpPrivateModelGroup); m_nlpWidget->setLayout(m_nlpVLayout); // 滚动区域 m_scrollVLayout = new QVBoxLayout; m_scrollVLayout->setContentsMargins(16, 20, 16, 0); m_scrollVLayout->addWidget(m_nlpWidget); // m_scrollVLayout->addWidget(m_visionWidget); // m_scrollVLayout->addWidget(m_speechWidget); m_scrollVLayout->addStretch(); m_scrollWidget = new QWidget; m_scrollWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_scrollWidget"); m_scrollWidget->setContentsMargins(0, 0, 0, 0); m_scrollWidget->setLayout(m_scrollVLayout); m_scrollArea = new QScrollArea(this); m_scrollArea->setAccessibleName("kylin-ai-subsystem-modelconfig_QScrollArea_m_scrollArea"); m_scrollArea->setFixedHeight(420); m_scrollArea->setWidgetResizable(true); m_scrollArea->setFrameStyle(QFrame::NoFrame); // 无边框 m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // 不显示水平滚动条 m_scrollArea->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); m_scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove", false); m_scrollArea->setWidget(m_scrollWidget); m_mainVLayout->addWidget(m_scrollArea); m_confirmWidget = new QWidget(this); m_confirmWidget->setAccessibleName("kylin-ai-subsystem-modelconfig_QWidget_m_confirmWidget"); m_confirmPrivateButton = new QPushButton(tr("OK"), this); m_confirmPrivateButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_m_confirmPrivateButton"); m_confirmPrivateButton->setProperty("isImportant", true); m_confirmPrivateButtoLayout = new QHBoxLayout(); m_confirmPrivateButtoLayout->setContentsMargins(0, 0, 24, 24); m_confirmPrivateButtoLayout->addStretch(); m_confirmPrivateButtoLayout->addWidget(m_confirmPrivateButton); m_confirmWidget->setLayout(m_confirmPrivateButtoLayout); m_mainVLayout->addStretch(); m_mainVLayout->addWidget(m_confirmWidget); } ModelStatus PrivateModelConfigWidget::getModelStatus(const QString &modelName) { ModelConfig mc; ModelStatus ret = mc.getModelStatus(modelName.toStdString()); KyInfo() << QString("ModelStatus = %0").arg((qint32)ret); return ret; } void PrivateModelConfigWidget::onEditModelItem(AiCapability capability, QString modelName) { if (!polkit()) { return; } KyInfo() << QString("currentEditModelItem:AiCapability=%0, ModelName=%1").arg((qint32)capability).arg(modelName); KyInfo() << "currentEditModelItem:modelName"<(capability) << modelName; bool canProceed = showModelInUseMessage(this); if (canProceed == true) { onDeleteModelItem(capability, modelName); } } else { // 未使用,确认弹窗 bool canProceed = showConfirmMessage(this); if (canProceed == true) { bool ret = mc.deleteCustomModel(modelName.toStdString()); if (ret == true) { deleteModelItem(capability, modelName); KyInfo() << modelName << " 验证信息clear成功"; } else { showErrorMessage(tr("Failed to delete model"), this); KyInfo() << modelName << " 验证信息clear失败, 删除失败"; } } } } bool PrivateModelConfigWidget::eventFilter(QObject *watched, QEvent *event) { //模型配置 PrivateModelItemWidget *clickedModelItem = qobject_cast(watched); if (clickedModelItem) { if (event->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::LeftButton) { // 判断左键 // 切换模型 KyInfo() << "nlpSelectedPrivateModel:" << nlpSelectedPrivateModel; clickPrivateModel(clickedModelItem->getAICapability(), clickedModelItem->getModelName()); return true; } } } return QObject::eventFilter(watched, event); } void PrivateModelConfigWidget::nlpAddModelItem() { // 设置为随父窗口居中 PrivateModelConfigDialog settingDialog(this); settingDialog.initUIData(AiCapability::Nlp ,DeployType::Custom); settingDialog.exec(); } void PrivateModelConfigWidget::visionAddModelItem() { } void PrivateModelConfigWidget::speechAddModelItem() { } void PrivateModelConfigWidget::loadModelConfig() { // 清空modelmap所有控件 m_nlpPrivateModelMap.clear(); // 删除ModelItem对象 for( PrivateModelItemWidget *item : m_nlpPrivateModelItemMap){ if(item){ delete item; item = nullptr; } } m_nlpPrivateModelItemMap.clear(); m_nlpPrivateModelItemList.clear(); m_nlpPrivateModelGroup->removeAndDeleteAllWidget(); m_nlpPrivateModelMapUI.clear(); ModelConfig mc; std::string nlpPrivateModel = mc.getCurrentModelName(AiCapability::Nlp,DeployType::Custom); KyInfo() << "loadModelConfig-------------getCurrentModelName" << "nlpModel" << QString::fromStdString(nlpPrivateModel); nlpSelectedPrivateModel = QString::fromStdString(nlpPrivateModel); for (auto capability : {AiCapability::Nlp, AiCapability::Vision, AiCapability::Speech}) { const auto models = mc.getExtendedModels(capability); for (const auto &model : models) { //过滤自定义模型 if(model.deployType == DeployType:: Custom) { PrivateModel privateModel; privateModel.capability = model.capability; privateModel.vendor = QString::fromStdString(model.vendor); privateModel.modelName = QString::fromStdString(model.modelName); privateModel.modelVersion = QString::fromStdString(model.modelVersion); privateModel.apiUrl = QString::fromStdString(model.apiUrl); privateModel.multiAuths = mc.getModelAuthentications(model.modelName); for (const auto &authen : privateModel.multiAuths) { KyInfo() << "loadModelConfig配置项名称" << QString::fromStdString( authen.itemName); for (const auto &au : authen.authentications) { if (au.key == "apiKey") { privateModel.apiKey = QString::fromStdString(au.value); } } } switch (capability) { case AiCapability::Nlp: loadModelItem(privateModel, nlpSelectedPrivateModel); break; case AiCapability::Vision: loadModelItem(privateModel, visionSelectedPrivateModel); break; case AiCapability::Speech: loadModelItem(privateModel, speechSelectedPrivateModel); break; default: break; } } } } } void PrivateModelConfigWidget::initConnect() { connect(m_nlpAddButton, &QPushButton::clicked, this, [this](){ this->nlpAddModelItem(); }); connect(m_confirmPrivateButton, &QPushButton::clicked, this, [this](){ this->close(); }); } void PrivateModelConfigWidget::addModelItem(PrivateModel model) { UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); itemFrame->setObjectName(model.modelName); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(0, 0, 0, 0); PrivateModelItemWidget *item = new PrivateModelItemWidget(model.capability, model.modelName, itemFrame); item->installEventFilter(this); connect(item, &PrivateModelItemWidget::sigEdit, this, &PrivateModelConfigWidget::onEditModelItem); connect(item, &PrivateModelItemWidget::sigDelete, this,&PrivateModelConfigWidget::onDeleteModelItem); layItem->addWidget(item); if (model.capability == AiCapability::Nlp) { m_nlpPrivateModelItemList.append(item); m_nlpPrivateModelMap[model.modelName] = model; m_nlpPrivateModelItemMap[model.modelName] = item; m_nlpPrivateModelMapUI[model.modelName] = itemFrame; m_nlpPrivateModelGroup->addWidget(itemFrame); // 第一个添加的模型,设置为选中 if (m_nlpPrivateModelItemMap.count() == 1) { item->showSelectedIcon(true); nlpSelectedPrivateModel = model.modelName; } } else if (model.capability == AiCapability::Vision) { m_visionPrivateModelItemList.append(item); m_visionPrivateModelMap[model.modelName] = model; m_visionPrivateModelItemMap[model.modelName] = item; m_visionPrivateModelMapUI[model.modelName] = itemFrame; m_visionPrivateModelGroup->addWidget(itemFrame); // 第一个添加的模型,设置为选中 if (m_visionPrivateModelItemMap.count() == 1) { item->showSelectedIcon(true); visionSelectedPrivateModel = model.modelName; } } else if (model.capability == AiCapability::Speech) { m_speechPrivateModelItemList.append(item); m_speechPrivateModelMap[model.modelName] = model; m_speechPrivateModelItemMap[model.modelName] = item; m_speechPrivateModelMapUI[model.modelName] = itemFrame; m_speechPrivateModelGroup->addWidget(itemFrame); // 第一个添加的模型,设置为选中 if (m_speechPrivateModelItemMap.count() == 1) { item->showSelectedIcon(true); speechSelectedPrivateModel = model.modelName; } } } void PrivateModelConfigWidget::loadModelItem(PrivateModel model, QString curSelectedName) { ModelConfig mc; std::vector multiAuths = mc.getModelAuthentications(model.modelName.toStdString()); bool isValueEmpty = false; bool isContinuousValueEmpty = false; bool isRealtimeValueEmpty = false; KyInfo() << "loadModelConfig模型名称" << model.modelName; for (const auto &authen : multiAuths) { KyInfo() << "loadModelConfig配置项名称" << QString::fromStdString(authen.itemName); for (const auto &au : authen.authentications) { if (au.key == "appIdRealTime" || au.key == "apiKeyRealTime") { if (au.value == "") { isContinuousValueEmpty = true; } } else if (au.key == "appIdContinuous" || au.key == "apiKeyContinuous" || au.key == "secretKeyContinuous") { if (au.value == "") { isRealtimeValueEmpty = true; } } else { if (au.value == "") { isValueEmpty = true; } } } } if (model.modelName == "讯飞-语音大模型") { if (isContinuousValueEmpty && isRealtimeValueEmpty) { KyInfo() << model.modelName << "验证信息为空,不加载"; return; } } else { if(isValueEmpty) { KyInfo() << model.modelName << "验证信息为空,当前自定义模型无需限制key的输入,正常加载"; } } UkccFrame *itemFrame = new UkccFrame(this); itemFrame->setAccessibleName("kylin-ai-subsystem-modelconfig_UkccFrame_itemFrame"); itemFrame->setMinimumWidth(496); itemFrame->setMaximumWidth(496); itemFrame->setFixedHeight(56); itemFrame->setObjectName(model.modelName); QHBoxLayout *layItem = new QHBoxLayout(itemFrame); layItem->setContentsMargins(0, 0, 0, 0); PrivateModelItemWidget *item = new PrivateModelItemWidget(model.capability, model.modelName, itemFrame); item->setAccessibleName("kylin-ai-subsystem-modelconfig_PrivateModelItemWidget_item"); item->installEventFilter(this); connect(item, &PrivateModelItemWidget::sigEdit, this, &PrivateModelConfigWidget::onEditModelItem); connect(item, &PrivateModelItemWidget::sigDelete, this, &PrivateModelConfigWidget::onDeleteModelItem); layItem->addWidget(item); if (model.capability == AiCapability::Nlp) { m_nlpPrivateModelItemList.append(item); m_nlpPrivateModelMap[model.modelName] = model; m_nlpPrivateModelItemMap[model.modelName] = item; m_nlpPrivateModelMapUI[model.modelName] = itemFrame; m_nlpPrivateModelGroup->addWidget(itemFrame); // 设置为选中 if (model.modelName == curSelectedName) { item->showSelectedIcon(true); nlpSelectedPrivateModel = model.modelName; } } else if (model.capability == AiCapability::Vision) { m_visionPrivateModelItemList.append(item); m_visionPrivateModelMap[model.modelName] = model; m_visionPrivateModelItemMap[model.modelName] = item; m_visionPrivateModelMapUI[model.modelName] = itemFrame; m_visionPrivateModelGroup->addWidget(itemFrame); // 设置为选中 if (model.modelName == curSelectedName) { item->showSelectedIcon(true); visionSelectedPrivateModel = model.modelName; } } else if (model.capability == AiCapability::Speech) { m_speechPrivateModelItemList.append(item); m_speechPrivateModelMap[model.modelName] = model; m_speechPrivateModelItemMap[model.modelName] = item; m_speechPrivateModelMapUI[model.modelName] = itemFrame; m_speechPrivateModelGroup->addWidget(itemFrame); // 设置为选中 if (model.modelName == curSelectedName) { item->showSelectedIcon(true); speechSelectedPrivateModel = model.modelName; } } } void PrivateModelConfigWidget::deleteModelItem(AiCapability capability, QString modelName) { ModelConfig mc; QString curModelName = QString::fromStdString(mc.getCurrentModelName(capability,DeployType::Custom)); bool isCheckSelected = checkModelSelection(capability, modelName); KyInfo() << "currentmodelname" << curModelName << "要删除的modelname" << modelName << "isCheckSelected" << isCheckSelected; if (capability == AiCapability::Nlp) { // 手动删除 ModelItem 对象 auto item = m_nlpPrivateModelItemList.takeAt(m_nlpPrivateModelItemList.indexOf(m_nlpPrivateModelItemMap[modelName])); if (m_nlpPrivateModelItemMap.contains(modelName)) { if (m_nlpPrivateModelItemMap[modelName]) { delete m_nlpPrivateModelItemMap[modelName]; m_nlpPrivateModelItemMap[modelName] = nullptr; } } m_nlpPrivateModelMap.remove(modelName); m_nlpPrivateModelItemMap.remove(modelName); m_nlpPrivateModelGroup->removeWidget(m_nlpPrivateModelMapUI[modelName]); m_nlpPrivateModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_nlpPrivateModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 PrivateModelItemWidget* firstItem = m_nlpPrivateModelItemList.first(); QString firstModelName = firstItem->getModelName(); KyInfo() << "============删除后 nlp firstModelName" << firstModelName; bool ret = setSelectPrivateModelName(capability, DeployType::Custom, firstModelName); // set sdk if (ret == true) { switchModelItem(firstItem->getAICapability(), firstItem->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " nlpModelItemMap为空"; nlpSelectedPrivateModel = ""; } } } else if (capability == AiCapability::Vision) { // 手动删除 ModelItem 对象 auto item = m_visionPrivateModelItemList.takeAt(m_visionPrivateModelItemList.indexOf(m_visionPrivateModelItemMap[modelName])); if (m_visionPrivateModelItemMap.contains(modelName)) { if (m_visionPrivateModelItemMap[modelName]) { delete m_visionPrivateModelItemMap[modelName]; m_visionPrivateModelItemMap[modelName] = nullptr; } } m_visionPrivateModelMap.remove(modelName); m_visionPrivateModelItemMap.remove(modelName); m_visionPrivateModelGroup->removeWidget(m_visionPrivateModelMapUI[modelName]); m_visionPrivateModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_visionPrivateModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 PrivateModelItemWidget* firstItem = m_visionPrivateModelItemList.first(); QString firstModelName = firstItem->getModelName(); KyInfo() << "============删除后 vision firstModelName" << firstModelName; bool ret = setSelectPrivateModelName(capability, DeployType::Custom, firstModelName); // set sdk if (ret == true) { switchModelItem(firstItem->getAICapability(), firstItem->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " visionModelItemMap为空"; visionSelectedPrivateModel = ""; } } } else if (capability == AiCapability::Speech) { // 手动删除 ModelItem 对象 auto item = m_speechPrivateModelItemList.takeAt(m_speechPrivateModelItemList.indexOf(m_speechPrivateModelItemMap[modelName])); if (m_speechPrivateModelItemMap.contains(modelName)) { if (m_speechPrivateModelItemMap[modelName]) { delete m_speechPrivateModelItemMap[modelName]; m_speechPrivateModelItemMap[modelName] = nullptr; } } m_speechPrivateModelMap.remove(modelName); m_speechPrivateModelItemMap.remove(modelName); m_speechPrivateModelGroup->removeWidget(m_speechPrivateModelMapUI[modelName]); m_speechPrivateModelMapUI.remove(modelName); // 如果删除选中模型,需重新设置currentmodelname if(curModelName == modelName || isCheckSelected) { if (m_speechPrivateModelItemMap.count() > 0) { // 删除后,设置剩下模型中的第一个为选中 PrivateModelItemWidget* firstItem = m_speechPrivateModelItemList.first(); QString firstModelName = firstItem->getModelName(); KyInfo() << "============删除后 speech firstModelName" << firstModelName; bool ret = setSelectPrivateModelName(capability, DeployType::Custom, firstModelName); // set sdk if (ret == true) { switchModelItem(firstItem->getAICapability(), firstItem->getModelName()); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model setup failed"), this); KyInfo() << modelName << " 设置为选中模型失败"; return; } } else { // 删除后无模型 KyInfo() << " speechModelItemMap为空"; speechSelectedPrivateModel = ""; } } } } void PrivateModelConfigWidget::switchModelItem(AiCapability capability, QString modelName) { QMap *modelItemMap = nullptr; if (capability == AiCapability::Nlp) { modelItemMap = &m_nlpPrivateModelItemMap; } else if (capability == AiCapability::Vision) { modelItemMap = &m_visionPrivateModelItemMap; } else if (capability == AiCapability::Speech) { modelItemMap = &m_speechPrivateModelItemMap; } if (modelItemMap) { foreach (const auto& modelItemName, modelItemMap->keys()) { PrivateModelItemWidget* modelItem = modelItemMap->value(modelItemName); if (modelItem->getModelName() == modelName) { KyInfo() << "匹配成功,展示图标"; modelItem->showSelectedIcon(true); if (capability == AiCapability::Nlp) { nlpSelectedPrivateModel = modelName; } else if (capability == AiCapability::Vision) { visionSelectedPrivateModel = modelName; } else if (capability == AiCapability::Speech) { speechSelectedPrivateModel = modelName; } } else { // 不匹配,隐藏图标 KyInfo() << "不匹配,隐藏图标"; modelItem->showSelectedIcon(false); } } } } bool PrivateModelConfigWidget::setSelectPrivateModelConfig(PrivateModel model) { ModelConfig mc; bool ret1 = mc.addCustomModel(model.modelName.toStdString(), model.modelVersion.toStdString(), model.apiKey.toStdString(), model.apiUrl.toStdString()); if (ret1 == true) { bool ret2 = setSelectPrivateModelName(model.capability, DeployType::Custom, model.modelName); if (ret2 == false) { KyInfo() << "setCurrentModelName failed:" << ret2; return false; } } else { KyInfo() << "addCustomModel failed:" << ret1; return false; } return true; } bool PrivateModelConfigWidget::setSelectPrivateModelName(AiCapability capability, DeployType deployType, QString modelName) { KyInfo() << "setSelectPrivateModelName" << modelName; ModelConfig mc; bool ret2 = mc.setCurrentModelName(capability, deployType, modelName.toStdString()); if ( ret2 == true) { KyInfo() << "setCurrentModelName success:"<< ret2; } else { KyInfo() << "setCurrentModelName failed:"<< ret2; } return ret2; } bool PrivateModelConfigWidget::editSelectPrivateModel(PrivateModel model, bool isContinuousSelected, bool isRealTimeSelected, bool isValueChanged, QDialog *parentDialog) { bool isSwitchStateChanged = false; if (model.capability == AiCapability::Speech) { if (continuousSelected != isContinuousSelected) { isSwitchStateChanged = true; } if (realtimeSelected != isRealTimeSelected) { isSwitchStateChanged = true; } } while (getModelStatus(model.modelName) == ModelStatus::Running) { // NLP or VISION or SPEECH 正在使用,重试弹窗 KyInfo() << "正在使用" << static_cast(model.capability); if (isValueChanged == false && isSwitchStateChanged == false) { KyInfo() << "检查无修改内容,仅查看,关闭弹窗"; return true; } bool canProceed = showModelInUseMessage(parentDialog); if (canProceed == true) { continue; } else { KyInfo() << "取消本次操作"; return false; } } // 未使用 // 当前选中的,无需再setCurrentModelName // 更新当前模型信息 bool ret = this->updatePrivateModel(model); if (ret == true) { // 发送信号告知已设置模型,重新创建会话 if (model.capability == AiCapability::Nlp) { m_nlpPrivateModelMap[model.modelName] = model; } else if (model.capability== AiCapability::Vision) { m_visionPrivateModelMap[model.modelName] = model; } else if (model.capability== AiCapability::Speech) { m_speechPrivateModelMap[model.modelName] = model; } if (model.capability == AiCapability::Speech) { // 同步两个开关的状态 continuousSelected = isContinuousSelected; realtimeSelected = isRealTimeSelected; } } else { showErrorMessage(tr("Model Editing failed"), parentDialog); KyInfo() << "编辑模型" << model.modelName << "失败"; return false; } return true; } void PrivateModelConfigWidget::clickPrivateModel(AiCapability capability, QString modelName) { KyInfo() << "正要切换到" << static_cast(capability) << modelName ; KyInfo() << "当前正在回答的选中模型为" << nlpSelectedPrivateModel; bool ret = checkModelSelection(capability, modelName); if(ret == true){ return; } else { if ((capability == AiCapability::Nlp && (getModelStatus(nlpSelectedPrivateModel) == ModelStatus::Running)) || (capability == AiCapability::Vision && (getModelStatus(visionSelectedPrivateModel) == ModelStatus::Running)) || (capability == AiCapability::Speech && (getModelStatus(speechSelectedPrivateModel) == ModelStatus::Running))) { // NLP or VISION or SPEECH 正在使用 KyInfo() << "正在使用" << static_cast(capability); bool canProceed = showModelInUseMessage(this); if (canProceed == true) { clickPrivateModel(capability, modelName); } else { KyInfo() << "取消本次操作"; return; } } else { bool ret = setSelectPrivateModelName(capability, DeployType::Custom, modelName); if (ret == true) { switchModelItem(capability, modelName); KyInfo() << modelName << " 设置为选中模型成功"; } else { showErrorMessage(tr("Model switching failed"),this); KyInfo() << modelName << " 设置为选中模型失败"; } } } } bool PrivateModelConfigWidget::clearModelMultiAuths(AiCapability capability, QString modelName) { ModelConfig mc; bool ret = mc.clearModelAuthentications(modelName.toStdString()); return ret; } bool PrivateModelConfigWidget::clearCustomModel(AiCapability capability, QString modelName) { ModelConfig mc; bool ret = mc.deleteCustomModel(modelName.toStdString()); return ret; } bool PrivateModelConfigWidget::addPrivateModel(PrivateModel model) { ModelConfig mc; bool ret = mc.addCustomModel(model.modelName.toStdString(), model.modelVersion.toStdString(), model.apiKey.toStdString(), model.apiUrl.toStdString()); if (ret == true) { return true; } else { KyInfo() << "addPrivateModel failed:" << ret; return false; } } bool PrivateModelConfigWidget::updatePrivateModel(PrivateModel model) { ModelConfig mc; bool ret1 = mc.setCustomModelApiUrl(model.modelName.toStdString(), model.apiUrl.toStdString()); bool ret2 = mc.setCustomModelVersion(model.modelName.toStdString(), model.modelVersion.toStdString()); bool ret3 = mc.setModelAuthentications(model.modelName.toStdString(), model.multiAuths); if (ret1 == true && ret2 == true && ret3 == true) { return true; } else { KyInfo() << "updateCustomModel failed"<<"ret1"<checkAuthorizationSync( "org.kylin-ai-subsystem-modelconfig.policy", PolkitQt1::UnixProcessSubject(QCoreApplication::applicationPid()), PolkitQt1::Authority::AllowUserInteraction); KyInfo() << "PolkitQt1 Authority result:" << result; if (result == PolkitQt1::Authority::Yes) { //认证通过 KyInfo() << QString("operation authorized"); return true; } else { KyInfo() << QString("not authorized"); return false; } } QMap &PrivateModelConfigWidget::getModelItemMap(AiCapability capability) { if (capability == AiCapability::Nlp) { return m_nlpPrivateModelItemMap; } else if (capability == AiCapability::Vision) { return m_visionPrivateModelItemMap; } else if (capability == AiCapability::Speech) { return m_speechPrivateModelItemMap; } } void PrivateModelConfigWidget::showCentered() { if (QWidget* mainWindow = QApplication::activeWindow()) { QRect mainGeom = mainWindow->geometry(); move(mainGeom.x() + (mainGeom.width() - width()) / 2, mainGeom.y() + (mainGeom.height() - height()) / 2 + 15); } adjustPosition(this); // 调用内部调整逻辑 } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/privatemodelconfigwidget.h000066400000000000000000000141611520576575000300130ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef PRIVATEMODELCONFIGWIDGET_H #define PRIVATEMODELCONFIGWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "privatemodelconfigdialog.h" #include "privatemodelitemwidget.h" #include "kaglobal.h" #include "libukcc/widgets/SettingWidget/addbutton.h" #include "libukcc/widgets/SettingWidget/settinggroup.h" #include "ukui-log4qt.h" #include #include #include #include using namespace std; using namespace kdk; using namespace kyai::config::model; class PrivateModelConfigWidget : public QDialog { Q_OBJECT friend class PrivateModelConfigDialog; public: explicit PrivateModelConfigWidget(QWidget *parent =nullptr); void initLayout(); void initModelTitleLayout(); void initModelLayout(); void showCentered(); ModelStatus getModelStatus(const QString &modelName); signals: void sigSetSelectPrivateModel(AiCapability capability, QString modelName); public slots: void onEditModelItem(AiCapability capability, QString modelName); void onDeleteModelItem(AiCapability capability, QString modelName); protected: bool eventFilter(QObject *watched, QEvent *event) override; private slots: void nlpAddModelItem(); void visionAddModelItem(); void speechAddModelItem(); private: // 从sdk加载数据 void loadModelConfig(); // 信号槽 void initConnect(); // 添加模型 void addModelItem(PrivateModel model); // 加载模型 void loadModelItem(PrivateModel model, QString curSelectedName); // 删除模型 void deleteModelItem(AiCapability capability, QString modelName); // 切换选中模型 void switchModelItem(AiCapability capability, QString modelName); // 设置选中模型 bool setSelectPrivateModelConfig(PrivateModel model); // 设置选中模型名称 bool setSelectPrivateModelName(AiCapability capability, DeployType deployType, QString modelName); // 编辑选中模型 // 返回值表示是否需要关闭当前正在编辑的窗口 bool editSelectPrivateModel(PrivateModel model, bool isContinuousSelected, bool isRealTimeSelected, bool isValueChanged, QDialog *parentDialog); // 点击模型 void clickPrivateModel(AiCapability capability, QString modelName); //恢复模型key默认值 bool clearModelMultiAuths(AiCapability capability,QString modelName); //清除自定义模型 bool clearCustomModel(AiCapability capability, QString modelName); //添加自定义模型 bool addPrivateModel(PrivateModel model); // 更新自定义模型 bool updatePrivateModel(PrivateModel model); // 检查该模型是否已选择 bool checkModelSelection(AiCapability capability, QString modelName); // 授权弹窗 bool polkit(); // 获取ModelItemMap QMap& getModelItemMap(AiCapability capability); private: QVBoxLayout *m_mainVLayout; QHBoxLayout *m_titleHLayout; QLabel *m_titleLabel; QVBoxLayout *m_vLeftLayout = nullptr; QLabel *m_iconLabel = nullptr; QVBoxLayout *m_privateHLayout = nullptr; QLabel *m_privateLabel = nullptr; kdk::KLabel *m_descripLabel = nullptr; QVBoxLayout *m_baseVLayout = nullptr; QScrollArea *m_scrollArea = nullptr; QWidget *m_scrollWidget = nullptr; QVBoxLayout *m_scrollVLayout = nullptr; //NLP大语言模型 QWidget *m_nlpWidget = nullptr; QVBoxLayout *m_nlpDescVLayout = nullptr; QHBoxLayout *m_nlpHLayout = nullptr; QVBoxLayout *m_nlpVLayout = nullptr; QLabel * m_nlpLabel = nullptr; kdk::KLabel * m_nlpDescLabel = nullptr; KBorderlessButton *m_nlpAddButton = nullptr; //确定按钮 QWidget *m_confirmWidget = nullptr; QPushButton *m_confirmPrivateButton = nullptr; QHBoxLayout *m_confirmPrivateButtoLayout = nullptr; public: QMap m_nlpPrivateModelMap; QMap m_visionPrivateModelMap; QMap m_speechPrivateModelMap; QMap m_nlpPrivateModelItemMap; QMap m_visionPrivateModelItemMap; QMap m_speechPrivateModelItemMap; QList m_nlpPrivateModelItemList; QList m_visionPrivateModelItemList; QList m_speechPrivateModelItemList; QMap m_nlpPrivateModelMapUI; QMap m_visionPrivateModelMapUI; QMap m_speechPrivateModelMapUI; SettingGroup *m_nlpPrivateModelGroup = nullptr; SettingGroup *m_visionPrivateModelGroup = nullptr; SettingGroup *m_speechPrivateModelGroup = nullptr; QString nlpSelectedPrivateModel; QString visionSelectedPrivateModel; QString speechSelectedPrivateModel; bool continuousSelected = false; bool realtimeSelected = false; }; #endif // PRIVATEMODELCONFIGWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/privatemodelitemwidget.cpp000066400000000000000000000076201520576575000300410ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "privatemodelitemwidget.h" PrivateModelItemWidget::PrivateModelItemWidget(kyai::config::model::AiCapability capability, QString modelName, QWidget *parent) : QWidget(parent) { m_capability = capability; m_modelName = modelName; initLayout(); initMenu(); } PrivateModelItemWidget::~PrivateModelItemWidget() { } void PrivateModelItemWidget::initLayout() { m_nameLabel = new QLabel; m_nameLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_nameLabel"); m_nameLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); m_nameLabel->setText(m_modelName); m_moreButton = new QToolButton; m_moreButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QToolButton_m_moreButton"); m_moreButton->setFixedSize(38, 38); m_moreButton->setProperty("useButtonPalette", true); m_moreButton->setAutoRaise(true); m_moreButton->setPopupMode(QToolButton::InstantPopup); m_moreButton->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); m_moreButton->setFocusPolicy(Qt::NoFocus); m_selectedIconLabel = new QLabel(); m_selectedIconLabel->setAccessibleName("kylin-ai-subsystem-modelconfig_QLabel_m_selectedIconLabel"); QIcon selectIcon = QIcon::fromTheme("ukui-selected"); m_selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); const QByteArray id(THEME_QT_SCHEMA); QGSettings *mQtSettings = new QGSettings(id, QByteArray(), this); connect(mQtSettings, &QGSettings::changed, this, [=](QString key) { if (key == "iconThemeName") m_selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); }); QFrame *frame = new QFrame(this); frame->setFixedSize(16,16); QHBoxLayout *frameLayout = new QHBoxLayout; frameLayout->setContentsMargins(0, 0, 0, 0); frame->setLayout(frameLayout); frameLayout->addWidget(m_selectedIconLabel); m_selectedIconLabel->setVisible(false); QHBoxLayout *hLayout = new QHBoxLayout; hLayout->setContentsMargins(16, 10, 16, 10); hLayout->addWidget(m_nameLabel); hLayout->addStretch(); hLayout->addWidget(m_moreButton); hLayout->addWidget(frame); this->setLayout(hLayout); } void PrivateModelItemWidget::initMenu() { m_menu = new QMenu(); m_menu->setAccessibleName("kylin-ai-subsystem-modelconfig_QMenu_m_menu"); m_moreButton->setMenu(m_menu); QAction *actionEdit = new QAction(QIcon::fromTheme("document-edit-symbolic"), tr("Edit")); //actionEdit->setDisabled(true); connect(actionEdit, &QAction::triggered, [this]{Q_EMIT sigEdit(m_capability, m_modelName);}); QAction *actionDelete = new QAction(QIcon::fromTheme("edit-delete-symbolic"), tr("Delete")); connect(actionDelete, &QAction::triggered, [this]{Q_EMIT sigDelete(m_capability, m_modelName);}); m_menu->addAction(actionEdit); m_menu->addAction(actionDelete); } void PrivateModelItemWidget::showSelectedIcon(bool flag) { m_selectedIconLabel->setVisible(flag); } bool PrivateModelItemWidget::isSelected() { return m_selectedIconLabel->isVisible(); } AiCapability PrivateModelItemWidget::getAICapability() { return m_capability; } QString PrivateModelItemWidget::getModelName() { return m_modelName; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/privatemodelitemwidget.h000066400000000000000000000036071520576575000275070ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef PRIVATEMODELITEMWIDGET_H #define PRIVATEMODELITEMWIDGET_H #include #include #include #include #include #include #include #include #include #define THEME_QT_SCHEMA "org.ukui.style" using namespace std; using namespace kyai::config::model; class PrivateModelItemWidget : public QWidget { Q_OBJECT public: explicit PrivateModelItemWidget(AiCapability capability,QString modelName, QWidget *parent = nullptr); ~PrivateModelItemWidget(); void showSelectedIcon(bool flag); bool isSelected(); AiCapability getAICapability(); QString getModelName(); signals: void sigEdit(AiCapability capability, QString modelName); void sigDelete(AiCapability capability, QString modelName); private: void initLayout(); void initMenu(); QLabel *m_nameLabel = nullptr; // 模型名称 QToolButton *m_moreButton = nullptr; // 更多 QMenu *m_menu = nullptr; // 菜单 QLabel *m_selectedIconLabel = nullptr;// 已选择状态 kyai::config::model::AiCapability m_capability; QString m_modelName; }; #endif // PRIVATEMODELITEMWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/updatenotificationwidget.cpp000066400000000000000000000144701520576575000303610ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "updatenotificationwidget.h" #include #include UpdateNotificationWidget::UpdateNotificationWidget(PublicLocalModel &model, QWidget *parent) :QWidget(parent) ,m_currentState(LatestVersion)//默认为最新版本 ,m_downloadProgress(0) ,m_downloading(false) { m_modelDebName = model.debName; // 初始化 UI initLayout(); } void UpdateNotificationWidget::initLayout() { m_progressBar = new QProgressBar(this); m_progressBar->setAccessibleName("kylin-ai-subsystem-modelconfig_QProgressBar_m_progressBar"); m_progressBar->setMinimum(0); m_progressBar->setMaximum(100); m_progressBar->setValue(0); m_progressBar->setTextVisible(false); m_progressBar->setFixedSize(56,16); m_progressBar->setObjectName("progressbar"); m_pauseButton = new QPushButton( this); m_pauseButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_m_pauseButton"); m_pauseButton->setObjectName("puaseButton"); connect(m_pauseButton,&QPushButton::clicked,this,[=]{ }); m_pauseButton->setFixedSize(16,16); m_pauseButton->setIcon(QIcon::fromTheme("media-playback-pause-symbolic")); m_pauseButton->setIconSize(QSize(16,16)); m_pauseButton->setProperty("isWindowButton", 0x1); m_pauseButton->setFlat(true); m_pauseButton->setVisible(false); m_pauseButton->setProperty("useButtonPalette", true); m_closeButton = new QPushButton(this); m_closeButton->setAccessibleName("kylin-ai-subsystem-modelconfig_QPushButton_m_closeButton"); connect(m_closeButton,&QPushButton::clicked,this,&UpdateNotificationWidget::slClickExitButton); m_closeButton->setObjectName("cancelButton"); m_closeButton->setFixedSize(16,16); m_closeButton->setProperty("isWindowButton", QVariant(0x1)); m_closeButton->setProperty("useButtonPalette", true); m_closeButton->setFlat(true); m_closeButton->setIcon(QIcon::fromTheme("application-exit-symbolic")); m_closeButton->setIconSize(QSize(16,16)); // 布局设置 m_mainHLayout = new QHBoxLayout(); m_mainHLayout->addWidget(m_progressBar); m_mainHLayout->addWidget(m_pauseButton); m_mainHLayout->addWidget(m_closeButton); this->setLayout(m_mainHLayout); } void UpdateNotificationWidget::resetProgressBar() { m_progressBar->setValue(0); m_closeButton->setVisible(true); } bool UpdateNotificationWidget::checkNetWorkOnline() { CURL *curl; CURLcode res; long http_code = 0; QString targetUrl = getDownloadUrl(); curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, targetUrl.toUtf8().constData()); curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); // 只获取头部信息 curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L); // 设置超时时间为 5 秒 res = curl_easy_perform(curl); if (res == CURLE_OK) { curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code); if (http_code == 200) { curl_easy_cleanup(curl); return true; // 网络可用 } } curl_easy_cleanup(curl); } KyInfo() << "curl error code: " << res; return false; // 网络不可用 } void UpdateNotificationWidget::setCancelDownloadButtonVisible(bool isVisible) { //在下载返回的进度值大于50时不显示取消下载按钮及进度条显示并显示安装中的提示 if(m_closeButton->isVisible() == true && isVisible == false) { m_progressBar->setValue(100); m_progressBar->setVisible(false); //设置显示安装中 emit sigShowIsInstalling(); m_closeButton->setVisible(isVisible); } } void UpdateNotificationWidget::setProgressBarVisible(bool isVisible) { if(m_progressBar) { m_progressBar->setVisible(isVisible); } } void UpdateNotificationWidget::setCancelDownloadButtenEnabled(bool isEnabled) { if(m_closeButton) { m_closeButton->setEnabled(isEnabled); } } QString UpdateNotificationWidget::getDownloadUrl() { QString targetUrl = ""; if(m_modelDebName.isEmpty()) { targetUrl = kaglobal::baiduUrl; return targetUrl; } else { QProcess process; QString cmd1 = QString("apt show %1 | grep APT-Sources | cut -d ' ' -f 2 ").arg(m_modelDebName); process.start("bash", QStringList() << "-c" << cmd1); process.waitForFinished(); QString outPutStr = process.readAllStandardOutput(); KyInfo() << "ffffffffffffffffffffffffffff:" <getCurrentInstallStatus(); if(isInstall) { return; } if(m_progressBar && m_progressBar->isVisible()) { m_progressBar->setValue(value); } } void UpdateNotificationWidget::slClickExitButton() { bool isInstall = ModelDownload::getInstance()->getCurrentInstallStatus(); //非安装安装状态下可直接取消安装 if(!isInstall) { ModelDownload::getInstance()->cancelDownloading(); } } bool UpdateNotificationWidget::getNetStatus() { return m_netStaus; } kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/updatenotificationwidget.h000066400000000000000000000046531520576575000300300ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef UPDATENOTIFICATIONWIDGET_H #define UPDATENOTIFICATIONWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include "kaglobal.h" #include "modeldownload.h" #include "ktoolbutton.h" using namespace std; using namespace kdk; class UpdateNotificationWidget : public QWidget { Q_OBJECT public: enum UpdateState { NewVersionAvailable, LatestVersion, NetworkError }; explicit UpdateNotificationWidget(PublicLocalModel &model, QWidget *parent = nullptr); void initLayout(); void setUpdateState(UpdateState state); void resetProgressBar(); bool getNetStatus(); bool checkNetWorkOnline(); void setCancelDownloadButtonVisible(bool isVisible); void setProgressBarVisible(bool isVisible); void setCancelDownloadButtenEnabled(bool isEnabled); QString getDownloadUrl(); public slots: void slUpdateProgressValue(int value); void slClickExitButton(); signals: void updateDownloadProgress(int value ); void sigCancelDownload(); void sigShowIsInstalling(); private: private: QHBoxLayout *m_mainHLayout; QLabel *updateMessageLabel = nullptr; QLabel *noNewUpdateLabel = nullptr; QLabel *errorMessageLabel = nullptr; QLabel *restartEffectLabel = nullptr; QPushButton *m_pauseButton; QPushButton *m_closeButton; QProgressBar *m_progressBar; QToolButton *m_downloadButton = nullptr; // 下载 int m_downloadProgress; UpdateState m_currentState; QString m_modelDebName; bool m_downloading; bool m_netStaus; }; #endif // UPDATENOTIFICATIONWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/modelconfigmanager/util.h000066400000000000000000000065651520576575000237140ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef UTIL_H #define UTIL_H #include #include #include #include #include #include #include #include enum class SystemVersion { Version_2403, Version_2503, Version_V11 }; static SystemVersion curSystemVersion() { QString version = kdk_system_get_version_detaile().os_version; qInfo() << "System version: " << version; if (version == "2403") { return SystemVersion::Version_2403; } else if (version == "2503") { return SystemVersion::Version_2503; } else { return SystemVersion::Version_V11; } } static void setKLabelFontColor(kdk::KLabel *klabel, QColor color) { #ifdef SYSTEM_VERSION_2403 QPalette palette; palette.setColor(QPalette::WindowText, color); klabel->setPalette(palette); #else klabel->setFontColor(color); #endif } static void showErrorMessage(const QString &message, QWidget *parent) { QMessageBox msgBox(parent); msgBox.setIcon(QMessageBox::Question); msgBox.setText(message); QPushButton *cancelButton = msgBox.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole); QPushButton *sureButton = msgBox.addButton(QObject::tr("Ok"), QMessageBox::AcceptRole); msgBox.setDefaultButton(sureButton); msgBox.exec(); } static bool showModelInUseMessage(QWidget* parent) { QMessageBox retryMsgBox(parent); retryMsgBox.setText(QObject::tr("Sorry, the model is currently executing another task. Please try again after it is completed..")); retryMsgBox.setIcon(QMessageBox::Critical); QPushButton *cancelButton = retryMsgBox.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole); QPushButton *retryButton = retryMsgBox.addButton(QObject::tr("Retry"), QMessageBox::AcceptRole); retryMsgBox.setDefaultButton(retryButton); retryMsgBox.exec(); if ((QPushButton *)retryMsgBox.clickedButton() == retryButton) { return true; } return false; } static bool showConfirmMessage(QWidget* parent) { QMessageBox confirmMsgBox(parent); confirmMsgBox.setText(QObject::tr("Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it?")); confirmMsgBox.setIcon(QMessageBox::Question); QPushButton *cancelButton = confirmMsgBox.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole); QPushButton *sureButton = confirmMsgBox.addButton(QObject::tr("Delete"), QMessageBox::AcceptRole); confirmMsgBox.setDefaultButton(sureButton); confirmMsgBox.exec(); if ((QPushButton *)confirmMsgBox.clickedButton() == sureButton) { return true; } return false; } #endif // UTIL_H kylin-ai-subsystem-plugin-1.0.0.2/subsysteminstallmodule.cpp000066400000000000000000000105351520576575000242740ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "subsysteminstallmodule.h" #include #include #include #include SubSystemInstallModule::SubSystemInstallModule(QObject *parent) : QObject(parent) { QTranslator *translator = new QTranslator(this); translator->load("/usr/share/kylin-ai-subsystem-plugin/translations/" + QLocale::system().name()); QApplication::installTranslator(translator); pluginName = tr("AI Models"); pluginType = COMMONINFO; } QString SubSystemInstallModule::plugini18nName() { return pluginName; } int SubSystemInstallModule::pluginTypes() { return pluginType; } QWidget *SubSystemInstallModule::pluginUi() { if (mFirstLoad) { initUI(); connectSignals(); mFirstLoad = false; QTimer::singleShot(100, [this]() { subSystemWidget->continueLoading(); }); } return mainFrame; } bool SubSystemInstallModule::isEnable() const { return true; } const QString SubSystemInstallModule::name() const { return "aisubsystem"; } bool SubSystemInstallModule::isShowOnHomePage() const { return true; } QIcon SubSystemInstallModule::icon() const { return QIcon::fromTheme("ukui-ai-module-manager-symbolic"); } QString SubSystemInstallModule::translationPath() const { return "/usr/share/kylin-ai-subsystem-plugin/translations/%1.ts"; } void SubSystemInstallModule::initUI() { mainFrame = new QFrame(); mainFrame->setAccessibleName( "kylin-ai-subsystem-plugin_QFrame_subsystemMainInterface"); mainVLayout = new QVBoxLayout(); mainVLayout->setObjectName( "kylin-ai-subsystem-plugin_QVBoxLayout_subsystemMainLayout"); mainFrame->setLayout(mainVLayout); subSystemWidget = new SubSystemWidget(mainFrame); mainWidget = subSystemWidget->mainWidget(); if (mainWidget) { mainVLayout->addWidget(mainWidget); } loadingPluginText = new QLabel(mainFrame); loadingPluginText->setText(tr("loading plugin")); loadingPluginText->setAlignment(Qt::AlignCenter); loadingPluginText->hide(); mainVLayout->addWidget(loadingPluginText); mainVLayout->addStretch(1); } void SubSystemInstallModule::connectSignals() { connect(subSystemWidget, &SubSystemWidget::uninstallPkgSuccess, this, [this]() { if (modelConfigWidget) { modelConfigWidget->hide(); } }); connect(subSystemWidget, &SubSystemWidget::modelConfigLoaded, this, [this]() { modelConfigWidget = subSystemWidget->modelConfigWidget(); if (modelConfigWidget) { mainVLayout->addWidget(modelConfigWidget); if (!subSystemWidget->runtimeProcessExists()) { modelConfigWidget->hide(); } } computePowerSharingWidget = subSystemWidget->computePowerSharingWidget(); if (computePowerSharingWidget) { mainVLayout->addWidget(computePowerSharingWidget); if (!subSystemWidget->runtimeProcessExists()) { computePowerSharingWidget->hide(); } } loadingPluginText->hide(); mainVLayout->takeAt(2); mainVLayout->addStretch(1); }); connect(subSystemWidget, &SubSystemWidget::loadingPlugin, this, [this]() { loadingPluginText->show(); }); } void SubSystemInstallModule::initSearchText() { //~ contents_path /aisubsystem/AI SubSystem tr("AI SubSystem"); //~ contents_path /aisubsystem/Model Configuration tr("Model Configuration"); } kylin-ai-subsystem-plugin-1.0.0.2/subsysteminstallmodule.h000066400000000000000000000037411520576575000237420ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef SUBSYSTEMINSTALLMODULE_H #define SUBSYSTEMINSTALLMODULE_H #include #include #include #include #include "subsystemwidget.h" class SubSystemInstallModule : public QObject, CommonInterface { Q_OBJECT Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface") Q_INTERFACES(CommonInterface) public: explicit SubSystemInstallModule(QObject *parent = nullptr); QString plugini18nName() Q_DECL_OVERRIDE; int pluginTypes() Q_DECL_OVERRIDE; QWidget *pluginUi() Q_DECL_OVERRIDE; bool isEnable() const Q_DECL_OVERRIDE; const QString name() const Q_DECL_OVERRIDE; bool isShowOnHomePage() const Q_DECL_OVERRIDE; QIcon icon() const Q_DECL_OVERRIDE; QString translationPath() const Q_DECL_OVERRIDE; private: void initUI(); void connectSignals(); void initSearchText(); private: QString pluginName; int pluginType; QWidget *mainWidget = nullptr; QVBoxLayout *mainVLayout = nullptr; QFrame *mainFrame = nullptr; QObject *plugin = nullptr; QWidget *modelConfigWidget = nullptr; QWidget *computePowerSharingWidget = nullptr; QLabel *loadingPluginText = nullptr; SubSystemWidget *subSystemWidget = nullptr; bool mFirstLoad = true; }; #endif // SUBSYSTEMINSTALLMODULE_H kylin-ai-subsystem-plugin-1.0.0.2/subsystempackagemanager.cpp000066400000000000000000000174121520576575000243470ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "subsystempackagemanager.h" #include #include #include #include #include SubSystemPackageManager::SubSystemPackageManager(QObject *parent) : QObject(parent) { connectSignals(); } void SubSystemPackageManager::installPackage() { isUpdatingCache_ = true; updateCache(); } void SubSystemPackageManager::unInstallPackage( const QStringList &uninstallList) { QDBusInterface interface(serviceName_, objectPath_, interfaceName_, QDBusConnection::systemBus()); isUninstallingPkg = true; QDBusMessage reply = interface.call("PurgePackages", uninstallList, "", ""); } void SubSystemPackageManager::reboot() { QDBusInterface interface( "org.gnome.SessionManager", "/org/gnome/SessionManager", "org.gnome.SessionManager", QDBusConnection::sessionBus()); interface.call("reboot"); } void SubSystemPackageManager::fixBrokenDepends() { qDebug() << __func__; QDBusInterface interface(serviceName_, objectPath_, interfaceName_, QDBusConnection::systemBus()); QDBusMessage reply = interface.call("FixBrokenDepends"); } void SubSystemPackageManager::fixIncompleteInstall() { qDebug() << __func__; QDBusInterface interface(serviceName_, objectPath_, interfaceName_, QDBusConnection::systemBus()); QDBusMessage reply = interface.call("FixIncompleteInstall"); } void SubSystemPackageManager::connectSignals() { bool updateCacheFinishedConnected = QDBusConnection::systemBus().connect( serviceName_, objectPath_, interfaceName_, "UpdateCacheFinished", this, SLOT(handleUpdateCacheFinished(bool, QStringList, QString, QString))); if (!updateCacheFinishedConnected) { qWarning() << "无法连接到 UpdateCacheFinished 信号"; } bool updateCacheStatusConnected = QDBusConnection::systemBus().connect( serviceName_, objectPath_, interfaceName_, "UpdateCacheStatusChanged", this, SLOT(handleUpdateCacheStatusChanged(int, QString))); if (!updateCacheStatusConnected) { qWarning() << "无法连接到 UpdateCacheStatusChanged 信号"; } bool installdebStatusConnected = QDBusConnection::systemBus().connect( serviceName_, objectPath_, interfaceName_, "InstalldebStatusChanged", this, SLOT(handleInstalldebStatusChanged(int, QString, QString))); if (!installdebStatusConnected) { qWarning() << "无法连接到 InstalldebStatusChanged 信号"; } bool updateInstallFinishedConnected = QDBusConnection::systemBus().connect( serviceName_, objectPath_, interfaceName_, "UpdateInstallFinished", this, SLOT(handleUpdateInstallFinished(bool, QStringList, QString, QString))); if (!updateInstallFinishedConnected) { qWarning() << "无法连接到 UpdateInstallFinished 信号"; } bool purgePackagesStatusConnected = QDBusConnection::systemBus().connect( serviceName_, objectPath_, interfaceName_, "PurgePkgStatusChanged", this, SLOT(handlePurgePackagesStatusChanged(int, QString, QString))); if (!purgePackagesStatusConnected) { qWarning() << "无法连接到 PurgePkgStatusChanged 信号"; } bool purgePackagesFinishedConnected = QDBusConnection::systemBus().connect( serviceName_, objectPath_, interfaceName_, "PurgePackagesFinishedWithPkgname", this, SLOT(handlePurgePackagesFinished(bool, QString, QString, QString))); if (!purgePackagesFinishedConnected) { qWarning() << "无法连接到 PurgePackagesFinished 信号"; } } void SubSystemPackageManager::updateCache() { QDBusInterface interface(serviceName_, objectPath_, interfaceName_, QDBusConnection::systemBus()); QDBusMessage reply = interface.call("UpdateCache"); if (reply.type() == QDBusMessage::ErrorMessage) { qWarning() << __func__ << "Failed to call dbus method: " << reply.errorMessage(); return; } QVariantList results = reply.arguments(); if (results.size() >= 2) { int returnValue0 = results[0].toInt(); QString returnValue1 = results[1].toString(); // 返回0表示调用成功 if (returnValue0) { qWarning() << "Failed to call dbus method: UpdateCache!" << returnValue1; } } } void SubSystemPackageManager::handleUpdateCacheFinished( bool success, const QStringList &groupList, const QString &errorResult, const QString &errorReason) { qDebug() << __func__ << success << groupList << errorResult << errorReason; if (!isUpdatingCache_) { return; } QDBusInterface interface(serviceName_, objectPath_, interfaceName_, QDBusConnection::systemBus()); isUpdatingCache_ = false; interface.call("InstallPackages", installPackageNames_); isInstallingPkg_ = true; } void SubSystemPackageManager::handleUpdateCacheStatusChanged( int progress, const QString &status) { qDebug() << __func__ << progress << status; } void SubSystemPackageManager::handleInstalldebStatusChanged( int progress, const QString &status, const QString &details) { qDebug() << __func__ << progress << status << details; if (isInstallingPkg_) { emit installProgressChanged(progress); } else { for (auto pkgName : installList_) { if (details.contains(pkgName)) { emit installProgressChanged(progress); break; } } } } void SubSystemPackageManager::handleUpdateInstallFinished( bool success, const QStringList &groupList, const QString &errorResult, const QString &errorReason) { qDebug() << __func__ << success << groupList << errorResult << errorReason; for (auto pkgName : installPackageNames_) { if (!groupList.contains(pkgName)) { return; } } isInstallingPkg_ = false; if (success) { emit installSuccessed(); } else { emit installFailed(errorResult, errorReason); } } void SubSystemPackageManager::handlePurgePackagesStatusChanged( int progress, const QString &status, const QString &details) { qDebug() << __func__ << progress << status << details; if (isUninstallingPkg) { emit uninstallProgressChanged(progress); } else { for (auto pkgName : uninstallPackageNames_) { if (details.contains(pkgName)) { emit uninstallProgressChanged(progress); break; } } } } void SubSystemPackageManager::handlePurgePackagesFinished( bool success, const QString &status, const QString &details, const QString &pkgNameListString) { QStringList pkgNameList = pkgNameListString.split(','); for (auto pkgName : pkgNameList) { if (!uninstallPackageNames_.contains(pkgName)) { continue; } qDebug() << __func__ << success << status << details << pkgNameList; isUninstallingPkg = false; success ? emit unInstallSuccessed() : emit unIntsallFailed(); break; } } kylin-ai-subsystem-plugin-1.0.0.2/subsystempackagemanager.h000066400000000000000000000075171520576575000240210ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef SUBSYSTEMPACKAGEMANAGER_H #define SUBSYSTEMPACKAGEMANAGER_H #include class SubSystemPackageManager : public QObject { Q_OBJECT public: explicit SubSystemPackageManager(QObject *parent = nullptr); void installPackage(); void unInstallPackage(const QStringList &uninstallList); void reboot(); void fixBrokenDepends(); void fixIncompleteInstall(); private: void connectSignals(); void updateCache(); private slots: void handleUpdateCacheFinished(bool success, const QStringList &groupList, const QString &errorResult, const QString &errorReason); void handleUpdateCacheStatusChanged(int progress, const QString &status); void handleInstalldebStatusChanged(int progress, const QString &status, const QString &details); void handleUpdateInstallFinished(bool success, const QStringList &groupList, const QString &errorResult, const QString &errorReason); void handlePurgePackagesStatusChanged(int progress, const QString &status, const QString &details); void handlePurgePackagesFinished(bool success, const QString &status, const QString &details, const QString &pkgNameListString); signals: void installProgressChanged(int progress); void installSuccessed(); void installFailed(QString errorResult, QString errorReason); void uninstallProgressChanged(int progress); void unInstallSuccessed(); void unIntsallFailed(); private: const QString serviceName_ = "com.kylin.systemupgrade"; const QString objectPath_ = "/com/kylin/systemupgrade"; const QString interfaceName_ = "com.kylin.systemupgrade.interface"; const QStringList installPackageNames_ = {"kylin-ai-subsystem"}; const QStringList uninstallPackageNames_ = { "kylin-ai-subsystem", "kylin-ai-runtime", "kylin-ai-engine-plugins", "kylin-ai-subsystem-modelconfig", "kyai-data-management-service", "kylin-ai-document-qa-service", "kylin-ai-document-service", "kylin-ai-vector-engine", "kylin-ai-python-env", "libtriton-server"}; const QStringList installList_ = { "libkylin-ondevice-traditional-ai-engine-plugin", "libkyai-business-framework", "kylin-ai-document-qa-service", "libkylin-ai-document-qa-service", "kylin-ai-document-service", "libkylin-ai-document-service", "kylin-ai-python-env", "libkysdk-vector-engine-client", "kylin-ai-vector-engine", "kylin-ai-runtime", "libkylin-coreai-embedding", "libkyai-assistant0", "libkyai-config0", "libkysdk-coreai-speech0", "libkysdk-coreai-vision0", "libkysdk-genai-nlp0", "libkysdk-genai-vision0", "kylin-ai-subsystem-modelconfig"}; bool isUpdatingCache_ = false; bool isInstallingPkg_ = false; bool isUninstallingPkg = false; }; #endif // SUBSYSTEMPACKAGEMANAGER_H kylin-ai-subsystem-plugin-1.0.0.2/subsystemwidget.cpp000066400000000000000000000562621520576575000227120ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #include "subsystemwidget.h" #include #include #include #include #include #include #include #include #include #include "aisubsystemplugininterface.h" #include "modelconfigmanager/aisubsystem.h" static const char *AI_SUBSYSTEM_PROCESS = "kylin-ai-runtime"; namespace { bool hasProcessByName(const std::string &namePart) { const std::string command = "ps ax | grep " + namePart + " | grep -v grep"; // 通过管道获取命令执行结果 std::unique_ptr pipe(popen(command.c_str(), "r"), pclose); if (!pipe) { return false; } char buffer[128]; const bool found = fgets(buffer, sizeof(buffer), pipe.get()) != nullptr; return found; } } // namespace SubSystemWidget::SubSystemWidget(QWidget *parent) : QWidget(parent) { initSubSystemWidget(); connectSignals(); } void SubSystemWidget::continueLoading() { initQaptBackend(); setWidgetProperty(); checkRuntime(); } QWidget *SubSystemWidget::mainWidget() { return topMainFrame; } QWidget *SubSystemWidget::modelConfigWidget() { return configWidget_; } QWidget *SubSystemWidget::computePowerSharingWidget() { return computePowerSharingWidget_; } bool SubSystemWidget::runtimeProcessExists() { return hasProcessByName(AI_SUBSYSTEM_PROCESS); } bool SubSystemWidget::isRestarted() { return !QFile::exists(tmpFilePath_); } void SubSystemWidget::initSubSystemWidget() { topMainFrame = new QFrame(this); topMainFrame->setAccessibleName( "kylin-ai-subsystem-plugin_QFrame_subsystemBackFrame"); topMainFrame->setMinimumWidth(550); topMainFrame->setMaximumWidth(16777215); topMainVBoxLayout = new QVBoxLayout(); topMainVBoxLayout->setObjectName( "kylin-ai-subsystem-plugin_QVBoxLayout_subsystemBackFrameLayout"); topMainVBoxLayout->setContentsMargins(0, 0, 0, 0); topLabel = new QLabel(topMainFrame); topLabel->setAccessibleName("kylin-ai-subsystem-plugin_QLabel_aiSubSystem"); topLabel->setText(tr("AI SubSystem")); topLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); topLabel->setContentsMargins(16, 0, 0, 0); topHFrame = new QFrame(topMainFrame); topHFrame->setAccessibleName( "kylin-ai-subsystem-plugin_QFrame_subsystemFrame"); topHFrame->setFrameShape(QFrame::Box); topHFrame->setFixedHeight(128); QHBoxLayout *hLayout = new QHBoxLayout(topHFrame); hLayout->setObjectName( "kylin-ai-subsystem-plugin_QHBoxLayout_subsystemFrameLayout"); hLayout->setContentsMargins(16, 0, 16, 0); topHFrame->setLayout(hLayout); mainIconLabel = new QLabel(topHFrame); mainIconLabel->setAccessibleName( "kylin-ai-subsystem-plugin_QLabel_subsystemIcon"); QPixmap iconPixmap(":/image/ai-subsystem.svg"); mainIconLabel->setPixmap(iconPixmap); hLayout->addWidget(mainIconLabel); QVBoxLayout *vLayout = new QVBoxLayout(topHFrame); vLayout->setObjectName( "kylin-ai-subsystem-plugin_QVBoxLayout_functionDescriptionLayout"); textLabel1 = new QLabel(tr("Kylin AI SubSystem"), topHFrame); textLabel1->setAccessibleName( "kylin-ai-subsystem-plugin_QLabel_aiSubSystem"); QFont textFont1 = textLabel1->font(); textFont1.setBold(true); textLabel1->setFont(textFont1); textLabel2 = new kdk::KLabel(topHFrame); textLabel2->setObjectName( "kylin-ai-subsystem-plugin_KLabel_functionDescription"); textLabel2->setText( tr("Provide a runtime environment for AI applications or functions." "Such as model files, runtime libraries, configuration parameters," "etc.")); textLabel2->setContentsMargins(0, 0, 16, 0); mainTextLabel = new kdk::KLabel(topHFrame); mainTextLabel->setText(tr("loading")); mainTextLabel->setObjectName("kylin-ai-subsystem-plugin_KLabel_version"); mainTextLabel->setContentsMargins(0, 0, 16, 0); setKLabelFontColor(mainTextLabel, "#808080"); redMainTextLabel = new QLabel(topHFrame); redMainTextLabel->setObjectName("kylin-ai-subsystem-plugin_QLabel_error"); QPalette mainPalette = mainTextLabel->palette(); mainPalette.setColor(QPalette::WindowText, Qt::red); redMainTextLabel->setPalette(mainPalette); redMainTextLabel->hide(); vLayout->setContentsMargins(0, 30, 0, 30); vLayout->setSpacing(0); vLayout->addWidget(textLabel1); vLayout->addWidget(textLabel2); vLayout->addWidget(mainTextLabel); vLayout->addWidget(redMainTextLabel); hLayout->addLayout(vLayout); hLayout->addStretch(1); // 重启按钮 rebootButton = new QPushButton(tr("Reboot Immediately"), topHFrame); rebootButton->setAccessibleName( "kylin-ai-subsystem-plugin_QPushButton_reboot"); rebootButton->hide(); hLayout->addWidget(rebootButton); // loading loadingLabel = new QLabel(topHFrame); loadingLabel->setAccessibleName( "kylin-ai-subsystem-plugin_QLabel_loadingImage"); loadingLabel->setPixmap( QIcon::fromTheme("ukui-loading-0-symbolic").pixmap(16, 16)); loadingLabel->setContentsMargins(16, 0, 16, 0); loadingTimer = new QTimer(this); loadingTimer->start(100); hLayout->addWidget(loadingLabel); topMainVBoxLayout->addWidget(topLabel); topMainVBoxLayout->addWidget(topHFrame); topMainFrame->setLayout(topMainVBoxLayout); } void SubSystemWidget::setKLabelFontColor(kdk::KLabel *klabel, QColor color) { #ifdef SYSTEM_VERSION_2403 QPalette palette; palette.setColor(QPalette::WindowText, color); klabel->setPalette(palette); #else klabel->setFontColor(color); #endif } void SubSystemWidget::initMenu() { moreOptionsMenu = new QMenu(this); moreOptionsMenu->setAccessibleName( "kylin-ai-subsystem-plugin_QMenu_PackageOperation"); detectUpdateAction = moreOptionsMenu->addAction(tr("Detect Update")); unloadAction = moreOptionsMenu->addAction(tr("UnInstall")); } void SubSystemWidget::initMsgBox() { initInstallSuccessMsgBox(); initUnInstallMsgBox(); initServiceUnavailableMsgBox(); } void SubSystemWidget::initInstallSuccessMsgBox() { installSuccessMsgBox = new QMessageBox(this); installSuccessMsgBox->setAccessibleName( "kylin-ai-subsystem-plugin_QMessageBox_installSuccess"); installSuccessMsgBox->setIconPixmap( QIcon::fromTheme("ukui-dialog-success").pixmap(24, 24)); installSuccessMsgBox->setText(tr("Install success!")); installSuccessMsgBox->setInformativeText( tr("The AI subsystem has been installed and needs to be restarted " "before it can take effect. Do you want to restart it?")); installSuccessMsgBox->addButton(tr("Reboot Later"), QMessageBox::RejectRole); QPushButton *rebootImmediately = installSuccessMsgBox->addButton( tr("Reboot Immediately"), QMessageBox::AcceptRole); installSuccessMsgBox->setDefaultButton(rebootImmediately); connect(rebootImmediately, &QPushButton::clicked, this, [this]() { subSystemPackageManager_.reboot(); }); } void SubSystemWidget::initUnInstallMsgBox() { unInstallMsgBox = new QMessageBox(this); unInstallMsgBox->setAccessibleName( "kylin-ai-subsystem-plugin_QMessageBox_uninstallConfirm"); unInstallMsgBox->setIcon(QMessageBox::Question); unInstallMsgBox->setText( tr("Are you sure you want to uninstall the AI subsystem?")); unInstallMsgBox->setInformativeText( tr("After uninstallation, the AI services of " "related applications will not be available.")); unInstallMsgBox->addButton(tr("Cancel"), QMessageBox::RejectRole); QPushButton *unInstall = unInstallMsgBox->addButton(tr("Uninstall"), QMessageBox::AcceptRole); unInstallMsgBox->setDefaultButton(unInstall); connect(unInstall, &QPushButton::clicked, this, &SubSystemWidget::uninstalling); } void SubSystemWidget::initServiceUnavailableMsgBox() { serviceUnavailableMsgBox = new QMessageBox(); serviceUnavailableMsgBox->setIcon(QMessageBox::Warning); serviceUnavailableMsgBox->setText(tr("AI service unavailable")); serviceUnavailableMsgBox->setInformativeText( tr("The AI subsystem was not detected, and the AI service of " "the application cannot be used. Please go to System Settings" ">AI Module Management page to install.")); serviceUnavailableMsgBox->addButton("Cancel", QMessageBox::RejectRole); QPushButton *goNow = serviceUnavailableMsgBox->addButton( tr("Go Now"), QMessageBox::AcceptRole); installSuccessMsgBox->setDefaultButton(goNow); } void SubSystemWidget::initGsettings() { if (!QGSettings::isSchemaInstalled("org.ukui.style")) { qWarning() << __func__ << "Failed to find schema org.ukui.style"; return; } QGSettings *iconThemeSettings = new QGSettings("org.ukui.style", "/org/ukui/style/"); connect(iconThemeSettings, &QGSettings::changed, [&](const QString &value) { if (value == "styleName") { setLabelTextColor(); } if (value == "systemFontSize" || value == "systemFont") { QFont textFont2 = textLabel2->font(); textFont2.setPointSize(textLabel1->font().pointSize()); textLabel2->setFont(textFont2); QFont mainTextFont = mainTextLabel->font(); mainTextFont.setPointSize(textLabel1->font().pointSize() - 2); mainTextLabel->setFont(mainTextFont); } }); } void SubSystemWidget::setLabelTextColor() { QPalette palette; QColor placeholderTextColor = palette.color(QPalette::PlaceholderText); if (!placeholderTextColor.isValid()) { qWarning() << "PlaceholderText color is not valid on this platform."; return; } palette.setColor(QPalette::WindowText, placeholderTextColor); textLabel2->setPalette(palette); mainTextLabel->setPalette(palette); } void SubSystemWidget::loadModelConfigWidget() { TestAiSubSystem *modelConfig = new TestAiSubSystem(this); configWidget_ = modelConfig->createModelConfigWidget(); emit modelConfigLoaded(); } void SubSystemWidget::showInstallBtn() { installButton->show(); mainProgressBar->hide(); rebootButton->hide(); menuButton->hide(); updateButton->hide(); } void SubSystemWidget::showProgressBar() { installButton->hide(); mainProgressBar->show(); rebootButton->hide(); menuButton->hide(); updateButton->hide(); } void SubSystemWidget::showRebootBtn() { installButton->hide(); mainProgressBar->hide(); rebootButton->show(); menuButton->hide(); updateButton->hide(); } void SubSystemWidget::showMenuBtn() { installButton->hide(); mainProgressBar->hide(); rebootButton->hide(); menuButton->show(); updateButton->hide(); } void SubSystemWidget::setMainLabelVesionText(const QString &text) { if (!text.isEmpty()) { mainTextLabel->setText(tr("Version: %1").arg(text)); } else { mainTextLabel->setText(""); } } void SubSystemWidget::updateMainLabelTextByDetectTime() { QString lastDetectTime = configManager_.getLastDetectAndUpdateTime(); QString curVersion = getCurPkgVersion(); QString lastestVersion = getLastestVersion(); if (lastDetectTime.isEmpty()) { setMainLabelVesionText(curVersion); return; } if (curVersion == lastestVersion || lastestVersion.isEmpty()) { mainTextLabel->setText(tr("Version: %1 " "Last detection time: %2") .arg(curVersion) .arg(lastDetectTime)); } else { mainTextLabel->setText(tr("Detected an upgradable version: %1 " "Last detection time: %2") .arg(lastestVersion) .arg(lastDetectTime)); updateButton->show(); } } bool SubSystemWidget::isPkgInstallingByInstallProgress() { int installProgress = configManager_.getInstallProgress(); return installProgress > 0 && installProgress < 100; } bool SubSystemWidget::isPkgUninstallingByUninstallProgress() { int uninstallProgress = configManager_.getUninstallProgress(); return uninstallProgress > 0 && uninstallProgress < 100 && isPkgUninstalling(); } void SubSystemWidget::showNotInstalledState() { updateInstallProgress(0); updateUninstallProgress(0); showInstallBtn(); setMainLabelVesionText(getCurPkgVersion()); } void SubSystemWidget::showInstallingState(const int progress) { showProgressBar(); mainProgressBar->setValue(progress); mainTextLabel->setText(tr("Installing...")); } void SubSystemWidget::showInstalledAndRebootState() { showMenuBtn(); updateMainLabelTextByDetectTime(); updateInstallProgress(100); updateUninstallProgress(0); emit loadingPlugin(); } void SubSystemWidget::showInstalledAndNotRebootState() { updateInstallProgress(100); updateUninstallProgress(0); showRebootBtn(); mainTextLabel->setText(tr("Installed, effective after restarting.")); } void SubSystemWidget::showUninstallingState() { showMenuBtn(); mainTextLabel->setText(tr("Uninstalling...")); } void SubSystemWidget::setWidgetProperty() { QString curVersion = getCurPkgVersion(); setMainLabelVesionText(curVersion); if (curSystemVersion() == SystemVersion::Version_2403) { if (isPkgInstalled() && !hasProcessByName(AI_SUBSYSTEM_PROCESS)) { rebootButton->show(); mainTextLabel->setText( tr("Installed, effective after restarting.")); } } loadingLabel->hide(); loadingTimer->stop(); } SystemVersion SubSystemWidget::curSystemVersion() { QString version = kdk_system_get_version_detaile().os_version; qInfo() << "System version: " << version; if (version == "2403") { return SystemVersion::Version_2403; } else if (version == "2503") { return SystemVersion::Version_2503; } else { return SystemVersion::Version_V11; } } long SubSystemWidget::getSystemRunningTime() { struct sysinfo info; if (sysinfo(&info) != 0) { qWarning() << "Failed to obtain system information!"; return 0; } return info.uptime; } void SubSystemWidget::createTmpFile() { QFile file(tmpFilePath_); if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { file.close(); } else { qWarning() << "unable to create file:" << tmpFilePath_; } } void SubSystemWidget::createUninstallingTmpFile() { QFile file(subsystemUninstallingFilePath_); if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { file.close(); } else { qWarning() << "unable to create file:" << subsystemUninstallingFilePath_; } } QStringList SubSystemWidget::getUninstallList() { QStringList uninstallPkgList = uninstallList_; for (int i = 0; i < uninstallPkgList.size(); ++i) { QString pkgName = uninstallPkgList[i]; auto package = qaptBackend_.package(pkgName); if (package == nullptr) { uninstallPkgList.removeOne(pkgName); --i; } } qDebug() << __func__ << uninstallPkgList; return uninstallPkgList; } bool SubSystemWidget::isRestartedInUninstalling() { return !QFile::exists(subsystemUninstallingFilePath_); }; void SubSystemWidget::connectSignals() { connect(loadingTimer, &QTimer::timeout, this, &SubSystemWidget::updateLoadingImage); connect(rebootButton, &QPushButton::clicked, [this]() { subSystemPackageManager_.reboot(); }); } void SubSystemWidget::initQaptBackend() { auto *initThread = QThread::create([this]() { int timeout = 0; while (timeout < 15) { if (qaptBackend_.init()) { qaptInited = true; break; } qWarning() << __func__ << "QApt backend initialization failed." << qaptBackend_.initErrorMessage(); QThread::sleep(1); timeout += 1; } if (!qaptInited) { initSuccess_ = false; qWarning() << __func__ << "QApt backend initialization failed after 15 seconds." << qaptBackend_.initErrorMessage(); } }); connect(initThread, &QThread::finished, initThread, &QObject::deleteLater); connect(qApp, &QCoreApplication::aboutToQuit, initThread, &QThread::quit); initThread->start(); } bool SubSystemWidget::isInitQaptSuccessful() { while (!qaptInited) { if (!initSuccess_) { return false; } qApp->processEvents(); QThread::usleep(1); } return true; } bool SubSystemWidget::isPkgInstalled() { return true; if (!isInitQaptSuccessful()) { return false; } for (auto pkgName : installList_) { auto package = qaptBackend_.package(pkgName); if (!package || !package->isInstalled()) { qWarning() << __func__ << pkgName << " not exists or not installed!"; return false; } } return true; } bool SubSystemWidget::isPkgUninstalling() { if (!isInitQaptSuccessful()) { return false; } for (auto pkgName : uninstallList_) { auto package = qaptBackend_.package(pkgName); if (package && package->isInstalled()) { qDebug() << __func__ << pkgName << package->state(); return true; } } return false; } QString SubSystemWidget::getCurPkgVersion() { if (!isInitQaptSuccessful()) { return ""; } auto package = qaptBackend_.package(packageName_); if (package == nullptr) { return QString(); } return package->version(); } QString SubSystemWidget::getLastestVersion() { if (!isInitQaptSuccessful()) { return ""; } auto updatePackageList = qaptBackend_.upgradeablePackages(); for (auto tmpPkg : updatePackageList) { if (tmpPkg->name() == packageName_) { return tmpPkg->availableVersion(); } } return QString(); } void SubSystemWidget::checkPkgVersion() { qaptInited = false; initQaptBackend(); QDateTime currentDate = QDateTime::currentDateTime(); QString formattedDate = currentDate.toString("yyyy/MM/dd HH:mm"); QString curVersion = getCurPkgVersion(); QString lastestVersion = getLastestVersion(); loadingTimer->stop(); loadingLabel->hide(); if (curVersion == lastestVersion || lastestVersion.isEmpty()) { mainTextLabel->setText( tr("The current version is already the latest version: %1 " "Last detection time: %2") .arg(curVersion) .arg(formattedDate)); QTimer::singleShot(6000, this, [this, curVersion, formattedDate]() { mainTextLabel->setText(tr("Version: %1 " "Last detection time: %2") .arg(curVersion) .arg(formattedDate)); }); } else { mainTextLabel->setText(tr("Detected an upgradable version: %1 " "Last detection time: %2") .arg(lastestVersion) .arg(formattedDate)); updateButton->show(); } updateLastDetectUpdateTime(formattedDate); } void SubSystemWidget::checkRuntime() { if (hasProcessByName(AI_SUBSYSTEM_PROCESS) && isPkgInstalled()) { emit loadingPlugin(); loadModelConfigWidget(); } } void SubSystemWidget::startProgress() { createTmpFile(); redMainTextLabel->hide(); mainTextLabel->show(); updateInstallProgress(1); showProgressBar(); mainTextLabel->setText(tr("Installing...")); subSystemPackageManager_.installPackage(); } void SubSystemWidget::installFailed(QString errorResult, QString errorReason) { qWarning() << __func__ << packageName_ << errorResult << errorReason; if (errorResult.contains("软件包") || errorReason.contains("软件包")) { subSystemPackageManager_.fixBrokenDepends(); subSystemPackageManager_.fixIncompleteInstall(); } redMainTextLabel->show(); mainTextLabel->hide(); updateInstallProgress(0); updateUninstallProgress(0); if (errorReason.contains("网络")) { networkAnomaly(); return; } installButton->show(); mainProgressBar->hide(); redMainTextLabel->setText( tr("Installation failed, necessary files are missing.")); } void SubSystemWidget::networkAnomaly() { installButton->show(); mainProgressBar->hide(); redMainTextLabel->setText( tr("Network abnormality, " "please check the network connection and try again.")); } void SubSystemWidget::installSuccess() { updateInstallProgress(100); updateUninstallProgress(0); installButton->hide(); mainProgressBar->hide(); rebootButton->show(); menuButton->hide(); installSuccessMsgBox->show(); mainTextLabel->setText(tr("Installed, effective after restarting.")); } void SubSystemWidget::showMenu() { moreOptionsMenu->show(); } void SubSystemWidget::detectAndUpdate() { mainTextLabel->setText(tr("Detecting And Update...")); loadingLabel->show(); loadingTimer->start(100); checkPkgVersion(); } void SubSystemWidget::uninstalling() { updateUninstallProgress(1); mainTextLabel->setText(tr("Uninstalling...")); menuButton->setEnabled(false); subSystemPackageManager_.unInstallPackage(getUninstallList()); } void SubSystemWidget::uninstallSuccess() { updateInstallProgress(0); updateUninstallProgress(100); updateLastDetectUpdateTime(""); emit uninstallPkgSuccess(); installButton->show(); updateButton->hide(); setMainLabelVesionText(getCurPkgVersion()); menuButton->setEnabled(true); menuButton->hide(); } void SubSystemWidget::uninstallFailed() { showNotInstalledState(); } void SubSystemWidget::updateLoadingImage() { imageIndex += 1; int index = imageIndex % 8; loadingLabel->setPixmap( QIcon::fromTheme(QString("ukui-loading-%1-symbolic").arg(index)) .pixmap(16, 16)); } void SubSystemWidget::updateUninstallProgress(int progress) { configManager_.setUninstallProgress(progress); } void SubSystemWidget::updateInstallProgress(int progress) { mainProgressBar->setValue(progress); configManager_.setInstallProgress(progress); } void SubSystemWidget::updateLastDetectUpdateTime(const QString &time) { configManager_.setLastDetectAndUpdateTime(time); } kylin-ai-subsystem-plugin-1.0.0.2/subsystemwidget.h000066400000000000000000000125711520576575000223520ustar00rootroot00000000000000/* * Copyright 2025 KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef SUBSYSTEMWIDGET_H #define SUBSYSTEMWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "configmanager.h" #include "subsystempackagemanager.h" #include "modelconfigmanager/util.h" class SubSystemWidget : public QWidget { Q_OBJECT public: explicit SubSystemWidget(QWidget *parent = nullptr); void continueLoading(); QWidget *mainWidget(); QWidget *modelConfigWidget(); QWidget *computePowerSharingWidget(); bool runtimeProcessExists(); bool isRestarted(); private: void initSubSystemWidget(); void initMenu(); void initMsgBox(); void initInstallSuccessMsgBox(); void initUnInstallMsgBox(); void initServiceUnavailableMsgBox(); void initGsettings(); void setLabelTextColor(); void connectSignals(); void initQaptBackend(); bool isInitQaptSuccessful(); bool isPkgInstalled(); bool isPkgUninstalling(); QString getCurPkgVersion(); QString getLastestVersion(); void checkPkgVersion(); void checkRuntime(); void loadModelConfigWidget(); void showInstallBtn(); void showProgressBar(); void showRebootBtn(); void showMenuBtn(); void setMainLabelVesionText(const QString &text); void updateMainLabelTextByDetectTime(); bool isPkgInstallingByInstallProgress(); bool isPkgUninstallingByUninstallProgress(); void showNotInstalledState(); void showInstallingState(const int progress); void showInstalledAndRebootState(); void showInstalledAndNotRebootState(); void showUninstallingState(); void setWidgetProperty(); long getSystemRunningTime(); void createTmpFile(); void createUninstallingTmpFile(); QStringList getUninstallList(); bool isRestartedInUninstalling(); SystemVersion curSystemVersion(); void setKLabelFontColor(kdk::KLabel *klabel, QColor color); private slots: void startProgress(); void installFailed(QString errorResult, QString errorReason); void networkAnomaly(); void installSuccess(); void showMenu(); void detectAndUpdate(); void uninstalling(); void uninstallSuccess(); void uninstallFailed(); void updateLoadingImage(); void updateUninstallProgress(int progress); void updateInstallProgress(int progress); void updateLastDetectUpdateTime(const QString &time); signals: void modelConfigLoaded(); void uninstallPkgSuccess(); void loadingPlugin(); private: QFrame *topMainFrame = nullptr; QVBoxLayout *topMainVBoxLayout = nullptr; QLabel *topLabel = nullptr; QFrame *topHFrame = nullptr; QLabel *mainIconLabel = nullptr; QLabel *textLabel1 = nullptr; kdk::KLabel *textLabel2 = nullptr; kdk::KLabel *mainTextLabel = nullptr; QLabel *redMainTextLabel = nullptr; QPushButton *installButton = nullptr; QProgressBar *mainProgressBar = nullptr; QPushButton *rebootButton = nullptr; QLabel *loadingLabel = nullptr; QToolButton *menuButton = nullptr; QPushButton *updateButton = nullptr; QTimer *loadingTimer = nullptr; int imageIndex = 0; QMenu *moreOptionsMenu = nullptr; QAction *detectUpdateAction = nullptr; QAction *unloadAction = nullptr; QMessageBox *installSuccessMsgBox = nullptr; QMessageBox *unInstallMsgBox = nullptr; QMessageBox *serviceUnavailableMsgBox = nullptr; QWidget *configWidget_ = nullptr; QWidget *computePowerSharingWidget_ = nullptr; QApt::Backend qaptBackend_; SubSystemPackageManager subSystemPackageManager_; QString pluginDir_ = KYLIN_AI_SUBSYSTEM_PLUGIN_PATH; QString packageName_ = "kylin-ai-subsystem"; std::atomic_bool qaptInited{false}; std::atomic_bool initSuccess_{true}; ConfigManager configManager_; const QStringList installList_ = { "kylin-ai-subsystem", "kylin-ai-runtime"}; const QStringList uninstallList_ = { "kylin-ai-subsystem", "kylin-ai-runtime", "kylin-ai-engine-plugins", "kylin-ai-subsystem-modelconfig", "kyai-data-management-service", "kylin-ai-document-qa-service", "kylin-ai-document-service", "kylin-ai-vector-engine", "kylin-ai-python-env", "libtriton-server"}; const QString tmpFilePath_ = "/tmp/kylin-ai-subsystem-plugin"; const QString subsystemUninstallingFilePath_ = "/tmp/kylin-ai-subsystem-plugin-uninstalling"; }; #endif // SUBSYSTEMWIDGET_H kylin-ai-subsystem-plugin-1.0.0.2/translations/000077500000000000000000000000001520576575000214525ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/translations/bo_CN.ts000066400000000000000000002407301520576575000230100ustar00rootroot00000000000000 AddBtn Add སྣོན་པ་ AddButton Add སྣོན་པ་ AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. AIཡི་ཉེར་སྤྱོད་པར་གཞི་ཁག་གཅིག་དམའ་དྲགས་པས།མ་ལག་དང་འཆམ་མཐུན་མེད་པས།བྱེད་ནུས་ལ་ཚོད་འཛིན་ཐེབས་སྲིད། པར་གཞི་གསར་ཤོས་ལ་རིམ་སྤོར་བྱས་ནས་རྒྱུན་ལྡན་གྱི་བེད་སྤྱོད་འགན་ལེན་བྱེད་རོགས། Go to update གསར་བརྗེས་ལ་འགྲོ་བ། CloudModelConfigWidget Cloud Model སྤྲིན་སྣེ་དཔེ་དབྱིབས་ Deployed on the cloud server, access and use over the network སྤྲིན་སྣེའི་ཞབས་ཞུ་ཆས་བཀོད་སྒྲིག་དང་།དྲ་རྒྱ་བརྒྱུད་འཚམས་འདྲི་དང་བེད་སྤྱོད་། NLP Model ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Processing and generating text, such as understanding text and answering questions ཡི་གེ་ཐག་གཅོད་དང་གྲུབ་པ་དང་།དཔེར་ན་ཡིག་དེབ་ལ་གོ་བ་ལེན་དང་།གནད་དོན་ལ་ལན་འདེབས་པ། Add སྣོན་པ་ Visual Model བརྙན་རིས་རིགས་དཔེ་དབྱིབས་ Processing and generating images, such as recognizing objects and analyzing scenes འདྲ་རིས་ཐག་གཅོད་དང་གྲུབ་པ་དང་།དཔེར་ན་དངོས་གཟུགས་དབྱེ་འབྱེད་དང་།ཡུལ་ལྗོངས་དབྱེ་ཞིབ་། Speech Model སྐད་བརྡའི་རིགས་དཔེ་དབྱིབས་ Processing sound and speech, such as recognizing speech and synthesizing speech སྒྲ་དང་སྐད་གདངས་ཐག་གཅོད་དང་།དཔེར་ན་སྐད་གདངས་ངོས་འཛིན་དང་།འདྲེས་གྲུབ་སྐད་གདངས་། OK འགྲིགས། Model switching failed དཔེ་དབྱིབས་འདེམས་པར་བཀོད་སྒྲིག་བྱས་ནས་ཕམ་སོང་། Failed to delete model དཔེ་དབྱིབས་སུབ་པ་ཕམ་པ། Model setup failed འདྲ་དཔེ་བཀོད་སྒྲིག་ཕམ་པ། Model Editing failed རྩོམ་སྒྲིག་དཔེ་དབྱིབས་ཕམ་པ། Cloud model སྤྲིན་སྣེ་དཔེ་དབྱིབས་ Free Trial Account རིན་མི་དགོས་པར་ཚོད་ལྟའི་རྩིས་ཐོ། Sorry, the model is currently executing another task. Please try again after it is completed. དགོངས་པ་མ་ཚོམ།དཔེ་དབྱིབས་འདིས་མིག་སྔར་ལས་འགན་གཞན་དག་ལག་བསྟར་བྱེད་བཞིན་ཡོད།ལེགས་འགྲུབ་བྱུང་རྗེས་བསྐྱར་དུ་ཚོད་ལྟ་བྱེད་པར་སྒུག་རོགས། Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? འདྲ་དཔེ་འདི་བསུབ་ན་འདྲ་དཔེ་འདི་ལ་བརྟེན་པའི་བཀོལ་སྤྱོད་རྒྱུན་ལྡན་གྱི་འཁོར་སྐྱོད་བྱེད་ཐབས་བྲལ་སྲིད།ཁྱེད་རང་གི་བསུབ་དགོས་པ་ཐག་གིས་ཆོད། kylin-aiassistant AI 助手 Cancel མེད་པར་བཟོ་བ། Ok གཏན་འཁེལ། Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. དགོངས་པ་མ་ཚོམ།མིག་སྔར་AIལས་རོགས་ལ་ལས་འགན་ཡོད་པས་དཔེ་དབྱིབས་འདི་བཀོལ་བཞིན་ཡོད།ལས་འགན་མཇུག་སྒྲིལ་རྗེས་ཚོད་ལྟ་བྱེད་རོགས། Retry ཡང་བསྐྱར་ཚོད་ལེན། Delete མཚོན་རྟགས། LocalModelConfigWidget Local Model ས་གནས་དེ་གའི་དཔེ་དབྱིབས་ Installed on local equipment, it can run without network ས་གནས་དེ་གའི་སྒྲིག་ཆས་སྟེང་སྒྲིག་སྦྱོར་དང་།དྲ་རྒྱ་མི་དགོས་ཀྱང་འཁོར་སྐྱོད་བྱེད་ཆོག (Installing/uninstalling models requires a reboot to take effect) (དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་དང་བསུབ་ན་ཡང་བསྐྱར་འགོ་འཛུགས་དགོས་ན་ད་གཟོད་ནུས་པ་ཐོན་ཐུབ།) Install སྒྲིག་སྦྱོར་བྱེད་པ། Update/Uninstall གསར་བསྒྱུར/བླུགས་པ། Built in model of the system རྒྱུད་ཁོངས་ནང་སྒྲིག་དཔེ་དབྱིབས་ The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation བརྙན་རིས་དབྱེ་འབྱེད་དང་།ཕྱོགས་ཚད་ཅན།སྐད་བརྡའི་ཐག་གཅོད་སོགས་མ་ལག་གཞན་པའི་འཁོར་སྐྱོད་ལ་མཁོ་བའི་དཔེ་དབྱིབས་ NLP Model ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Processing and generating text, such as understanding text and answering questions ཡི་གེ་ཐག་གཅོད་དང་གྲུབ་པ་དང་།དཔེར་ན་ཡིག་དེབ་ལ་གོ་བ་ལེན་དང་།གནད་དོན་ལ་ལན་འདེབས་པ། OK འགྲིགས། Are you sure you want to exit? ཕྱིར་འཐེན་བྱེད་དགོས་པ་གཏན་འཁེལ་ཡིན་ནམ། The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? འདྲ་དཔེ་སྒྲིག་སྦྱོར་བྱེད་བཞིན་ཡོད།ཕྱིར་འཐེན་བྱས་ན་སྒྲིག་སྦྱོར་ཕམ་སྲིད། ཕྱིར་འཐེན་གཏན་འཁེལ་བྱེད་དམ། Cancel མེད་པར་བཟོ་བ། Quit ཕྱིར་འཐེན་ Exit current window? མིག་སྔའི་སྒེའུ་ཁུང་ནས་ཕྱིར་འཐེན་བྱེད་ད The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་མུ་མཐུད་རྒྱབ་སྟེགས་སུ་འཁོར་སྐྱོད་བྱ་རྒྱུ་ཡིན་པ་དང་ལེགས་གྲུབ་བྱས་རྗེས་བསྐྱར་དུ་སྒོ་ཕྱེ་ནས་ནུས་པ་ཐོན་རྒྱུ་ཡིན་པ་རེད། Built in model group ནང་སྒྲིག་དཔེ་དབྱིབས་ཚོགས། Model setup failed འདྲ་དཔེ་བཀོད་སྒྲིག་ཕམ་པ། Model switching failed དཔེ་དབྱིབས་འདེམས་པར་བཀོད་སྒྲིག་བྱས་ནས་ཕམ་སོང་། Installing/uninstalling models requires a restart to take effect དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་དང་བསུབ་ན་ཡང་བསྐྱར་འགོ་འཛུགས་དགོས་ན་ད་གཟོད་ནུས་པ་ཐོན་ཐུབ། After downloading and installing, a restart is required to take effect ཕབ་ལེན་སྒྲིག་སྦྱོར་བྱས་རྗེས་བསྐྱར་དུ་སྒོ་ཕྱེ་ནས་ནུས་པ་ཐོན་དགོས། After downloading and installing, you need to log out for it to take effect ཕབ་ལེན་སྒྲིག་སྦྱོར་བྱས་རྗེས་སུ་ཐོ་ཁོངས་ནས་སུབ་དགོས་བྱུང་ན་གཞི་ནས་ནུས་པ་འཐོན་རྒྱུ (The installation/uninstallation of the model will take effect after logging out) སྒྲིག་སྦྱོར་/བླུགས་པའི་དཔེ་དབྱིབས་ཐོར་འཐེན་རྗེས་ནུས་པ་ཐོན་དགོས། The installation/uninstallation of the model will take effect after logging out སྒྲིག་སྦྱོར་/བླུགས་པའི་དཔེ་དབྱིབས་ཐོར་འཐེན་རྗེས་ནུས་པ་ཐོན་དགོས། Sorry, the model is currently executing another task. Please try again after it is completed. དགོངས་པ་མ་ཚོམ།དཔེ་དབྱིབས་འདིས་མིག་སྔར་ལས་འགན་གཞན་དག་ལག་བསྟར་བྱེད་བཞིན་ཡོད།ལེགས་འགྲུབ་བྱུང་རྗེས་བསྐྱར་དུ་ཚོད་ལྟ་བྱེད་པར་སྒུག་རོགས། Failed to delete model དཔེ་དབྱིབས་སུབ་པ་ཕམ་པ། Installing/uninstalling models requires a reboot to take effect དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་དང་བསུབ་ན་ཡང་བསྐྱར་འགོ་འཛུགས་དགོས་ན་ད་གཟོད་ནུས་པ་ཐོན་ཐུབ། Tips སྣེ་སྟོན། Current model not install,you can use the model after install it. མིག་སྔར་དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་བྱས་མེད་པས།སྒྲིག་སྦྱོར་བྱས་ཚར་རྗེས་ད་གཟོད་རྒྱུན་ལྡན་དུ་བཀོལ་སྤྱོད་བྱེད་ཐུབ། Install Now འཕྲལ་དུ་སྒྲིག་སྦྱོར་། Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. དགོངས་པ་མ་ཚོམ།མིག་སྔར་AIལས་རོགས་ལ་ལས་འགན་ཡོད་པས་དཔེ་དབྱིབས་འདི་བཀོལ་བཞིན་ཡོད།ལས་འགན་མཇུག་སྒྲིལ་རྗེས་ཚོད་ལྟ་བྱེད་རོགས། Retry ཡང་བསྐྱར་ཚོད་ལེན། kylin-aiassistant AI 助手 Ok གཏན་འཁེལ། Add 添加 LocalModelItem Detect updates ཞིབ་དཔྱད་གསར་བསྒྱུར། Effective after reboot བསྐྱར་དུ་འགོ་ཚུགས་རྗེས་ནུས་པ་ཐོན་པ། Effective after reboot . བསྐྱར་དུ་འགོ་ཚུགས་རྗེས་ནུས་པ་ཐོན་པ། Detect Updates ཞིབ་དཔྱད་གསར་བསྒྱུར། Install success! སྒྲིག་སྦྱོར་ལེགས་འགྲུབ་བྱུང་། The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་བྱས་ཟིན་པས།མ་ལག་བསྐྱར་དུ་སྒོ་ཕྱེ་རྗེས་གཞི་ནས་ནུས་པ་ཐོན་ཐུབ།བསྐྱར་དུ་སྒོ་ཕྱེ་དགོས་སམ། Reboot Later ཅུང་ཙམ་འགོར་རྗེས་བསྐྱར་སྤེལ། Reboot Immediately འཕྲལ་དུ་བསྐྱར་སྤེལ། Take effect after rebooting བསྐྱར་དུ་འགོ་ཚུགས་རྗེས་ནུས་པ་ཐོན་པ། installing... སྒྲིག་སྦྱོར་བྱེད་བཞིན་ཡོད། Net is error,Please check and try again དྲ་རྒྱ་རྒྱུན་ལྡན་མིན་པ་དང་།ཞིབ་བཤེར་བྱས་རྗེས་བསྐྱར་དུ་ཚོད་ལྟ་གནང་རོགས་། The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! གཏན་འཁེལ་བྱས་པའི་དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་ཁུག་མ་རྙེད་མེད།%1དང་།མཉེན་ཆས་ཁུངས་དང་དྲ་རྒྱའི་རྣམ་པ་ལ་ཞིབ་བཤེར་དང་ཡང་བསྐྱར་ཚོད་ལྟ་བྱེད་རོགས། The current model installation package is not installed, it can be downloaded and installed མིག་སྔའི་དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་ཁུག་མ་སྒྲིག་སྦྱོར་བྱས་མེད་དང་།ཕབ་ལེན་དང་སྒྲིག་སྦྱོར་བྱས་ཆོག New version needs to be updated upon discovery པར་གཞི་གསར་པ་རྙེད་པ། The current model is already the latest model མིག་སྔའི་དཔེ་དབྱིབས་ནི་དཔེ་དབྱིབས་གསར་ཤོས་ཡིན། Current model version is the lastest version པར་གཞི་འདི་ནི་གསར་ཤོས་རེད། Current model install failed,please install manually. སྒྲིག་སྦྱོར་ནོར་སོང་།ལག་སྒུལ་སྒྲིག་སྦྱོར་བྱེད་རོགས། Tips སྣེ་སྟོན། ModelCallPriority Model call priority དཔེ་དབྱིབས་བཀོལ་སྤྱོད་སྔོན་རིམ། Cloud model first (Kylin Certification) སྤྲིན་སྣེའི་དཔེ་དབྱིབས་དམིགས་སུ་བཀར་ནས་སྔོན་(Kylin དཔང་དངོས་བདེན་དཔང་) Local model first (Kylin Certification) སྔོན་ལ་ས་གནས་དེ་གའི་དཔེ་དབྱིབས་(Kylin དཔང་དངོས་བདེན་དཔང་) Cloud model first སྔོན་སྤྲིན་སྣེ་དཔེ་དབྱིབས་ Local model first སྔོན་ལ་ས་གནས་དེ་གའི་དཔེ་དབྱིབས་ Private model first སྔོན་ལ་རང་འདེམས་དཔེ་དབྱིབས་ Model Call Priority དཔེ་དབྱིབས་བཀོལ་སྤྱོད་སྔོན་རིམ། ModelConfigDialog Ok གཏན་འཁེལ། Model Type དཔེ་དབྱིབས་རིགས། Voice dictation & online voice synthesis (streaming version) སྐད་བརྡའི་ཉན་འབྲི་དྲ་ཐོག་སྐད་བརྡའི་འདྲེས་གྲུབ་(རྒྱུན་རྣམ་པར་གཞི།) Real time voice transcription དུས་ཐོག་སྐད་བརྡའི་སྒྱུར་འབྲི་ Model Configuration Tutorial དཔེ་དབྱིབས་བཀོད་སྒྲིག་སློབ་ཚོགས། Cancel མེད་པར་བཟོ་བ། Accept ཁས་ལེན་ Add སྣོན་པ་ Cannot contain spaces, please re-enter! བར་སྟོང་འདུས་མི་ཆོགཡང་བསྐྱར་ནང་འཇུག་རོགས། Add-NLP Model ཁ་སྣོན་-ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Add-Visual Model སྣོན་-བརྙན་རིས་རིགས་དཔེ་དབྱིབས་ Add-Speech Model ཁ་སྣོན་-སྐད་བརྡའི་རིགས་ཀྱི་དཔེ་དབྱིབས་ Required ངེས་པར་དུ་ཁ་སྐོང་། Edit-NLP Model རྩོམ་སྒྲིག་-ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Edit-Visual Model རྩོམ་སྒྲིག་-བརྙན་རིས་རིགས་དཔེ་དབྱིབས་ Edit-Speech Model རྩོམ་སྒྲིག་-སྐད་བརྡའི་རིགས་ཀྱི་དཔེ་དབྱིབས་ The model type already exists. Cannot be repeated! འདྲ་དཔེ་རིགས་འདི་གནས་ཡོད།བསྐྱར་ཟློས་བྱས་ན་མི་འགྲིག Model Editing failed རྩོམ་སྒྲིག་དཔེ་དབྱིབས་ཕམ་པ། Adding model failed འདྲ་དཔེ་ཁ་སྣོན་ཕམ་པ། Close སྒོ་རྒྱག་པ་ APPID APPID No account? Get Now ཨང་གྲངས་མེད། མྱུར་དུ་ལེན་པ། ModelDownload The current environment's dbus interface is abnormal མིག་སྔའི་ཁོར་ཡུག་dbusམཐུད་ཁུང་རྒྱུན་ལྡན་མིན་པ་ The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. “AIརོགས་མོའི”པར་གཞི་དམའ་དྲགས་པ་དང་མ་ལག་དང་འཆམ་མཐུན་མེད་པས།བྱེད་ནུས་ལ་ཚོད་འཛིན་ཐེབས་སྲིད། པར་གཞི་གསར་ཤོས་ལ་རིམ་སྤོར་བྱས་ནས་རྒྱུན་ལྡན་གྱི་བེད་སྤྱོད་འགན་ལེན་བྱེད་རོགས། The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. “ཆི་ལིན་མྱུར་ཟིན་པའི”པར་གཞི་དམའ་དྲགས་པས།མ་ལག་དང་འཆམ་མཐུན་མེད་པས།བྱེད་ནུས་ལ་ཚོད་འཛིན་ཐེབས་སྲིད། པར་གཞི་གསར་ཤོས་ལ་རིམ་སྤོར་བྱས་ནས་རྒྱུན་ལྡན་གྱི་བེད་སྤྱོད་འགན་ལེན་བྱེད་རོགས། The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. “AIརོགས་མཁན”དང“ཆི་ལིན་མྱུར་ཟིན་པའི”པར་གཞི་དམའ་དྲགས་པས།མ་ལག་དང་འཆམ་མཐུན་མེད་པས།བྱེད་ནུས་ལ་ཚོད་འཛིན་ཐེབས་སྲིད། པར་གཞི་གསར་ཤོས་ལ་རིམ་སྤོར་བྱས་ནས་རྒྱུན་ལྡན་གྱི་བེད་སྤྱོད་འགན་ལེན་བྱེད་རོགས། Tips སྣེ་སྟོན། Backend init failed མཇུག་སྣེ་འགོ་སྒྲིག་ཕམ་པ། The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! གཏན་འཁེལ་དཔེ་དབྱིབས་ཀྱི་སྒྲིག་སྦྱོར་ཁུག་མ་རྙེད་མེད།:% 1.མཉེན་ཆས་ཀྱི་ཁུངས་དང་དྲ་རྒྱའི་རྣམ་པར་ཞིབ་བཤེར་བྱས་ནས་ཡང་བསྐྱར་ཚོད་ལྟ་བྱེད་རོགས། The current model installation package is not installed, it can be downloaded and installed མིག་སྔའི་དཔེ་དབྱིབས་སྒྲིག་སྦྱོར་ཁུག་མ་སྒྲིག་སྦྱོར་བྱས་མེད་དང་།ཕབ་ལེན་དང་སྒྲིག་སྦྱོར་བྱས་ཆོག New version needs to be updated upon discovery པར་གཞི་གསར་པ་རྙེད་པ། The current model is already the latest model ག་སྔའི་དཔེ་དབྱིབས་ནི་དཔེ་དབྱིབས་གསར་ཤོས་ཡིན། ModelItem Edit རྩོམ་སྒྲིག Delete མཚོན་རྟགས། ModelWidget Sort Upwards རིམ་སྒྲིག་མདུན་དུ་ Increase priority དམིགས་སུ་བཀར་ནས་སྔོན་ལ་རིམ་པ Increase Priority དམིགས་སུ་བཀར་ནས་སྔོན་ལ་རིམ་པ Configure བཀོད་སྒྲིག་ PrivateModelConfigDialog Ok གཏན་འཁེལ། Add-NLP Model ཁ་སྣོན་-ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Add-Visual Model སྣོན་-བརྙན་རིས་རིགས་དཔེ་དབྱིབས་ Add-Speech Model ཁ་སྣོན་-སྐད་བརྡའི་རིགས་ཀྱི་དཔེ་དབྱིབས་ Edit-NLP Model རྩོམ་སྒྲིག་-ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Edit-Visual Model རྩོམ་སྒྲིག་-བརྙན་རིས་རིགས་དཔེ་དབྱིབས་ Edit-Speech Model རྩོམ་སྒྲིག་-སྐད་བརྡའི་རིགས་ཀྱི་དཔེ་དབྱིབས་ CustomName མཚན་ཉིད་རང་འཇོག་མིང་། ModelName དཔེ་དབྱིབས་མིང་ RequestUrl རེ་ཞུ་ས་གནས་ Required (To distinguish models) ངེས་པར་དུ་སྐོང་དགོས།(འདྲ་དཔེ་དབྱེ་འབྱེད་བྱེད་པར་སྤྱོད།) Optional འདེམས་སྐོང་ Optional (Required for cloud services) འདེམས་སྐོང་(སྤྲིན་སྣེའི་ཞབས་ཞུ་ངེས་པར་དུ་སྐོང་དགོས།) Required ངེས་པར་དུ་ཁ་སྐོང་། Cancel མེད་པར་བཟོ་བ། Accept ཁས་ལེན་ The length must not exceed 32 characters རིང་ཚད་ཡིག་རྟགས་32ལས་ཆེ་མི་རུང་། Cannot contain spaces, please re-enter! བར་སྟོང་འདུས་མི་ཆོགཡང་བསྐྱར་ནང་འཇུག་རོགས། Duplicate name, please re-enter! མིང་བསྐྱར་ཟློས་དང་།བསྐྱར་དུ་ནང་འཇུག་རོགས་། Model Editing failed རྩོམ་སྒྲིག་དཔེ་དབྱིབས་ཕམ་པ། Adding model failed འདྲ་དཔེ་ཁ་སྣོན་ཕམ་པ། Close སྒོ་རྒྱག་པ་ PrivateModelConfigWidget Private Model རང་འདེམས་དཔེ་དབྱིབས་ Flexible model management to meet personalized usage scenarios སྟབས་བསྟུན་གྱི་དཔེ་དབྱིབས་དོ་དམ་བྱེད་སྟངས་དང་།རང་གཤིས་ཅན་གྱི་བེད་སྤྱོད་རྣམ་པ་སྐོང་། NLP Model ཡིག་དེབ་རིགས་དཔེ་དབྱིབས་ Processing and generating text, such as understanding text and answering questions ཡི་གེ་ཐག་གཅོད་དང་གྲུབ་པ་དང་།དཔེར་ན་ཡིག་དེབ་ལ་གོ་བ་ལེན་དང་།གནད་དོན་ལ་ལན་འདེབས་པ། Add སྣོན་པ་ OK འགྲིགས། Failed to delete model དཔེ་དབྱིབས་སུབ་པ་ཕམ་པ། Model setup failed འདྲ་དཔེ་བཀོད་སྒྲིག་ཕམ་པ། Model Editing failed རྩོམ་སྒྲིག་དཔེ་དབྱིབས་ཕམ་པ། Model switching failed དཔེ་དབྱིབས་འདེམས་པར་བཀོད་སྒྲིག་བྱས་ནས་ཕམ་སོང་། Cancel མེད་པར་བཟོ་བ། Ok འགྲིགས། Sorry, the model is currently executing another task. Please try again after it is completed. དགོངས་པ་མ་ཚོམ།དཔེ་དབྱིབས་འདིས་མིག་སྔར་ལས་འགན་གཞན་དག་ལག་བསྟར་བྱེད་བཞིན་ཡོད།ལེགས་འགྲུབ་བྱུང་རྗེས་བསྐྱར་དུ་ཚོད་ལྟ་བྱེད་པར་སྒུག་རོགས། Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. དགོངས་པ་མ་ཚོམ།མིག་སྔར་AIལས་རོགས་ལ་ལས་འགན་ཡོད་པས་དཔེ་དབྱིབས་འདི་བཀོལ་བཞིན་ཡོད།ལས་འགན་མཇུག་སྒྲིལ་རྗེས་ཚོད་ལྟ་བྱེད་རོགས། Retry ཡང་བསྐྱར་ཚོད་ལེན། Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? འདྲ་དཔེ་འདི་བསུབ་ན་འདྲ་དཔེ་འདི་ལ་བརྟེན་པའི་བཀོལ་སྤྱོད་རྒྱུན་ལྡན་གྱི་འཁོར་སྐྱོད་བྱེད་ཐབས་བྲལ་སྲིད།ཁྱེད་རང་གི་བསུབ་དགོས་པ་ཐག་གིས་ཆོད། Delete མཚོན་རྟགས། PrivateModelItemWidget Edit རྩོམ་སྒྲིག Delete མཚོན་རྟགས། QAptDownLoadDeb Tips སྣེ་སྟོན། Backend init failed མཇུག་སྣེ་འགོ་སྒྲིག་ཕམ་པ། %1 package not founds %1 སྒྲིག་སྦྱོར་ཁུག་མ་རྙེད་མ་བྱུང་། Failed to create transaction. དོན་རྐྱེན་གསར་འཛུགས་ཕམ་ཁ་བྱུང་། Package could not be update. ཁུག་མ་གསར་སྒྱུར་བྱེད་ཐབས་མེད། The current model is already the latest model མིག་སྔའི་དཔེ་དབྱིབས་ནི་དཔེ་དབྱིབས་གསར་ཤོས་ཡིན། New version needs to be updated upon discovery པར་གཞི་གསར་པ་རྙེད་པ། QObject Cancel མེད་པར་བཟོ་བ། Ok འགྲིགས། Sorry, the model is currently executing another task. Please try again after it is completed.. དགོངས་པ་མ་ཚོམ།དཔེ་དབྱིབས་འདིས་མིག་སྔར་ལས་འགན་གཞན་དག་ལག་བསྟར་བྱེད་བཞིན་ཡོད།ལེགས་འགྲུབ་བྱུང་རྗེས་བསྐྱར་དུ་ཚོད་ལྟ་བྱེད་པར་སྒུག་རོགས། Retry ཡང་བསྐྱར་ཚོད་ལེན། Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? འདྲ་དཔེ་འདི་བསུབ་ན་འདྲ་དཔེ་འདི་ལ་བརྟེན་པའི་བཀོལ་སྤྱོད་རྒྱུན་ལྡན་གྱི་འཁོར་སྐྱོད་བྱེད་ཐབས་བྲལ་སྲིད།ཁྱེད་རང་གི་བསུབ་དགོས་པ་ཐག་གིས་ཆོད། Delete མཚོན་རྟགས། Sorry, the model is currently executing another task. Please try again after it is completed. དགོངས་པ་མ་ཚོམ།དཔེ་དབྱིབས་འདིས་མིག་སྔར་ལས་འགན་གཞན་དག་ལག་བསྟར་བྱེད་བཞིན་ཡོད།ལེགས་འགྲུབ་བྱུང་རྗེས་བསྐྱར་དུ་ཚོད་ལྟ་བྱེད་པར་སྒུག་རོགས། Cloud model first (Kylin Certification) སྤྲིན་སྣེའི་དཔེ་དབྱིབས་དམིགས་སུ་བཀར་ནས་སྔོན་(Kylin དཔང་དངོས་བདེན་དཔང་) Local model first (Kylin Certification) སྔོན་ལ་ས་གནས་དེ་གའི་དཔེ་དབྱིབས་(Kylin དཔང་དངོས་བདེན་དཔང་) Custom model first སྔོན་ལ་རང་འདེམས་དཔེ་དབྱིབས་ Private model first སྔོན་ལ་རང་འདེམས་དཔེ་དབྱིབས་ Cloud Model First (Kylin Certification) སྤྲིན་སྣེའི་དཔེ་དབྱིབས་དམིགས་སུ་བཀར་ནས་སྔོན་(Kylin དཔང་དངོས་བདེན་དཔང་) Local Model First (Kylin Certification) སྔོན་ལ་ས་གནས་དེ་གའི་དཔེ་དབྱིབས་(Kylin དཔང་དངོས་བདེན་དཔང་) Custom Model First སྔོན་ལ་རང་འདེམས་དཔེ་དབྱིབས་ SubSystemInstallModule AIModuleManager AIདཔེ་དུམ་དོ་དམ་ AI Models AIདཔེ་དུམ་དོ་དམ་ loading plugin སྣོན་འཇུག་བསྒར་ཆས་ཁྲོད། Model Configuration དཔེ་དབྱིབས་སྒྲིག་སྦྱོགས། /aisubsystem/Model Configuration aisubsystem AIམ་ལག་མ་ལག་ AI SubSystem AIམ་ལག་མ་ལག་ /aisubsystem/AI SubSystem SubSystemWidget AI SubSystem AIམ་ལག་མ་ལག་ Ai SubSystem AIམ་ལག་མ་ལག་ Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. AIཉེར་སྤྱོད་སམ་བྱེད་ནུས་ལ་འཁོར་སྐྱོད་མཁོ་འདོན་བྱེད་དགོས། དཔེར་ན།AIལས་རོགས་དང་།གཞི་གྲངས་དོ་དམ་པ།དྲན་ཤེས་ས་བཀྲ།ཆི་ལིན་མྱུར་འགོད་སོགས། loading སྣོན་འཇུག་བྱེད་སྐབས། Install སྒྲིག་སྦྱོར་ Reboot Immediately འཕྲལ་དུ་བསྐྱར་སྤེལ། Update གསར་སྒྱུར་ Kylin Ai SubSystem དྭ་ལིན་AIམ་ལག Kylin AI SubSystem དྭ་ལིན་AIམ་ལག Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. AIཡི་ཉེར་སྤྱོད་དང་AIནུས་པར་འཁོར་སྐྱོད་འདོན་སྤྲོད་བྱེད་དགོས། དཔེར་ན་དཔེ་དབྱིབས་ཀྱི་ཡིག་ཆ་དང་འཁོར་སྐྱོད་བྱེད་སྐབས་ཀྱི་བང་མཛོད། བཀོད་སྒྲིག་བྱས་པའི་གྲངས་ཀ་སོགས་ལྟ་བུ་ཡིན Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. AIཡི་ཉེར་སྤྱོད་དང་AIནུས་པར་འཁོར་སྐྱོད་འདོན་སྤྲོད་བྱེད་དགོས། དཔེར་ན་དཔེ་དབྱིབས་ཀྱི་ཡིག་ཆ་དང་འཁོར་སྐྱོད་བྱེད་སྐབས་ཀྱི་བང་མཛོད། བཀོད་སྒྲིག་བྱས་པའི་གྲངས་ཀ་སོགས་ལྟ་བུ་ཡིན Detect Update ཞིབ་དཔྱད་གསར་བསྒྱུར། UnInstall ཕོག་པ་ Install success! སྒྲིག་སྦྱོར་ལེགས་འགྲུབ་བྱུང་། The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? AIམ་ལག་སྒྲིག་སྦྱོར་བྱས་ཟིན་པས།མ་ལག་བསྐྱར་དུ་སྒོ་ཕྱེ་རྗེས་གཞི་ནས་ནུས་པ་ཐོན་ཐུབ།བསྐྱར་དུ་སྒོ་ཕྱེ་དགོས་སམ། Reboot Later ཅུང་ཙམ་འགོར་རྗེས་བསྐྱར་སྤེལ། Are you sure you want to uninstall the AI subsystem? AIམ་ལག་བཤིག་དགོས་པ་གཏན་འཁེལ་བྱས་ཡོད་དམ། After uninstallation, the AI services of related applications will not be available. ཕུད་རྗེས་འབྲེལ་ཡོད་ཉེར་སྤྱོད་ཀྱི་། AIཞབས་ཞུ་བཀོལ་མི་ཐུབ། Cancel མེད་པ་བཟོ་བ་ Uninstall ཕོག་པ་ AI service unavailable AIཞབས་ཞུ་སྤྱོད་མི་ཆོག་། The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. AIམ་ལག་ལ་ཞིབ་དཔྱད་ཚད་ལེན་མ་ཐུབ་ན།བཀོལ་སྤྱོད་ཀྱི་AIཞབས་ཞུ་བཀོལ་སྤྱོད་བྱེད་ཐབས་བྲལ། རྒྱུད་ཁོངས་བཀོད་སྒྲིག་ལ་འགྲོ་རོགས་།>AI། དཔེ་དུམ་དོ་དམ་ཤོག་ངོས་སྒྲིག་སྦྱོར་བྱེད་དགོས། Go Now མྱུར་དུ་སོང་། Version: %1 པར་གཞི།%1 Version: %1 Last detection time: %2 པར་གཞི།%1 ཐེངས་སྔོན་མའི་ཞིབ་དཔྱད་ཚད་ལེན་དུས་ཚོད།%2 Detected an upgradable version: %1 Last detection time: %2 ཞིབ་དཔྱད་ཚད་ལེན་བྱས་ནས་གསར་སྒྱུར་བྱེད་ཆོག་པའི་པར་གཞི་ནི།%1 ཐེངས་སྔོན་མར་ཞིབ་དཔྱད་ཚད་ལེན་བྱེད་པའི་དུས་ཚོད།%2 Installed, effective after restarting. སྒྲིག་སྦྱོར་བྱས་ཟིན་པ་དང་།བསྐྱར་དུ་སྒོ་ཕྱེ་རྗེས་ནུས་པ་ཐོན་། Installing... སྒྲིག་སྦྱོར་བྱེད་བཞིན་ཡོད། Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. AIཉེར་སྤྱོད་སམ་བྱེད་ནུས་ལ་འཁོར་སྐྱོད་ཁོར་ཡུག་མཁོ་འདོན་བྱེད་དགོས། དཔེར་ན།AIལས་རོགས་དང་།དྲན་ཤེས་ས་ཁྲ།ཆི་ལིན་མྱུར་འགོད་སོགས། Uninstalling... བཤིག་པའི་ཁྲོད་དུ། The current version is already the latest version: %1 Last detection time: %2 མིག་སྔར་པར་གཞི་གསར་ཤོས་ཡིན་པ་སྟེ།%1 ཐེངས་སྔོན་མའི་ཞིབ་དཔྱད་ཚད་ལེན་དུས་ཚོད།%2ཡིན། Installation failed, necessary files are missing. སྒྲིག་སྦྱོར་ཕམ་ཁ་དང་།དགོས་ངེས་ཀྱི་ཡིག་ཆ་ཆད་ལྷག་། Network abnormality, please check the network connection and try again. དྲ་རྒྱ་རྒྱུན་ལྡན་མིན་པ་དང་།ཁྱེད་ཀྱིས་དྲ་རྒྱ་སྦྲེལ་མཐུད་བྱས་རྗེས་ཡང་བསྐྱར་ཚོད་ལྟ་། Detecting And Update... ཞིབ་དཔྱད་གསར་བརྗེས་བྱེད་སྐབས། TestAiSubSystem Model Configuration དཔེ་དབྱིབས་སྒྲིག་སྦྱོགས། Cloud Model (Kylin Certification) སྤྲིན་སྣེའི་དཔེ་དཔེ།(Kylinདཔང་དངོས་བདེན་དཔང་) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) ཆིན་གྱིས་བདེན་དཔང་བྱས་པའི་སྤྲིན་སྣེའི་དཔེ་དབྱིབས་བཀོད་སྒྲིག་བྱེད་དགོས།(སྤྲིན་སྣེའི་ཞབས་ཞུ་ཆས་སུ་བཀོད་སྒྲིག་བྱེད་པ་དང་དྲ་རྒྱ་བརྒྱུད་འཚམས་འདྲི་དང་བཀོལ་སྤྱོད།) Local Model (Kylin Certification) ས་གནས་དེ་གའི་དཔེ་དབྱིབས་(Kylinདཔང་དངོས་བདེན་དཔང་) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) ཆི་ལིན་གྱིས་བདེན་དཔང་བྱས་པའི་ས་གནས་དེ་གའི་དཔེ་དབྱིབས་བཀོད་སྒྲིག་བྱེད་དགོས།(ས་གནས་དེ་གའི་སྒྲིག་ཆས་སྟེང་དུ་སྒྲིག་སྦྱོར་བྱས་ན་དྲ་རྒྱ་མེད་ཀྱང་འཁོར་སྐྱོད་བྱེད་ཐུབ།) Custom Model རང་འདེམས་དཔེ་དབྱིབས་ Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) ཆི་ལིན་གྱིས་ཁས་ལེན་མ་བྱས་པའི་ས་གནས་དེ་གའི་དཔེ་དབྱིབས་ཡིག་ཆ་དང་།ཁྱབ་ཆུང་དྲ་རྒྱ།སྤྱི་ལ་དབང་བའི་སྤྲིན་པའི་དཔེ་དབྱིབས་སྒྲིག་སྒྲིག(གལ་ཏེ་ཁྱེད་ལ་སྟབས་མི་བདེ་བ་བཟོས་ན་བསམ་ཤེས་གནང་རོགས།) Failed to set cloud model priority སྤྲིན་སྣེའི་དཔེ་དབྱིབས་བཀོད་སྒྲིག་སྔོན་རིམ་ཕམ་པ། Failed to set local model priority ས་གནས་དེ་གའི་དཔེ་དབྱིབས་བཀོད་སྒྲིག་སྔོན་རིམ་ཕམ་པ། Failed to set custom model priority རང་འདེམས་དཔེ་དབྱིབས་བཀོད་སྒྲིག་སྔོན་རིམ་ཕམ་པ། Cloud model (Kylin Certification) སྤྲིན་སྣེའི་དཔེ་དཔེ།(Kylinདཔང་དངོས་བདེན་དཔང་) Cancel མེད་པར་བཟོ་བ། Ok འགྲིགས། UpdateNotificationWidget Tips སྣེ་སྟོན། Apt update failed. གསར་སྒྱུར་ཕམ་པ། Current model is downloading now ,Are you sure you to cancel the download? འདྲ་དཔེ་ཕབ་ལེན་བྱེད་བཞིན་ཡོད།ཕབ་ལེན་མེད་པར་བཟོ་རྒྱུའི་གཏན་འཁེལ་བྱས་ཡོད་དམ། kylin-ai-subsystem-plugin-1.0.0.2/translations/en_US.ts000066400000000000000000001215301520576575000230350ustar00rootroot00000000000000 AddButton Add AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. Go to update CloudModelConfigWidget Cloud Model Deployed on the cloud server, access and use over the network NLP Model Processing and generating text, such as understanding text and answering questions Add Visual Model Processing and generating images, such as recognizing objects and analyzing scenes Speech Model Processing sound and speech, such as recognizing speech and synthesizing speech OK Model switching failed Failed to delete model Model setup failed Model Editing failed LocalModelConfigWidget Local Model Installed on local equipment, it can run without network (Installing/uninstalling models requires a reboot to take effect) Install Update/Uninstall Built in model of the system The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation NLP Model Processing and generating text, such as understanding text and answering questions OK Are you sure you want to exit? The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? Cancel Quit Exit current window? The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. Built in model group Model setup failed Model switching failed LocalModelItem Effective after reboot Effective after reboot . Detect Updates Install success! The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? Reboot Later Reboot Immediately Take effect after rebooting installing... Net is error,Please check and try again The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! The current model installation package is not installed, it can be downloaded and installed New version needs to be updated upon discovery The current model is already the latest model Current model version is the lastest version Current model install failed,please install manually. ModelCallPriority Model Call Priority ModelConfigDialog Ok Model Type Voice dictation & online voice synthesis (streaming version) Real time voice transcription Model Configuration Tutorial Cancel Accept Add Cannot contain spaces, please re-enter! Add-NLP Model Add-Visual Model Add-Speech Model Required Edit-NLP Model Edit-Visual Model Edit-Speech Model The model type already exists. Cannot be repeated! Model Editing failed Adding model failed ModelDownload The current environment's dbus interface is abnormal The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. Tips Backend init failed ModelItem Edit Delete ModelWidget Increase Priority Configure PrivateModelConfigDialog Ok Add-NLP Model Add-Visual Model Add-Speech Model Edit-NLP Model Edit-Visual Model Edit-Speech Model CustomName ModelName RequestUrl Required (To distinguish models) Optional Optional (Required for cloud services) Required Cancel Accept The length must not exceed 32 characters Cannot contain spaces, please re-enter! Duplicate name, please re-enter! Model Editing failed Adding model failed PrivateModelConfigWidget Private Model Flexible model management to meet personalized usage scenarios NLP Model Processing and generating text, such as understanding text and answering questions Add OK Failed to delete model Model setup failed Model Editing failed Model switching failed PrivateModelItemWidget Edit Delete QObject Cloud Model First (Kylin Certification) Local Model First (Kylin Certification) Custom Model First Cancel Ok Sorry, the model is currently executing another task. Please try again after it is completed.. Retry Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? Delete SubSystemInstallModule AI Models loading plugin AI SubSystem /aisubsystem/AI SubSystem Model Configuration /aisubsystem/Model Configuration SubSystemWidget AI SubSystem loading Reboot Immediately Detect Update UnInstall Install success! The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? Reboot Later Are you sure you want to uninstall the AI subsystem? After uninstallation, the AI services of related applications will not be available. Cancel Uninstall AI service unavailable The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. Go Now Version: %1 Version: %1 Last detection time: %2 Detected an upgradable version: %1 Last detection time: %2 Installed, effective after restarting. Installing... Kylin AI SubSystem Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. Uninstalling... The current version is already the latest version: %1 Last detection time: %2 Installation failed, necessary files are missing. Network abnormality, please check the network connection and try again. Detecting And Update... TestAiSubSystem Model Configuration Cloud Model (Kylin Certification) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) Local Model (Kylin Certification) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) Custom Model Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) Failed to set cloud model priority Failed to set local model priority Failed to set custom model priority kylin-ai-subsystem-plugin-1.0.0.2/translations/kk.ts000066400000000000000000001560721520576575000224420ustar00rootroot00000000000000 AddBtn Add 添加 AddButton Add قوش AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىپ بايقاعان بۅلۅك AI قولدونۇشچان ۉلگۉسۉ ۅتۅ تۅمۅن بولۇپ، بۅلۉمچۅ ساامالىق مەنەن شاي كەلمەيدىكەن، بۇل قۇربات ، جۅندۅم چەكتەمەگە ۇچۇرايت. نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. Go to update جاڭىرتىشقا قاراپ Configure 前往更新 配置 CloudModelConfigWidget Cloud Model بۇلۇتلۇق مودەل Deployed on the cloud server, access and use over the network بۇلۇتلۇق مۇلازىمەتچىگە ورۇنداشتىرىلىپ، تور ارقىلۇۇ زىيارات جاسوو ،اتقارۇۇ جانا ىشتەتىش NLP Model تەكىست نۇسقا ، قالپ Processing and generating text, such as understanding text and answering questions جازۇۇسۇن بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى تەكىستتى تۉشۅنۉۉ، سوئالغا جووپ بەرۉۉ Add قوش Visual Model سۉرۅت تۉرۉندۅگۉ مودەل Processing and generating images, such as recognizing objects and analyzing scenes سۉرۅتتۉ بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى جىسىمنى ايىرمالاندىرىش ، انالىز جاسوو ،اتقارۇۇ Speech Model دوبۇش تۉرۉندۅگۉ مودەل Processing sound and speech, such as recognizing speech and synthesizing speech دووش جانا تىبىشتى بىر تاراپ جاسوو ،اتقارۇۇ ،مىسالى تىبىشتى ايىرمالاندىرىش ،بىر ىكمە دوبۇش OK بەكىتۉۉ Model switching failed تانداش نۇسقا ، قالپ جاساپ تەڭشۅۅ جەڭىلۉۉ بولدۇ Failed to delete model مودەلدى ۅندۉرۉپ تاشتاش جەڭىلۉۉ بولدۇ Model setup failed مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ جەڭىلۉۉ بولدۇ Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Cloud model بۇلۇتلۇق مودەل Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Free Trial Account 免费试用账号 kylin-ai-subsystem-modelconfig AI模型配置 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? kylin-aiassistant AI 助手 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Delete 删除 LocalModelConfigWidget Local Model جەردىك مودەل Installed on local equipment, it can run without network جەردىك اسپاپتارعا ورنوتۇلعان بولۇپ، تور كەرەگى جوق يۈرۈشتۈرگىلى بولوت (Installing/uninstalling models requires a reboot to take effect) (قۇراشتۇرۇش / چۈشۈرۈش مودېلى قايتا قوزغىتىلغاندىن كېيىن كۈچكە ئىگە بولىدۇ) Install قاچالوو Update/Uninstall جاڭىلوو/جۉك تۉشۉرۉ Built in model of the system سەستىماسىنىن ىچكى بۅلۅگۉنۅ مودەل ورنوتۇلعان The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation سۉرۅت ايىرمالاندىرىش ، ۋېكتورلاشتۇرۇش، دوبۇش بىر تاراپ جاسوو ،اتقارۇۇ قاتارلۇۇ باشقا سىستېمىلارنىڭ يۈرۈشىشىگە ەتىياجدۇۇ مودېللار NLP Model تەكىست نۇسقا ، قالپ Processing and generating text, such as understanding text and answering questions جازۇۇسۇن بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى تەكىستتى تۉشۅنۉۉ، سوئالغا جووپ بەرۉۉ OK بەكىتۉۉ Are you sure you want to exit? جانىپ چىعۇۇنۇ تۇراقتاندىرا الاسىزبى؟ The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? مودەل قۇراشتىرىلىپ جاتات، جانىپ سىندىرۇۇ ورنوتۇ جەڭىلۉۉ بولۇۇسۇ مۉمكۉن. چەگىپ سىندىرۇۇ نى بىكىتەمدۇق جوق Cancel ارعادان قالتىرىش Quit جانىپ كەت Exit current window? گەزەكتەكى كۅزۅنۅكتۅن جانىپ سىندىرۇۇ ؟ The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. مودەلدى قۇراشتىرۇۇ جالعاشتۇۇ ارقا سۇپادا ىشتەلەت، بۉتكۅندۅن كىيىن قايتادان قوزعوتۇۇ كۉچۉنۅ ەە بولموق بولوت . Built in model group ىچىنە مودەل گۇرۇپپاسى وردۇ Model setup failed مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ جەڭىلۉۉ بولدۇ Model switching failed تانداش نۇسقا ، قالپ جاساپ تەڭشۅۅ جەڭىلۉۉ بولدۇ Installing/uninstalling models requires a restart to take effect 安装/卸载模型需重启后生效 Processing and generating images, such as recognizing objects and analyzing scenes 处理和生成图像,比如识别物体、分析场景 Processing sound and speech, such as recognizing speech and synthesizing speech 处理声音和语音,比如识别语音、合成语音 Failed to delete model 删除模型失败 After downloading and installing, a restart is required to take effect 下载安装后需重启生效 After downloading and installing, you need to log out for it to take effect 下载安装后需注销生效 (The installation/uninstallation of the model will take effect after logging out) (安装/卸载模型需注销后生效) The installation/uninstallation of the model will take effect after logging out 安装/卸载模型需注销后生效 Installing/uninstalling models requires a reboot to take effect قۇراشتۇرۇش / چۈشۈرۈش مودېلى قايتا قوزغىتىلغاندىن كېيىن كۈچكە ئىگە بولىدۇ Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Tips 提示 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 kylin-ai-modelconfig 模型配置 Current model not install,you can use the model after install it. 当前模型尚未安装,完成安装后才能正常使用。 Install Now 立即安装 kylin-aiassistant AI 助手 kylin-ai-subsystem-modelconfig AI模型配置 Ok 确定 Add 添加 Visual Model 图像类模型 Speech Model 语音类模型 LocalModelItem Discover a new version 发现新版本 Effective after reboot قايرا قوزعوتقوندون كىيىن كۉچۉنۅ ەە بولموق بولوت Effective after reboot . 重启后生效 قايتا قوزغاتقاندىن كېيىن كۈچكە ئىگە بولىدۇ Detect Updates تەكشەرىش جاڭىلانۇسۇ تەكشۈ Install success! قۇراشتىرۇۇ جەڭىشتۉۉ بولدۇ ! The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? مودەل قۇراشتۇرۇلۇپ بولدۇ ، سەستىمانى قايتادان قوزعوتقوندون كىيىن اندان كۉچۉنۅ ەە بولموق بولوت ، قايتادان قوزغىتامدۇ؟ Reboot Later سەل تۇرۇپ قايرا قوزعوتۇڭ Reboot Immediately دەرەۋ قاتە قوزعالتۋ Take effect after rebooting قايرا قوزعوتقوندون كىيىن كۉچۉنۅ ەە بولموق بولوت installing... قۇراشتىرۇۇ بارىشندا... Net is error,Please check and try again تور بۅتۅنچۅ ، تەكشەرىلگەندەن كىيىن قايرا سىناپ باعىڭ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! بەلگىلەنگەن مودېلنىڭ قۇراشتىرۇۇ سومكاسىن تاپالمىدىم: %1، جۇمشاق تەتىك قاينارى جانا تور ابالىن تەكشەرىپ قايتادان سىناپ باعىڭ! The current model installation package is not installed, it can be downloaded and installed گەزەكتە مودەل ورنوتۇ سومكاسى ورنوتۇلباعان ، تۉشۉرۉ جانا ورنوتۇقا بولوت New version needs to be updated upon discovery جاڭى نۇسقاسىن بايقىماق The current model is already the latest model گەزەكتە مودەل تەە مۇردا ەڭ جاڭى مودەل Current model version is the lastest version بۇل نۇسقا تەە مۇردا ەڭ جاڭى Current model install failed,please install manually. قاتاا ورنوتۇ ، قولدو ورنوتۇڭ Detect updates تەكشەرىش جاڭىلانۇسۇ تەكشۈ kylin-ai-subsystem-modelconfig_QMessageBox_installSuccess 安装成功! Tips 提示 Current model deb install finished 模型安装完成 ModelCallPriority Model call priority مودەل جۅتكۅپ ىشتەتىش وزوت داراجاسى Cloud model first (Kylin Certification) 优先云端模型(麒麟认证) Local model first (Kylin Certification) 优先本地模型(麒麟认证) Cloud model first 优先云端模型 Local model first 优先本地模型 Private model first 优先自选模型 Model Call Priority مودەل جۅتكۅپ ىشتەتىش وزوت داراجاسى ModelConfigDialog Ok ماقۇل Model Type مودەل تۉرۉ Voice dictation & online voice synthesis (streaming version) دوبۇش ۇعۇپ جازۇۇ : توردو دوبۇش بىرىكتىرىش ( اعىم تۉرۉندۅگۉ ۉلگۉسۉ ) Real time voice transcription دوبۇش ايلاندىرىپ جازۇۇ Model Configuration Tutorial مودەل سەپتەش دەرسلىكى Cancel ارعادان قالتىرىش Accept قابىلدوو جاسوو ،اتقارۇۇ Add قوش Cannot contain spaces, please re-enter! بوشتۇقتۇ ۅز ىچىنە السا بولبويت ، قايتادان كىرگىزىڭ ! Add-NLP Model قوشۇۇ - تەكىست نۇسقا ، قالپ Add-Visual Model قوشۇۇ - سۉرۅت تۉرۉندۅگۉ مودەل Add-Speech Model قوشۇۇ - دوبۇش نۇسقا ، قالپ Required زارىل Edit-NLP Model تۅپتۅۅچۉ - تەكىست تۉرۉندۅگۉ مودېللار Edit-Visual Model تۅپتۅۅچۉ - سۉرۅت تۉرۉندۅگۉ مودېللار Edit-Speech Model تۅپتۅۅچۉ - دوبۇش تۉرۉندۅگۉ مودېللار The model type already exists. Cannot be repeated! تەە مۇردا بۇل مودەل باربولۇۇسۇ بولۇپ قالدى ،قايرا قوشۇۇعا بولبويت Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Adding model failed قوشۇۇ نۇسقا ، قالپ جەڭىلۉۉ بولدۇ Close 关闭 APPID APPID No account? Get Now 没有账号?立即获取 ModelDownload The current environment's dbus interface is abnormal گەزەكتە چۅرۅسۉ dbus ۇلوو ووزۇ بۅتۅنچۅ The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىش ارقىلۇۇ "AI جاردامچىسى" ۉلگۉسۉنۉن ۅتۅ تۅمۅن بولۇپ، بۅلۉمچۅ ساامالىق مەنەن شاي كەلمەيدىغانلىقى، قۇرباتى چەكتەمەگە ۇچۇرايتۇرعاندىعىن بايقادى. نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىش ارقىلۇۇ " بوتۇلكىلىق تەز قاتىرەسىن " ۉلگۉسۉنۉن ۅتۅ تۅمۅن بولۇپ ، بۅلۉمچۅ ساامالىعى مەنەن شاي كەلمەيدىغانلىقى ، قۇرباتى چەكتەمەگە ۇچۇرايت . نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىش ارقىلۇۇ "AI جاردامچىسى"، "بوتۇلكىلىق تەزدىك قاتىرەسىن" ۉلگۉسۉنۉن ۅتۅ تۅمۅن بولۇپ، بۅلۉمچۅ ساامالىعى مەنەن شاي كەلمەيدىغانلىقى، قۇرباتى چەكتەمەگە ۇچۇرايت. نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. Tips ەسكەرتمە Backend init failed ارقا بۅلۅگۉ العاچقى تەرەپلىشىش جەڭىلۉۉ بولدۇ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 未找到指定模型的安装包:%1,请检查软件源及网络状态并重新尝试! The current model installation package is not installed, it can be downloaded and installed 当前模型安装包未安装,可以下载及安装 New version needs to be updated upon discovery 发现新版本 The current model is already the latest model 当前模型已经是最新模型 Cancel download failed 取消下载失败 ModelItem Edit تۅپتۅۅچۉ Delete ۅچۉر ModelWidget Sort Upwards 排序靠前 Increase priority الدىن كۅرۅرلۉك چەگىن ۅستۉرۉۉ كەرەك Increase Priority الدىن كۅرۅرلۉك چەگىن ۅستۉرۉۉ كەرەك Configure سەپتەش PrivateModelConfigDialog Ok ماقۇل Add-NLP Model قوشۇۇ - تەكىست نۇسقا ، قالپ Add-Visual Model قوشۇۇ - سۉرۅت تۉرۉندۅگۉ مودەل Add-Speech Model قوشۇۇ - دوبۇش نۇسقا ، قالپ Edit-NLP Model تۅپتۅۅچۉ - تەكىست تۉرۉندۅگۉ مودېللار Edit-Visual Model تۅپتۅۅچۉ - سۉرۅت تۉرۉندۅگۉ مودېللار Edit-Speech Model تۅپتۅۅچۉ - دوبۇش تۉرۉندۅگۉ مودېللار CustomName ۅزۉ بەلگىلۅۅ ناامى ModelName مودەل ناامى RequestUrl ئۆتۈنۈش دايىن وردۇ Required (To distinguish models) سۅزسۉز تولتۇرۇ ( ايىرمالاندىرىش نۇسقا ، قالپ ) Optional تانداپ تولتۇرۇ Optional (Required for cloud services) تانداش ( بۇلۇتلۇق تەيلۅۅ سۅزسۉز تولتۇرۇ ) Required زارىل Cancel ارعادان قالتىرىش Accept قابىلدوو جاسوو ،اتقارۇۇ The length must not exceed 32 characters ۇزۇندۇعۇ 32 قاتتان چوڭ بولبوستۇعۇ كەرەك Cannot contain spaces, please re-enter! بوشتۇقتۇ ۅز ىچىنە السا بولبويت ، قايتادان كىرگىزىڭ ! Duplicate name, please re-enter! ات تەكرارلىنىدۇ،قايتادان كىرگىزىڭ Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Adding model failed قوشۇۇ نۇسقا ، قالپ جەڭىلۉۉ بولدۇ Close 关闭 The model type already exists. Cannot be repeated! 已存在该模型类型,不可重复添加 APPID APPID PrivateModelConfigWidget Private Model ۅزۉ تاندايتۇرعان مودەل Flexible model management to meet personalized usage scenarios جاندۇۇ مودەل باشقارىش ارعاسى قاسىيەت ىشتەتىلۉۉ گۅرۉنۉشۉن قاندۇرۇش كەرەك NLP Model تەكىست نۇسقا ، قالپ Processing and generating text, such as understanding text and answering questions جازۇۇسۇن بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى تەكىستتى تۉشۅنۉۉ، سوئالغا جووپ بەرۉۉ Add قوش OK بەكىتۉۉ Failed to delete model مودەلدى ۅندۉرۉپ تاشتاش جەڭىلۉۉ بولدۇ Model setup failed مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ جەڭىلۉۉ بولدۇ Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Model switching failed تانداش نۇسقا ، قالپ جاساپ تەڭشۅۅ جەڭىلۉۉ بولدۇ Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? Delete 删除 PrivateModelItemWidget Edit تۅپتۅۅچۉ Delete ۅچۉر QAptDownLoadDeb Tips 提示 Backend init failed 后端初始化失败 %1 package not founds %1 安装包未找到 Failed to create transaction. 事件创建失败 Package could not be update. 无法更新包 The current model is already the latest model 当前模型已经是最新模型 New version needs to be updated upon discovery 发现新版本 QObject Cancel ارعادان قالتىرىش Ok ماقۇل Sorry, the model is currently executing another task. Please try again after it is completed.. كەچۈرۈڭ، بۇ مودېل ھازىر باشقا ۋەزىپىلەرنى ئىجرا قىلىۋاتىدۇ، تاماملانغاندىن كېيىن قايتا سىناپ بېقىڭ. Retry قايرا سىناپ باعۇۇ Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? بۇلل مودەلدى ۅندۉرۉپ تاشتاش بۇلل مودەلدىڭ ىشتەتىلىشىنە سۅۅنۉپ نورماال ئىشلىتەلمەسلىكىنى كەلىترىپ چىعارات، سىز يۇيىۋېتىشنى تۇراقتاندىرا الاسىزبى؟ Delete ۅچۉر Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Cloud model first (Kylin Certification) الدىن بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Local model first (Kylin Certification) الدىن جەردىك مودەل ( بوتۇلكا ىسپاتتوو ) Custom model first ئالدىن ئۆزى تاللايدىغان مودېل Private model first 优先自选模型 Cloud Model First (Kylin Certification) الدىن بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Local Model First (Kylin Certification) الدىن جەردىك مودەل ( بوتۇلكا ىسپاتتوو ) Custom Model First ئالدىن ئۆزى تاللايدىغان مودېل SubSystemInstallModule AIModuleManager AI模块管理 AI SubSystem بۅلۉمچۅ ساامالىق AI /aisubsystem/AI SubSystem aisubsystem AI子系统 loading plugin قىستىرما تەتىك قاچالوو بارىشندا... AI Models مودەل باشقارىش AI Model Configuration مودەل بۅلۉشتۉرۉ /aisubsystem/Model Configuration SubSystemWidget AI SubSystem بۅلۉمچۅ ساامالىق AI Ai SubSystem AI子系统 Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、数据管家、记忆地图、麒麟速记等。 Version: %1 باسما نومۇرۇ :%1 Install 安装 LogOut immediately 立即注销 Update 更新 Detect Update تەكشەرىش جاڭىلانۇسۇ تەكشۈ UnInstall يۈكنى تۉشۉرۉ Install success! قۇراشتىرۇۇ جەڭىشتۉۉ بولدۇ ! The AI subsystem has been installed and needs to be logged out before it can take effect. Do you want to log out? AI子系统已经安装完成,需要注销后才能生效,是否注销? Are you sure you want to uninstall the AI subsystem? AI بۅلۉمچۅ سەستىمانى تۉشۉرۉنۉ تۇراقتاندىرا الاسىزبى؟ After uninstallation, the AI services of related applications will not be available. يۈكنى تۉشۉرگۅندۅن كىيىن، بايلانىشتۇۇ قولدونۇلاتۇرعان AI مۇلازىمەتىردى ىشتەتكەلى بولبويت . Uninstall ۅچۉرۉۉ AI service unavailable قىزماتتى ىشتەتكەلى بولبويت AI The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. AI بۅلۉمچۅ سەستىمانى تەكشەرىپ بايقىمىغاندا، قولدونۇلعان AI مۇلازىمەتىردى ىشتەتكەلى بولبويت . ساامالىق قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ > AI نۇسقاسىن باشقارىش بەتىنە بەرىپ قۇراشتىرىڭ. Go Now داروو بارىمەن Installing... قاچالاپ جاتات... Installation failed, necessary files are missing. قۇراشتىرۇۇ جەڭىلۉۉ بولدۇ ، زارىل ۅجۅت گەمچىل بولۇش Network abnormality, please check the network connection and try again. تور بۅتۅنچۅ ، تور ۇلانعاندىعىن تەكشەرگەندەن كىيىن قايرا سىناپ باعىڭ Installed, effective after logging out. 已安装,注销后生效 Detecting And Update... تەكشەرىش جاڭىلوو بارىشندا... The current version is already the latest version: %1 Last detection time: %2 گەزەكتە ەڭ جاڭى ۉلگۉسۉ : %1 الدىنقى ىرەت تەكشەرىش ۇباقتى: 2 Version: %1 Last detection time: %2 ۉلگۉسۉ : 1 الدىنقى ىرەت تەكشەرىش ۇباقتى: 2 Detected an upgradable version: %1 Last detection time: %2 تەكشەرىپ بايقاعاندا جاڭىرتقالى بولوتۇرعان ۉلگۉسۉ : %1 الدىنقى ىرەت تەكشەرىش ۇباقتى: 2 Uninstalling... جۉك تۉشۉرۉ بارىشندا... Cancel ارعادان قالتىرىش LogOut Later 稍后注销 LogOut Immediately 立即注销 Reboot Immediately دەرەۋ قاتە قوزعالتۋ Reboot Later سەل تۇرۇپ قايرا قوزعوتۇڭ The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? AI بۅلۉمچۅ ساامالىعى قۇراشتۇرۇلۇپ بولدۇ ، سەستىمانى قايتادان قوزعوعوندون كىيىن اندان كۉچۉنۅ ەە بولموق بولوت ، قايتادان قوزغىتامدۇ؟ Installed, effective after restarting. قۇراشتۇرۇلۇپ قايتادان قوزعوتقوندون كىيىن كۉچۉنۅ ەە بولموق loading جۉك قاچالوو بارىشندا... Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、记忆地图、麒麟速记等。 Kylin Ai SubSystem 麒麟AI子系统 Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. 为AI应用和AI功能提供运行环境。如模型文件、运行时库、配置参数等。 Kylin AI SubSystem بولىن AI بۅلۉمچۅ ساامالىعى Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. AI قولدونۇش جانا AI قۇرباتىن يۈرۈشتۈرۈش چۅيرۅسۉ مەنەن قامدايت . مىسالى مودەل ۅجۅت ، يۈرۈشتۈرۈش ۇباقىت قازىناعى ، سەپتەش پارامەتىرى قاتارلۇۇلار . TestAiSubSystem Model Configuration مودەل بۅلۉشتۉرۉ Cloud Model (Kylin Certification) بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) بوتۇلكىلىق گۇۋاھنامەدىن ۅتكۅن بۇلۇتلۇق مودەل تاقسىمدالعان ( بۇلۇتلۇق مۇلازىمەتچىگە ورۇنداشتىرىلعان ، تور ارقىلۇۇ زىيارات جاسوو ،اتقارۇۇ جانا ىشتەتىش ) Local Model (Kylin Certification) جەردىك مودەل ( بوتۇلكا ىسپاتتوو ) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) بوتۇلكىلىق گۇۋاھنامەدىن ۅتكۅن جەردىك مودەل تاقسىمدالعان (جەردىك اسپاپتارعا ورنوتۇلعان، تور ھاجەتسىزمۇ يۈرۈشتۈرگىلى بولوت ) Custom Model ۅزۉ تاندايتۇرعان مودەل Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) بوتۇلكىنىڭ ئىسپاتلىشىدىن ۅتپۅگۅن جەردىك مودەل ۅجۅت، رايون ،چۅلكۅم تورۇ جانا جالپى ئشتەتىلە تۇرعان بۇلۇت مودەلى سەپتەمەسى (ەگەر سىزگە قولايسىزلىق الىپ كەلسە كەچىرۉۉ) Failed to set cloud model priority بۇلۇتلۇق مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاساشتىن وزوت داراجاسى جەڭىلۉۉ بولدۇ Failed to set local model priority جەردىك مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ وزوت داراجاسى جەڭىلۉۉ بولدۇ Failed to set custom model priority ۅزۉ تاندايتۇرعان مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاساشتىن وزوت داراجاسى جەڭىلۉۉ بولدۇ Cloud model (recommended) 云端模型(推荐) Local Model (recommended) 本地模型(推荐) Cloud model (Kylin Certification) بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this has caused any inconvenience to you, please understand) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this causes any inconvenience, please accept our sincere apologies.) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Deployed on the cloud server, access and use over the network 部署在云端服务器,通过网络访问和使用 Installed on local equipment, it can run without network 安装在本地设备上,无需网络也可运行 Private Model 自选模型 Flexible model management to meet personalized usage scenarios 灵活的模型管理方式,满足个性化使用场景 UpdateNotificationWidget Tips 提示 Apt update failed. 更新失败 Current downloading value is 100,now the model is install ,current can not stop . 下载进度为100时无法取消安装模型 Current model is downloading now ,Are you sure you to cancel the download? 模型正在下载,确定取消下载吗? kylin-ai-subsystem-plugin-1.0.0.2/translations/ky.ts000066400000000000000000001561661520576575000224640ustar00rootroot00000000000000 AddBtn Add 添加 AddButton Add قوشۇۇ AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىپ بايقاعان بۅلۅك AI قولدونۇشچان ۉلگۉسۉ ۅتۅ تۅمۅن بولۇپ، بۅلۉمچۅ ساامالىق مەنەن شاي كەلمەيدىكەن، بۇل قۇربات ، جۅندۅم چەكتەمەگە ۇچۇرايت. نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. Go to update جاڭىرتىشقا قاراپ Configure 前往更新 配置 CloudModelConfigWidget Cloud Model بۇلۇتلۇق مودەل Deployed on the cloud server, access and use over the network بۇلۇتلۇق مۇلازىمەتچىگە ورۇنداشتىرىلىپ، تور ارقىلۇۇ زىيارات جاسوو ،اتقارۇۇ جانا ىشتەتىش NLP Model تەكىست نۇسقا ، قالپ Processing and generating text, such as understanding text and answering questions جازۇۇسۇن بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى تەكىستتى تۉشۅنۉۉ، سوئالغا جووپ بەرۉۉ Add قوشۇۇ Visual Model سۉرۅت تۉرۉندۅگۉ مودەل Processing and generating images, such as recognizing objects and analyzing scenes سۉرۅتتۉ بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى جىسىمنى ايىرمالاندىرىش ، انالىز جاسوو ،اتقارۇۇ Speech Model دوبۇش تۉرۉندۅگۉ مودەل Processing sound and speech, such as recognizing speech and synthesizing speech دووش جانا تىبىشتى بىر تاراپ جاسوو ،اتقارۇۇ ،مىسالى تىبىشتى ايىرمالاندىرىش ،بىر ىكمە دوبۇش OK ماقۇل Model switching failed تانداش نۇسقا ، قالپ جاساپ تەڭشۅۅ جەڭىلۉۉ بولدۇ Failed to delete model مودەلدى ۅندۉرۉپ تاشتاش جەڭىلۉۉ بولدۇ Model setup failed مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ جەڭىلۉۉ بولدۇ Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Cloud model بۇلۇتلۇق مودەل Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Free Trial Account 免费试用账号 kylin-ai-subsystem-modelconfig AI模型配置 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? kylin-aiassistant AI 助手 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Delete 删除 LocalModelConfigWidget Local Model جەردىك مودەل Installed on local equipment, it can run without network جەردىك اسپاپتارعا ورنوتۇلعان بولۇپ، تور كەرەگى جوق يۈرۈشتۈرگىلى بولوت (Installing/uninstalling models requires a reboot to take effect) (قۇراشتۇرۇش / چۈشۈرۈش مودېلى قايتا قوزغىتىلغاندىن كېيىن كۈچكە ئىگە بولىدۇ) Install قاچالوو Update/Uninstall جاڭىلوو/جۉك تۉشۉرۉ Built in model of the system سەستىماسىنىن ىچكى بۅلۅگۉنۅ مودەل ورنوتۇلعان The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation سۉرۅت ايىرمالاندىرىش ، ۋېكتورلاشتۇرۇش، دوبۇش بىر تاراپ جاسوو ،اتقارۇۇ قاتارلۇۇ باشقا سىستېمىلارنىڭ يۈرۈشىشىگە ەتىياجدۇۇ مودېللار NLP Model تەكىست نۇسقا ، قالپ Processing and generating text, such as understanding text and answering questions جازۇۇسۇن بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى تەكىستتى تۉشۅنۉۉ، سوئالغا جووپ بەرۉۉ OK ماقۇل Are you sure you want to exit? جانىپ چىعۇۇنۇ تۇراقتاندىرا الاسىزبى؟ The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? مودەل قۇراشتىرىلىپ جاتات، جانىپ سىندىرۇۇ ورنوتۇ جەڭىلۉۉ بولۇۇسۇ مۉمكۉن. چەگىپ سىندىرۇۇ نى بىكىتەمدۇق جوق Cancel ارعادان قالتىرىش Quit جانىپ كەت Exit current window? گەزەكتەكى كۅزۅنۅكتۅن جانىپ سىندىرۇۇ ؟ The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. مودەلدى قۇراشتىرۇۇ جالعاشتۇۇ ارقا سۇپادا ىشتەلەت، بۉتكۅندۅن كىيىن قايتادان قوزعوتۇۇ كۉچۉنۅ ەە بولموق بولوت . Built in model group ىچىنە مودەل گۇرۇپپاسى وردۇ Model setup failed مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ جەڭىلۉۉ بولدۇ Model switching failed تانداش نۇسقا ، قالپ جاساپ تەڭشۅۅ جەڭىلۉۉ بولدۇ Installing/uninstalling models requires a restart to take effect 安装/卸载模型需重启后生效 Processing and generating images, such as recognizing objects and analyzing scenes 处理和生成图像,比如识别物体、分析场景 Processing sound and speech, such as recognizing speech and synthesizing speech 处理声音和语音,比如识别语音、合成语音 Failed to delete model 删除模型失败 After downloading and installing, a restart is required to take effect 下载安装后需重启生效 After downloading and installing, you need to log out for it to take effect 下载安装后需注销生效 (The installation/uninstallation of the model will take effect after logging out) (安装/卸载模型需注销后生效) The installation/uninstallation of the model will take effect after logging out 安装/卸载模型需注销后生效 Installing/uninstalling models requires a reboot to take effect قۇراشتۇرۇش / چۈشۈرۈش مودېلى قايتا قوزغىتىلغاندىن كېيىن كۈچكە ئىگە بولىدۇ Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Tips 提示 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 kylin-ai-modelconfig 模型配置 Current model not install,you can use the model after install it. 当前模型尚未安装,完成安装后才能正常使用。 Install Now 立即安装 kylin-aiassistant AI 助手 kylin-ai-subsystem-modelconfig AI模型配置 Ok 确定 Add 添加 Visual Model 图像类模型 Speech Model 语音类模型 LocalModelItem Discover a new version 发现新版本 Effective after reboot قايرا قوزعوتقوندون كىيىن كۉچۉنۅ ەە بولموق بولوت Effective after reboot . 重启后生效 قايتا قوزغاتقاندىن كېيىن كۈچكە ئىگە بولىدۇ Detect Updates تەكشەرىش جاڭىلانۇسۇ تەكشۈ Install success! قۇراشتىرۇۇ جەڭىشتۉۉ بولدۇ ! The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? مودەل قۇراشتۇرۇلۇپ بولدۇ ، سەستىمانى قايتادان قوزعوتقوندون كىيىن اندان كۉچۉنۅ ەە بولموق بولوت ، قايتادان قوزغىتامدۇ؟ Reboot Later سەل تۇرۇپ قايرا قوزعوتۇڭ Reboot Immediately داروو قايتادان قوزعوتۇۇ Take effect after rebooting قايرا قوزعوتقوندون كىيىن كۉچۉنۅ ەە بولموق بولوت installing... قۇراشتىرۇۇ بارىشندا... Net is error,Please check and try again تور بۅتۅنچۅ ، تەكشەرىلگەندەن كىيىن قايرا سىناپ باعىڭ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! بەلگىلەنگەن مودېلنىڭ قۇراشتىرۇۇ سومكاسىن تاپالمىدىم: %1، جۇمشاق تەتىك قاينارى جانا تور ابالىن تەكشەرىپ قايتادان سىناپ باعىڭ! The current model installation package is not installed, it can be downloaded and installed گەزەكتە مودەل ورنوتۇ سومكاسى ورنوتۇلباعان ، تۉشۉرۉ جانا ورنوتۇقا بولوت New version needs to be updated upon discovery جاڭى نۇسقاسىن بايقىماق The current model is already the latest model گەزەكتە مودەل تەە مۇردا ەڭ جاڭى مودەل Current model version is the lastest version بۇل نۇسقا تەە مۇردا ەڭ جاڭى Current model install failed,please install manually. قاتاا ورنوتۇ ، قولدو ورنوتۇڭ Detect updates تەكشەرىش جاڭىلانۇسۇ تەكشۈ kylin-ai-subsystem-modelconfig_QMessageBox_installSuccess 安装成功! Tips 提示 Current model deb install finished 模型安装完成 ModelCallPriority Model call priority مودەل جۅتكۅپ ىشتەتىش وزوت داراجاسى Cloud model first (Kylin Certification) 优先云端模型(麒麟认证) Local model first (Kylin Certification) 优先本地模型(麒麟认证) Cloud model first 优先云端模型 Local model first 优先本地模型 Private model first 优先自选模型 Model Call Priority مودەل جۅتكۅپ ىشتەتىش وزوت داراجاسى ModelConfigDialog Ok ماقۇل Model Type مودەل تۉرۉ Voice dictation & online voice synthesis (streaming version) دوبۇش ۇعۇپ جازۇۇ : توردو دوبۇش بىرىكتىرىش ( اعىم تۉرۉندۅگۉ ۉلگۉسۉ ) Real time voice transcription دوبۇش ايلاندىرىپ جازۇۇ Model Configuration Tutorial مودەل سەپتەش دەرسلىكى Cancel ارعادان قالتىرىش Accept قابىلدوو جاسوو ،اتقارۇۇ Add قوشۇۇ Cannot contain spaces, please re-enter! بوشتۇقتۇ ۅز ىچىنە السا بولبويت ، قايتادان كىرگىزىڭ ! Add-NLP Model قوشۇۇ - تەكىست نۇسقا ، قالپ Add-Visual Model قوشۇۇ - سۉرۅت تۉرۉندۅگۉ مودەل Add-Speech Model قوشۇۇ - دوبۇش نۇسقا ، قالپ Required مۉلدۅ تولتۇرۇ Edit-NLP Model تۅپتۅۅچۉ - تەكىست تۉرۉندۅگۉ مودېللار Edit-Visual Model تۅپتۅۅچۉ - سۉرۅت تۉرۉندۅگۉ مودېللار Edit-Speech Model تۅپتۅۅچۉ - دوبۇش تۉرۉندۅگۉ مودېللار The model type already exists. Cannot be repeated! تەە مۇردا بۇل مودەل باربولۇۇسۇ بولۇپ قالدى ،قايرا قوشۇۇعا بولبويت Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Adding model failed قوشۇۇ نۇسقا ، قالپ جەڭىلۉۉ بولدۇ Close 关闭 APPID APPID No account? Get Now 没有账号?立即获取 ModelDownload The current environment's dbus interface is abnormal گەزەكتە چۅرۅسۉ dbus ۇلوو ووزۇ بۅتۅنچۅ The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىش ارقىلۇۇ "AI جاردامچىسى" ۉلگۉسۉنۉن ۅتۅ تۅمۅن بولۇپ، بۅلۉمچۅ ساامالىق مەنەن شاي كەلمەيدىغانلىقى، قۇرباتى چەكتەمەگە ۇچۇرايتۇرعاندىعىن بايقادى. نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىش ارقىلۇۇ " بوتۇلكىلىق تەز قاتىرەسىن " ۉلگۉسۉنۉن ۅتۅ تۅمۅن بولۇپ ، بۅلۉمچۅ ساامالىعى مەنەن شاي كەلمەيدىغانلىقى ، قۇرباتى چەكتەمەگە ۇچۇرايت . نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشەرىش ارقىلۇۇ "AI جاردامچىسى"، "بوتۇلكىلىق تەزدىك قاتىرەسىن" ۉلگۉسۉنۉن ۅتۅ تۅمۅن بولۇپ، بۅلۉمچۅ ساامالىعى مەنەن شاي كەلمەيدىغانلىقى، قۇرباتى چەكتەمەگە ۇچۇرايت. نورماال ئىشلىتىلىشكە ەەبولۇۇ جاسوو ،اتقارۇۇ ۉچۉن ەڭ جاڭى نۇسقاعا ۅزگۅرتۉڭ. Tips تۉرۉ Backend init failed ارقا بۅلۅگۉ العاچقى تەرەپلىشىش جەڭىلۉۉ بولدۇ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 未找到指定模型的安装包:%1,请检查软件源及网络状态并重新尝试! The current model installation package is not installed, it can be downloaded and installed 当前模型安装包未安装,可以下载及安装 New version needs to be updated upon discovery 发现新版本 The current model is already the latest model 当前模型已经是最新模型 Cancel download failed 取消下载失败 ModelItem Edit تۅپتۅۅچۉ Delete ۅچۉرۉۉ ModelWidget Sort Upwards 排序靠前 Increase priority الدىن كۅرۅرلۉك چەگىن ۅستۉرۉۉ كەرەك Increase Priority الدىن كۅرۅرلۉك چەگىن ۅستۉرۉۉ كەرەك Configure تۉزۉلمۅ PrivateModelConfigDialog Ok ماقۇل Add-NLP Model قوشۇۇ - تەكىست نۇسقا ، قالپ Add-Visual Model قوشۇۇ - سۉرۅت تۉرۉندۅگۉ مودەل Add-Speech Model قوشۇۇ - دوبۇش نۇسقا ، قالپ Edit-NLP Model تۅپتۅۅچۉ - تەكىست تۉرۉندۅگۉ مودېللار Edit-Visual Model تۅپتۅۅچۉ - سۉرۅت تۉرۉندۅگۉ مودېللار Edit-Speech Model تۅپتۅۅچۉ - دوبۇش تۉرۉندۅگۉ مودېللار CustomName ۅزۉ بەلگىلۅۅ ناامى ModelName مودەل ناامى RequestUrl ئۆتۈنۈش دايىن وردۇ Required (To distinguish models) سۅزسۉز تولتۇرۇ ( ايىرمالاندىرىش نۇسقا ، قالپ ) Optional تانداپ تولتۇرۇ Optional (Required for cloud services) تانداش ( بۇلۇتلۇق تەيلۅۅ سۅزسۉز تولتۇرۇ ) Required مۉلدۅ تولتۇرۇ Cancel ارعادان قالتىرىش Accept قابىلدوو جاسوو ،اتقارۇۇ The length must not exceed 32 characters ۇزۇندۇعۇ 32 قاتتان چوڭ بولبوستۇعۇ كەرەك Cannot contain spaces, please re-enter! بوشتۇقتۇ ۅز ىچىنە السا بولبويت ، قايتادان كىرگىزىڭ ! Duplicate name, please re-enter! ات تەكرارلىنىدۇ،قايتادان كىرگىزىڭ Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Adding model failed قوشۇۇ نۇسقا ، قالپ جەڭىلۉۉ بولدۇ Close 关闭 The model type already exists. Cannot be repeated! 已存在该模型类型,不可重复添加 APPID APPID PrivateModelConfigWidget Private Model ۅزۉ تاندايتۇرعان مودەل Flexible model management to meet personalized usage scenarios جاندۇۇ مودەل باشقارىش ارعاسى قاسىيەت ىشتەتىلۉۉ گۅرۉنۉشۉن قاندۇرۇش كەرەك NLP Model تەكىست نۇسقا ، قالپ Processing and generating text, such as understanding text and answering questions جازۇۇسۇن بىر تاراپ جاسوو ،اتقارۇۇ جانا پايدا قىلۇۇ جاسوو ،اتقارۇۇ ، مىسالى تەكىستتى تۉشۅنۉۉ، سوئالغا جووپ بەرۉۉ Add قوشۇۇ OK ماقۇل Failed to delete model مودەلدى ۅندۉرۉپ تاشتاش جەڭىلۉۉ بولدۇ Model setup failed مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ جەڭىلۉۉ بولدۇ Model Editing failed مودەل تۅپتۅش جەڭىلۉۉ بولدۇ Model switching failed تانداش نۇسقا ، قالپ جاساپ تەڭشۅۅ جەڭىلۉۉ بولدۇ Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? Delete 删除 PrivateModelItemWidget Edit تۅپتۅۅچۉ Delete ۅچۉرۉۉ QAptDownLoadDeb Tips 提示 Backend init failed 后端初始化失败 %1 package not founds %1 安装包未找到 Failed to create transaction. 事件创建失败 Package could not be update. 无法更新包 The current model is already the latest model 当前模型已经是最新模型 New version needs to be updated upon discovery 发现新版本 QObject Cancel ارعادان قالتىرىش Ok ماقۇل Sorry, the model is currently executing another task. Please try again after it is completed.. كەچۈرۈڭ، بۇ مودېل ھازىر باشقا ۋەزىپىلەرنى ئىجرا قىلىۋاتىدۇ، تاماملانغاندىن كېيىن قايتا سىناپ بېقىڭ. Retry قايرا سىناپ باعۇۇ Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? بۇلل مودەلدى ۅندۉرۉپ تاشتاش بۇلل مودەلدىڭ ىشتەتىلىشىنە سۅۅنۉپ نورماال ئىشلىتەلمەسلىكىنى كەلىترىپ چىعارات، سىز يۇيىۋېتىشنى تۇراقتاندىرا الاسىزبى؟ Delete ۅچۉرۉۉ Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Cloud model first (Kylin Certification) الدىن بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Local model first (Kylin Certification) الدىن جەردىك مودەل ( بوتۇلكا ىسپاتتوو ) Custom model first ئالدىن ئۆزى تاللايدىغان مودېل Private model first 优先自选模型 Cloud Model First (Kylin Certification) الدىن بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Local Model First (Kylin Certification) الدىن جەردىك مودەل ( بوتۇلكا ىسپاتتوو ) Custom Model First ئالدىن ئۆزى تاللايدىغان مودېل SubSystemInstallModule AIModuleManager AI模块管理 AI SubSystem بۅلۉمچۅ ساامالىق AI /aisubsystem/AI SubSystem aisubsystem AI子系统 loading plugin قىستىرما تەتىك قاچالوو بارىشندا... AI Models مودەل باشقارىش AI Model Configuration مودەل بۅلۉشتۉرۉ /aisubsystem/Model Configuration SubSystemWidget AI SubSystem بۅلۉمچۅ ساامالىق AI Ai SubSystem AI子系统 Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、数据管家、记忆地图、麒麟速记等。 Version: %1 باسما نومۇرۇ :%1 Install 安装 LogOut immediately 立即注销 Update 更新 Detect Update تەكشەرىش جاڭىلانۇسۇ تەكشۈ UnInstall يۈكنى تۉشۉرۉ Install success! قۇراشتىرۇۇ جەڭىشتۉۉ بولدۇ ! The AI subsystem has been installed and needs to be logged out before it can take effect. Do you want to log out? AI子系统已经安装完成,需要注销后才能生效,是否注销? Are you sure you want to uninstall the AI subsystem? AI بۅلۉمچۅ سەستىمانى تۉشۉرۉنۉ تۇراقتاندىرا الاسىزبى؟ After uninstallation, the AI services of related applications will not be available. يۈكنى تۉشۉرگۅندۅن كىيىن، بايلانىشتۇۇ قولدونۇلاتۇرعان AI مۇلازىمەتىردى ىشتەتكەلى بولبويت . Uninstall ۅچۉرۉۉ AI service unavailable قىزماتتى ىشتەتكەلى بولبويت AI The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. AI بۅلۉمچۅ سەستىمانى تەكشەرىپ بايقىمىغاندا، قولدونۇلعان AI مۇلازىمەتىردى ىشتەتكەلى بولبويت . ساامالىق قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ > AI نۇسقاسىن باشقارىش بەتىنە بەرىپ قۇراشتىرىڭ. Go Now داروو بارىمەن Installing... قاچالاپ جاتات... Installation failed, necessary files are missing. قۇراشتىرۇۇ جەڭىلۉۉ بولدۇ ، زارىل ۅجۅت گەمچىل بولۇش Network abnormality, please check the network connection and try again. تور بۅتۅنچۅ ، تور ۇلانعاندىعىن تەكشەرگەندەن كىيىن قايرا سىناپ باعىڭ Installed, effective after logging out. 已安装,注销后生效 Detecting And Update... تەكشەرىش جاڭىلوو بارىشندا... The current version is already the latest version: %1 Last detection time: %2 گەزەكتە ەڭ جاڭى ۉلگۉسۉ : %1 الدىنقى ىرەت تەكشەرىش ۇباقتى: 2 Version: %1 Last detection time: %2 ۉلگۉسۉ : 1 الدىنقى ىرەت تەكشەرىش ۇباقتى: 2 Detected an upgradable version: %1 Last detection time: %2 تەكشەرىپ بايقاعاندا جاڭىرتقالى بولوتۇرعان ۉلگۉسۉ : %1 الدىنقى ىرەت تەكشەرىش ۇباقتى: 2 Uninstalling... جۉك تۉشۉرۉ بارىشندا... Cancel ارعادان قالتىرىش LogOut Later 稍后注销 LogOut Immediately 立即注销 Reboot Immediately داروو قايتادان قوزعوتۇۇ Reboot Later سەل تۇرۇپ قايرا قوزعوتۇڭ The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? AI بۅلۉمچۅ ساامالىعى قۇراشتۇرۇلۇپ بولدۇ ، سەستىمانى قايتادان قوزعوعوندون كىيىن اندان كۉچۉنۅ ەە بولموق بولوت ، قايتادان قوزغىتامدۇ؟ Installed, effective after restarting. قۇراشتۇرۇلۇپ قايتادان قوزعوتقوندون كىيىن كۉچۉنۅ ەە بولموق loading جۉك قاچالوو بارىشندا... Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、记忆地图、麒麟速记等。 Kylin Ai SubSystem 麒麟AI子系统 Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. 为AI应用和AI功能提供运行环境。如模型文件、运行时库、配置参数等。 Kylin AI SubSystem بولىن AI بۅلۉمچۅ ساامالىعى Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. AI قولدونۇش جانا AI قۇرباتىن يۈرۈشتۈرۈش چۅيرۅسۉ مەنەن قامدايت . مىسالى مودەل ۅجۅت ، يۈرۈشتۈرۈش ۇباقىت قازىناعى ، سەپتەش پارامەتىرى قاتارلۇۇلار . TestAiSubSystem Model Configuration مودەل بۅلۉشتۉرۉ Cloud Model (Kylin Certification) بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) بوتۇلكىلىق گۇۋاھنامەدىن ۅتكۅن بۇلۇتلۇق مودەل تاقسىمدالعان ( بۇلۇتلۇق مۇلازىمەتچىگە ورۇنداشتىرىلعان ، تور ارقىلۇۇ زىيارات جاسوو ،اتقارۇۇ جانا ىشتەتىش ) Local Model (Kylin Certification) جەردىك مودەل ( بوتۇلكا ىسپاتتوو ) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) بوتۇلكىلىق گۇۋاھنامەدىن ۅتكۅن جەردىك مودەل تاقسىمدالعان (جەردىك اسپاپتارعا ورنوتۇلعان، تور ھاجەتسىزمۇ يۈرۈشتۈرگىلى بولوت ) Custom Model ۅزۉ تاندايتۇرعان مودەل Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) بوتۇلكىنىڭ ئىسپاتلىشىدىن ۅتپۅگۅن جەردىك مودەل ۅجۅت، رايون ،چۅلكۅم تورۇ جانا جالپى ئشتەتىلە تۇرعان بۇلۇت مودەلى سەپتەمەسى (ەگەر سىزگە قولايسىزلىق الىپ كەلسە كەچىرۉۉ) Failed to set cloud model priority بۇلۇتلۇق مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاساشتىن وزوت داراجاسى جەڭىلۉۉ بولدۇ Failed to set local model priority جەردىك مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاسوو ،اتقارۇۇ وزوت داراجاسى جەڭىلۉۉ بولدۇ Failed to set custom model priority ۅزۉ تاندايتۇرعان مودەل قۇرۇۇ ، اچۇۇ ، باشتوو جاساشتىن وزوت داراجاسى جەڭىلۉۉ بولدۇ Cloud model (recommended) 云端模型(推荐) Local Model (recommended) 本地模型(推荐) Cloud model (Kylin Certification) بۇلۇتلۇق مودەل ( بوتۇلكىلىق ىسپاتتوو ) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this has caused any inconvenience to you, please understand) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this causes any inconvenience, please accept our sincere apologies.) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Deployed on the cloud server, access and use over the network 部署在云端服务器,通过网络访问和使用 Installed on local equipment, it can run without network 安装在本地设备上,无需网络也可运行 Private Model 自选模型 Flexible model management to meet personalized usage scenarios 灵活的模型管理方式,满足个性化使用场景 UpdateNotificationWidget Tips 提示 Apt update failed. 更新失败 Current downloading value is 100,now the model is install ,current can not stop . 下载进度为100时无法取消安装模型 Current model is downloading now ,Are you sure you to cancel the download? 模型正在下载,确定取消下载吗? kylin-ai-subsystem-plugin-1.0.0.2/translations/mn.ts000066400000000000000000002470071520576575000224460ustar00rootroot00000000000000 AddBtn Add ᠨᠡᠮᠡᠯᠲᠡ AddButton Add ᠨᠡᠮᠡᠯᠲᠡ AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. ᠬᠡᠰᠡᠭ AI ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠦ ᠬᠡᠪᠯᠡᠯ ᠬᠡᠲᠦᠷᠬᠡᠶ ᠳᠣᠤᠷ᠎ᠠ ᠂ ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠲᠡᠶ ᠪᠠᠭᠲᠠᠭᠠᠮᠵᠢ ᠦᠭᠡᠶ ᠪᠣᠯ ᠴᠢᠳᠠᠮᠵᠢ ᠨᠢ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠭᠳᠠᠬᠤ ᠪᠣᠯᠣᠮᠵᠢ ᠲᠠᠶ ᠃ ᠬᠠᠮᠤᠭ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠪᠣᠯᠲᠠᠯ᠎ᠠ ᠳᠡᠰ ᠳᠡᠪᠰᠢᠭᠦᠯᠵᠦ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠬᠡᠷᠡᠭ᠍ᠯᠡᠬᠦ ᠶᠢ ᠦᠨᠡᠨᠬᠦ ᠪᠠᠲᠤᠯᠠᠭᠠᠷᠠᠢ ᠃ Go to update ᠰᠢᠨᠡᠳᠬᠡᠨ᠎ᠡ ᠃ CloudModelConfigWidget Cloud Model ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Deployed on the cloud server, access and use over the network ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠦᠷ ᠲᠦ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠵᠤ ᠂ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠪᠡᠷ ᠳᠠᠮᠵᠢᠭᠤᠯᠤᠨ ᠰᠤᠷᠪᠤᠯᠵᠢᠯᠠᠬᠤ ᠪᠠ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ NLP Model ᠳᠠᠢᠢᠰᠺᠸᠲ ᠲᠦᠷᠦᠯ ᠦᠨ ᠮᠣᠳᠧᠯ Processing and generating text, such as understanding text and answering questions ᠰᠢᠶᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠪᠠ ᠦᠰᠦᠭ ᠡᠭᠦᠰᠭᠡᠬᠦ ᠂ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠲᠧᠺᠰᠲ ᠢ ᠣᠶᠢᠯᠭᠠᠬᠤ ᠂ ᠠᠰᠠᠭᠤᠯᠲᠠ ᠶᠢ ᠬᠠᠷᠢᠭᠤᠯᠬᠤ Add ᠨᠡᠮᠡᠯᠲᠡ Visual Model ᠵᠢᠷᠤᠭ ᠳᠦᠷᠰᠦᠲᠦ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ᠃ Processing and generating images, such as recognizing objects and analyzing scenes ᠰᠢᠶᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠪᠠ ᠵᠢᠷᠤᠭ ᠪᠦᠲᠦᠭᠡᠬᠦ ᠂ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠪᠣᠳᠠᠰ ᠢ ᠢᠯᠭᠠᠨ ᠲᠠᠨᠢᠬᠤ ᠂ ᠦᠵᠡᠭᠳᠡᠯ ᠢ ᠵᠠᠳᠠᠯᠬᠤ Speech Model ᠠᠪᠢᠶᠠᠨ ᠤ ᠲᠦᠷᠦᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Processing sound and speech, such as recognizing speech and synthesizing speech ᠠᠪᠢᠶ᠎ᠠ ᠪᠣᠯᠣᠨ ᠠᠪᠢᠶ᠎ᠠ ᠶᠢ ᠰᠢᠢᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠂ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠠᠪᠢᠶ᠎ᠠ ᠢᠯᠭᠠᠬᠤ ᠂ ᠨᠡᠶᠢᠯᠡᠮᠡᠯ ᠠᠪᠢᠶ᠎ᠠ ᠶᠢ ᠢᠯᠭᠠᠬᠤ ᠃ OK ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Model switching failed ᠰᠣᠩᠭᠣᠯᠲᠠ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ ᠢᠶᠠᠷ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠭᠰᠠᠨ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠭᠰᠠᠨ Failed to delete model ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠠᠰᠤᠵᠤ ᠢᠯᠠᠭᠳᠠᠯ ᠢ ᠬᠠᠰᠤᠨ᠎ᠠ ᠃ Model setup failed ᠵᠠᠭᠪᠤᠷ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠤᠭᠠᠳ ᠳᠡᠶᠢᠯᠦᠭᠰᠡᠨ ᠦᠭᠡᠢ Model Editing failed ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ ᠢᠯᠠᠭᠳᠠᠵᠠᠢ ᠃ Cloud model ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Free Trial Account ᠲᠥᠯᠥᠪᠦᠷᠢ ᠥᠭ᠋ᠡᠢ ᠲᠤᠷᠰᠢᠨ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠳᠠᠩᠰᠠᠨ ᠨᠣᠮᠧᠷ Sorry, the model is currently executing another task. Please try again after it is completed. ᠠᠭᠤᠴᠢᠯᠠᠭᠠᠷᠠᠶ ᠂ ᠡᠨᠡ ᠵᠠᠭᠪᠤᠷ ᠣᠳᠣᠬᠠᠨ ᠳᠤ ᠶᠠᠭ ᠪᠤᠰᠤᠳ ᠡᠭᠦᠷᠭᠡ ᠶᠢ ᠭᠦᠢᠴᠡᠳᠬᠡᠵᠦ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠪᠡᠶᠡᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠬᠤ ᠶᠢ ᠬᠦᠯᠢᠶᠡᠵᠦ ᠪᠠᠢ᠌ᠭᠠᠷᠠᠢ ᠃ Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? ᠡᠨᠡ ᠬᠦ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠠᠰᠤᠪᠠᠯ ᠡᠨᠡ ᠬᠦ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠳᠦ ᠲᠦᠰᠢᠭᠯᠡᠭᠡᠳ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠴᠢᠳᠠᠬᠤ ᠤᠢᠭᠡᠢ ᠪᠤᠯᠵᠦ ᠮᠡᠳᠡᠨ᠎ᠡ᠂ ᠲᠠ ᠯᠠᠪᠲᠠᠶ ᠬᠠᠰᠤᠨ᠎ᠠ ᠤᠣ? kylin-aiassistant AI 助手 Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. ᠣᠰᠣᠯᠳᠠᠯ᠎ᠠ ᠂ ᠣᠳᠣᠬᠠᠨ ᠳᠤ AI ᠬᠠᠪᠰᠤᠷᠤᠭᠴᠢ ᠶᠠᠭ ᠡᠶᠢᠮᠦ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠡᠷᠡᠭᠯᠡᠵᠦ ᠪᠠᠶᠢᠨ᠎ᠠ ᠂ ᠡᠭᠦᠷᠭᠡ ᠳᠠᠭᠤᠰᠤᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠵᠤ ᠦᠵᠡᠭᠡᠷᠡᠢ ᠃ Retry ᠲᠡᠬᠢᠠ ᠲᠤᠷᠰᠢᠬᠤ Delete ᠲᠡᠮᠳᠡᠭ᠎ᠢ᠋ ᠤᠰᠠᠳᠬᠠᠬᠤ LocalModelConfigWidget Local Model ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ ᠃ Installed on local equipment, it can run without network ᠲᠤᠬᠠᠶ ᠶᠢᠨ ᠭᠠᠵᠠᠷ ᠤᠨ ᠲᠥᠬᠥᠭᠡᠷᠦᠮᠵᠢ ᠳᠦ ᠤᠭᠰᠠᠷᠠᠪᠠᠯ ᠂ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠦᠭᠡᠢ ᠪᠡᠷ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠪᠣᠯᠤᠨ᠎ᠠ ᠃ (Installing/uninstalling models requires a reboot to take effect) (ᠡᠨᠡ ᠮᠣᠳᠧᠯ ᠢ ᠤᠭᠰᠠᠷᠠᠬᠤ / ᠨᠡᠭᠦᠯᠬᠦ ᠳᠦ ᠳᠠᠬᠢᠨ ᠠᠵᠢᠯᠯᠠᠭᠤᠯᠬᠤ ᠶᠢᠨ ᠰᠠᠶᠢ ᠬᠦᠴᠦᠨ ᠴᠢᠬᠤᠯᠠ ᠲᠠᠢ ᠃) Install ᠤᠭᠰᠠᠷᠠᠭᠤᠯᠬᠤ Update/Uninstall ᠰᠢᠨᠡᠳᠬᠡᠬᠦ/ᠠᠴᠢᠶ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ Built in model of the system ᠰᠢᠰᠲ᠋ᠧᠮ ᠦᠨ ᠳᠣᠲᠣᠭᠠᠳᠤ ᠵᠠᠭᠪᠤᠷ The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation ᠵᠢᠷᠤᠭ ᠳᠦᠷᠰᠦ ᠶᠢ ᠢᠯᠭᠠᠨ ᠲᠠᠨᠢᠬᠤ ᠂ ᠬᠡᠮᠵᠢᠶᠡᠯᠡᠬᠦ ᠂ ᠠᠪᠢᠶ᠎ᠠ ᠶᠢ ᠰᠢᠶᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠵᠡᠷᠭᠡ ᠪᠤᠰᠤᠳ ᠰᠢᠰᠲ᠋ᠧᠮ ᠦᠨ ᠠᠵᠢᠯᠯᠠᠭᠠᠨ ᠳᠤ ᠬᠡᠷᠡᠭᠰᠡᠬᠦ ᠵᠠᠭᠪᠤᠷ NLP Model ᠪᠢᠴᠢᠭ᠌ ᠦᠨ ᠲᠦᠷᠦᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ ᠃ Processing and generating text, such as understanding text and answering questions ᠦᠰᠦᠭ ᠪᠢᠴᠢᠭ᠌ ᠢ ᠰᠢᠢᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠪᠠ ᠦᠰᠦᠭ ᠪᠢᠴᠢᠭ᠌ ᠪᠣᠯᠭᠠᠨ᠎ᠠ ᠂ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠪᠢᠴᠢᠭ᠌ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ ᠢ ᠣᠢ᠌ᠯᠠᠭᠠᠬᠤ ᠂ ᠠᠰᠠᠭᠤᠯᠲᠠ ᠶᠢ ᠬᠠᠷᠢᠭᠤᠯᠬᠤ᠃ OK ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Are you sure you want to exit? ᠯᠠᠪᠲᠠᠶ ᠤᠬᠤᠷᠢᠵᠤ ᠭᠠᠷᠤᠨ᠎ᠠ ᠤᠣ? The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? ᠮᠣᠳᠧᠯ ᠢ ᠶᠠᠭ ᠤᠭᠰᠠᠷᠠᠵᠤ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠤᠬᠤᠷᠢᠵᠤ ᠭᠠᠷᠪᠠᠯ ᠤᠭᠰᠠᠷᠠᠬᠤ ᠳᠤ ᠪᠡᠷᠬᠡ ᠪᠣᠯᠵᠤ ᠮᠡᠳᠡᠨ᠎ᠡ ᠃ ᠤᠬᠤᠷᠢᠵᠤ ᠭᠠᠷᠬᠤ ᠶᠢ ᠲᠣᠭᠲᠠᠭᠠᠨ᠎ᠠ ᠤᠣ ᠦᠭᠡᠢ ᠦᠸ? Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Quit ᠤᠬᠤᠷᠢᠵᠤ ᠭᠠᠷᠤᠨ᠎ᠠ ᠃ Exit current window? ᠣᠳᠣᠬᠠᠨ ᠤ ᠴᠣᠩᠬᠣ ᠠᠴᠠ ᠭᠠᠷᠬᠤ ᠤᠸ? The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. ᠵᠠᠭᠪᠤᠷ ᠢ ᠤᠭᠰᠠᠷᠠᠬᠤ ᠨᠢ ᠦᠷᠭᠦᠯᠵᠢᠯᠡᠨ ᠠᠷᠤ ᠲᠠᠯ᠎ᠠ ᠳᠤ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠂ ᠪᠡᠶᠡᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠬᠦᠴᠦᠨ ᠲᠡᠶ ᠪᠣᠯᠣᠨ᠎ᠠ ᠃ Built in model group ᠳᠣᠲᠣᠭᠠᠳᠤ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠳᠤᠭᠤᠶᠢᠯᠠᠩ ᠃ Model setup failed ᠮᠣᠳᠧᠯ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠬᠤ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠪᠠ Model switching failed ᠰᠣᠩᠭ᠋ᠣᠭᠰᠠᠨ ᠮᠤᠳᠸᠯ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠵᠠᠢ Installing/uninstalling models requires a restart to take effect ᠡᠨᠡ ᠮᠣᠳᠧᠯ ᠢ ᠤᠭᠰᠠᠷᠠᠬᠤ / ᠨᠡᠭᠦᠯᠬᠦ ᠳᠦ ᠳᠠᠬᠢᠨ ᠠᠵᠢᠯᠯᠠᠭᠤᠯᠬᠤ ᠶᠢᠨ ᠰᠠᠶᠢ ᠬᠦᠴᠦᠨ ᠴᠢᠬᠤᠯᠠ ᠲᠠᠢ ᠃ After downloading and installing, a restart is required to take effect ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠤᠭᠰᠠᠷᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠪᠡᠯ ᠬᠦᠴᠦᠨ ᠲᠡᠶ ᠪᠣᠯᠤᠨ᠎ᠠ After downloading and installing, you need to log out for it to take effect ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠶᠢᠨ ᠬᠠᠮᠲᠤ ᠤᠭᠰᠠᠷᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠂ ᠲᠠ ᠬᠦᠴᠦᠨ ᠲᠡᠢ ᠪᠣᠯᠭᠠᠪᠠᠯ ᠰᠠᠶ ᠢ ᠬᠦᠴᠦᠨ ᠲᠡᠢ ᠪᠣᠯᠣᠨ᠎ᠠ ᠃ (The installation/uninstallation of the model will take effect after logging out) (ᠤᠭᠰᠠᠷᠠᠬᠤ / ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠦᠴᠦᠨ ᠦᠭᠡᠶ ᠪᠣᠯᠭᠠᠬᠤ ᠴᠢᠬᠤᠯᠠ ᠲᠠᠶ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠬᠦᠴᠦᠨ ᠲᠡᠶ ᠪᠣᠯᠤᠨ᠎ᠠ᠃) The installation/uninstallation of the model will take effect after logging out ᠤᠭᠰᠠᠷᠠᠬᠤ / ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠦᠴᠦᠨ ᠦᠭᠡᠶ ᠪᠣᠯᠭᠠᠬᠤ ᠴᠢᠬᠤᠯᠠ ᠲᠠᠶ ᠪᠣᠯᠤᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠬᠦᠴᠦᠨ ᠲᠡᠶ ᠪᠣᠯᠤᠨ᠎ᠠ᠃ Sorry, the model is currently executing another task. Please try again after it is completed. ᠠᠭᠤᠴᠢᠯᠠᠭᠠᠷᠠᠶ ᠂ ᠡᠨᠡ ᠵᠠᠭᠪᠤᠷ ᠣᠳᠣᠬᠠᠨ ᠳᠤ ᠶᠠᠭ ᠪᠤᠰᠤᠳ ᠡᠭᠦᠷᠭᠡ ᠶᠢ ᠭᠦᠢᠴᠡᠳᠬᠡᠵᠦ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠪᠡᠶᠡᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠬᠤ ᠶᠢ ᠬᠦᠯᠢᠶᠡᠵᠦ ᠪᠠᠢ᠌ᠭᠠᠷᠠᠢ ᠃ Failed to delete model ᠬᠠᠰᠤᠬᠤ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠢᠯᠠᠭᠳᠠᠯ Installing/uninstalling models requires a reboot to take effect ᠡᠨᠡ ᠮᠣᠳᠧᠯ ᠢ ᠤᠭᠰᠠᠷᠠᠬᠤ / ᠨᠡᠭᠦᠯᠬᠦ ᠳᠦ ᠳᠠᠬᠢᠨ ᠠᠵᠢᠯᠯᠠᠭᠤᠯᠬᠤ ᠶᠢᠨ ᠰᠠᠶᠢ ᠬᠦᠴᠦᠨ ᠴᠢᠬᠤᠯᠠ ᠲᠠᠢ ᠃ Tips ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ Current model not install,you can use the model after install it. ᠣᠳᠣᠬᠢ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠠᠷᠠᠬᠠᠨ ᠰᠠᠭᠤᠯᠭᠠᠳᠤᠢ ᠪᠠᠶᠢᠭᠰᠠᠭᠠᠷ ᠰᠠᠭᠤᠯᠭᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠰᠠᠶᠢ ᠬᠡᠪ ᠡᠶᠡᠷ ᠬᠡᠷᠡᠭᠯᠡᠵᠦ ᠪᠣᠯᠣᠨ᠎ᠠ ᠃ Install Now ᠳᠠᠷᠤᠢ ᠲᠦᠷᠭᠡᠨ ᠰᠠᠭᠤᠯᠭᠠᠬᠤ Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. ᠣᠰᠣᠯᠳᠠᠯ᠎ᠠ ᠂ ᠣᠳᠣᠬᠠᠨ ᠳᠤ AI ᠬᠠᠪᠰᠤᠷᠤᠭᠴᠢ ᠶᠠᠭ ᠡᠶᠢᠮᠦ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠡᠷᠡᠭᠯᠡᠵᠦ ᠪᠠᠶᠢᠨ᠎ᠠ ᠂ ᠡᠭᠦᠷᠭᠡ ᠳᠠᠭᠤᠰᠤᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠵᠤ ᠦᠵᠡᠭᠡᠷᠡᠢ ᠃ Retry ᠲᠡᠬᠢᠠ ᠲᠤᠷᠰᠢᠬᠤ kylin-aiassistant AI 助手 Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Add 添加 LocalModelItem Detect updates ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠵᠦ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ Effective after reboot ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠬᠦᠴᠦᠨ ᠲᠠᠢ ᠪᠣᠯᠬᠤ Effective after reboot . ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠬᠦᠴᠦᠨ ᠲᠠᠢ ᠪᠣᠯᠬᠤ Detect Updates ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠵᠦ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ Install success! ᠤᠭᠰᠠᠷᠠᠵᠤ ᠠᠮᠵᠢᠯᠲᠠ ᠣᠯᠵᠠᠢ ! The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? ᠵᠠᠭᠪᠤᠷ ᠢ ᠨᠢᠭᠡᠨᠲᠡ ᠤᠭᠰᠠᠷᠠᠵᠤ ᠳᠠᠭᠤᠰᠴᠤ᠂ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠰᠠᠶ᠋ᠢ ᠬᠦᠴᠦᠨ ᠲᠠᠢ ᠪᠣᠯᠤᠨ᠎ᠠ᠂ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠤᠤ? Reboot Later ᠤᠳᠠᠰᠬᠢᠭᠡᠳ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠬᠦ Reboot Immediately ᠳᠠᠷᠤᠢ ᠲᠦᠷᠭᠡᠨ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠬᠦ Take effect after rebooting ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠬᠦᠴᠦᠨ ᠲᠠᠢ ᠪᠣᠯᠬᠤ installing... ᠤᠭᠰᠠᠷᠠᠵᠤ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠃ Net is error,Please check and try again ᠲᠣᠣᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠡᠪ ᠦᠨ ᠪᠤᠰᠤ ᠂ ᠪᠠᠶᠢᠴᠠᠭᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠭᠠᠷᠠᠢ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! ᠵᠢᠭᠠᠨ ᠲᠣᠭᠲᠠᠭᠠᠭᠰᠠᠨ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠰᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠶᠢ ᠡᠷᠢᠵᠦ ᠣᠯᠣᠭᠰᠠᠨ ᠦᠭᠡᠢ᠌:%1᠂ ᠰᠣᠹᠲ᠋ᠸᠠᠶᠢᠷ ᠤᠨ ᠡᠬᠢ ᠪᠣᠯᠣᠨ ᠨᠡᠲ᠋ ᠦᠨ ᠪᠠᠶᠢᠳᠠᠯ ᠢ ᠪᠠᠶᠢᠴᠠᠭᠠᠵᠤ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠭᠠᠷᠠᠢ The current model installation package is not installed, it can be downloaded and installed ᠣᠳᠣᠬᠢ ᠵᠠᠭᠪᠤᠷ ᠰᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠶᠢ ᠰᠠᠭᠤᠯᠭᠠᠭᠰᠠᠨ ᠦᠭᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠣᠯᠣᠨᠰᠠᠭᠤᠯᠭᠠᠵᠤ ᠪᠣᠯᠣᠨ᠎ᠠ New version needs to be updated upon discovery ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠢ ᠢᠯᠡᠷᠡᠭᠦᠯᠬᠦ The current model is already the latest model ᠣᠳᠣᠬᠢ ᠵᠠᠭᠪᠤᠷ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠠᠮᠤᠭ ᠰᠢᠨ᠎ᠡ ᠵᠠᠭᠪᠤᠷ ᠪᠣᠯᠵᠠᠢ Current model version is the lastest version ᠲᠤᠰ ᠬᠡᠪᠯᠡᠯ ᠨᠢ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠠᠮᠤᠭ ᠰᠢᠨ᠎ᠡ Current model install failed,please install manually. ᠰᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠤᠷᠤᠭᠤ ᠭᠠᠷ ᠡᠶᠡᠷ ᠰᠠᠭᠤᠯᠭᠠᠭᠠᠷᠠᠢ ᠃ Tips ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ModelCallPriority Model call priority ᠵᠠᠭᠪᠤᠷ ᠲᠤᠬᠢᠷᠠᠭᠤᠯᠤᠨ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠲᠡᠷᠢᠭᠦᠯᠬᠦ ᠳᠡᠰ Cloud model first (Kylin Certification) ᠲᠡᠷᠢᠭᠦᠨ ᠦ ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠮᠣᠳᠧᠯ (Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠃) Local model first (Kylin Certification) ᠤᠷᠢᠳᠠᠪᠠᠷ ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ ᠢ ᠡᠩ ᠲᠡᠷᠢᠭᠦᠨ ᠳᠦ ᠪᠠᠶᠢᠯ(Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠃) Cloud model first ᠲᠡᠷᠢᠬᠦᠯᠡᠬᠦ ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠬᠦᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ Local model first ᠲᠡᠷᠢᠬᠦᠯᠡᠬᠦ ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ Private model first ᠤᠷᠢᠳᠠᠪᠠᠷ ᠦᠪᠡᠷ ᠲᠡᠭᠡᠨ ᠰᠤᠩᠭᠤᠬᠤ ᠵᠠᠭᠪᠤᠷ Model Call Priority ᠵᠠᠭᠪᠤᠷ ᠲᠤᠬᠢᠷᠠᠭᠤᠯᠤᠨ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠲᠡᠷᠢᠭᠦᠯᠬᠦ ᠳᠡᠰ ModelConfigDialog Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Model Type ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠦᠷᠦᠯ ᠰᠢᠨᠵᠢ Voice dictation & online voice synthesis (streaming version) ᠠᠪᠢᠶ᠎ᠠ ᠰᠣᠨᠣᠰᠬᠤ ᠪᠢᠴᠢᠭ᠌ ᠪᠢᠴᠢᠬᠦ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳᠡᠭᠡᠷᠡᠬᠢ ᠠᠪᠢᠶ᠎ᠠ ᠨᠡᠶᠢᠯᠡᠮᠡᠯ ( ᠤᠷᠤᠰᠭᠠᠯ ᠮᠠᠶᠢᠭ ᠤᠨ ᠬᠡᠪᠯᠡᠯ ) Real time voice transcription ᠠᠮᠵᠢᠯ ᠬᠤᠭᠤᠴᠠᠭᠠᠨ ᠤ ᠠᠪᠢᠶ᠎ᠠ ᠶᠢ ᠰᠢᠯᠵᠢᠭᠦᠯᠦᠨ ᠪᠢᠴᠢᠬᠦ Model Configuration Tutorial ᠮᠣᠳᠧᠯ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠬᠢᠴᠢᠶᠡᠯ Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Accept ᠨᠤᠲᠠᠯᠠᠬᠤ Add ᠨᠡᠮᠡᠯᠲᠡ Cannot contain spaces, please re-enter! ᠵᠠᠪ ᠲᠠᠢ ᠪᠠᠢ᠌ᠵᠤ ᠪᠣᠯᠬᠤ ᠦᠭᠡᠢ ᠂ ᠳᠠᠬᠢᠨ ᠣᠷᠣᠭᠤᠯᠬᠤ ᠪᠣᠯᠪᠠᠤ ! Add-NLP Model ᠨᠡᠮᠡᠬᠦ - ᠳ᠋ᠣᠺᠦᠮᠡᠨᠲ ᠤᠨ ᠲᠥᠷᠥᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Add-Visual Model ᠨᠡᠮᠡᠬᠦ - ᠢᠮᠡᠭᠧ ᠵᠢᠷᠤᠭ ᠤᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ Add-Speech Model ᠨᠡᠮᠡᠬᠦ - ᠠᠪᠢᠶ᠎ᠠ ᠶᠢᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ᠃ Required ᠵᠠᠪᠠᠯ ᠲᠠᠭᠯᠠᠨ᠎ᠠ ᠃ Edit-NLP Model ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ - ᠳ᠋ᠣᠺᠦᠮᠡᠨᠲ ᠤᠨ ᠲᠥᠷᠥᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Edit-Visual Model ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ - ᠢᠮᠡᠭᠧ ᠵᠢᠷᠤᠭ ᠤᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ Edit-Speech Model ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ - ᠠᠪᠢᠶ᠎ᠠ ᠶᠢᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ᠃ The model type already exists. Cannot be repeated! ᠨᠢᠭᠡᠨᠲᠡ ᠲᠤᠰ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠬᠡᠪᠰᠢᠯ ᠣᠷᠣᠰᠢᠵᠤ ᠪᠠᠶᠢᠨ᠎ᠠ ᠳᠠᠬᠢᠨ ᠳᠠᠪᠲᠠᠨ ᠨᠡᠮᠡᠵᠦ ᠪᠣᠯᠬᠤ ᠦᠭᠡᠢ Model Editing failed ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ ᠶᠢᠨ ᠮᠣᠳᠧᠯ ᠢᠯᠠᠭᠳᠠᠵᠠᠢ Adding model failed ᠵᠠᠭᠪᠤᠷ ᠨᠡᠮᠡᠬᠦ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠪᠠ Close ᠬᠠᠭᠠᠬᠤ ᠂ ᠬᠠᠭᠠᠬᠤ APPID APPID No account? Get Now ᠳᠠᠩᠰᠠᠨ ᠤ ᠨᠣᠮᠧᠷ ᠪᠠᠢ᠌ᠬᠤ ᠦᠭᠡᠢ ᠦᠦ ? ᠳᠠᠷᠤᠢ ᠲᠦᠷᠭᠡᠨ ᠣᠯᠪᠠ᠃ ModelDownload The current environment's dbus interface is abnormal ᠣᠳᠣᠬᠢ ᠣᠷᠴᠢᠨ ᠲᠣᠭᠤᠷᠢᠨ ᠤ dbus ᠵᠠᠯᠭᠠᠰᠤ ᠶᠢᠨ ᠬᠡᠪ ᠤᠨ ᠪᠤᠰᠤ ᠪᠠᠶᠢᠳᠠᠯ The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 《AI ᠬᠠᠪᠰᠤᠷᠤᠭᠴᠢ》 ᠶᠢᠨ ᠬᠡᠪᠯᠡᠯ ᠨᠢ ᠳᠡᠩᠳᠡᠭᠦᠦ ᠳᠣᠣᠷ᠎ᠠ ᠪᠠᠶᠢᠵᠤ᠂ ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠲᠡᠶ ᠵᠣᠬᠢᠴᠠᠬᠤ ᠦᠭᠡᠢ ᠪᠣᠯᠬᠣᠷ᠂ ᠴᠢᠳᠠᠮᠵᠢ ᠶᠢ ᠨᠢ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠵᠤ ᠮᠡᠳᠡᠨ᠎ᠡ᠃ ᠬᠠᠮᠤᠭ ᠤᠨ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠳᠦ ᠳᠡᠪᠰᠢᠭᠦᠯᠦᠭᠡᠳ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠶᠢ ᠪᠠᠲᠤᠯᠠᠭᠠᠷᠠᠶ ᠃ The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 《ᠪᠢᠯᠢᠭᠲᠦ ᠭᠥᠷᠥᠭᠡᠰᠦ ᠶᠢᠨ ᠲᠦᠷᠭᠡᠨ ᠲᠡᠮᠳᠡᠭᠯᠡᠯ》ᠤᠨ ᠬᠡᠪᠯᠡᠯ ᠨᠢ ᠬᠡᠲᠦ ᠳᠣᠸᠷ᠎ᠠ ᠂ ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠲᠡᠶ ᠵᠣᠬᠢᠴᠠᠬᠤ ᠥᠬᠡᠶ ᠪᠣᠯᠬᠣᠷ ᠴᠢᠳᠠᠮᠵᠢ ᠨᠢ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠭᠳᠠᠵᠤ ᠮᠡᠳᠡᠨ᠎ᠡ ᠃ ᠬᠠᠮᠤᠭ ᠤᠨ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠳᠦ ᠳᠡᠪᠰᠢᠭᠦᠯᠦᠭᠡᠳ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠶᠢ ᠪᠠᠲᠤᠯᠠᠭᠠᠷᠠᠶ ᠃ The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 《 AI ᠵᠢᠨ ᠲᠤᠰᠠᠯᠠᠭᠴᠢ 》 ᠂ 《 ᠪᠢᠯᠢᠭᠲᠦ ᠭᠥᠷᠥᠭᠡᠰᠦ ᠶᠢᠨ ᠲᠦᠷᠭᠡᠨ ᠲᠡᠮᠳᠡᠭᠯᠡᠯ 》 ᠤᠨ ᠬᠡᠪᠯᠡᠯ ᠨᠢ ᠬᠡᠲᠦ ᠳᠣᠸᠷ᠎ᠠ ᠪᠠᠶᠢᠵᠤ ᠂ ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠲᠡᠶ ᠵᠣᠬᠢᠴᠠᠬᠤ ᠥᠬᠡᠶ ᠪᠣᠯᠬᠣᠷ ᠴᠢᠳᠠᠮᠵᠢ ᠶᠢ ᠨᠢ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠵᠤ ᠮᠡᠳᠡᠨ᠎ᠡ ᠃ ᠬᠠᠮᠤᠭ ᠤᠨ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠳᠦ ᠳᠡᠪᠰᠢᠭᠦᠯᠦᠭᠡᠳ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠶᠢ ᠪᠠᠲᠤᠯᠠᠭᠠᠷᠠᠶ ᠃ Tips ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ Backend init failed ᠠᠷᠤ ᠦᠵᠦᠭᠦᠷ ᠦ᠋ᠨ ᠠᠩᠬᠠᠵᠢᠷᠠᠭᠤᠯᠤᠯᠲᠠ ᠢᠯᠠᠭᠳᠠᠪᠠ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! ᠵᠢᠭᠠᠨ ᠲᠣᠭᠲᠠᠭᠠᠭᠰᠠᠨ ᠵᠠᠭᠪᠤᠷ ᠤ᠋ᠨ ᠤᠭᠰᠠᠷᠠᠭᠰᠠᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠶ᠋ᠢ ᠡᠷᠢᠵᠦ ᠣᠯᠤᠭᠰᠠᠨ ᠦᠭᠡᠢ ᠄ %1 ᠂ ᠵᠥᠭᠡᠯᠡᠨ ᠲᠣᠨᠣᠭ ᠤ᠋ᠨ ᠡᠬᠢ ᠪᠠ ᠨᠧᠲ ᠦ᠋ᠨ ᠪᠠᠢᠳᠠᠯ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠪᠠᠰᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠱᠢᠵᠤ ᠦᠵᠡᠭᠡᠷᠡᠢ! The current model installation package is not installed, it can be downloaded and installed ᠣᠳᠣᠬᠢ ᠵᠠᠭᠪᠤᠷ ᠰᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠶᠢ ᠰᠠᠭᠤᠯᠭᠠᠭᠰᠠᠨ ᠦᠭᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠣᠯᠣᠨᠰᠠᠭᠤᠯᠭᠠᠵᠤ ᠪᠣᠯᠣᠨ᠎ᠠ New version needs to be updated upon discovery ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠢ ᠣᠯᠵᠤ ᠮᠡᠳᠡᠵᠡᠢ ᠃ The current model is already the latest model ᠣᠳᠣᠬᠢ ᠵᠠᠭᠪᠤᠷ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠠᠮᠤᠭ ᠰᠢᠨ᠎ᠡ ᠵᠠᠭᠪᠤᠷ ᠪᠣᠯᠵᠠᠢ ModelItem Edit ᠨᠠᠢᠷᠠᠭᠤᠯᠬᠤ Delete ᠲᠡᠮᠳᠡᠭ᠎ᠢ᠋ ᠤᠰᠠᠳᠬᠠᠬᠤ ModelWidget Sort Upwards ᠵᠢᠭᠰᠠᠭᠠᠬᠤ ᠶᠢ ᠡᠮᠦᠨᠡᠰᠢᠯᠡᠬᠦ Increase priority ᠡᠩ ᠲᠡᠷᠢᠭᠦᠨ ᠳᠦ ᠳᠡᠰ ᠢ ᠳᠡᠭᠡᠭᠰᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ᠃ Increase Priority ᠡᠩ ᠲᠡᠷᠢᠭᠦᠨ ᠳᠦ ᠳᠡᠰ ᠢ ᠳᠡᠭᠡᠭᠰᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ᠃ Configure ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ PrivateModelConfigDialog Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Add-NLP Model ᠨᠡᠮᠡᠬᠦ - ᠳ᠋ᠣᠺᠦᠮᠡᠨᠲ ᠤᠨ ᠲᠥᠷᠥᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Add-Visual Model ᠨᠡᠮᠡᠬᠦ - ᠢᠮᠡᠭᠧ ᠵᠢᠷᠤᠭ ᠤᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ Add-Speech Model ᠨᠡᠮᠡᠬᠦ - ᠠᠪᠢᠶ᠎ᠠ ᠶᠢᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ᠃ Edit-NLP Model ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ - ᠳ᠋ᠣᠺᠦᠮᠡᠨᠲ ᠤᠨ ᠲᠥᠷᠥᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ Edit-Visual Model ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ - ᠢᠮᠡᠭᠧ ᠵᠢᠷᠤᠭ ᠤᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ Edit-Speech Model ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ - ᠠᠪᠢᠶ᠎ᠠ ᠶᠢᠨ ᠲᠦᠷᠦᠯ ᠤᠨ ᠵᠠᠭᠪᠤᠷ᠃ CustomName ᠥᠪᠡᠷᠰᠡᠳ ᠢᠶᠡᠨ ᠲᠣᠳᠣᠷᠬᠠᠶᠢᠯᠠᠭᠰᠠᠨ ᠨᠡᠷᠡᠶᠢᠳᠦᠯ ModelName ᠵᠠᠭᠪᠤᠷ ᠨᠡᠷ᠎ᠡ RequestUrl ᠭᠤᠶᠤᠴᠢᠯᠠᠯᠲᠠ ᠶᠢᠨ ᠬᠠᠶᠢᠭ Required (To distinguish models) ᠵᠠᠪᠠᠯ ᠲᠠᠭᠯᠠᠬᠤ (ᠢᠯᠭᠠᠬᠤ ᠵᠠᠭᠪᠤᠷ ᠲᠤ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ) Optional ᠰᠤᠩᠭᠤᠨ ᠲᠠᠭᠯᠠᠬᠤ Optional (Required for cloud services) ᠰᠤᠩᠭ᠋ᠤᠬᠤ(ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠤᠨ ᠦᠢᠯᠡᠴᠢᠯᠡᠬᠡᠨ ᠤ ᠵᠠᠪᠠᠯ ᠲᠠᠭᠯᠠᠨ᠎ᠠ) Required ᠵᠠᠪᠠᠯ ᠲᠠᠭᠯᠠᠨ᠎ᠠ ᠃ Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Accept ᠨᠤᠲᠠᠯᠠᠬᠤ The length must not exceed 32 characters ᠤᠷᠲᠤ ᠨᠢ 32 ᠥᠰᠥᠭ ᠲᠡᠮᠳᠡᠭ ᠡᠴᠡ ᠶᠡᠬᠡ ᠪᠠᠶᠢᠵᠤ ᠪᠣᠯᠬᠤ ᠦᠭᠡᠢ Cannot contain spaces, please re-enter! ᠬᠣᠭᠣᠰᠣᠨ ᠣᠷᠣᠨ ᠢ ᠠᠭᠤᠯᠵᠤ ᠪᠣᠯᠬᠤ ᠦᠭᠡᠢ ᠳᠠᠬᠢᠨ ᠣᠷᠣᠭᠤᠯᠤᠭᠠᠷᠠᠢ ᠃ Duplicate name, please re-enter! ᠨᠡᠷᠡᠶᠢᠳᠦᠯ ᠳᠠᠪᠬᠤᠷᠳᠠᠵᠤ ᠂ ᠳᠠᠬᠢᠨ ᠣᠷᠣᠭᠤᠯᠬᠤ ᠪᠣᠯᠪᠠᠤ ᠃ Model Editing failed ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ ᠢᠯᠠᠭᠳᠠᠵᠠᠢ ᠃ Adding model failed ᠵᠠᠭᠪᠤᠷ ᠨᠡᠮᠡᠬᠦ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠪᠠ Close ᠬᠠᠭᠠᠬᠤ ᠂ ᠬᠠᠭᠠᠬᠤ PrivateModelConfigWidget Private Model ᠦᠪᠡᠷ ᠰᠤᠩᠭᠤᠯᠲᠠ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ Flexible model management to meet personalized usage scenarios ᠠᠮᠢᠳᠤᠯᠢᠭ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯᠲᠠ ᠶᠢᠨ ᠠᠷᠭ᠎ᠠ ᠮᠠᠶ᠋ᠢᠭ ᠨᠢ ᠥᠪᠡᠷᠮᠢᠴᠡ ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠶᠢᠨ ᠪᠠᠶᠢᠳᠠᠯ ᠢ ᠬᠠᠩᠭᠠᠨ᠎ᠠ᠃ NLP Model ᠪᠢᠴᠢᠭ᠌ ᠦᠨ ᠲᠦᠷᠦᠯ ᠦᠨ ᠵᠠᠭᠪᠤᠷ ᠃ Processing and generating text, such as understanding text and answering questions ᠦᠰᠦᠭ ᠪᠢᠴᠢᠭ᠌ ᠢ ᠰᠢᠢᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠪᠠ ᠦᠰᠦᠭ ᠪᠢᠴᠢᠭ᠌ ᠪᠣᠯᠭᠠᠨ᠎ᠠ ᠂ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠪᠢᠴᠢᠭ᠌ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ ᠢ ᠣᠢ᠌ᠯᠠᠭᠠᠵᠤ ᠂ ᠠᠰᠠᠭᠤᠯᠲᠠ ᠶᠢ ᠬᠠᠷᠢᠭᠤᠯᠬᠤ ᠶᠠᠪᠤᠳᠠᠯ ᠪᠣᠯᠣᠨ᠎ᠠ ᠃ Add ᠨᠡᠮᠡᠯᠲᠡ OK ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Failed to delete model ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠠᠰᠤᠬᠤ ᠢᠯᠠᠭᠳᠠᠪᠠ Model setup failed ᠮᠣᠳᠧᠯ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠬᠤ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠪᠠ Model Editing failed ᠨᠠᠶᠢᠷᠠᠭᠤᠯᠤᠭᠴᠢ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ ᠢᠯᠠᠭᠳᠠᠵᠠᠢ ᠃ Model switching failed ᠰᠣᠩᠭᠣᠯᠲᠠ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ ᠢᠶᠠᠷ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠭᠰᠠᠨ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠭᠰᠠᠨ Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Sorry, the model is currently executing another task. Please try again after it is completed. ᠠᠭᠤᠴᠢᠯᠠᠭᠠᠷᠠᠶ ᠂ ᠡᠨᠡ ᠵᠠᠭᠪᠤᠷ ᠣᠳᠣᠬᠠᠨ ᠳᠤ ᠶᠠᠭ ᠪᠤᠰᠤᠳ ᠡᠭᠦᠷᠭᠡ ᠶᠢ ᠭᠦᠢᠴᠡᠳᠬᠡᠵᠦ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠪᠡᠶᠡᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠬᠤ ᠶᠢ ᠬᠦᠯᠢᠶᠡᠵᠦ ᠪᠠᠢ᠌ᠭᠠᠷᠠᠢ ᠃ Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. ᠣᠰᠤᠯ ᠪᠣᠯᠣᠯ᠎ᠠ ᠣᠳᠣᠬᠠᠨ ᠳᠤ AI ᠬᠠᠪᠰᠤᠷᠤᠭᠴᠢ ᠶᠠᠭ ᠲᠤᠰ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠡᠷᠡᠭᠯᠡᠵᠦ ᠪᠠᠶᠢᠨ᠎ᠠ ᠡᠭᠦᠷᠭᠡ ᠬᠦᠯᠢᠶᠡᠵᠦ ᠪᠠᠷᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠭᠠᠷᠠᠢ ᠃ Retry ᠲᠡᠬᠢᠠ ᠲᠤᠷᠰᠢᠬᠤ Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? ᠡᠨᠡ ᠬᠦ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠠᠰᠤᠪᠠᠯ ᠡᠨᠡ ᠬᠦ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠳᠦ ᠲᠦᠰᠢᠭᠯᠡᠭᠡᠳ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠴᠢᠳᠠᠬᠤ ᠤᠢᠭᠡᠢ ᠪᠤᠯᠵᠦ ᠮᠡᠳᠡᠨ᠎ᠡ᠂ ᠲᠠ ᠯᠠᠪᠲᠠᠶ ᠬᠠᠰᠤᠨ᠎ᠠ ᠤᠣ? Delete ᠲᠡᠮᠳᠡᠭ᠎ᠢ᠋ ᠤᠰᠠᠳᠬᠠᠬᠤ PrivateModelItemWidget Edit ᠨᠠᠢᠷᠠᠭᠤᠯᠬᠤ Delete ᠲᠡᠮᠳᠡᠭ᠎ᠢ᠋ ᠤᠰᠠᠳᠬᠠᠬᠤ QAptDownLoadDeb Tips ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ Backend init failed ᠠᠷᠤ ᠦᠵᠦᠭᠦᠷ ᠦ᠋ᠨ ᠠᠩᠬᠠᠵᠢᠷᠠᠭᠤᠯᠤᠯᠲᠠ ᠢᠯᠠᠭᠳᠠᠪᠠ %1 package not founds %1 ᠰᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠶᠢ ᠡᠷᠢᠵᠦ ᠣᠯᠣᠭ᠎ᠠ ᠦᠭᠡᠢ᠌ Failed to create transaction. ᠶᠠᠪᠤᠳᠠᠯ ᠤᠨ ᠡᠭᠦᠳᠦᠯ ᠢᠯᠠᠭᠳᠠᠪᠠ Package could not be update. ᠰᠢᠨ᠎ᠡ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠠᠷᠭ᠎ᠠ ᠦᠭᠡᠢ᠌ The current model is already the latest model ᠣᠳᠣᠬᠢ ᠵᠠᠭᠪᠤᠷ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠠᠮᠤᠭ ᠰᠢᠨ᠎ᠡ ᠵᠠᠭᠪᠤᠷ ᠪᠣᠯᠵᠠᠢ New version needs to be updated upon discovery ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠢ ᠣᠯᠵᠤ ᠮᠡᠳᠡᠵᠡᠢ ᠃ QObject Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ Sorry, the model is currently executing another task. Please try again after it is completed.. ᠠᠭᠤᠴᠢᠯᠠᠭᠠᠷᠠᠶ ᠂ ᠡᠨᠡ ᠵᠠᠭᠪᠤᠷ ᠣᠳᠣᠬᠠᠨ ᠳᠤ ᠶᠠᠭ ᠪᠤᠰᠤᠳ ᠡᠭᠦᠷᠭᠡ ᠶᠢ ᠭᠦᠢᠴᠡᠳᠬᠡᠵᠦ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠪᠡᠶᠡᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠬᠤ ᠶᠢ ᠬᠦᠯᠢᠶᠡᠵᠦ ᠪᠠᠢ᠌ᠭᠠᠷᠠᠢ ᠃ Retry ᠲᠡᠬᠢᠠ ᠲᠤᠷᠰᠢᠬᠤ Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? ᠡᠨᠡ ᠬᠦ ᠵᠠᠭᠪᠤᠷ ᠢ ᠬᠠᠰᠤᠪᠠᠯ ᠡᠨᠡ ᠬᠦ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠳᠦ ᠲᠦᠰᠢᠭᠯᠡᠭᠡᠳ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠠᠵᠢᠯᠯᠠᠵᠤ ᠴᠢᠳᠠᠬᠤ ᠤᠢᠭᠡᠢ ᠪᠤᠯᠵᠦ ᠮᠡᠳᠡᠨ᠎ᠡ᠂ ᠲᠠ ᠯᠠᠪᠲᠠᠶ ᠬᠠᠰᠤᠨ᠎ᠠ ᠤᠣ? Delete ᠲᠡᠮᠳᠡᠭ᠎ᠢ᠋ ᠤᠰᠠᠳᠬᠠᠬᠤ Sorry, the model is currently executing another task. Please try again after it is completed. ᠠᠭᠤᠴᠢᠯᠠᠭᠠᠷᠠᠶ ᠂ ᠡᠨᠡ ᠵᠠᠭᠪᠤᠷ ᠣᠳᠣᠬᠠᠨ ᠳᠤ ᠶᠠᠭ ᠪᠤᠰᠤᠳ ᠡᠭᠦᠷᠭᠡ ᠶᠢ ᠭᠦᠢᠴᠡᠳᠬᠡᠵᠦ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠪᠡᠶᠡᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠬᠤ ᠶᠢ ᠬᠦᠯᠢᠶᠡᠵᠦ ᠪᠠᠢ᠌ᠭᠠᠷᠠᠢ ᠃ Cloud model first (Kylin Certification) ᠲᠡᠷᠢᠭᠦᠨ ᠦ ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠮᠣᠳᠧᠯ (Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠃) Local model first (Kylin Certification) ᠤᠷᠢᠳᠠᠪᠠᠷ ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ ᠢ ᠡᠩ ᠲᠡᠷᠢᠭᠦᠨ ᠳᠦ ᠪᠠᠶᠢᠯ(Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠃) Custom model first ᠤᠷᠢᠳᠠᠪᠠᠷ ᠦᠪᠡᠷ ᠲᠡᠭᠡᠨ ᠰᠤᠩᠭᠤᠬᠤ ᠵᠠᠭᠪᠤᠷ Private model first ᠤᠷᠢᠳᠠᠪᠠᠷ ᠦᠪᠡᠷ ᠲᠡᠭᠡᠨ ᠰᠤᠩᠭᠤᠬᠤ ᠵᠠᠭᠪᠤᠷ Cloud Model First (Kylin Certification) ᠲᠡᠷᠢᠭᠦᠨ ᠦ ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠮᠣᠳᠧᠯ (Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠃) Local Model First (Kylin Certification) ᠤᠷᠢᠳᠠᠪᠠᠷ ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ ᠢ ᠡᠩ ᠲᠡᠷᠢᠭᠦᠨ ᠳᠦ ᠪᠠᠶᠢᠯ(Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠃) Custom Model First ᠤᠷᠢᠳᠠᠪᠠᠷ ᠦᠪᠡᠷ ᠲᠡᠭᠡᠨ ᠰᠤᠩᠭᠤᠬᠤ ᠵᠠᠭᠪᠤᠷ SubSystemInstallModule AIModuleManager AIᠬᠡᠰᠡᠭ ᠦᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯᠲᠠ AI Models AIᠬᠡᠰᠡᠭ ᠦᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯᠲᠠ loading plugin ᠠᠴᠢᠶᠠᠯᠠᠬᠤ ᠬᠠᠪᠴᠢᠭᠤᠯᠭ᠎ᠠ ᠲᠤᠨᠤᠭ ᠤᠨ ᠳᠤᠮᠳᠠ Model Configuration ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠯᠲᠠ᠃ /aisubsystem/Model Configuration aisubsystem AIᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ AI SubSystem AIᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ /aisubsystem/AI SubSystem SubSystemWidget AI SubSystem AIᠬᠡᠰᠡᠭ ᠦᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯᠲᠠ Ai SubSystem AIᠬᠡᠰᠡᠭ ᠦᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯᠲᠠ Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. AI ᠵᠢᠨ ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠪᠤᠶᠤ ᠴᠢᠳᠠᠪᠤᠷᠢ ᠳᠤ ᠠᠵᠢᠯᠯᠠᠭᠠᠨ ᠢ ᠬᠠᠩᠭᠠᠨ᠎ᠠ᠃ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠂ AI ᠵᠢᠨ ᠲᠤᠰᠠᠯᠠᠭᠴᠢ ᠂ ᠲᠣᠭ᠎ᠠ ᠪᠠᠷᠢᠮᠲᠠ ᠶᠢᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠭᠴᠢ ᠂ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠢᠷᠤᠭ ᠂ ᠪᠢᠯᠢᠭᠲᠦ ᠭᠥᠷᠥᠭᠡᠰᠦ ᠶᠢᠨ ᠲᠠᠲᠠᠯᠭᠠᠨ ᠲᠡᠮᠳᠡᠭᠯᠡᠯ ᠵᠡᠷᠭᠡ ᠃ loading ᠠᠴᠢᠶᠠᠯᠠᠬᠤ ᠳᠤᠮᠳᠠ Install ᠤᠭᠰᠠᠷᠠᠭᠤᠯᠬᠤ Reboot Immediately ᠳᠠᠷᠤᠶ ᠳᠤᠨᠢ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠬᠦ Update ᠰᠢᠨᠡᠳᠬᠡᠬᠦ Kylin Ai SubSystem ᠪᠢᠯᠢᠭᠲᠦ ᠭᠥᠷᠥᠭᠡᠰᠦ ᠶᠢᠨ AI ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ Kylin AI SubSystem ᠪᠢᠯᠢᠭᠲᠦ ᠭᠥᠷᠥᠭᠡᠰᠦ ᠶᠢᠨ AI ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. AI ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠪᠠ AI ᠴᠢᠳᠠᠮᠵᠢ ᠳᠤ ᠠᠵᠢᠯᠯᠠᠭᠠᠨ ᠢ ᠬᠠᠩᠭᠠᠨ᠎ᠠ᠃ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠮᠣᠳᠧᠯ ᠦᠨ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ᠂ ᠠᠵᠢᠯᠯᠠᠬᠤ ᠴᠠᠭ ᠤᠨ ᠬᠥᠮᠥᠷᠭᠡ᠂ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠫᠠᠷᠠᠮᠧᠲ᠋ᠷ ᠵᠡᠷᠭᠡ᠃ Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. AI ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠪᠠ AI ᠴᠢᠳᠠᠮᠵᠢ ᠳᠤ ᠠᠵᠢᠯᠯᠠᠭᠠᠨ ᠢ ᠬᠠᠩᠭᠠᠨ᠎ᠠ᠃ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠮᠣᠳᠧᠯ ᠦᠨ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ᠂ ᠠᠵᠢᠯᠯᠠᠬᠤ ᠴᠠᠭ ᠤᠨ ᠬᠥᠮᠥᠷᠭᠡ᠂ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠫᠠᠷᠠᠮᠧᠲ᠋ᠷ ᠵᠡᠷᠭᠡ᠃ Detect Update ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠯᠲᠡ ᠶᠢᠨ ᠰᠢᠨᠡᠳᠬᠡᠯ UnInstall ᠠᠴᠢᠶ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ Install success! ᠤᠭᠰᠠᠷᠠᠭᠠᠳ ᠠᠮᠵᠢᠯᠲᠠ ᠣᠯᠤᠭᠰᠠᠨ! The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? AI ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ ᠨᠢᠭᠡᠨᠲᠡ ᠤᠭᠰᠠᠷᠠᠵᠤ᠂ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ ᠳᠠᠬᠢᠨ ᠨᠡᠭᠡᠭᠡᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠰᠠᠶ᠋ᠢ ᠬᠦᠴᠦᠨ ᠲᠡᠶ ᠪᠣᠯᠤᠨ᠎ᠠ᠂ ᠳᠠᠬᠢᠨ ᠨᠡᠭᠡᠭᠡᠨ᠎ᠡ ᠦᠸ ᠦᠭᠡᠢ ᠦᠸ? Reboot Later ᠪᠠᠶᠢᠰᠬᠢᠭᠡᠳ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠬᠦ Are you sure you want to uninstall the AI subsystem? AI ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠᠷ ᠲᠣᠭᠲᠠᠭᠰᠠᠨ ᠤᠸ? After uninstallation, the AI services of related applications will not be available. ᠠᠴᠢᠶ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠂ ᠬᠠᠮᠢᠶ᠎ᠠ ᠪᠦᠬᠦᠢ ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠦ AI ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠶᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠭᠡᠢ᠃ Cancel ᠬᠦᠴᠦᠨ ᠦᠭᠡᠢ ᠪᠣᠯᠭᠠᠬᠤ Uninstall ᠠᠴᠢᠶ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ AI service unavailable AI ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ ᠬᠡᠷᠡᠭᠯᠡᠵᠦ ᠪᠣᠯᠬᠤ ᠦᠭᠡᠢ The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. AI ᠬᠤᠪᠢᠶᠠᠷᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ ᠰᠢᠯᠭᠠᠨ ᠪᠠᠶᠢᠴᠠᠭᠠᠵᠤ ᠣᠯᠤᠭᠰᠠᠨ ᠦᠭᠡᠢ ᠪᠣᠯᠬᠣᠷ ᠬᠡᠷᠡᠭᠯᠡᠵᠦ ᠪᠠᠶᠢᠭ᠎ᠠ AI ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ ᠶᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠭᠡᠢ ᠶᠤᠮ᠃ ᠰᠢᠰᠲ᠋ᠧᠮ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠭᠠᠷᠠᠢ᠄AI ᠳᠤ ᠣᠴᠢᠭᠠᠷᠠᠢ ᠬᠡᠰᠡᠭ ᠦᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯᠲᠠ ᠶᠢᠨ ᠬᠠᠭᠤᠳᠠᠰᠤ ᠶᠢ ᠤᠭᠰᠠᠷᠠᠨ᠎ᠠ ᠃ Go Now ᠳᠠᠷᠤᠶᠢᠬᠠᠨ ᠣᠴᠢᠬᠤ Version: %1 ᠬᠡᠪᠯᠡᠯ: %1 Version: %1 Last detection time: %2 ᠬᠡᠪᠯᠡᠯ: %1 ᠳᠡᠭᠡᠷ᠎ᠡ ᠤᠳᠠᠭᠠᠨ ᠤ ᠰᠢᠯᠭᠠᠨ ᠪᠠᠶᠢᠴᠠᠭᠠᠭᠰᠠᠨ ᠴᠠᠭ: %2 Detected an upgradable version: %1 Last detection time: %2 ᠰᠢᠨᠡᠳᠬᠡᠵᠦ ᠪᠣᠯᠬᠤ ᠬᠡᠪᠯᠡᠯ ᠢ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠣᠯᠪᠠ: %1 ᠳᠡᠭᠡᠷ᠎ᠡ ᠤᠳᠠᠭᠠᠨ ᠤ ᠰᠢᠯᠭᠠᠨ ᠪᠠᠶᠢᠴᠠᠭᠠᠭᠰᠠᠨ ᠴᠠᠭ: %2 Installed, effective after restarting. ᠨᠢᠭᠡᠨᠲᠡ ᠤᠭᠰᠠᠷᠠᠭᠰᠠᠨ ᠂ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠰᠡᠨ ᠦ ᠳᠠᠷᠠᠭ᠎ᠠ ᠬᠦᠴᠦᠨ ᠲᠡᠶ ᠪᠣᠯᠤᠨ᠎ᠠ Installing... ᠲᠣᠨᠣᠭᠯᠠᠵᠤ ᠪᠠᠶᠢᠭ᠎ᠠ... Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. AI ᠶᠢᠨ ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠪᠤᠶᠤ ᠴᠢᠳᠠᠮᠵᠢ ᠳᠤ ᠠᠵᠢᠯᠯᠠᠭᠠᠨ ᠬᠠᠩᠭᠠᠨ᠎ᠠ ᠃ ᠵᠢᠱᠢᠶᠡᠯᠡᠪᠡᠯ ᠂ AI ᠬᠠᠪᠰᠤᠷᠤᠭᠴᠢ ᠂ ᠴᠡᠭᠡᠵᠢᠯᠡᠯ ᠦᠨ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠢᠷᠤᠭ ᠂ ᠾᠧ ᠯᠢᠨ ᠲᠦᠷᠭᠡᠨ ᠲᠡᠮᠳᠡᠭᠯᠡᠯ ᠵᠡᠷᠭᠡ ᠃ Uninstalling... ᠠᠴᠢᠶ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠪᠠᠶᠢᠭ᠎ᠠ... The current version is already the latest version: %1 Last detection time: %2 ᠣᠳᠣᠬᠠᠨ ᠳᠤ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠠᠮᠤᠭ ᠤᠨ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠪᠣᠯᠵᠠᠶ᠄ 1% ᠶᠢᠨ ᠳᠡᠭᠡᠷ᠎ᠡ ᠤᠳᠠᠭᠠᠨ ᠤ ᠪᠠᠶᠢᠴᠠᠭᠠᠯᠲᠠ ᠶᠢᠨ ᠴᠠᠭ᠄ 2% Installation failed, necessary files are missing. ᠤᠭᠰᠠᠷᠠᠵᠤ ᠳᠡᠶᠢᠯᠦᠭᠰᠡᠨ ᠦᠭᠡᠢ᠂ ᠴᠢᠬᠤᠯᠠ ᠪᠦᠬᠦᠢ ᠪᠢᠴᠢᠭ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ ᠳᠤᠲᠠᠵᠤ ᠪᠠᠶᠢᠨ᠎ᠠ Network abnormality, please check the network connection and try again. ᠨᠧᠲ᠋ ᠬᠡᠪ ᠦᠨ ᠪᠤᠰᠤ᠂ ᠨᠧᠲ᠋ ᠦᠨ ᠵᠠᠯᠭᠠᠯᠲᠠ ᠶᠢ ᠪᠠᠶᠢᠴᠠᠭᠠᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠲᠤᠷᠰᠢᠭᠠᠷᠠᠢ Detecting And Update... ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠰᠢᠯᠭᠠᠵᠤ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠳᠤᠮᠳᠠ ... TestAiSubSystem Model Configuration ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠯᠲᠠ᠃ Cloud Model (Kylin Certification) ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ (Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠯ ) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) ᠴᠢ ᠯᠢᠨ ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ ᠳᠠᠮᠵᠢᠭᠰᠠᠨ ᠡᠭᠦᠯᠡᠨ ᠪᠣᠳᠣᠯᠲᠠ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ(ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠬᠦᠷ ᠤᠨ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠦᠷ ᠢ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠵᠤ᠂ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ ᠰᠤᠷᠪᠤᠯᠵᠢᠯᠠᠭ᠎ᠠ ᠪᠠ ᠬᠡᠷᠡᠭᠯᠡᠯᠲᠡ ᠪᠠᠷ ᠳᠠᠮᠵᠢᠨ᠎ᠠ) Local Model (Kylin Certification) ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ (Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠯ ) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) ᠴᠢ ᠯᠢᠨ ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ ᠳᠠᠮᠵᠢᠭᠰᠠᠨ ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ(ᠲᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠲᠥᠬᠥᠭᠡᠷᠦᠮᠵᠢ ᠳᠡᠭᠡᠷ᠎ᠡ ᠰᠠᠭᠤᠯᠭᠠᠬᠤ ᠴᠢᠬᠤᠯᠠ ᠦᠭᠡᠢ ᠨᠡᠲ᠋ ᠢ ᠪᠠᠰᠠ ᠶᠠᠪᠤᠭᠳᠠᠭᠤᠯᠵᠤ ᠪᠣᠯᠣᠨ᠎ᠠ) Custom Model ᠦᠪᠡᠷ ᠰᠤᠩᠭᠤᠯᠲᠠ ᠶᠢᠨ ᠵᠠᠭᠪᠤᠷ Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) ᠴᠢ ᠯᠢᠨ ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠳᠡᠭᠰᠡᠨ ᠥᠬᠡᠶ ᠲᠣᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠪᠢᠴᠢᠭ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ᠂ ᠬᠡᠰᠡᠭ ᠬᠡᠪᠴᠢᠶᠡᠨ ᠤ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠪᠠ ᠨᠡᠶᠢᠲᠡ ᠶᠢᠨ ᠡᠭᠦᠯᠡᠨ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠯᠲᠠ ᠶᠢ ᠳᠣᠭᠢᠷᠠᠭᠤᠯᠤᠨ᠎ᠠ( ᠬᠡᠷᠪᠡ ᠲᠠᠨ ᠳᠤ ᠳᠥᠭᠦᠮ ᠦᠭᠡᠢ ᠪᠣᠯᠭᠠᠭᠰᠠᠨ ᠪᠣᠯ ᠠᠭᠤᠴᠢᠯᠠᠭᠠᠷᠠᠢ᠃) Failed to set cloud model priority ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠡᠷᠢᠭᠦᠯᠡᠬᠦ ᠳᠡᠰ ᠢ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠤᠨ᠎ᠠ Failed to set local model priority ᠳᠤᠰ ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠡᠷᠢᠭᠦᠯᠡᠬᠦ ᠳᠡᠰ ᠢ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠤᠭᠠᠳ ᠳᠡᠶᠢᠯᠦᠭᠰᠡᠨ ᠦᠬᠡᠢ Failed to set custom model priority ᠥᠪᠡᠷᠲᠡᠭᠡᠨ ᠰᠣᠩᠭ᠋ᠣᠬᠤ ᠵᠠᠭᠪᠤᠷ ᠤᠨ ᠲᠡᠷᠢᠭᠦᠯᠡᠬᠦ ᠳᠡᠰ ᠢ ᠪᠠᠶᠢᠷᠢᠯᠠᠭᠤᠯᠬᠤ ᠳᠤ ᠢᠯᠠᠭᠳᠠᠪᠠ Cloud model (Kylin Certification) ᠡᠭᠦᠯᠡᠨ ᠦᠵᠦᠭᠦᠷ ᠤᠨ ᠵᠠᠭᠪᠤᠷ (Kylin ᠭᠡᠷᠡᠴᠢᠯᠡᠯ ) Cancel ᠪᠣᠯᠢᠬᠤ ᠂ ᠪᠣᠯᠢᠬᠤ Ok ᠲᠣᠭᠲᠠᠭᠠᠬᠤ UpdateNotificationWidget Tips ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ Apt update failed. ᠰᠢᠨᠡᠳᠬᠡᠯ ᠢᠯᠠᠭᠳᠠᠬᠤ Current model is downloading now ,Are you sure you to cancel the download? ᠮᠣᠳᠧᠯ ᠢ ᠣᠳᠣ ᠶᠠᠭ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠪᠠᠢ᠌ᠨ᠎ᠠ ᠂ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠᠨ ᠪᠣᠯᠢᠬᠤ ᠤᠸ? kylin-ai-subsystem-plugin-1.0.0.2/translations/ug.ts000066400000000000000000001542251520576575000224460ustar00rootroot00000000000000 AddBtn Add 添加 AddButton Add قوش AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشۈرۈپ بايقىغان قىسمەن AI قوللىنىشچان نۇسخىسى بەك تۆۋەن بولۇپ، تارماق سىستېما بىلەن ماس كەلمەيدىكەن، بۇ ئىقتىدار چەكلىمىگە ئۇچرايدۇ. نورمال ئىشلىتىلىشكە كاپالەتلىك قىلىش ئۈچۈن ئەڭ يېڭى نۇسخىغا ئۆزگەرتىڭ. Go to update يېڭىلاشقا قاراپ Configure 前往更新 配置 CloudModelConfigWidget Cloud Model بۇلۇتلۇق مودېل Deployed on the cloud server, access and use over the network بۇلۇتلۇق مۇلازىمەتچىگە ئورۇنلاشتۇرۇلۇپ، تور ئارقىلىق زىيارەت قىلىش ۋە ئىشلىتىش NLP Model تېكىست مودېلى Processing and generating text, such as understanding text and answering questions يېزىقنى بىر تەرەپ قىلىش ۋە ھاسىل قىلىش، مەسىلەن تېكىستنى چۈشىنىش، سوئالغا جاۋاب بېرىش Add قوش Visual Model سۈرەت تۈرىدىكى مودېل Processing and generating images, such as recognizing objects and analyzing scenes سۈرەتنى بىر تەرەپ قىلىش ۋە ھاسىل قىلىش ، مەسىلەن جىسىمنى پەرقلەندۈرۈش ، تەھلىل قىلىش Speech Model تاۋۇش تۈرىدىكى مودېل Processing sound and speech, such as recognizing speech and synthesizing speech ئاۋاز ۋە تاۋۇشنى بىر تەرەپ قىلىش ،مەسىلەن تاۋۇشنى پەرقلەندۈرۈش ،بىرىكمە تاۋۇش OK جەزملەشتۈرۈش Model switching failed تاللاش مودېلى قىلىپ تەڭشەش مەغلۇپ بولدى Failed to delete model مودېلنى چىقىرىپ تاشلاش مەغلۇپ بولدى Model setup failed مودېل تەسىس قىلىش مەغلۇپ بولدى Model Editing failed مودېل تەھرىرلەش مەغلۇپ بولدى Cloud model بۇلۇتلۇق مودېل Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Free Trial Account 免费试用账号 kylin-ai-subsystem-modelconfig AI模型配置 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? kylin-aiassistant AI 助手 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Delete 删除 LocalModelConfigWidget Local Model يەرلىك مودېل Installed on local equipment, it can run without network يەرلىك ئۈسكۈنىلەرگە ئورنىتىلغان بولۇپ، تور ھاجەتسىز يۈرۈشتۈرگىلى بولىدۇ (Installing/uninstalling models requires a reboot to take effect) (قۇراشتۇرۇش / چۈشۈرۈش مودېلى قايتا قوزغىتىلغاندىن كېيىن كۈچكە ئىگە بولىدۇ) Install قاچىلاش Update/Uninstall يېڭىلاش/يۈك چۈشۈرۈش Built in model of the system سىستىمىنىڭ ئىچكى قىسمىغا مودېل ئورنىتىلغان The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation سۈرەت پەرقلەندۈرۈش، ۋېكتورلاشتۇرۇش، تاۋۇش بىر تەرەپ قىلىش قاتارلىق باشقا سىستېمىلارنىڭ يۈرۈشىشىگە ئېھتىياجلىق مودېللار NLP Model تېكىست مودېلى Processing and generating text, such as understanding text and answering questions يېزىقنى بىر تەرەپ قىلىش ۋە ھاسىل قىلىش، مەسىلەن تېكىستنى چۈشىنىش، سوئالغا جاۋاب بېرىش OK جەزملەشتۈرۈش Are you sure you want to exit? چېكىنىپ چىقىشنى جەزىملەشتۈرەلەمسىز؟ The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? مودېل قۇراشتۇرۇلىۋاتىدۇ، چېكىنىپ چىقىش ئورنىتىش مەغلۇپ بولۇشى مۇمكىن. چىكىنىپ چىقىشنى بىكىتەمدۇق يوق Cancel ئەمەلدىن قالدۇرۇش Quit چېكىنىش Exit current window? نۆۋەتتىكى كۆزنەكتىن چېكىنىپ چىقىش ؟ The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. مودېلنى قۇراشتۇرۇش داۋاملىق ئارقا سۇپىدا ئىشلىنىدۇ، تاماملانغاندىن كېيىن قايتىدىن قوزغىتىش كۈچكە ئىگە بولىدۇ. Built in model group ئىچىگە مودېل گۇرۇپپىسى ئورنى Model setup failed مودېل تەسىس قىلىش مەغلۇپ بولدى Model switching failed تاللاش مودېلى قىلىپ تەڭشەش مەغلۇپ بولدى Installing/uninstalling models requires a restart to take effect 安装/卸载模型需重启后生效 Processing and generating images, such as recognizing objects and analyzing scenes 处理和生成图像,比如识别物体、分析场景 Processing sound and speech, such as recognizing speech and synthesizing speech 处理声音和语音,比如识别语音、合成语音 Failed to delete model 删除模型失败 After downloading and installing, a restart is required to take effect 下载安装后需重启生效 After downloading and installing, you need to log out for it to take effect 下载安装后需注销生效 (The installation/uninstallation of the model will take effect after logging out) (安装/卸载模型需注销后生效) The installation/uninstallation of the model will take effect after logging out 安装/卸载模型需注销后生效 Installing/uninstalling models requires a reboot to take effect قۇراشتۇرۇش / چۈشۈرۈش مودېلى قايتا قوزغىتىلغاندىن كېيىن كۈچكە ئىگە بولىدۇ Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Tips 提示 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 kylin-ai-modelconfig 模型配置 Current model not install,you can use the model after install it. 当前模型尚未安装,完成安装后才能正常使用。 Install Now 立即安装 kylin-aiassistant AI 助手 kylin-ai-subsystem-modelconfig AI模型配置 Ok 确定 Add 添加 Visual Model 图像类模型 Speech Model 语音类模型 LocalModelItem Discover a new version 发现新版本 Effective after reboot قايتا قوزغاتقاندىن كېيىن كۈچكە ئىگە بولىدۇ Effective after reboot . 重启后生效 قايتا قوزغاتقاندىن كېيىن كۈچكە ئىگە بولىدۇ Detect Updates تەكشۈرۈش يېڭىلىنىشىنى تەكشۈ Install success! قۇراشتۇرۇش مۇۋەپپەقىيەتلىك بولدى ! The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? مودېل قۇراشتۇرۇلۇپ بولدى، سىستېمىنى قايتىدىن قوزغاتقاندىن كېيىن ئاندىن كۈچكە ئىگە بولىدۇ، قايتىدىن قوزغىتامدۇ؟ Reboot Later سەل تۇرۇپ قايتا قوزغىتىڭ Reboot Immediately دەرھال قايتىدىن قوزغىتىش Take effect after rebooting قايتا قوزغاتقاندىن كېيىن كۈچكە ئىگە بولىدۇ installing... قۇراشتۇرۇش جەريانىدا... Net is error,Please check and try again تور بىنورمال ، تەكشۈرۈلگەندىن كېيىن قايتا سىناپ بېقىڭ The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! بەلگىلەنگەن مودېلنىڭ قۇراشتۇرۇش سومكىسىنى تاپالمىدىم: %1، يۇمشاق دېتال مەنبەسى ۋە تور ھالىتىنى تەكشۈرۈپ قايتىدىن سىناپ بېقىڭ! The current model installation package is not installed, it can be downloaded and installed نۆۋەتتە مودېل ئورنىتىش سومكىسى ئورنىتىلمىغان ، چۈشۈرۈش ۋە ئورنىتىشقا بولىدۇ New version needs to be updated upon discovery يېڭى نۇسخىسىنى بايقىماق The current model is already the latest model نۆۋەتتە مودېل ئاللىقاچان ئەڭ يېڭى مودېل Current model version is the lastest version بۇ نۇسخا ئاللىقاچان ئەڭ يېڭى Current model install failed,please install manually. خاتا ئورنىتىش ، قولدا ئورنىتىڭ Detect updates تەكشۈرۈش يېڭىلىنىشىنى تەكشۈ kylin-ai-subsystem-modelconfig_QMessageBox_installSuccess 安装成功! Tips 提示 Current model deb install finished 模型安装完成 ModelCallPriority Model call priority مودېل يۆتكەپ ئىشلىتىش ئىلغار دەرىجىسى Cloud model first (Kylin Certification) 优先云端模型(麒麟认证) Local model first (Kylin Certification) 优先本地模型(麒麟认证) Cloud model first 优先云端模型 Local model first 优先本地模型 Private model first 优先自选模型 Model Call Priority مودېل يۆتكەپ ئىشلىتىش ئىلغار دەرىجىسى ModelConfigDialog Ok ماقۇل Model Type مودېل تىپى Voice dictation & online voice synthesis (streaming version) تاۋۇش ئاڭلاپ يېزىش : توردا تاۋۇش بىرىكتۈرۈش ( ئېقىم شەكلىدىكى نۇسخىسى ) Real time voice transcription تاۋۇش ئايلاندۇرۇپ يېزىش Model Configuration Tutorial مودېل سەپلەش دەرسلىكى Cancel ئەمەلدىن قالدۇرۇش Accept قوبۇل قىلىش Add قوش Cannot contain spaces, please re-enter! بوشلۇقنى ئۆز ئىچىگە ئالسا بولمايدۇ ، قايتىدىن كىرگۈزۈڭ ! Add-NLP Model قوشۇش - تېكىست مودېلى Add-Visual Model قوشۇش - سۈرەت تۈرىدىكى مودېل Add-Speech Model قوشۇش - تاۋۇش مودېلى Required مۇقەررەر تولدۇرۇش Edit-NLP Model تەھرىر - تېكىست تۈرىدىكى مودېللار Edit-Visual Model تەھرىر - سۈرەت تۈرىدىكى مودېللار Edit-Speech Model تەھرىر - تاۋۇش تۈرىدىكى مودېللار The model type already exists. Cannot be repeated! ئاللىقاچان بۇ مودېل مەۋجۇت بولۇپ قالدى ،قايتا قوشۇشقا بولمايدۇ Model Editing failed مودېل تەھرىرلەش مەغلۇپ بولدى Adding model failed قوشۇش مودېلى مەغلۇپ بولدى Close 关闭 APPID APPID No account? Get Now 没有账号?立即获取 ModelDownload The current environment's dbus interface is abnormal نۆۋەتتە مۇھىت dbus ئۇلاش ئېغىزى بىنورمال The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشۈرۈش ئارقىلىق "AI ياردەمچىسى" نۇسخىسىنىڭ بەك تۆۋەن بولۇپ، تارماق سىستېما بىلەن ماس كەلمەيدىغانلىقى، ئىقتىدارى چەكلىمىگە ئۇچرايدىغانلىقىنى بايقىدى. نورمال ئىشلىتىلىشكە كاپالەتلىك قىلىش ئۈچۈن ئەڭ يېڭى نۇسخىغا ئۆزگەرتىڭ. The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشۈرۈش ئارقىلىق " بوتۇلكىلىق تېز خاتىرىسى " نۇسخىسىنىڭ بەك تۆۋەن بولۇپ ، تارماق سىستېمىسى بىلەن ماس كەلمەيدىغانلىقى ، ئىقتىدارى چەكلىمىگە ئۇچرايدۇ . نورمال ئىشلىتىلىشكە كاپالەتلىك قىلىش ئۈچۈن ئەڭ يېڭى نۇسخىغا ئۆزگەرتىڭ. The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. تەكشۈرۈش ئارقىلىق "AI ياردەمچىسى"، "بوتۇلكىلىق سۈرئەت خاتىرىسى" نۇسخىسىنىڭ بەك تۆۋەن بولۇپ، تارماق سىستېمىسى بىلەن ماس كەلمەيدىغانلىقى، ئىقتىدارى چەكلىمىگە ئۇچرايدۇ. نورمال ئىشلىتىلىشكە كاپالەتلىك قىلىش ئۈچۈن ئەڭ يېڭى نۇسخىغا ئۆزگەرتىڭ. Tips ئەسكەرتمە Backend init failed ئارقا قىسمى دەسلەپكى تەرەپلىشىش مەغلۇپ بولدى The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 未找到指定模型的安装包:%1,请检查软件源及网络状态并重新尝试! The current model installation package is not installed, it can be downloaded and installed 当前模型安装包未安装,可以下载及安装 New version needs to be updated upon discovery 发现新版本 The current model is already the latest model 当前模型已经是最新模型 Cancel download failed 取消下载失败 ModelItem Edit تەھرىر Delete ئۆچۈرۈش ModelWidget Sort Upwards 排序靠前 Increase priority ئىلغارلىق دەرىجىسىنى ئۆستۈرۈش كېرەك Increase Priority ئىلغارلىق دەرىجىسىنى ئۆستۈرۈش كېرەك Configure سەپلىمە PrivateModelConfigDialog Ok ماقۇل Add-NLP Model قوشۇش - تېكىست مودېلى Add-Visual Model قوشۇش - سۈرەت تۈرىدىكى مودېل Add-Speech Model قوشۇش - تاۋۇش مودېلى Edit-NLP Model تەھرىر - تېكىست تۈرىدىكى مودېللار Edit-Visual Model تەھرىر - سۈرەت تۈرىدىكى مودېللار Edit-Speech Model تەھرىر - تاۋۇش تۈرىدىكى مودېللار CustomName ئۆزى بەلگىلەش نامى ModelName مودېل نامى RequestUrl ئۆتۈنۈش ئادرېسى Required (To distinguish models) چوقۇم تولدۇرۇش ( پەرقلەندۈرۈش مودېلى ) Optional تاللاپ تولدۇرۇش Optional (Required for cloud services) تاللاش ( بۇلۇتلۇق مۇلازىمەت چوقۇم تولدۇرۇش ) Required مۇقەررەر تولدۇرۇش Cancel ئەمەلدىن قالدۇرۇش Accept قوبۇل قىلىش The length must not exceed 32 characters ئۇزۇنلۇقى 32 خەتتىن چوڭ بولماسلىقى كېرەك Cannot contain spaces, please re-enter! بوشلۇقنى ئۆز ئىچىگە ئالسا بولمايدۇ ، قايتىدىن كىرگۈزۈڭ ! Duplicate name, please re-enter! ئىسىم تەكرارلىنىدۇ،قايتىدىن كىرگۈزۈڭ Model Editing failed مودېل تەھرىرلەش مەغلۇپ بولدى Adding model failed قوشۇش مودېلى مەغلۇپ بولدى Close 关闭 The model type already exists. Cannot be repeated! 已存在该模型类型,不可重复添加 APPID APPID PrivateModelConfigWidget Private Model ئۆزى تاللايدىغان مودېل Flexible model management to meet personalized usage scenarios جانلىق مودېل باشقۇرۇش ئۇسۇلى خاس ئىشلىتىلىش كۆرۈنۈشىنى قاندۇرۇش كېرەك NLP Model تېكىست مودېلى Processing and generating text, such as understanding text and answering questions يېزىقنى بىر تەرەپ قىلىش ۋە ھاسىل قىلىش، مەسىلەن تېكىستنى چۈشىنىش، سوئالغا جاۋاب بېرىش Add قوش OK جەزملەشتۈرۈش Failed to delete model مودېلنى چىقىرىپ تاشلاش مەغلۇپ بولدى Model setup failed مودېل تەسىس قىلىش مەغلۇپ بولدى Model Editing failed مودېل تەھرىرلەش مەغلۇپ بولدى Model switching failed تاللاش مودېلى قىلىپ تەڭشەش مەغلۇپ بولدى Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? Delete 删除 PrivateModelItemWidget Edit تەھرىر Delete ئۆچۈرۈش QAptDownLoadDeb Tips 提示 Backend init failed 后端初始化失败 %1 package not founds %1 安装包未找到 Failed to create transaction. 事件创建失败 Package could not be update. 无法更新包 The current model is already the latest model 当前模型已经是最新模型 New version needs to be updated upon discovery 发现新版本 QObject Cancel ئەمەلدىن قالدۇرۇش Ok ماقۇل Sorry, the model is currently executing another task. Please try again after it is completed.. كەچۈرۈڭ، بۇ مودېل ھازىر باشقا ۋەزىپىلەرنى ئىجرا قىلىۋاتىدۇ، تاماملانغاندىن كېيىن قايتا سىناپ بېقىڭ. Retry قايتا سىناپ بېقىش Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? بۇ مودېلنى چىقىرىپ تاشلاش بۇ مودېلنىڭ ئىشلىتىلىشىگە تايىنىپ نورمال ئىشلىتەلمەسلىكىنى كەلتۈرۈپ چىقىرىدۇ، سىز يۇيىۋېتىشنى جەزىملەشتۈرەلەمسىز؟ Delete ئۆچۈرۈش Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Cloud model first (Kylin Certification) ئالدىن بۇلۇتلۇق مودېل ( بوتۇلكىلىق ئىسپاتلاش ) Local model first (Kylin Certification) ئالدىن يەرلىك مودېل ( بوتۇلكا ئىسپاتلاش ) Custom model first ئالدىن ئۆزى تاللايدىغان مودېل Private model first 优先自选模型 Cloud Model First (Kylin Certification) ئالدىن بۇلۇتلۇق مودېل ( بوتۇلكىلىق ئىسپاتلاش ) Local Model First (Kylin Certification) ئالدىن يەرلىك مودېل ( بوتۇلكا ئىسپاتلاش ) Custom Model First ئالدىن ئۆزى تاللايدىغان مودېل SubSystemInstallModule AIModuleManager AI模块管理 AI SubSystem تارماق سىستېما AI /aisubsystem/AI SubSystem aisubsystem AI子系统 loading plugin قىستۇرما دېتال قاچىلاش جەريانىدا... AI Models مودېل باشقۇرۇش AI Model Configuration مودېل تەقسىملەش /aisubsystem/Model Configuration SubSystemWidget AI SubSystem تارماق سىستېما AI Ai SubSystem AI子系统 Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、数据管家、记忆地图、麒麟速记等。 Version: %1 نەشىر نومۇرى:%1 Install 安装 LogOut immediately 立即注销 Update 更新 Detect Update تەكشۈرۈش يېڭىلىنىشىنى تەكشۈ UnInstall يۈكنى چۈشۈرۈش Install success! قۇراشتۇرۇش مۇۋەپپەقىيەتلىك بولدى ! The AI subsystem has been installed and needs to be logged out before it can take effect. Do you want to log out? AI子系统已经安装完成,需要注销后才能生效,是否注销? Are you sure you want to uninstall the AI subsystem? AI تارماق سىستېمىسىنى چۈشۈرۈشنى جەزىملەشتۈرەلەمسىز؟ After uninstallation, the AI services of related applications will not be available. يۈكنى چۈشۈرگەندىن كېيىن، ئالاقىدار قوللىنىلىدىغان AI مۇلازىمىتىنى ئىشلەتكىلى بولمايدۇ. Uninstall ئۆچۈرۈش AI service unavailable مۇلازىمەتنى ئىشلەتكىلى بولمايدۇ AI The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. AI تارماق سىستېمىسىنى تەكشۈرۈپ بايقىمىغاندا، قوللىنىلغان AI مۇلازىمىتىنى ئىشلەتكىلى بولمايدۇ. سىستېما تەسىس قىلىش > AI مودېلىنى باشقۇرۇش بېتىگە بېرىپ قۇراشتۇرۇڭ. Go Now دەرھال بارىمەن Installing... قاچىلاۋاتىدۇ... Installation failed, necessary files are missing. قۇراشتۇرۇش مەغلۇپ بولدى، زۆرۈر ھۆججەت كەمچىل بولۇش Network abnormality, please check the network connection and try again. تور بىنورمال ، تور ئۇلانغانلىقىنى تەكشۈرگەندىن كېيىن قايتا سىناپ بېقىڭ Installed, effective after logging out. 已安装,注销后生效 Detecting And Update... تەكشۈرۈش يېڭىلاش جەريانىدا... The current version is already the latest version: %1 Last detection time: %2 نۆۋەتتە ئەڭ يېڭى نۇسخىسى: ٪1 ئالدىنقى قېتىم تەكشۈرۈش ۋاقتى: 2 Version: %1 Last detection time: %2 نۇسخىسى: 1 ئالدىنقى قېتىم تەكشۈرۈش ۋاقتى: 2 Detected an upgradable version: %1 Last detection time: %2 تەكشۈرۈپ بايقىغاندا يېڭىلىغىلى بولىدىغان نۇسخىسى: ٪1 ئالدىنقى قېتىم تەكشۈرۈش ۋاقتى: 2 Uninstalling... يۈك چۈشۈرۈش جەريانىدا... Cancel ئەمەلدىن قالدۇرۇش LogOut Later 稍后注销 LogOut Immediately 立即注销 Reboot Immediately دەرھال قايتىدىن قوزغىتىش Reboot Later سەل تۇرۇپ قايتا قوزغىتىڭ The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? AI تارماق سىستېمىسى قۇراشتۇرۇلۇپ بولدى، سىستېمىنى قايتىدىن قوزغىغاندىن كېيىن ئاندىن كۈچكە ئىگە بولىدۇ، قايتىدىن قوزغىتامدۇ؟ Installed, effective after restarting. قۇراشتۇرۇلۇپ قايتىدىن قوزغاتقاندىن كېيىن كۈچكە ئىگە loading يۈك قاچىلاش جەريانىدا... Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、记忆地图、麒麟速记等。 Kylin Ai SubSystem 麒麟AI子系统 Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. 为AI应用和AI功能提供运行环境。如模型文件、运行时库、配置参数等。 Kylin AI SubSystem بولىن AI تارماق سىستېمىسى Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. AI قوللىنىش ۋە AI ئىقتىدارىنى يۈرۈشتۈرۈش مۇھىتى بىلەن تەمىنلەيدۇ . مەسىلەن مودېل ھۆججەت ، يۈرۈشتۈرۈش ۋاقىت ئامبىرى ، سەپلەش پارامېتىرى قاتارلىقلار . TestAiSubSystem Model Configuration مودېل تەقسىملەش Cloud Model (Kylin Certification) بۇلۇتلۇق مودېل ( بوتۇلكىلىق ئىسپاتلاش ) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) بوتۇلكىلىق گۇۋاھنامەدىن ئۆتكەن بۇلۇتلۇق مودېل سەپلەنگەن ( بۇلۇتلۇق مۇلازىمەتچىگە ئورۇنلاشتۇرۇلغان ، تور ئارقىلىق زىيارەت قىلىش ۋە ئىشلىتىش ) Local Model (Kylin Certification) يەرلىك مودېل ( بوتۇلكا ئىسپاتلاش ) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) بوتۇلكىلىق گۇۋاھنامەدىن ئۆتكەن يەرلىك مودېل سەپلەنگەن (يەرلىك ئۈسكۈنىلەرگە ئورنىتىلغان، تور ھاجەتسىزمۇ يۈرۈشتۈرگىلى بولىدۇ) Custom Model ئۆزى تاللايدىغان مودېل Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) بوتۇلكىنىڭ ئىسپاتلىشىدىن ئۆتمىگەن يەرلىك مودېل ھۆججەت، رايون تورى ۋە ئاممىۋى بۇلۇت مودېلى سەپلىمىسى (ئەگەر سىزگە قولايسىزلىق ئېلىپ كەلسە كەچۈرۈڭ) Failed to set cloud model priority بۇلۇتلۇق مودېل تەسىس قىلىشنىڭ ئىلغار دەرىجىسى مەغلۇپ بولدى Failed to set local model priority يەرلىك مودېل تەسىس قىلىش ئىلغار دەرىجىسى مەغلۇپ بولدى Failed to set custom model priority ئۆزى تاللايدىغان مودېل تەسىس قىلىشنىڭ ئىلغار دەرىجىسى مەغلۇپ بولدى Cloud model (recommended) 云端模型(推荐) Local Model (recommended) 本地模型(推荐) Cloud model (Kylin Certification) بۇلۇتلۇق مودېل ( بوتۇلكىلىق ئىسپاتلاش ) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this has caused any inconvenience to you, please understand) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this causes any inconvenience, please accept our sincere apologies.) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Deployed on the cloud server, access and use over the network 部署在云端服务器,通过网络访问和使用 Installed on local equipment, it can run without network 安装在本地设备上,无需网络也可运行 Private Model 自选模型 Flexible model management to meet personalized usage scenarios 灵活的模型管理方式,满足个性化使用场景 UpdateNotificationWidget Tips 提示 Apt update failed. 更新失败 Current downloading value is 100,now the model is install ,current can not stop . 下载进度为100时无法取消安装模型 Current model is downloading now ,Are you sure you to cancel the download? 模型正在下载,确定取消下载吗? kylin-ai-subsystem-plugin-1.0.0.2/translations/zh_CN.ts000066400000000000000000001327311520576575000230320ustar00rootroot00000000000000 AddBtn Add 添加 AddButton Add 添加 AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. 检测到部分 AI 应用版本过低,与子系统不兼容,可能导致功能受限。请升级至最新版本以确保正常使用。 Go to update 前往更新 Configure 前往更新 配置 CloudModelConfigWidget Cloud Model 云端模型 Deployed on the cloud server, access and use over the network 部署在云端服务器,通过网络访问和使用 NLP Model 文本类模型 Processing and generating text, such as understanding text and answering questions 处理和生成文字,比如理解文本、回答问题 Add 添加 Visual Model 图像类模型 Processing and generating images, such as recognizing objects and analyzing scenes 处理和生成图像,比如识别物体、分析场景 Speech Model 语音类模型 Processing sound and speech, such as recognizing speech and synthesizing speech 处理声音和语音,比如识别语音、合成语音 OK 确定 Model switching failed 设置为选中模型失败 Failed to delete model 删除模型失败 Model setup failed 设置模型失败 Model Editing failed 编辑模型失败 Cloud model 云端模型 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Free Trial Account 免费试用账号 kylin-ai-subsystem-modelconfig AI模型配置 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? kylin-aiassistant AI 助手 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Delete 删除 LocalModelConfigWidget Local Model 本地模型 Installed on local equipment, it can run without network 安装在本地设备上,无需网络也可运行 (Installing/uninstalling models requires a reboot to take effect) (安装/卸载模型需重启后生效) Install 安装 Update/Uninstall 更新/卸载 Built in model of the system 系统内置模型 The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation 图像识别、向量化、语音处理等其他系统运行所需的模型 NLP Model 文本类模型 Processing and generating text, such as understanding text and answering questions 处理和生成文字,比如理解文本、回答问题 OK 确定 Are you sure you want to exit? 确定要退出吗? The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? 模型正在安装中,退出可能导致安装失败。是否确定退出? Cancel 取消 Quit 退出 Exit current window? 退出当前窗口? The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. 模型安装将继续在后台运行,完成后需重启生效。 Built in model group 内置模型组 Model setup failed 设置模型失败 Model switching failed 设置为选中模型失败 Installing/uninstalling models requires a restart to take effect 安装/卸载模型需重启后生效 Processing and generating images, such as recognizing objects and analyzing scenes 处理和生成图像,比如识别物体、分析场景 Processing sound and speech, such as recognizing speech and synthesizing speech 处理声音和语音,比如识别语音、合成语音 Failed to delete model 删除模型失败 After downloading and installing, a restart is required to take effect 下载安装后需重启生效 After downloading and installing, you need to log out for it to take effect 下载安装后需注销生效 (The installation/uninstallation of the model will take effect after logging out) (安装/卸载模型需注销后生效) The installation/uninstallation of the model will take effect after logging out 安装/卸载模型需注销后生效 Installing/uninstalling models requires a reboot to take effect 安装/卸载模型需重启后生效 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Tips 提示 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 kylin-ai-modelconfig 模型配置 Current model not install,you can use the model after install it. 当前模型尚未安装,完成安装后才能正常使用。 Install Now 立即安装 kylin-aiassistant AI 助手 kylin-ai-subsystem-modelconfig AI模型配置 Ok 确定 Add 添加 Visual Model 图像类模型 Speech Model 语音类模型 LocalModelItem Discover a new version 发现新版本 Effective after reboot 重启后生效 Effective after reboot . 重启后生效 重启后生效 Detect Updates 检测更新 Install success! 安装成功! The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? 模型已经安装完成,需重启系统后才能生效,是否重启? Reboot Later 稍后重启 Reboot Immediately 立即重启 Take effect after rebooting 重启后生效 installing... 安装中... Net is error,Please check and try again 网络异常,请检查后重试 The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 未找到指定模型的安装包:%1,请检查软件源及网络状态并重新尝试 The current model installation package is not installed, it can be downloaded and installed 当前模型安装包未安装,可以下载及安装 New version needs to be updated upon discovery 发现新版本 The current model is already the latest model 当前模型已经是最新模型 Current model version is the lastest version 此版本已是最新 Current model install failed,please install manually. 安装错误,请手动安装。 Detect updates 检测更新 kylin-ai-subsystem-modelconfig_QMessageBox_installSuccess 安装成功! Tips 提示 Current model deb install finished 模型安装完成 ModelCallPriority Model call priority 模型调用优先级 Cloud model first (Kylin Certification) 优先云端模型(麒麟认证) Local model first (Kylin Certification) 优先本地模型(麒麟认证) Cloud model first 优先云端模型 Local model first 优先本地模型 Private model first 优先自选模型 Model Call Priority 模型调用优先级 ModelConfigDialog Ok 确定 Model Type 模型类型 Voice dictation & online voice synthesis (streaming version) 语音听写 & 在线语音合成(流式版) Real time voice transcription 实时语音转写 Model Configuration Tutorial 模型配置教程 Cancel 取消 Accept 确认 Add 添加 Cannot contain spaces, please re-enter! 不能含有空格,请重新输入! Add-NLP Model 添加-文本类模型 Add-Visual Model 添加-图像类模型 Add-Speech Model 添加-语音类模型 Required 必填 Edit-NLP Model 编辑-文本类模型 Edit-Visual Model 编辑-图像类模型 Edit-Speech Model 编辑-语音类模型 The model type already exists. Cannot be repeated! 已存在该模型类型,不可重复添加 Model Editing failed 编辑模型失败 Adding model failed 添加模型失败 Close 关闭 APPID APPID No account? Get Now 没有账号?立即获取 ModelDownload The current environment's dbus interface is abnormal 当前环境dbus接口异常 The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 检测到“AI 助手”版本过低,与子系统不兼容,可能导致功能受限。请升级至最新版本以确保正常使用。 The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 检测到“麒麟速记”版本过低,与子系统不兼容,可能导致功能受限。请升级至最新版本以确保正常使用。 The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 检测到“AI 助手”、“麒麟速记”版本过低,与子系统不兼容,可能导致功能受限。请升级至最新版本以确保正常使用。 Tips 提示 Backend init failed 后端初始化失败 The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 未找到指定模型的安装包:%1,请检查软件源及网络状态并重新尝试! The current model installation package is not installed, it can be downloaded and installed 当前模型安装包未安装,可以下载及安装 New version needs to be updated upon discovery 发现新版本 The current model is already the latest model 当前模型已经是最新模型 Cancel download failed 取消下载失败 ModelItem Edit 编辑 Delete 删除 ModelWidget Sort Upwards 排序靠前 Increase priority 提高优先级 Increase Priority 提高优先级 Configure 配置 PrivateModelConfigDialog Ok 确定 Add-NLP Model 添加-文本类模型 Add-Visual Model 添加-图像类模型 Add-Speech Model 添加-语音类模型 Edit-NLP Model 编辑-文本类模型 Edit-Visual Model 编辑-图像类模型 Edit-Speech Model 编辑-语音类模型 CustomName 自定义名称 ModelName 模型名称 RequestUrl 请求地址 Required (To distinguish models) 必填(用于区分模型) Optional 选填 Optional (Required for cloud services) 选填(云端服务必填) Required 必填 Cancel 取消 Accept 添加 The length must not exceed 32 characters 长度不得大于 32 字符 Cannot contain spaces, please re-enter! 不能含有空格,请重新输入! Duplicate name, please re-enter! 名称重复,请重新输入 Model Editing failed 编辑模型失败 Adding model failed 添加模型失败 Close 关闭 The model type already exists. Cannot be repeated! 已存在该模型类型,不可重复添加 APPID APPID PrivateModelConfigWidget Private Model 自选模型 Flexible model management to meet personalized usage scenarios 灵活的模型管理方式,满足个性化使用场景 NLP Model 文本类模型 Processing and generating text, such as understanding text and answering questions 处理和生成文字,比如理解文本、回答问题 Add 添加 OK 确定 Failed to delete model 删除模型失败 Model setup failed 设置模型失败 Model Editing failed 编辑模型失败 Model switching failed 设置为选中模型失败 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,当前AI助手有任务正在使用此模型,请等待任务结束后再尝试。 Retry 重试 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? Delete 删除 PrivateModelItemWidget Edit 编辑 Delete 删除 QAptDownLoadDeb Tips 提示 Backend init failed 后端初始化失败 %1 package not founds %1 安装包未找到 Failed to create transaction. 事件创建失败 Package could not be update. 无法更新包 The current model is already the latest model 当前模型已经是最新模型 New version needs to be updated upon discovery 发现新版本 QObject Cancel 取消 Ok 确定 Sorry, the model is currently executing another task. Please try again after it is completed.. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Retry 重试 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 删除此模型可能导致依赖此模型的应用无法正常运行,您确定要删除吗? Delete 删除 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,该模型当前正在执行其他任务,请等待完成后重试。 Cloud model first (Kylin Certification) 优先云端模型(麒麟认证) Local model first (Kylin Certification) 优先本地模型(麒麟认证) Custom model first 优先自选模型 Private model first 优先自选模型 Cloud Model First (Kylin Certification) 优先云端模型(麒麟认证) Local Model First (Kylin Certification) 优先本地模型(麒麟认证) Custom Model First 优先自选模型 SubSystemInstallModule AIModuleManager AI模块管理 AI SubSystem AI子系统 /aisubsystem/AI SubSystem aisubsystem AI子系统 loading plugin 加载插件中... AI Models AI模块管理 Model Configuration 模型配置 /aisubsystem/Model Configuration SubSystemWidget AI SubSystem AI子系统 Ai SubSystem AI子系统 Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、数据管家、记忆地图、麒麟速记等。 Version: %1 版本: %1 Install 安装 LogOut immediately 立即注销 Update 更新 Detect Update 检测更新 UnInstall 卸载 Install success! 安装成功! The AI subsystem has been installed and needs to be logged out before it can take effect. Do you want to log out? AI子系统已经安装完成,需要注销后才能生效,是否注销? Are you sure you want to uninstall the AI subsystem? 确定要卸载 AI子系统吗? After uninstallation, the AI services of related applications will not be available. 卸载后,相关应用的 AI 服务将无法使用。 Uninstall 卸载 AI service unavailable AI 服务不可用 The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. 未检测到 AI 子系统,应用的 AI 服务无法使用。请前往 系统设置 > AI模块管理 页进行安装 。 Go Now 立即前往 Installing... 安装中... Installation failed, necessary files are missing. 安装失败,必要文件缺失 Network abnormality, please check the network connection and try again. 网络异常,请检查网络连接后再试 Installed, effective after logging out. 已安装,注销后生效 Detecting And Update... 检测更新中... The current version is already the latest version: %1 Last detection time: %2 当前已是最新版本: %1 上次检测时间: %2 Version: %1 Last detection time: %2 版本: %1 上次检测时间: %2 Detected an upgradable version: %1 Last detection time: %2 检测到可更新版本: %1 上次检测时间: %2 Uninstalling... 卸载中... Cancel 取消 LogOut Later 稍后注销 LogOut Immediately 立即注销 Reboot Immediately 立即重启 Reboot Later 稍后重启 The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? AI子系统已经安装完成,需重启系统后才能生效,是否重启? Installed, effective after restarting. 已安装,重启后生效 loading 加载中... Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. 为 AI 应用或功能提供运行环境。如,AI助手、记忆地图、麒麟速记等。 Kylin Ai SubSystem 麒麟AI子系统 Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. 为AI应用和AI功能提供运行环境。如模型文件、运行时库、配置参数等。 Kylin AI SubSystem 麒麟AI子系统 Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. 为 AI 应用和 AI 功能提供运行环境。如模型文件、运行时库、配置参数等。 TestAiSubSystem Model Configuration 模型配置 Cloud Model (Kylin Certification) 云端模型(麒麟认证) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) 配置经过麒麟认证的云端模型(部署在云端服务器,通过网络访问和使用) Local Model (Kylin Certification) 本地模型(麒麟认证) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) 配置经过麒麟认证的本地模型(安装在本地设备上,无需网络也可运行) Custom Model 自选模型 Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) Failed to set cloud model priority 设置云端模型优先级失败 Failed to set local model priority 设置本地模型优先级失败 Failed to set custom model priority 设置自选模型优先级失败 Cloud model (recommended) 云端模型(推荐) Local Model (recommended) 本地模型(推荐) Cloud model (Kylin Certification) 云端模型(麒麟认证) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this has caused any inconvenience to you, please understand) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) Configure local model files, LAN, and public cloud model configurations without Kylin authentication (If this causes any inconvenience, please accept our sincere apologies.) 配置未经麒麟认证的本地模型文件、局域网和公有云模型配置(若给您带来不便,敬请谅解) kylin-ai-subsystem-modelconfig AI模型配置 Cancel 取消 Ok 确定 Deployed on the cloud server, access and use over the network 部署在云端服务器,通过网络访问和使用 Installed on local equipment, it can run without network 安装在本地设备上,无需网络也可运行 Private Model 自选模型 Flexible model management to meet personalized usage scenarios 灵活的模型管理方式,满足个性化使用场景 UpdateNotificationWidget Tips 提示 Apt update failed. 更新失败 Current downloading value is 100,now the model is install ,current can not stop . 下载进度为100时无法取消安装模型 Current model is downloading now ,Are you sure you to cancel the download? 模型正在下载,确定取消下载吗? kylin-ai-subsystem-plugin-1.0.0.2/translations/zh_HK.ts000066400000000000000000001704621520576575000230370ustar00rootroot00000000000000 AddBtn Add 添加 AddButton Add 添加 AppVersionErrorWarningWidget which may lead limited functionality. Please upgrade to the latest version to ensure proper usage. 檢測到部分 AI 應用版本過低,與子系統不兼容,可能導致功能受限。請升級至最新版本以確保正常使用。 Go to update 前往更新 CloudModelConfigWidget Cloud Model 雲端模型 Deployed on the cloud server, access and use over the network 部署在雲端服務器,通過網絡訪問和使用 NLP Model 大語言模型 Processing and generating text, such as understanding text and answering questions 處理和生成文字,比如理解文本,回答問題 Add 添加 Visual Model 視覺模型 Processing and generating images, such as recognizing objects and analyzing scenes 處理和生成圖像,比如識別物體,分析場景 Speech Model 語音模型 Processing sound and speech, such as recognizing speech and synthesizing speech 處理聲音和語音,比如辨識語音,合成語音 OK 確定 Model switching failed 設置為選中模型失敗 Failed to delete model 刪除模型失敗 Model setup failed 設置模型失敗 Model Editing failed 編輯模型失敗 Cloud model 雲端模型 Deploy on cloud servers, access and use through the network 部署在雲端伺服器,通過網路訪問和使用 Free Trial Account 免費試用賬號 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,該模型當前正在執行其他任務,請等待完成後重試。 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 刪除此模型可能導致依賴此模型的應用無法正常運行,您確定要刪除嗎? kylin-ai-subsystem-modelconfig AI模型配置 kylin-aiassistant AI 助手 Cancel 取消 Ok 確定 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,當前AI助手有任務正在使用此模型,請等待任務結束后再嘗試。 Retry 重試 Deleting this model may cause applications that rely on it to malfunction. Are you sure you want to delete it? 刪除此模型可能導致依賴此模型的應用無法正常運行。 您確定要刪除嗎? Delete 刪除 LocalModelConfigWidget Local Model 本地模型 Installed on local equipment, it can run without network 安裝在本地設備上,無需網路也可運行 (Installing/uninstalling models requires a reboot to take effect) (安裝/卸載模型需重啟後生效) Install 安裝 Update/Uninstall 更新/卸載 Built in model of the system 系統內置模型 The system has built-in models for image recognition, vectorization, speech processing, and other necessary models for system operation 圖像識別、向量化、語音處理等其他系統運行所需的模型 NLP Model 大語言模型 Processing and generating text, such as understanding text and answering questions 處理和生成文字,比如理解文本,回答問題 OK 確定 Are you sure you want to exit? 確定要退出嗎? The model is currently being installed, exiting may result in installation failure. Are you sure you want to exit? 模型正在安裝中,退出可能導致安裝失敗。 是否確定退出? Cancel 取消 Quit 退出 Exit current window? 退出當前窗口? The model installation will continue to run in the background. A restart is required for the changes to take effect once completed. 模型安装将继续在后台运行,完成后需重启生效。 Built in model group 內置模型組 Model setup failed 設置模型失敗 Model switching failed 設置為選中模型失敗 Installing/uninstalling models requires a restart to take effect 安裝/卸載模型需重啟後生效 Processing and generating images, such as recognizing objects and analyzing scenes 處理和生成圖像,比如識別物體,分析場景 Processing sound and speech, such as recognizing speech and synthesizing speech 處理聲音和語音,比如辨識語音,合成語音 After downloading and installing, a restart is required to take effect 下載安裝後需重啟生效 After downloading and installing, you need to log out for it to take effect 下載安裝後需註銷生效 (The installation/uninstallation of the model will take effect after logging out) (安裝/卸載模型需註銷後生效) The installation/uninstallation of the model will take effect after logging out 安裝/卸載模型需註銷後生效 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,該模型當前正在執行其他任務,請等待完成後重試。 Failed to delete model 刪除模型失敗 Installing/uninstalling models requires a reboot to take effect 安裝/卸載模型需重啟後生效 Tips 提示 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,當前AI助手有任務正在使用此模型,請等待任務結束后再嘗試。 Retry 重試 kylin-ai-modelconfig 模型配置 Current model not install,you can use the model after install it. 當前模型尚未安裝,完成安裝後才能正常使用。 Install Now 立即安裝 kylin-aiassistant AI 助手 kylin-ai-subsystem-modelconfig AI模型配置 Ok 確定 Add 添加 Visual Model 視覺模型 Speech Model 語音模型 LocalModelItem Discover a new version 發現新版本 Detect updates 檢測更新 kylin-ai-subsystem-modelconfig_QMessageBox_installSuccess 安裝成功 Effective after reboot 重啟後生效 Effective after reboot . 重啟後生效 Detect Updates 檢測更新 Install success! 安裝成功 The ondevice model has been installed and needs to be restarted before it can take effect. Do you want to restart it? 模型已經安裝完成,需重啟系統後才能生效,是否重啟? Reboot Later 稍後重啟 Reboot Immediately 立即重啟 Take effect after rebooting 重啟後生效 installing... 安裝中... Net is error,Please check and try again 網絡異常,請檢查後重試 The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 未找到指定模型的安裝包:%1,請檢查軟體源及網路狀態並重新嘗試 The current model installation package is not installed, it can be downloaded and installed 當前模型安裝包未安裝,可以下載及安裝 New version needs to be updated upon discovery 發現新版本需要更新 The current model is already the latest model 當前模型已經是最新模型 Current model version is the lastest version 此版本已是最新 Current model install failed,please install manually. 安裝錯誤,請手動安裝。 Net is error 網路異常 Tips 提示 Current model deb install finished 模型安裝完成 ModelCallPriority Model call priority 模型調用優先順序 Cloud model first (Kylin Certification) 優先雲端模型(麒麟認證) Local model first (Kylin Certification) 優先本地模型(麒麟認證) Cloud model first 優先雲端模型 Local model first 優先本地模型 Private model first 優先自選模型 Model Call Priority 模型調用優先順序 ModelConfigDialog Ok 確定 Model Type 模型類型 Voice dictation & online voice synthesis (streaming version) 語音聽寫 & 線上語音合成(流式版) Real time voice transcription 即時語音轉寫 Model Configuration Tutorial 模型配置教程 Cancel 取消 Accept 確認 Add 添加 Cannot contain spaces, please re-enter! 不能含有空格,請重新輸入! Add-NLP Model 添加-大語言模型 Add-Visual Model 添加-視覺模型 Add-Speech Model 添加-語音模型 Required 必填 Edit-NLP Model 編輯-大語言模型 Edit-Visual Model 編輯-視覺模型 Edit-Speech Model 編輯-語音模型 The model type already exists. Cannot be repeated! 已存在該模型類型,不可重複添加 Model Editing failed 編輯模型失敗 Adding model failed 添加模型失敗 Close 關閉 APPID APPID No account? Get Now 沒有帳號? 立即獲取 Must write 必填 ModelDownload The current environment's dbus interface is abnormal 當前環境dbus介面異常 The 'kylin-aiassistant' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 檢測到“AI 助手”版本過低,與子系統不兼容,可能導致功能受限。請升級至最新版本以確保正常使用。 The 'kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 檢測到“麒麟速記”版本過低,與子系統不兼容,可能導致功能受限。請升級至最新版本以確保正常使用。 The 'kylin-aiassistant,kylin-note' version is outdated and incompatible with the subsystem, which may result in limited functionality. Please upgrade to the latest version to ensure proper usage. 檢測到“AI 助手”、“麒麟速記”版本過低,與子系統不兼容,可能導致功能受限。請升級至最新版本以確保正常使用。 Tips 提示 Backend init failed 後端初始化失敗 The installation package for the specified model was not found:% 1. Please check the software source and network status and try again! 找不到指定模型的安裝包:%1,請檢查軟體源及網路狀態並重新嘗試! The current model installation package is not installed, it can be downloaded and installed 當前模型安裝包未安裝,可以下載及安裝 New version needs to be updated upon discovery 發現新版本需要更新 The current model is already the latest model 當前模型已經是最新模型 Cancel download failed 取消下載失敗 ModelItem Edit 編輯 Delete 刪除 ModelWidget Sort Upwards 排序靠前 Increase priority 提高優先級 Increase Priority 提高優先級 Configure 配置 PrivateModelConfigDialog Ok 確定 Add-NLP Model 添加-大語言模型 Add-Visual Model 添加-視覺模型 Add-Speech Model 添加-語音模型 Edit-NLP Model 編輯-文本類模型 Edit-Visual Model 編輯-圖像類模型 Edit-Speech Model 編輯-語音類模型 CustomName 自定義名稱 ModelName 模型名稱 RequestUrl 請求地址 Required (To distinguish models) 必填(用於區分模型) Optional 選填 Optional (Required for cloud services) 選填(雲端服務必填) Required 必填 Cancel 取消 Accept 確認 The length must not exceed 32 characters 長度不得大於 32 字符 Cannot contain spaces, please re-enter! 不能含有空格,請重新輸入! Duplicate name, please re-enter! 名稱重復,請重新輸入 Model Editing failed 編輯模型失敗 Adding model failed 添加模型失敗 Close 關閉 APPID APPID PrivateModelConfigWidget Private Model 自訂模型 Flexible model management to meet personalized usage scenarios 靈活的模型管理方式,滿足個性化使用場景 NLP Model 大語言模型 Processing and generating text, such as understanding text and answering questions 處理和生成文字,比如理解文本,回答問題 Add 添加 OK 確定 Failed to delete model 刪除模型失敗 Model setup failed 設置模型失敗 Model Editing failed 編輯模型失敗 Model switching failed 設置為選中模型失敗 Cancel 取消 Ok 確定 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,該模型當前正在執行其他任務,請等待完成後重試。 Sorry, the kylin-aiassistant is currently using this model for a task. Please wait for the task to finish before attempting again. 抱歉,當前AI助手有任務正在使用此模型,請等待任務結束后再嘗試。 Retry 重試 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 刪除此模型可能導致依賴此模型的應用無法正常運行,您確定要刪除嗎? Delete 刪除 PrivateModelItemWidget Edit 編輯 Delete 刪除 QAptDownLoadDeb Tips 提示 Backend init failed 後端初始化失敗 %1 package not founds %1 安裝包未找到 Failed to create transaction. 事件創建失敗 Package could not be update. 無法更新包 The current model is already the latest model 當前模型已經是最新模型 New version needs to be updated upon discovery 發現新版本需要更新 QObject Cancel 取消 Ok 確定 Sorry, the model is currently executing another task. Please try again after it is completed.. 抱歉,該模型當前正在執行其他任務,請等待完成後重試。 Retry 重試 Deleting this model may cause apps that rely on this model to not function properly, are you sure you want to remove it? 刪除此模型可能導致依賴此模型的應用無法正常運行,您確定要刪除嗎? Delete 刪除 Sorry, the model is currently executing another task. Please try again after it is completed. 抱歉,該模型當前正在執行其他任務,請等待完成後重試。 Cloud model first (Kylin Certification) 優先雲端模型(麒麟認證) Local model first (Kylin Certification) 優先本地模型(麒麟認證) Custom model first 優先自選模型 Private model first 優先自選模型 Cloud Model First (Kylin Certification) 優先雲端模型(麒麟認證) Local Model First (Kylin Certification) 優先本地模型(麒麟認證) Custom Model First 優先自選模型 SubSystemInstallModule AIModuleManager AI模塊管理 AI Models AI模塊管理 loading plugin 加載插件中... Model Configuration 模型配置 /aisubsystem/Model Configuration aisubsystem AI子系統 AI SubSystem AI子系統 /aisubsystem/AI SubSystem SubSystemWidget AI SubSystem AI子系統 Ai SubSystem AI子系統 Provide a runtime environment for AI applications or functions.For example, AI assistants, data managers, memory maps, kylin shorthand, etc. 為 AI 應用或功能提供運行環境。如,AI助手、數據管家、記憶地圖、麒麟速記等。 loading 加載中... Install 安裝 Reboot Immediately 立即重啟 Update 更新 Kylin Ai SubSystem 麒麟AI子系統 Kylin AI SubSystem 麒麟AI子系統 Provide a runtime environment for AI applications or functions.For example, Model file, Runtime library, Configuration parameter, etc. 為AI應用和AI功能提供運行環境。如模型文件、運行時庫、配置參數等。 Provide a runtime environment for AI applications or functions.Such as model files, runtime libraries, configuration parameters,etc. 為AI應用和AI功能提供運行環境。如模型文件、運行時庫、配置參數等。 Detect Update 檢測更新 UnInstall 卸載 Install success! 安裝成功! The AI subsystem has been installed and needs to be restarted before it can take effect. Do you want to restart it? 未檢測到AI子系統,應用的A 服務無法使用。請前往系統設置 > AI模塊管理 頁進行安裝 。 Reboot Later 稍後重啟 Are you sure you want to uninstall the AI subsystem? 確定要卸載 AI子系統嗎? After uninstallation, the AI services of related applications will not be available. 卸載後,相關應用的 AI 服務將無法使用。 Cancel 取消 Uninstall 卸載 AI service unavailable AI服務不可用 The AI subsystem was not detected, and the AI service of the application cannot be used. Please go to System Settings>AI Module Management page to install. 未檢測到AI子系統,應用的AI服務無法使用。請前往系統設置 > AI模塊管理頁進行安裝 。 Go Now 立即前往 Version: %1 版本: %1 Version: %1 Last detection time: %2 版本: %1 上次檢測時間: %2 Detected an upgradable version: %1 Last detection time: %2 檢測到可更新版本: %1 上次檢測時間: %2 Installed, effective after restarting. 已安裝,重啟後生效 Installing... 安裝中... Provide a runtime environment for AI applications or functions.For example, AI assistants, memory maps, kylin shorthand, etc. 為 AI 應用或功能提供運行環境。如,AI助手、記憶地圖、麒麟速記等。 Uninstalling... 卸載中... The current version is already the latest version: %1 Last detection time: %2 當前已是最新版本: %1 上次檢測時間: %2 Installation failed, necessary files are missing. 安裝失敗,必要文件缺失 Network abnormality, please check the network connection and try again. 網絡異常,請檢查網絡連接後再試 Detecting And Update... 檢測更新中... TestAiSubSystem Model Configuration 模型配置 Cloud Model (Kylin Certification) 雲端模型(麒麟認證) Configure cloud models certified by Kylin (Deployed on the cloud server, access and use over the network) 配置經過麒麟認證的雲端模型(部署在雲端服務器,通過網絡訪問和使用) Local Model (Kylin Certification) 本地模型(麒麟認證) Configure a local model certified by Kylin (Installed on local equipment, it can run without network) 配置經過麒麟認證的本地模型(安裝在本地設備上,無需網絡也可運行) Custom Model 自選模型 Configure local model files, LAN, and public cloud model configurations without Kylin authentication (we apologize for any inconvenience causeds.) 配置未經麒麟認證的本地模型文件、局域網和公有雲模型配置(若給您帶來不便,敬請諒解) Failed to set cloud model priority 設置雲端模型優先級失敗 Failed to set local model priority 設置本地模型優先級失敗 Failed to set custom model priority 設置自選模型優先級失敗 Cloud model (Kylin Certification) 雲端模型(麒麟認證) Cancel 取消 Ok 確定 Cloud Model 雲端模型 Deployed in the cloud server, accessed and used through the network 部署在雲端伺服器,通過網路訪問和使用 Local Model 本地模型 Installed on local equipment, it can run without network 安裝在本地設備上,無需網路也可運行 Private Model 自訂模型 You can modify the model by youself 靈活的模型管理方式,滿足個人化使用場景 UpdateNotificationWidget Tips 提示 Apt update failed. 更新失敗 Current downloading value is 100,now the model is install ,current can not stop . 下載進度為100時無法取消安裝模型 Current model is downloading now ,Are you sure you to cancel the download? 模型正在下載,確定取消下載嗎? kylin-ai-subsystem-plugin-1.0.0.2/usr/000077500000000000000000000000001520576575000175425ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/usr/share/000077500000000000000000000000001520576575000206445ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/usr/share/pkgconfig/000077500000000000000000000000001520576575000226135ustar00rootroot00000000000000kylin-ai-subsystem-plugin-1.0.0.2/usr/share/pkgconfig/kylin-ai-subsystem-plugin.pc000066400000000000000000000002051520576575000302010ustar00rootroot00000000000000Name: libkylin-ai-subsystem-plugin Description: Ai sub system plugin Version: 1.0.0 Cflags: -I/usr/include/kylin-ai-subsystem-plugin