├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── SECURITY.md ├── basic_usage.md ├── example ├── README.md ├── csharp │ ├── CSharpClientExample │ │ ├── Benchmark.cs │ │ ├── CSharpClientExample.csproj │ │ ├── Program.cs │ │ ├── README.md │ │ └── Tests │ │ │ └── simple.json │ └── example.sln ├── golang │ ├── README.md │ ├── go.mod │ ├── go.sum │ ├── main.go │ └── proto │ │ ├── superbuilder_middleware.pb.go │ │ └── superbuilder_middleware_grpc.pb.go ├── proto │ └── superbuilder_service.proto ├── python │ ├── README.md │ ├── client.py │ ├── examples │ │ ├── chat_examples.py │ │ ├── client_examples.py │ │ ├── outlook_example.py │ │ ├── query_examples.py │ │ ├── rag_examples.py │ │ └── resources │ │ │ ├── Minimum Wages Order 2022.pdf │ │ │ └── image.jpg │ ├── export2ov.bat │ ├── helpers │ │ ├── chat.py │ │ ├── config.py │ │ ├── model.py │ │ ├── mw.py │ │ ├── parameters.py │ │ └── rag.py │ ├── install.bat │ ├── requirements.txt │ ├── run.bat │ ├── run_tests.bat │ ├── superbuilder_middleware_pb2.py │ ├── superbuilder_middleware_pb2_grpc.py │ └── tests │ │ ├── test_chat.py │ │ ├── test_config.py │ │ ├── test_mw.py │ │ ├── test_parameters.py │ │ └── test_rag.py └── run-smoke-test.ps1 ├── media ├── 12203a5085925a8714a0b28efa36423e.png ├── 1c963aec81be29b3d949e5f6231af2fe.png ├── 24e3d8d9071449014e01ac1399c93b9c.png ├── 40986ed2aad5910769328c62d5497d7e.png ├── 56896a80bc165e94ad83392a67239ec9.png ├── 596a08fd2d25c663654baed1113da405.png ├── 8e0e5bdf9efab056bf271f95906cf93d.png ├── 917896de1185740322e7ad5f45d79c15.jpeg ├── 9bf109917571555fefb578d4fd005e27.png ├── 9e1c571d44058fd8acf1ce4e04b8a343.png ├── SuperBuilder_1_2_Feature_Review_20250529.mp4 ├── SuperBuilder_Demo_AIPC_to_Cluster_20250529.mp4 ├── SuperBuilder_Demo_Multi_Agent_20250529.mp4 ├── api_service.png ├── api_service_border.png ├── b7ee6629bd1d637ab0c16dfcf186b306.png ├── d4303d539460099455c351596781655e.png ├── e02aa4c73fade1e31f7c426b7cdcd194.png ├── f48b205f630b9807f1b2c65f3a908698.png ├── models_action.png ├── models_action_border.png ├── notification_border.png ├── resume_match1.png ├── resume_match2.png ├── superbuild_ui.png ├── superbuild_ui_border.png ├── webportal.jpeg ├── webportal_border.png └── white_title_bar.png └── special_query.md /.gitignore: -------------------------------------------------------------------------------- 1 | .venv 2 | __pycache__ 3 | example/csharp/CSharpClientExample/obj/* 4 | example/csharp/CSharpClientExample/bin/* 5 | **/.vs/* -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, caste, color, religion, or sexual 10 | identity and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the overall 26 | community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or advances of 31 | any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email address, 35 | without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | CommunityCodeOfConduct AT intel DOT com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series of 86 | actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or permanent 93 | ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within the 113 | community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.1, available at 119 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 120 | 121 | Community Impact Guidelines were inspired by 122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 123 | 124 | For answers to common questions about this code of conduct, see the FAQ at 125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 126 | [https://www.contributor-covenant.org/translations][translations]. 127 | 128 | [homepage]: https://www.contributor-covenant.org 129 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 130 | [Mozilla CoC]: https://github.com/mozilla/diversity 131 | [FAQ]: https://www.contributor-covenant.org/faq 132 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ### License 4 | 5 | Intel AI Assistant Builder is licensed under the terms in [LICENSE](LICENSE.md). By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms. 6 | 7 | ### Sign your work 8 | 9 | Please use the sign-off line at the end of the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify 10 | the below (from [developercertificate.org](http://developercertificate.org/)): 11 | 12 | ``` 13 | Developer Certificate of Origin 14 | Version 1.1 15 | 16 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 17 | 660 York Street, Suite 102, 18 | San Francisco, CA 94110 USA 19 | 20 | Everyone is permitted to copy and distribute verbatim copies of this 21 | license document, but changing it is not allowed. 22 | 23 | Developer's Certificate of Origin 1.1 24 | 25 | By making a contribution to this project, I certify that: 26 | 27 | (a) The contribution was created in whole or in part by me and I 28 | have the right to submit it under the open source license 29 | indicated in the file; or 30 | 31 | (b) The contribution is based upon previous work that, to the best 32 | of my knowledge, is covered under an appropriate open source 33 | license and I have the right under that license to submit that 34 | work with modifications, whether created in whole or in part 35 | by me, under the same open source license (unless I am 36 | permitted to submit under a different license), as indicated 37 | in the file; or 38 | 39 | (c) The contribution was provided directly to me by some other 40 | person who certified (a), (b) or (c) and I have not modified 41 | it. 42 | 43 | (d) I understand and agree that this project and the contribution 44 | are public and that a record of the contribution (including all 45 | personal information I submit with it, including my sign-off) is 46 | maintained indefinitely and may be redistributed consistent with 47 | this project or the open source license(s) involved. 48 | ``` 49 | 50 | Then you just add a line to every git commit message: 51 | 52 | Signed-off-by: Joe Smith 53 | 54 | Use your real name (sorry, no anonymous contributions.) 55 | 56 | If you set your `user.name` and `user.email` git configs, you can sign your 57 | commit automatically with `git commit -s`. 58 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Source code licensed under the MIT License 2 | SPDX-License-Identifier: MIT 3 | 4 | Copyright (c) 2025 Intel Corporation 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | ======================================================================= 25 | 26 | 27 | 28 | 29 | Documentation and non-code assets licensed under Creative Commons Attribution 30 | 4.0 International 31 | SPDX-License-Identifier: CC-BY-4.0 32 | 33 | Attribution 4.0 International 34 | 35 | ======================================================================= 36 | 37 | Creative Commons Corporation ("Creative Commons") is not a law firm and 38 | does not provide legal services or legal advice. Distribution of 39 | Creative Commons public licenses does not create a lawyer-client or 40 | other relationship. Creative Commons makes its licenses and related 41 | information available on an "as-is" basis. Creative Commons gives no 42 | warranties regarding its licenses, any material licensed under their 43 | terms and conditions, or any related information. Creative Commons 44 | disclaims all liability for damages resulting from their use to the 45 | fullest extent possible. 46 | 47 | Using Creative Commons Public Licenses 48 | 49 | Creative Commons public licenses provide a standard set of terms and 50 | conditions that creators and other rights holders may use to share 51 | original works of authorship and other material subject to copyright 52 | and certain other rights specified in the public license below. The 53 | following considerations are for informational purposes only, are not 54 | exhaustive, and do not form part of our licenses. 55 | 56 | Considerations for licensors: Our public licenses are 57 | intended for use by those authorized to give the public 58 | permission to use material in ways otherwise restricted by 59 | copyright and certain other rights. Our licenses are 60 | irrevocable. Licensors should read and understand the terms 61 | and conditions of the license they choose before applying it. 62 | Licensors should also secure all rights necessary before 63 | applying our licenses so that the public can reuse the 64 | material as expected. Licensors should clearly mark any 65 | material not subject to the license. This includes other CC- 66 | licensed material, or material used under an exception or 67 | limitation to copyright. More considerations for licensors: 68 | wiki.creativecommons.org/Considerations_for_licensors 69 | 70 | Considerations for the public: By using one of our public 71 | licenses, a licensor grants the public permission to use the 72 | licensed material under specified terms and conditions. If 73 | the licensor's permission is not necessary for any reason--for 74 | example, because of any applicable exception or limitation to 75 | copyright--then that use is not regulated by the license. Our 76 | licenses grant only permissions under copyright and certain 77 | other rights that a licensor has authority to grant. Use of 78 | the licensed material may still be restricted for other 79 | reasons, including because others have copyright or other 80 | rights in the material. A licensor may make special requests, 81 | such as asking that all changes be marked or described. 82 | Although not required by our licenses, you are encouraged to 83 | respect those requests where reasonable. More considerations 84 | for the public: 85 | wiki.creativecommons.org/Considerations_for_licensees 86 | 87 | ======================================================================= 88 | 89 | Creative Commons Attribution 4.0 International Public License 90 | 91 | By exercising the Licensed Rights (defined below), You accept and agree 92 | to be bound by the terms and conditions of this Creative Commons 93 | Attribution 4.0 International Public License ("Public License"). To the 94 | extent this Public License may be interpreted as a contract, You are 95 | granted the Licensed Rights in consideration of Your acceptance of 96 | these terms and conditions, and the Licensor grants You such rights in 97 | consideration of benefits the Licensor receives from making the 98 | Licensed Material available under these terms and conditions. 99 | 100 | 101 | Section 1 -- Definitions. 102 | 103 | a. Adapted Material means material subject to Copyright and Similar 104 | Rights that is derived from or based upon the Licensed Material 105 | and in which the Licensed Material is translated, altered, 106 | arranged, transformed, or otherwise modified in a manner requiring 107 | permission under the Copyright and Similar Rights held by the 108 | Licensor. For purposes of this Public License, where the Licensed 109 | Material is a musical work, performance, or sound recording, 110 | Adapted Material is always produced where the Licensed Material is 111 | synched in timed relation with a moving image. 112 | 113 | b. Adapter's License means the license You apply to Your Copyright 114 | and Similar Rights in Your contributions to Adapted Material in 115 | accordance with the terms and conditions of this Public License. 116 | 117 | c. Copyright and Similar Rights means copyright and/or similar rights 118 | closely related to copyright including, without limitation, 119 | performance, broadcast, sound recording, and Sui Generis Database 120 | Rights, without regard to how the rights are labeled or 121 | categorized. For purposes of this Public License, the rights 122 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 123 | Rights. 124 | 125 | d. Effective Technological Measures means those measures that, in the 126 | absence of proper authority, may not be circumvented under laws 127 | fulfilling obligations under Article 11 of the WIPO Copyright 128 | Treaty adopted on December 20, 1996, and/or similar international 129 | agreements. 130 | 131 | e. Exceptions and Limitations means fair use, fair dealing, and/or 132 | any other exception or limitation to Copyright and Similar Rights 133 | that applies to Your use of the Licensed Material. 134 | 135 | f. Licensed Material means the artistic or literary work, database, 136 | or other material to which the Licensor applied this Public 137 | License. 138 | 139 | g. Licensed Rights means the rights granted to You subject to the 140 | terms and conditions of this Public License, which are limited to 141 | all Copyright and Similar Rights that apply to Your use of the 142 | Licensed Material and that the Licensor has authority to license. 143 | 144 | h. Licensor means the individual(s) or entity(ies) granting rights 145 | under this Public License. 146 | 147 | i. Share means to provide material to the public by any means or 148 | process that requires permission under the Licensed Rights, such 149 | as reproduction, public display, public performance, distribution, 150 | dissemination, communication, or importation, and to make material 151 | available to the public including in ways that members of the 152 | public may access the material from a place and at a time 153 | individually chosen by them. 154 | 155 | j. Sui Generis Database Rights means rights other than copyright 156 | resulting from Directive 96/9/EC of the European Parliament and of 157 | the Council of 11 March 1996 on the legal protection of databases, 158 | as amended and/or succeeded, as well as other essentially 159 | equivalent rights anywhere in the world. 160 | 161 | k. You means the individual or entity exercising the Licensed Rights 162 | under this Public License. Your has a corresponding meaning. 163 | 164 | 165 | Section 2 -- Scope. 166 | 167 | a. License grant. 168 | 169 | 1. Subject to the terms and conditions of this Public License, 170 | the Licensor hereby grants You a worldwide, royalty-free, 171 | non-sublicensable, non-exclusive, irrevocable license to 172 | exercise the Licensed Rights in the Licensed Material to: 173 | 174 | a. reproduce and Share the Licensed Material, in whole or 175 | in part; and 176 | 177 | b. produce, reproduce, and Share Adapted Material. 178 | 179 | 2. Exceptions and Limitations. For the avoidance of doubt, where 180 | Exceptions and Limitations apply to Your use, this Public 181 | License does not apply, and You do not need to comply with 182 | its terms and conditions. 183 | 184 | 3. Term. The term of this Public License is specified in Section 185 | 6(a). 186 | 187 | 4. Media and formats; technical modifications allowed. The 188 | Licensor authorizes You to exercise the Licensed Rights in 189 | all media and formats whether now known or hereafter created, 190 | and to make technical modifications necessary to do so. The 191 | Licensor waives and/or agrees not to assert any right or 192 | authority to forbid You from making technical modifications 193 | necessary to exercise the Licensed Rights, including 194 | technical modifications necessary to circumvent Effective 195 | Technological Measures. For purposes of this Public License, 196 | simply making modifications authorized by this Section 2(a) 197 | (4) never produces Adapted Material. 198 | 199 | 5. Downstream recipients. 200 | 201 | a. Offer from the Licensor -- Licensed Material. Every 202 | recipient of the Licensed Material automatically 203 | receives an offer from the Licensor to exercise the 204 | Licensed Rights under the terms and conditions of this 205 | Public License. 206 | 207 | b. No downstream restrictions. You may not offer or impose 208 | any additional or different terms or conditions on, or 209 | apply any Effective Technological Measures to, the 210 | Licensed Material if doing so restricts exercise of the 211 | Licensed Rights by any recipient of the Licensed 212 | Material. 213 | 214 | 6. No endorsement. Nothing in this Public License constitutes or 215 | may be construed as permission to assert or imply that You 216 | are, or that Your use of the Licensed Material is, connected 217 | with, or sponsored, endorsed, or granted official status by, 218 | the Licensor or others designated to receive attribution as 219 | provided in Section 3(a)(1)(A)(i). 220 | 221 | b. Other rights. 222 | 223 | 1. Moral rights, such as the right of integrity, are not 224 | licensed under this Public License, nor are publicity, 225 | privacy, and/or other similar personality rights; however, to 226 | the extent possible, the Licensor waives and/or agrees not to 227 | assert any such rights held by the Licensor to the limited 228 | extent necessary to allow You to exercise the Licensed 229 | Rights, but not otherwise. 230 | 231 | 2. Patent and trademark rights are not licensed under this 232 | Public License. 233 | 234 | 3. To the extent possible, the Licensor waives any right to 235 | collect royalties from You for the exercise of the Licensed 236 | Rights, whether directly or through a collecting society 237 | under any voluntary or waivable statutory or compulsory 238 | licensing scheme. In all other cases the Licensor expressly 239 | reserves any right to collect such royalties. 240 | 241 | 242 | Section 3 -- License Conditions. 243 | 244 | Your exercise of the Licensed Rights is expressly made subject to the 245 | following conditions. 246 | 247 | a. Attribution. 248 | 249 | 1. If You Share the Licensed Material (including in modified 250 | form), You must: 251 | 252 | a. retain the following if it is supplied by the Licensor 253 | with the Licensed Material: 254 | 255 | i. identification of the creator(s) of the Licensed 256 | Material and any others designated to receive 257 | attribution, in any reasonable manner requested by 258 | the Licensor (including by pseudonym if 259 | designated); 260 | 261 | ii. a copyright notice; 262 | 263 | iii. a notice that refers to this Public License; 264 | 265 | iv. a notice that refers to the disclaimer of 266 | warranties; 267 | 268 | v. a URI or hyperlink to the Licensed Material to the 269 | extent reasonably practicable; 270 | 271 | b. indicate if You modified the Licensed Material and 272 | retain an indication of any previous modifications; and 273 | 274 | c. indicate the Licensed Material is licensed under this 275 | Public License, and include the text of, or the URI or 276 | hyperlink to, this Public License. 277 | 278 | 2. You may satisfy the conditions in Section 3(a)(1) in any 279 | reasonable manner based on the medium, means, and context in 280 | which You Share the Licensed Material. For example, it may be 281 | reasonable to satisfy the conditions by providing a URI or 282 | hyperlink to a resource that includes the required 283 | information. 284 | 285 | 3. If requested by the Licensor, You must remove any of the 286 | information required by Section 3(a)(1)(A) to the extent 287 | reasonably practicable. 288 | 289 | 4. If You Share Adapted Material You produce, the Adapter's 290 | License You apply must not prevent recipients of the Adapted 291 | Material from complying with this Public License. 292 | 293 | 294 | Section 4 -- Sui Generis Database Rights. 295 | 296 | Where the Licensed Rights include Sui Generis Database Rights that 297 | apply to Your use of the Licensed Material: 298 | 299 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 300 | to extract, reuse, reproduce, and Share all or a substantial 301 | portion of the contents of the database; 302 | 303 | b. if You include all or a substantial portion of the database 304 | contents in a database in which You have Sui Generis Database 305 | Rights, then the database in which You have Sui Generis Database 306 | Rights (but not its individual contents) is Adapted Material; and 307 | 308 | c. You must comply with the conditions in Section 3(a) if You Share 309 | all or a substantial portion of the contents of the database. 310 | 311 | For the avoidance of doubt, this Section 4 supplements and does not 312 | replace Your obligations under this Public License where the Licensed 313 | Rights include other Copyright and Similar Rights. 314 | 315 | 316 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 317 | 318 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 319 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 320 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 321 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 322 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 323 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 324 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 325 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 326 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 327 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 328 | 329 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 330 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 331 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 332 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 333 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 334 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 335 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 336 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 337 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 338 | 339 | c. The disclaimer of warranties and limitation of liability provided 340 | above shall be interpreted in a manner that, to the extent 341 | possible, most closely approximates an absolute disclaimer and 342 | waiver of all liability. 343 | 344 | 345 | Section 6 -- Term and Termination. 346 | 347 | a. This Public License applies for the term of the Copyright and 348 | Similar Rights licensed here. However, if You fail to comply with 349 | this Public License, then Your rights under this Public License 350 | terminate automatically. 351 | 352 | b. Where Your right to use the Licensed Material has terminated under 353 | Section 6(a), it reinstates: 354 | 355 | 1. automatically as of the date the violation is cured, provided 356 | it is cured within 30 days of Your discovery of the 357 | violation; or 358 | 359 | 2. upon express reinstatement by the Licensor. 360 | 361 | For the avoidance of doubt, this Section 6(b) does not affect any 362 | right the Licensor may have to seek remedies for Your violations 363 | of this Public License. 364 | 365 | c. For the avoidance of doubt, the Licensor may also offer the 366 | Licensed Material under separate terms or conditions or stop 367 | distributing the Licensed Material at any time; however, doing so 368 | will not terminate this Public License. 369 | 370 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 371 | License. 372 | 373 | 374 | Section 7 -- Other Terms and Conditions. 375 | 376 | a. The Licensor shall not be bound by any additional or different 377 | terms or conditions communicated by You unless expressly agreed. 378 | 379 | b. Any arrangements, understandings, or agreements regarding the 380 | Licensed Material not stated herein are separate from and 381 | independent of the terms and conditions of this Public License. 382 | 383 | 384 | Section 8 -- Interpretation. 385 | 386 | a. For the avoidance of doubt, this Public License does not, and 387 | shall not be interpreted to, reduce, limit, restrict, or impose 388 | conditions on any use of the Licensed Material that could lawfully 389 | be made without permission under this Public License. 390 | 391 | b. To the extent possible, if any provision of this Public License is 392 | deemed unenforceable, it shall be automatically reformed to the 393 | minimum extent necessary to make it enforceable. If the provision 394 | cannot be reformed, it shall be severed from this Public License 395 | without affecting the enforceability of the remaining terms and 396 | conditions. 397 | 398 | c. No term or condition of this Public License will be waived and no 399 | failure to comply consented to unless expressly agreed to by the 400 | Licensor. 401 | 402 | d. Nothing in this Public License constitutes or may be interpreted 403 | as a limitation upon, or waiver of, any privileges and immunities 404 | that apply to the Licensor or You, including from the legal 405 | processes of any jurisdiction or authority. 406 | 407 | 408 | ======================================================================= 409 | 410 | Creative Commons is not a party to its public 411 | licenses. Notwithstanding, Creative Commons may elect to apply one of 412 | its public licenses to material it publishes and in those instances 413 | will be considered the “Licensor.” The text of the Creative Commons 414 | public licenses is dedicated to the public domain under the CC0 Public 415 | Domain Dedication. Except for the limited purpose of indicating that 416 | material is shared under a Creative Commons public license or as 417 | otherwise permitted by the Creative Commons policies published at 418 | creativecommons.org/policies, Creative Commons does not authorize the 419 | use of the trademark "Creative Commons" or any other trademark or logo 420 | of Creative Commons without its prior written consent including, 421 | without limitation, in connection with any unauthorized modifications 422 | to any of its public licenses or any other arrangements, 423 | understandings, or agreements concerning use of licensed material. For 424 | the avoidance of doubt, this paragraph does not form part of the 425 | public licenses. 426 | 427 | Creative Commons may be contacted at creativecommons.org. 428 | 429 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![A pile of legos with white text AI-generated content may be incorrect.](media/917896de1185740322e7ad5f45d79c15.jpeg)](https://aibuilder.intel.com) 2 | 3 |

Intel® AI Assistant Builder
(a.k.a. SuperBuilder)

4 | 5 |

Intel® AI Assistant Builder—also known as SuperBuilder—is Intel’s Gen-AI reference design platform that enables the rapid creation of custom AI assistants and agents tailored to specific industry needs and proprietary data. 6 | These assistants streamline everyday tasks and deliver intelligent solutions by leveraging your internal knowledge bases—all while running entirely locally on Intel®-based AI PCs. Your data and workflows remain private and secure, powered by cutting-edge large language models (LLMs), customizable agentic workflows, and performance-optimized processing.

7 | 8 | - [Key Benefits](#key-benefits) 9 | - [Prerequisites](#prerequisites) 10 | - [Hardware requirements](#hardware-requirements) 11 | - [Software requirements](#software-requirements) 12 | - [Getting started](#getting-started) 13 | - [What's included](#whats-included) 14 | - [Sample code](#sample-code) 15 | - [SuperBuilder Service API Guide](#superbuilder-service-api-guide) 16 | - [LLM Model List](#llm-model-list) 17 | - [Features](#features) 18 | - [Tips, Troubleshooting, Known Issues](#tips-troubleshooting-known-issues) 19 | - [Release Notes](#release-notes) 20 | - [Version 1.2](#version-12) 21 | - [Previous Release Notes](#previous-release-notes) 22 | - [Version 1.1](#version-11) 23 | - [Version 1.0](#version-10) 24 | - [Contact](#contact) 25 | 26 | 27 |
28 | 29 | ### Key Benefits 30 | *** 31 | - **Simple & Accelerated Development**: Jumpstart your AI assistant with a rich set of prebuilt **APIs**, reusable **templates**, and a user-friendly tooling environment designed for fast prototyping and deployment. 32 | - **Flexible & Modular Architecture**: Use our turnkey front-end reference design for immediate rollout or integrate only the backend components you need to build a fully customized experience. 33 | - **Secure & Local Execution**: Keep your proprietary data and IP safe with AI that runs directly on-device—no cloud required. 34 | - **Customizable for Any Industry**: Tailor assistants to meet the demands of your specific domain, whether in healthcare, finance, manufacturing, or beyond. 35 | - **Scalable & Portable**: Package and deploy across a wide range of devices and use cases with ease. 36 | 37 |
38 |

With Intel® AI Assistant Builder, you can empower your teams and customers with intelligent, adaptable, and secure AI solutions—delivered simply and on your terms.

39 | 40 | ![ui](media/superbuild_ui_border.png) 41 | 42 | 43 | 44 |
45 | 46 | ### Prerequisites 47 | *** 48 |

The download, installation, and initial setup of the application require an internet connection. Once the initial setup is complete, no connection is needed unless you choose to change the model used by the assistant, in which case additional file downloads may be required.

49 | 50 | #### Hardware requirements 51 | | **Component** | **Minimum Requirements** | **Recommended Requirements** | 52 | |---------------|--------------------------------------------------------------|---------------------------------------------| 53 | | Processor | Intel® Core™ Ultra processor Series 1 (Meteor Lake) | Intel® Core™ Ultra 200V series (Lunar Lake) | 54 | | Memory (RAM) | 16GB | 32GB | 55 | | Storage | 4GB for AI Assistant with 1 LLM | 12GB for AI Assistant with 3 LLMs | 56 | | Graphics | Integrated Intel® Graphics | Integrated Intel® Arc™ Graphics | 57 | | Network | Broadband connection for LLMs and other components’ download | | 58 | > [!NOTE] 59 | > * Intel® AI Assistant Builder has been validated on limited Intel AIPC: MTL, LNL, and ARL systems. 60 | > * Minimum Intel Graphics driver version is **30.0.100.9955**. and minimum NPU driver version is **32.0.100.3714**. 61 | 62 | #### Software requirements 63 | Intel® AI Assistant Builder has been validated for use on **Microsoft Windows 11 version 23H2 or newer**. During the installation process, Intel® AI Assistant Builder application may download and install required components. 64 | 65 | > [!TIP] 66 | > To update your Intel® GPU and NPU drivers, please visit [Intel®: Download Drivers & Software](https://www.intel.com/content/www/us/en/download-center/home.html). 67 | 68 | ### Getting started 69 | *** 70 | > [!WARNING] 71 | > Currently, Intel® AI Assistant Builder supports **one Assistant installation at a time**. Please uninstall the existing Assistant before installing a different one. 72 | - #### Download the software 73 | 1. Visit [https://aibuilder.intel.com](https://aibuilder.intel.com/) 74 | 2. Click on one of the available AI Assistants to start the download. For general use, we recommend the “Sales Assistant”. The assistant’s capability (and appearance) can be customized after installation. 75 | 3. Locate and open the downloaded installer. The wizard will guide you through the required steps to successfully complete the installation. 76 | 77 | ![webportal](media/webportal_border.png) 78 | 79 | - #### Using SuperBuilder 80 | - [Getting started](basic_usage.md) 81 | - [Special Query Functions](special_query.md) 82 | 83 | > [!TIP] 84 | > Please refer to the [user guide](https://aibuilder.intel.com/Intel%20AI%20Assistant%20Builder%20User%20Guide.pdf) for more details. 85 | 86 |
87 | 88 | ### What's included 89 | *** 90 | #### Sample code 91 | This folder contains a sample application created using the SuperBuilder API service. We included sample projects built from `dotnet` , `Python` and `Go`. 92 | 93 | [Sample Code](example/README.md) 94 | 95 | #### [SuperBuilder Service API Guide](https://intel.github.io/intel-ai-assistant-builder/) 96 | This folder contains API service documentation. SuperBuilder's API service main entry point is the [AssistantService](https://intel.github.io/intel-ai-assistant-builder/html/127056c5-b74d-e4f7-a324-5e4aa7c09935.htm) class. You can also access the API document from this link: [API Documentation](https://intel.github.io/intel-ai-assistant-builder/) 97 | 98 | ![Assistant Service](media/api_service_border.png) 99 | 100 |
101 | 102 | ### LLM Model List and Recommended Models 103 | *** 104 |

Intel® AI Assistant Builder supports most LLM models enabled by Intel® OpenVINO. Model recommendations are made based on the assistant type and system hardware, using the performance and accurancy data collected inside our lab.

105 | 106 | As of version `v1.2.X`, the following models are available for selection: 107 | 108 | - **Chat Models** 109 | ``` 110 | * Phi-4-mini-instruct-int4-ov 111 | * Qwen2.5-7B-Instruct-int4-ov 112 | * DeepSeek-R1-Distill-Qwen-7B-int4-ov 113 | * BioMistral-7B-SLERP-int4 114 | * Qwen2-7B-Instruct-int4-ov 115 | * Phi-3-mini-128k-instruct-int4-ov 116 | * Phi-3-mini-4k-instruct-int4-ov 117 | * neural-chat-7b-v3-3-int4-ov 118 | * notus-7b-v1-int4-ov 119 | * zephyr-7b-beta-int4-ov 120 | ``` 121 | 122 | - **Vision Models** 123 | ``` 124 | * Phi-3.5-vision-instruct-int4-ov 125 | ``` 126 | 127 | - **RAG Models** 128 | ``` 129 | * bge-base-en-v1.5-int8-ov 130 | * bge-reranker-base-int8-ov 131 | ``` 132 | 133 | - **NPU Models** 134 | ``` 135 | * phi-3-mini-2k-int4_sym_g128-npu 136 | ``` 137 | 138 | You may also **upload your own model** or **convert models from Hugging Face directly** using the provided "Model Upload" or "Model Conversion" capabilities. Please consult the [user guide](https://aibuilder.intel.com/Intel%20AI%20Assistant%20Builder%20User%20Guide.pdf) for full details on these features. 139 | 140 | ![Model Tools](media/models_action_border.png) 141 | 142 |
143 | 144 | ### Features 145 | *** 146 | * **Local LLM and RAG chat**: Build a local knowledge base using your documentation (various file formats are supported). 147 | * **Configurable Parameters and Settings**: Numerous parameters can be adjusted to tune LLM and RAG models, ingestion, retrieval, reranking processes, and application operations. 148 | * **Special Query Functions**: Focus the assistant on specific functions to extend capability and maximize accuracy and performance. Special queries include the ability to: Query tabular data, query images, rank resumes against a job description, and more. 149 | * **Agentic Workflow - Resume Match**: The agentic workflow illustrated in the "Resume Match" function is one example of how capabilities can be extended to support real world use cases that matter to you. 150 | * **Model Management**: Easily switch between models, upload a model, or convert a model to take advantage of the latest LLM optimizations and capabilities. 151 | * **UI customization**: Use the "Appearance" adjustments to easily customize the interface to fit your needs. 152 | * **Profile Management**: Import and export Assistant profiles/configurations for backup, profile switching, and sharing. 153 | * **Localization Support**: Partial localization is available for Simplified Chinese (zh-Hans) and Traditional Chinese (zh-Hant). 154 | * **Admin Mode**: Enable "Admin" features like adjusting settings and adding documentation to the knowledge base **-OR-** limit features to standard "User" capabilities like asking the Assistant questions. 155 | * **API Services**: Expose all features through SuperBuilder API services. 156 | 157 |
158 | 159 | :bulb:**Upcoming Features** :sparkles: 160 | *** 161 | 162 | * **Multi-Agent Orchestration Framework**: Implement AI agents built with MCP (Model Context Protocol) for enhanced coordination. 163 | * **E2E Enterprise Solution**: Connect your Intel AIPC to edge/server clusters for comprehensive enterprise integration. 164 | * **SuperBuilder API Service Only Installation Package**: A streamlined API package to create custom UIs and seamlessly integrate SuperBuilder capabilities. 165 | * **SST and TTS multimodality Features**: Advanced speech synthesis and text-to-speech functionalities for enhanced user interaction and communication. 166 | 167 |
168 | 169 | ### Tips, Troubleshooting, Known Issues 170 | *** 171 | > [!IMPORTANT] 172 | >* **Installation Issues**: Some antivirus software such as McAfee Antivirus software is known to interfere with the installation process of Intel® AI Assistant Builder on Windows systems. If you encounter installation problems and have antivirus installed, please stop the real-time scanning feature and then reinstall Intel® AI Assistant Builder. Once the installation is done and the models are loaded, you can re-enable it. Users might experience performance impacts when antivirus real-time scanning is running. 173 | 174 | > [!WARNING] 175 | >* **Model Download Errors**: This issue could be due to a few reasons: 176 | > - **HTTP/HTTPS Proxy for Enterprise Environments**: If you are an enterprise user and your organization uses an HTTP or HTTPS proxy, you need to configure it on your AI PC to enable the Intel® AI Assistant Builder to download LLMs, RAG, and other necessary components. Please consult your organization’s IT department to determine which proxy server(s) are in use and how to configure them up on your device. 177 | > - **Model Download Endpoint**: Check your model download endpoint and consider selecting a different download server. 178 | > - **For users in the PRC**, ***Model Scope*** is recommended. 179 | > - **For users in other regions**, please choose the ***Hugging Face***. 180 | >* **Export Config Issues**: For configurations involving a large set of documents, only a partial set of text chunks is currently exported. Support for exporting a full set is currently under development. 181 | >* **NPU model limitation**: The NPU model is supported only on ***Lunar Lake*** systems. 182 | 183 | > [!CAUTION] 184 | >* **Initial load time / Unresponsive**: When the AI assistant is started, the assistant service and models must be initialized before the assistant can be used. During this time, the chat text entry field will be disabled, and a status message at the bottom of the window will indicate what is happening. When the AI assistant is ready, the status bar at the bottom of the window will be removed and the chat text entry will be enabled. 185 | > ![A close-up of a red and grey rectangle AI-generated content may be incorrect.](media/notification_border.png) 186 | >* **Model Loading Errors**: If a “model loading error” occurs, please make sure to update the GPU and NPU drivers to the latest version. The NPU model requires NPU Driver **32.0.100.3714 at a minimum**. 187 | >* **Backend Not Ready**: When running the Intel® AI Assistant Builder for the first time a "backend not ready" condition may occur, especially when there is a slow network connection. Please re-start the application and if possible move to a location which has a better network connection. 188 | >* **Upgrade Errors**: If you are upgrading from ```v1.1.0``` to ```v1.2.0```, the installer might have issues removing all your selected local files. If you wish to remove everything, we recommend fully uninstalling the application using Window's built-in _Add or Remove Programs_, and then installing ```v1.2.0```. 189 | >* **Model Conversion Error**: The model conversion tool within the Intel® AI Assistant Builder supports models compatible with the **Intel® OpenVINO** platform. Not all models are supported.
190 | Some models on Hugging Face require user consent before they can be downloaded. Our application cannot proceed with the download until you consent to the Hugging Face model terms. 191 | >* **Query Tabular Data Issue**: Query Tabular Data will fail to process XLSX files having `time` format. A fix for this will be included in the next release. 192 | >* **Conversation History - Reset to Defaults Issue**: Although the `Reset to Defaults` button sets the `Conversation History` to 0, the conversation history is still utilized in the context. To resolve this issue, please manually adjust the value using the slider. 193 | >* **Intermittent Qwen2 and Qwen2.5 Models Issue**: The Qwen2 and Qwen2.5 models have a known intermittent issue where they occasionally generate unwanted responses with exclamation marks. This behavior is not consistently reproducible, but retrying the query typically resolves the problem. 194 | >* **White Title Bar Issue:** When upgrading from an older version to v1.2.0, you might see a white title bar at the top. Go to *Settings > Appearance* and click the "Reset" button to correct this. If you want to keep your existing style, make sure to export the configuration (*Settings > Export/Import Configuration > Export*) before resetting the appearance. 195 | > ![Model Tools](media/white_title_bar.png) 196 | 197 | > [!TIP] 198 | >* **Multiple Assistants Support**: Users can use our Import and Export functions to try out multiple assistant profiles on the same local AI PC. 199 |
200 | 201 | ### Release Notes 202 | *** 203 | #### Version 1.2 204 | 205 | - New Models Support 206 | Intel(R) AI Assistant Builder now officially supports Qwen2.5-7B, Phi4-mini, and Deepseek-R1-Distilled-Qwen-7B. 207 | 208 | - ModelScope Download Endpoint Support 209 | Intel(R) AI Assistant Builder now supports direct model downloads from ModelScope.cn, improving accessibility and convenience. 210 | 211 | - Localization Support 212 | Partial localization is available for Simplified Chinese (zh-Hans) and Traditional Chinese (zh-Hant). Language settings are automatically adjusted based on your Windows system language, but you may manually select the preferred language under *Settings > Appearance > Language* 213 | 214 | - Admin Mode 215 | Switch between a simple chatbot interface for "standard" users and an "Admin" interface with comprehensive configuration options. This enables administrators to configure, preview, and evaluate the end-user experience. 216 | 217 | #### Previous Release Notes 218 | 219 | ##### Version 1.1 220 | 221 | - HF-Mirror for Users in PRC 222 | The HF-Mirror provides users in the People's Republic of China with faster, more reliable access to models. 223 | 224 | - Model Conversion to OpenVINO Format 225 | The model conversion utility enables the conversion of most 'Text Generation' models to the OpenVINO format for immediate use in the assistant or wherever you plan to use a given model. You can convert models directly from Hugging Face or from a local folder. Optimized performance, compatibility, and efficiency of model execution are just a few benefits of this new utility. Please note that the model conversion utility does not work with all models, and it is important to verify the accuracy of any converted model. 226 | 227 | - Import and Export Assistant 228 | The new "Import and Export Assistant" feature simplifies the process of transferring data and configurations between computers and when conducting upgrades or re-installations. The option to export a "Built" assistant and allow another user to import it facilitates collaboration and sharing. 229 | 230 | - New HR Special Query called Resume Match 231 | The new HR assistant feature allows unlimited resume uploads in one session, intelligently scores resumes against job descriptions, extracts key details from top candidates using RAG, and facilitates continuous conversational analysis of documents. 232 | 233 | - Update to Query Tabular Data 234 | The Query Tabular Data feature now shows the SQL query used to generate the response, allowing users to verify, correct if necessary, and rerun the adjusted query. 235 | 236 | - New Collect Metrics Parameter 237 | The new Collect Metrics parameter, when enabled by the user, gathers performance metrics related to file ingestion and response generation, providing valuable insights. 238 | 239 | ##### Version 1.0 240 | 241 | - User Interface 242 | - UX customization: Users can upload their own logo and customize additional app colors. 243 | - Users can upload their own LLM or RAG models. Instructions are provided to convert models to a compatible format. Intel does not guarantee that all models will work. 244 | 245 | - AI Features 246 | - Query Summary: Users can attach up to three files (PDF, DOCX, TXT) and generate a summary of each file, allowing them to ask follow-up questions based on the summary. 247 | - Query Tabular Data: Users can attach one file (XLSX, CSV). The data must be in tabular format, with headers in the first row and data in subsequent rows. This feature generates a description of the tabular data in each worksheet. 248 | - Query Images: Users can attach up to three files (PNG, JPEG, JPG) and generate a description of each image. This requires a vision model such as Phi-3.5-vision-instruct-int4-ov. 249 | 250 | - NPU Model 251 | - NPU model support for Phi3-4K now offers an improved token length of 2K. 252 | 253 | - New Assistant 254 | - Added Finance Assistant. 255 | 256 | ### Contact 257 | *** 258 | For technical questions and feature requests, please use GitHub [Issues](https://github.com/intel/intel-ai-assistant-builder/issues). 259 | 260 | We would love to hear about your experience. Please contact us at [support.aibuilder@intel.com](mailto:support.aibuilder@intel.com). 261 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. 3 | 4 | ## Reporting a Vulnerability 5 | Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). 6 | -------------------------------------------------------------------------------- /basic_usage.md: -------------------------------------------------------------------------------- 1 | **First time use and initial setup** 2 | 3 | The first time the application runs certain required files will need to be downloaded. Accept the terms and conditions of use and then click “Proceed” for the download to begin. 4 | 5 | The status bar at the bottom of the window indicates the application status and is removed when the download is complete. 6 | 7 | ![A screenshot of a computer Description automatically generated](media/596a08fd2d25c663654baed1113da405.png) 8 | 9 | LLM, RAG, and Other Components’ Download Dialogue Window: 10 | Download in Progress and Download Complete 11 | 12 | ![A screenshot of a computer Description automatically generated](media/9bf109917571555fefb578d4fd005e27.png) 13 | 14 | ![A screenshot of a computer Description automatically generated](media/40986ed2aad5910769328c62d5497d7e.png) 15 | 16 | The AI Assistant can’t be used until all required files are downloaded and “activated”. This is only required the first time the assistant runs and typically takes a few minutes at most to complete, however depending on network conditions and specific system hardware the process could take longer. 17 | 18 | **Adding documents to the assistant** 19 | 20 | “Train your assistant” by adding relevant documents. 21 | 22 | Intel® AI Assistant Builder Application Interface for File and Folder Loading 23 | 24 | ![A white background with black text Description automatically generated](media/e02aa4c73fade1e31f7c426b7cdcd194.png) 25 | 26 | **Customize the assistant - Settings** 27 | 28 | You can further customize your AI Assistant by clicking the settings icon on the left sidebar. 29 | 30 | ![A screenshot of a phone AI-generated content may be incorrect.](media/b7ee6629bd1d637ab0c16dfcf186b306.png) 31 | 32 | Some of available settings include: 33 | 34 | - Customize the appearance and name. 35 | - Change the LLM and RAG models and/or upload custom models. 36 | - Adjust LLM and RAG parameters. 37 | - View the hardware details of your AI PC. 38 | - Import or Export a “built” assistant configuration 39 | 40 | **Using the assistant – Basic functions** 41 | 42 | Your assistant is much smarter and more helpful when you add documents to the “knowledge base” in order to give it context and references for your topic of interest. 43 | 44 | Knowledge base / File library: Train your assistant by adding files and documents to the common “Knowledge Base”. The assistant will use this knowledge base as a reference to find relevant information to answer your questions. The assistant will also note which document it used to answer any questions you ask. The knowledge base is shared across chat sessions and remains in place unless you choose to remove or replace a document. 45 | 46 | Supported file formats include PDF, DOCX, TXT, MD, PPTX, XLSX, CSV 47 | 48 | ![A white rectangular object with black lines AI-generated content may be incorrect.](media/f48b205f630b9807f1b2c65f3a908698.png) 49 | 50 | A basic chat after documents have been added is shown below: 51 | 52 | ![A screenshot of a computer AI-generated content may be incorrect.](media/12203a5085925a8714a0b28efa36423e.png) 53 | 54 | The Knowledge Base is managed by clicking the “Manage Knowledge Base” button where you may add or remove files as needed. 55 | 56 | ![A screenshot of a computer AI-generated content may be incorrect.](media/56896a80bc165e94ad83392a67239ec9.png) 57 | 58 | *\*PRO Tip:* When documents are added or removed from the knowledge base the source documents are not moved and remain unchanged. Only the embeddings of the files are stored in the knowledge base. 59 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Intel® AI Assistant Builder Service Client Examples 2 | 3 |

This folder contains sample code for a terminal-based client for Intel® AI Assistant Builder. We believe this will assist developers in quickly prototyping new features and integrations with Intel® AI Assistant Builder Service.

4 | 5 | - **[Prerequisites](#prerequisites)** 6 | - **[GRPC Dependency](#grpc-dependency)** 7 | - **[Smoke Test](#smoke-test)** 8 | - **Client Examples** 9 | - [C# Client Example](csharp/CSharpClientExample/README.md) 10 | - [Python Client Example](python/README.md) 11 | - [Golang Client Example](golang/README.md) 12 | *** 13 | 14 | ### Prerequisites 15 |
16 | 1. Protoc 17 | 18 | >* Protoc is **essential for the C#, Python, Go Client Examples**. Intel® AI Assistant Builder utilizes Protoc to generate `pb`/`pb2` files for **Golang** and **Python**. 19 | >* **Installation Steps:** 20 | > 1. Download [`protoc-27.2-win64.zip`](https://github.com/protocolbuffers/protobuf/releases/tag/v27.2) file and extract it to the desired location on your computer. 21 | > 2. Set an environment variable named `PROTOC` with the value `\path\to\protoc-27.2-win64\bin\protoc.exe` on your Windows system. 22 | > 3. Open PowerShell and run `$env:PROTOC` to ensure the path is correctly set. 23 | ![Protoc](../media/protoc.png) 24 |
25 | 26 |
27 | 2. Python 3.12.9 28 | 29 | >* Python is **essential for Python Client Example**. 30 | >* **Installation Steps:** 31 | > 1. Download [`Python 3.12.9`](https://www.python.org/downloads/release/python-3129/) and run the installer on your computer. 32 | > 2. Proceed through the installation by following the prompts provided by the installer. 33 | > 3. Once the installation is complete, open Command Prompt and run `python --version` to confirm the installation. 34 |
35 | 36 |
37 | 3. Visual Studio 2022 Community 38 | 39 | >* Visual Studio 2022 Community is **essential for CSharp Client Example**. 40 | >* **Installation Steps:** 41 | > 1. Download [`Visual Studio 2022 Community`](https://visualstudio.microsoft.com/vs/) installer. 42 | > 2. Run the installer and select the components for `Desktop Development with C++` and `.NET Desktop Development`. 43 |
44 | 45 |
46 | 4. Golang 47 | 48 | >* Golang is **essential for Golang Client Example**. 49 | >* **Installation Steps:** 50 | > 1. Download [`Golang`](https://go.dev/dl/) installer. **Note**: `Go 1.24.1` has been tested for compatibility. 51 | > 2. Run the installer and follow the prompts to complete the installation. 52 |
53 | 54 | *** 55 | 56 | ### GRPC Dependency 57 | 58 | Intel® AI Assistant Builder uses GRPC for communication with its services. 59 | 60 | :information_source: **Service information:** 61 | - Intel® AI Assistant Builder Service runs on `localhost:5006`. 62 | - Intel® AI Assistant Builder Service is named `IntelAiaService.exe`. 63 | - Intel® AI Assistant Builder Service is registered as a Microsoft Windows service. 64 | - All available services are defined in `shared\superbuilder_middleware.proto`. 65 | - Use the Powershell script `shared\recompile-client-proto.ps1` to regenerate the `pb`/`pb2` files for Golang and Python. 66 | - C# automatically regenerates its `pb`/`pb2` files each time the code is built. 67 | 68 | *** 69 | 70 | ### Smoke Test 71 | 72 | Use the file `example\run-smoke-test.ps1` to verify your computer's configuration. By default, this script will run all client tests. 73 | -------------------------------------------------------------------------------- /example/csharp/CSharpClientExample/Benchmark.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Grpc.Core; 3 | using Grpc.Net.Client; 4 | using SuperBuilderWinService; 5 | 6 | 7 | namespace CSharpClientExample 8 | { 9 | public static class Benchmark 10 | { 11 | private class TestStep 12 | { 13 | public string? Type { get; set; } 14 | public string[]? Files { get; set; } 15 | public string? Content { get; set; } 16 | } 17 | 18 | private class TestStepsFile 19 | { 20 | public string? TestName { get; set; } 21 | public string? MetricOutputFilePath { get; set; } 22 | public string[]? ModelList { get; set; } 23 | public List? TestSteps { get; set; } 24 | } 25 | 26 | private static TestStepsFile ParseJSONFile(string fileName) 27 | { 28 | string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Tests", fileName); 29 | string jsonString = File.ReadAllText(filePath); 30 | TestStepsFile? testFile = JsonConvert.DeserializeObject(jsonString); 31 | if (testFile == null || testFile.TestSteps == null) 32 | { 33 | throw new Exception($"Could not read JSON file {filePath}"); 34 | } 35 | return testFile; 36 | } 37 | 38 | /// 39 | /// Parse a test file and execute all test steps by calling the middleware APIs via grpc 40 | /// (Middleware and Backend must be running for this to work) 41 | /// 42 | /// Metrics will output to specified file path in JSON test file MetricOutputFilePath field 43 | /// 44 | /// The JSON file with the test steps, should be added to the build to use 45 | public static async Task ExecuteTestOnFile(string fileName) 46 | { 47 | // Connect to the middleware 48 | using var channel = GrpcChannel.ForAddress("http://localhost:5006"); 49 | var client = new SuperBuilder.SuperBuilderClient(channel); 50 | 51 | // Get the test execution steps from the JSON file 52 | TestStepsFile testFile = ParseJSONFile(fileName); 53 | 54 | Console.WriteLine($"\n\n\n====================================================================================="); 55 | Console.WriteLine($"Running {testFile.TestName}, outputting results to C:\\temp\\IntelAia\\generation.metrics.csv"); 56 | Console.WriteLine($"=====================================================================================\n\n\n"); 57 | 58 | foreach (string modelPath in testFile.ModelList) 59 | { 60 | Console.WriteLine($"--------------Running on Model: {modelPath}----------------\n\n"); 61 | await client.SetModelsAsync(new SetModelsRequest { Llm = modelPath, 62 | Embedder = "local_models\\bge-base-en-v1.5-int8-ov", 63 | Ranker = "local_models\\bge-reranker-base-int8-ov", 64 | }); 65 | 66 | // Execute each test step in order 67 | foreach (TestStep testStep in testFile.TestSteps) 68 | { 69 | // Parse what type of API to call through Test Type, which will determine the contents of the test step 70 | Console.WriteLine($"\n\nExecuting test step: {testStep.Type}"); 71 | switch (testStep.Type) 72 | { 73 | case "Chat": 74 | Console.WriteLine($"Calling Chat with Prompt: {testStep.Content}..."); 75 | string formatDate = DateTime.Now.ToString("yyyyMMdd"); 76 | string fixedOutputPath = $"C:\\temp\\IntelAia\\{formatDate}.generation.metrics.csv"; 77 | var chatResponse = client.Chat(new ChatRequest { Name = "SuperBuilder C# Client!", Prompt = testStep.Content}); 78 | string result = ""; 79 | try 80 | { 81 | await foreach (var response in chatResponse.ResponseStream.ReadAllAsync()) 82 | { 83 | result += response.Message; 84 | } 85 | Console.WriteLine($"Output to: {fixedOutputPath}..."); 86 | } 87 | catch (Exception e) 88 | { 89 | Console.WriteLine(e.ToString()); 90 | } 91 | Console.WriteLine("\nServer Reply: " + result); 92 | break; 93 | case "AddFiles": 94 | Console.WriteLine($"Calling AddFiles with FilesToUpload: [{String.Join(", ", testStep.Files)}]..."); 95 | var grpcUploadList = JsonConvert.SerializeObject(testStep.Files); 96 | var addFileResponse = client.AddFiles(new AddFilesRequest { FilesToUpload = grpcUploadList }); 97 | Console.WriteLine("\nServer Reply: " + addFileResponse.ToString()); 98 | break; 99 | case "RemoveFiles": 100 | Console.WriteLine($"Calling RemoveFiles with FilesToRemove: [{String.Join(", ", testStep.Files)}]..."); 101 | var grpcRemoveList = JsonConvert.SerializeObject(testStep.Files); 102 | var removeFilesResponse = await client.RemoveFilesAsync(new RemoveFilesRequest { FilesToRemove = grpcRemoveList }); 103 | Console.WriteLine("\nServer Reply: " + removeFilesResponse.FilesRemoved); 104 | break; 105 | case "SayHello": 106 | Console.WriteLine($"Calling SayHello with Name: {testStep.Content}..."); 107 | var sayHelloResponse = await client.SayHelloAsync(new SayHelloRequest { Name = testStep.Content }); 108 | Console.WriteLine("Server Reply: " + sayHelloResponse.Message); 109 | break; 110 | case "CheckHealth": 111 | Console.WriteLine($"Calling CheckHealth with Type of Check: {testStep.Content}..."); 112 | var checkHealthResponse = await client.CheckHealthAsync(new CheckHealthRequest { TypeOfCheck = testStep.Content }); 113 | Console.WriteLine("\nServer Reply: " + checkHealthResponse.Status); 114 | break; 115 | case "AddFeedback": 116 | Console.WriteLine($"Calling AddFeedback with Feedback Comment: {testStep.Content}..."); 117 | break; 118 | case "GetFileList": 119 | Console.WriteLine($"Calling GetFileList..."); 120 | var getFileResponse = await client.GetFileListAsync(new GetFileListRequest { FileType = "" }); 121 | Console.WriteLine("\nServer Reply: " + getFileResponse.FileList); 122 | break; 123 | default: 124 | throw new Exception($"Could not recognize test step {testStep.Type}..."); 125 | } 126 | } 127 | Console.WriteLine($"{modelPath} TEST COMPLETE."); 128 | } 129 | Console.WriteLine($"ALL TESTS COMPLETE."); 130 | } 131 | } 132 | } -------------------------------------------------------------------------------- /example/csharp/CSharpClientExample/CSharpClientExample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0-windows10.0.26100.0 6 | enable 7 | enable 8 | x64 9 | 10.0.17763.0 10 | 11 | 12 | 13 | 14 | 15 | 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | all 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Always 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/csharp/CSharpClientExample/Program.cs: -------------------------------------------------------------------------------- 1 | using CSharpClientExample; 2 | using Google.Protobuf.Collections; 3 | using Grpc.Core; 4 | using Grpc.Net.Client; 5 | using SuperBuilderWinService; 6 | using Newtonsoft.Json; 7 | 8 | var grpcServerAddress = "http://localhost:5006"; 9 | 10 | Console.WriteLine("Creating connection to SuperBuilder middleware (AssistantService)..."); 11 | 12 | 13 | var httpClientHandler = new HttpClientHandler 14 | { 15 | UseProxy = false, // Disable the proxy 16 | SslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls13, 17 | ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator // For development only 18 | }; 19 | 20 | // Create the HttpClient with the handler 21 | var httpClient = new HttpClient(httpClientHandler) 22 | { 23 | DefaultRequestVersion = new Version(2, 0), 24 | DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher 25 | }; 26 | 27 | // Create the GrpcChannel with the HttpClient 28 | var channel = GrpcChannel.ForAddress(grpcServerAddress, new GrpcChannelOptions 29 | { 30 | HttpClient = httpClient, 31 | Credentials = ChannelCredentials.Insecure // Use Insecure for local development 32 | }); 33 | 34 | 35 | 36 | //using var channel = GrpcChannel.ForAddress("http://localhost:5006"); 37 | var client = new SuperBuilder.SuperBuilderClient(channel); 38 | 39 | Console.WriteLine("\n\n-------- Say Hello Test -------"); 40 | 41 | // Make a gRPC call 42 | try 43 | { 44 | var sayHelloResponse = await client.SayHelloAsync(new SayHelloRequest { Name = "SuperBuilder C# Client!" }); 45 | Console.WriteLine("Server Reply: " + sayHelloResponse.Message); 46 | } 47 | catch (RpcException e) 48 | { 49 | Console.WriteLine($"gRPC error: {e.Status.Detail}"); 50 | } 51 | catch (HttpRequestException e) 52 | { 53 | Console.WriteLine($"HTTP request error: {e.Message}"); 54 | } 55 | 56 | 57 | Console.WriteLine("\n\n-------- Get Software Update ------- "); 58 | var updateResponse = await client.GetSoftwareUpdateAsync(new SayHelloRequest { Name = "SuperBuilder C# Client!" }); 59 | Console.WriteLine("Server Reply: " + updateResponse.Message); 60 | 61 | Console.WriteLine("\n\n-------- Health Check Test -------"); 62 | var checkHealthResponse = await client.CheckHealthAsync(new CheckHealthRequest { TypeOfCheck = "RAG" }); 63 | Console.WriteLine("\nServer Reply: " + checkHealthResponse.Status); 64 | 65 | 66 | 67 | // CHAT TEST 68 | Console.WriteLine("\n\n-------- Chat Test -------"); 69 | var chatRequest = new ChatRequest 70 | { 71 | Name = "SuperBuilder C# Client!", 72 | Prompt = "What were we just talking about?", 73 | }; 74 | // add in some chat history 75 | chatRequest.History.Add(new ConversationHistory { Role = "user", Content = "Tell me a bit about yourself" }); 76 | chatRequest.History.Add(new ConversationHistory { Role = "assistant", Content = "I am an Intel AI Assistant, a chatbot developed by Intel. I can help you with various tasks provided context." }); 77 | var fullResponse = ""; 78 | try 79 | { 80 | // // Set a timeout of 10 seconds (For testing) 81 | // var callOptions = new CallOptions(deadline: DateTime.UtcNow.AddSeconds(5)); 82 | var r = client.Chat(chatRequest); 83 | await foreach (var response in r.ResponseStream.ReadAllAsync()) 84 | { 85 | Console.WriteLine("Received chat message: " + response.Message); 86 | // convert response.Message to json 87 | var messageDict = JsonConvert.DeserializeObject>(response.Message); 88 | messageDict.TryGetValue("message", out var messageValue); 89 | fullResponse += messageValue; 90 | } 91 | } 92 | catch (Exception ex) 93 | { 94 | Console.WriteLine($"Unexpected error: {ex.Message}"); 95 | Console.WriteLine($"Sending stop generation now..."); 96 | var stopRequest = new StopChatRequest { }; 97 | var stopResponse = client.StopChat(stopRequest); 98 | Console.WriteLine($"Generation stopped"); 99 | } 100 | finally 101 | { 102 | Console.WriteLine($"Full response: {fullResponse}"); 103 | } -------------------------------------------------------------------------------- /example/csharp/CSharpClientExample/README.md: -------------------------------------------------------------------------------- 1 | # C# Client for Intel® AI Assistant Builder Service 2 | This folder contains a simple C# Client designed to communicate with Intel® AI Assistant Builder Service. 3 | 4 | ## Install Dependencies 5 | - Please ensure that `Desktop Development with C++` and `.NET Desktop Development` are installed on your system. 6 | > [!TIP] 7 | > If these components are not installed, download [Visual Studio 2022 Community](https://visualstudio.microsoft.com/vs/) and install the required components. 8 | 9 | ## How to Run 10 | ``` 11 | cd example\\csharp\\CSharpClientExample 12 | dotnet restore 13 | dotnet build 14 | dotnet run 15 | ``` 16 | -------------------------------------------------------------------------------- /example/csharp/CSharpClientExample/Tests/simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestName": "Simple Test", 3 | "MetricOutputFilePath": "simple_metrics.csv", 4 | "ModelList": [ 5 | "local_models\\Phi-3-mini-4k-instruct-int4-ov", 6 | "local_models\\Meta-Llama-3-8B-Instruct-hf-sym_int4", 7 | "local_models\\zephyr-7b-beta-int4-ov", 8 | "local_models\\vicuna-7b-v1.5-hf-sym_int4", 9 | "local_models\\Mistral-7B-Instruct-v0.2-int4-ov" 10 | ], 11 | "TestSteps": [ 12 | { 13 | "Type": "Chat", 14 | "Content": "Hello, what is your name?" 15 | }, 16 | { 17 | "Type": "AddFiles", 18 | "Files": [ "path/to/file.pdf", "path/to/file.pdf" ] 19 | }, 20 | { 21 | "Type": "RemoveFiles", 22 | "Files": [ "path/to/file.pdf", "path/to/file.pdf" ] 23 | }, 24 | { 25 | "Type": "SayHello", 26 | "Content": "SuperBuilder C# Client!" 27 | }, 28 | { 29 | "Type": "CheckHealth", 30 | "Content": "RAG" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /example/csharp/example.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.5.2.0 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpClientExample", "CSharpClientExample\CSharpClientExample.csproj", "{766B6DE7-8016-93B8-42AF-523200177FC2}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|Any CPU = Debug|Any CPU 10 | Debug|x64 = Debug|x64 11 | Release|Any CPU = Release|Any CPU 12 | Release|x64 = Release|x64 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Debug|x64.ActiveCfg = Debug|x64 18 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Debug|x64.Build.0 = Debug|x64 19 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Release|Any CPU.ActiveCfg = Release|Any CPU 20 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Release|Any CPU.Build.0 = Release|Any CPU 21 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Release|x64.ActiveCfg = Release|x64 22 | {766B6DE7-8016-93B8-42AF-523200177FC2}.Release|x64.Build.0 = Release|x64 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | GlobalSection(ExtensibilityGlobals) = postSolution 28 | SolutionGuid = {E78BBBE6-10E1-45D8-B88F-17D6C10EE14D} 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /example/golang/README.md: -------------------------------------------------------------------------------- 1 | # Go Client for Intel® AI Assistant Builder Service 2 | This folder contains a simple Go client designed to communicate with Intel® AI Assistant Builder Service. 3 | 4 | ## Install Dependencies 5 | - Please ensure that **[Go](https://go.dev/dl/)** is installed on your system. Then, navigate to the `example\golang` directory and download the necessary modules: 6 | ``` 7 | cd example\golang 8 | go mod download 9 | ``` 10 | 11 | ## How to Run 12 | - Before executing the Go Client, please ensure that Intel® AI Assistant Builder Service is already running. 13 | ``` 14 | cd example\golang 15 | go run . 16 | ``` 17 | 18 | ## Recompile Proto to pb.go 19 | - Use the Powershell script `shared\recompile-client-proto.ps1` to regenerate the `pb`/`pb2` files for Golang. 20 | ``` 21 | cd path\to\shared 22 | .\recompile-client-proto.ps1 23 | ``` 24 | -------------------------------------------------------------------------------- /example/golang/go.mod: -------------------------------------------------------------------------------- 1 | module superbuilder 2 | 3 | go 1.24.1 4 | 5 | require ( 6 | google.golang.org/grpc v1.71.1 7 | google.golang.org/protobuf v1.36.6 8 | ) 9 | 10 | require ( 11 | golang.org/x/net v0.39.0 // indirect 12 | golang.org/x/sys v0.32.0 // indirect 13 | golang.org/x/text v0.24.0 // indirect 14 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250407143221-ac9807e6c755 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /example/golang/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= 2 | github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 3 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 4 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 5 | github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= 6 | github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= 7 | github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= 8 | github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 9 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 10 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 11 | go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= 12 | go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= 13 | go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= 14 | go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= 15 | go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= 16 | go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= 17 | go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= 18 | go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= 19 | go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= 20 | go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= 21 | go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= 22 | go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= 23 | golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= 24 | golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= 25 | golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= 26 | golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 27 | golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= 28 | golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= 29 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250407143221-ac9807e6c755 h1:TwXJCGVREgQ/cl18iY0Z4wJCTL/GmW+Um2oSwZiZPnc= 30 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250407143221-ac9807e6c755/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= 31 | google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= 32 | google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= 33 | google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= 34 | google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= 35 | -------------------------------------------------------------------------------- /example/golang/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "fmt" 7 | "io" 8 | "log" 9 | "math/rand" 10 | "time" 11 | 12 | middleware "superbuilder/proto" 13 | 14 | "google.golang.org/grpc" 15 | "google.golang.org/grpc/credentials/insecure" 16 | ) 17 | 18 | func main() { 19 | serverAddress := "localhost:5006" 20 | fmt.Println("connecting to server at", serverAddress) 21 | 22 | conn, err := grpc.NewClient(serverAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) 23 | if err != nil { 24 | log.Fatalf("did not connect: %v", err) 25 | } 26 | defer conn.Close() 27 | 28 | // middlewareClient responsible for communicating with the server 29 | middlewareClient := middleware.NewSuperBuilderClient(conn) 30 | 31 | // create default context to manage the connection timeout 32 | ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) 33 | defer cancel() 34 | 35 | // create longer context to manage the connection timeout 36 | // this is to compensate for the long running functions, e.g. SetParameters 37 | ctx_no_timeout := context.Context(context.Background()) 38 | 39 | // ------------------ example of calling server ------------------ 40 | 41 | // example 1 - call server and return system information 42 | fmt.Println("\n\nexample 1 - call server and return system information") 43 | fmt.Println("==========") 44 | responseSayHello, err := middlewareClient.SayHello(ctx, &middleware.SayHelloRequest{}) 45 | if err != nil { 46 | log.Fatalf("error calling function SayHello: %v", err) 47 | } 48 | fmt.Println(responseSayHello.GetMessage()) 49 | 50 | // example 2 - call server and return chat history 51 | fmt.Println("\n\nexample 2 - call server and return chat history") 52 | fmt.Println("==========") 53 | responseGetChatHistory, err := middlewareClient.GetChatHistory(ctx_no_timeout, &middleware.GetChatHistoryRequest{}) 54 | if err != nil { 55 | log.Fatalf("error calling function GetChatHistory: %v", err) 56 | } 57 | fmt.Println(responseGetChatHistory.GetData()) 58 | 59 | // example 3 - get current client model configuration 60 | fmt.Println("\n\nexample 3 - call server and return client model configuration") 61 | fmt.Println("==========") 62 | responseGetClientConfig, err := middlewareClient.GetClientConfig(ctx, &middleware.GetClientConfigRequest{}) 63 | if err != nil { 64 | log.Fatalf("error calling function GetClientConfig: %v", err) 65 | } 66 | // fmt.Println(responseGetClientConfig.GetData()) 67 | 68 | // unmarshal json 69 | var f interface{} 70 | err = json.Unmarshal([]byte(responseGetClientConfig.Data), &f) 71 | if err != nil { 72 | log.Fatalf("error unmarshalling client config: %v", err) 73 | } 74 | 75 | currentUserConfig := f.(map[string]interface{}) 76 | ActiveAssistant := currentUserConfig["ActiveAssistant"].(map[string]interface{}) 77 | selectedModels := ActiveAssistant["models"] 78 | AllModels := ActiveAssistant["all_models"].([]interface{}) 79 | 80 | // show activeAssistant Model configuration 81 | var embedding_model map[string]interface{} 82 | var ranker_model map[string]interface{} 83 | var chat_model map[string]interface{} 84 | 85 | for _, each := range selectedModels.([]interface{}) { 86 | current := each.(map[string]interface{}) 87 | if current["model_type"] == "chat_model" { 88 | chat_model = current 89 | } 90 | if current["model_type"] == "embedding_model" { 91 | embedding_model = current 92 | } 93 | if current["model_type"] == "ranker_model" { 94 | ranker_model = current 95 | } 96 | } 97 | fmt.Println("current embedding model:", embedding_model["full_name"]) 98 | fmt.Println("current ranker model:", ranker_model["full_name"]) 99 | fmt.Println("current chat model:", chat_model["full_name"]) 100 | 101 | // example 4 - change active chat model 102 | fmt.Println("\n\nexample 4 - change active chat model") 103 | fmt.Println("==========") 104 | 105 | next_chat_model := "Qwen2-7B-Instruct-int4" 106 | if chat_model["full_name"] == "Qwen2-7B-Instruct-int4" { 107 | next_chat_model = "Phi-3-mini-4k-instruct-int4-ov" 108 | } 109 | 110 | // all chat models 111 | for _, each := range AllModels { 112 | current := each.(map[string]interface{}) 113 | if current["full_name"] == next_chat_model { 114 | chat_model = current 115 | } 116 | } 117 | 118 | fmt.Println("changing current chat model to:", chat_model["full_name"]) 119 | 120 | var newModelsConfiguration []map[string]interface{} 121 | newModelsConfiguration = append(newModelsConfiguration, embedding_model) 122 | newModelsConfiguration = append(newModelsConfiguration, ranker_model) 123 | newModelsConfiguration = append(newModelsConfiguration, chat_model) 124 | 125 | ModelsJsonFormat, err := json.Marshal(newModelsConfiguration) 126 | if err != nil { 127 | log.Fatalf("error marshalling new models configuration: %v", err) 128 | } 129 | middlewareClient.SetActiveAssistant(ctx_no_timeout, &middleware.SetActiveAssistantRequest{ 130 | Assistant: ActiveAssistant["short_name"].(string), 131 | ModelsJson: string(ModelsJsonFormat), 132 | }) 133 | 134 | // example 5 - chat with the server 135 | fmt.Println("\n\nexample 5 - chat with the server") 136 | fmt.Println("==========") 137 | type ChatResponseInJSON struct { 138 | Message string `json:"message"` 139 | } 140 | 141 | var attachedFiles string = "[]" 142 | var randomInt int32 = rand.Int31() 143 | 144 | var questions []string = []string{ 145 | "what is the model name of the current chat model?", 146 | "what is the model name of the current embedding model?", 147 | "what is the model name of the current reranker model?", 148 | "why the sky blue?", 149 | "why the sea purple?", 150 | "why the tree leaf green?", 151 | } 152 | 153 | middlewareChatRequest := middleware.ChatRequest{ 154 | Name: "SuperBuilder Go Clients!", 155 | Prompt: questions[rand.Intn(len(questions))], 156 | SessionId: randomInt, // random number to identify the session 157 | AttachedFiles: &attachedFiles, 158 | } 159 | 160 | fmt.Println("Question:\n", middlewareChatRequest.Prompt) 161 | responseHandler, err := middlewareClient.Chat(ctx_no_timeout, &middlewareChatRequest) 162 | if err != nil { 163 | log.Fatalf("error calling function Chat: %v", err) 164 | } 165 | 166 | fullMessage := "" 167 | for { 168 | chatResponse, err := responseHandler.Recv() 169 | if err == io.EOF { 170 | // End of stream reached 171 | // log.Println("Stream ended by server") 172 | break 173 | } 174 | if err != nil { 175 | _, err2 := middlewareClient.StopChat(ctx_no_timeout, &middleware.StopChatRequest{}) 176 | if err2 != nil { 177 | log.Fatalf("error calling function StopChat: %v", err2) 178 | } 179 | fmt.Println("Chat stopped successfully") 180 | log.Fatalf("error receiving chat response: %v", err) 181 | } 182 | 183 | var message ChatResponseInJSON 184 | messageObject := chatResponse.GetMessage() 185 | json.Unmarshal([]byte(messageObject), &message) 186 | fullMessage += message.Message 187 | fmt.Print(message.Message) 188 | } 189 | 190 | fmt.Println("\n\n\n### Golang example ended ###") 191 | 192 | } 193 | -------------------------------------------------------------------------------- /example/golang/proto/superbuilder_middleware_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.27.2 5 | // source: superbuilder_middleware.proto 6 | 7 | package SuperBuilderWinService 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | SuperBuilder_SayHello_FullMethodName = "/SuperBuilder.SuperBuilder/SayHello" 23 | SuperBuilder_SayHelloPyllm_FullMethodName = "/SuperBuilder.SuperBuilder/SayHelloPyllm" 24 | SuperBuilder_Chat_FullMethodName = "/SuperBuilder.SuperBuilder/Chat" 25 | SuperBuilder_StopChat_FullMethodName = "/SuperBuilder.SuperBuilder/StopChat" 26 | SuperBuilder_LoadModels_FullMethodName = "/SuperBuilder.SuperBuilder/LoadModels" 27 | SuperBuilder_CheckHealth_FullMethodName = "/SuperBuilder.SuperBuilder/CheckHealth" 28 | SuperBuilder_AddFeedback_FullMethodName = "/SuperBuilder.SuperBuilder/AddFeedback" 29 | SuperBuilder_AddFiles_FullMethodName = "/SuperBuilder.SuperBuilder/AddFiles" 30 | SuperBuilder_StopAddFiles_FullMethodName = "/SuperBuilder.SuperBuilder/StopAddFiles" 31 | SuperBuilder_RemoveFiles_FullMethodName = "/SuperBuilder.SuperBuilder/RemoveFiles" 32 | SuperBuilder_DownloadFiles_FullMethodName = "/SuperBuilder.SuperBuilder/DownloadFiles" 33 | SuperBuilder_GetFileList_FullMethodName = "/SuperBuilder.SuperBuilder/GetFileList" 34 | SuperBuilder_SetModels_FullMethodName = "/SuperBuilder.SuperBuilder/SetModels" 35 | SuperBuilder_UnloadModels_FullMethodName = "/SuperBuilder.SuperBuilder/UnloadModels" 36 | SuperBuilder_SetParameters_FullMethodName = "/SuperBuilder.SuperBuilder/SetParameters" 37 | SuperBuilder_ClientDisconnected_FullMethodName = "/SuperBuilder.SuperBuilder/ClientDisconnected" 38 | SuperBuilder_GetClientConfig_FullMethodName = "/SuperBuilder.SuperBuilder/GetClientConfig" 39 | SuperBuilder_GetChatHistory_FullMethodName = "/SuperBuilder.SuperBuilder/GetChatHistory" 40 | SuperBuilder_GetSoftwareUpdate_FullMethodName = "/SuperBuilder.SuperBuilder/GetSoftwareUpdate" 41 | SuperBuilder_SetVectorDB_FullMethodName = "/SuperBuilder.SuperBuilder/SetVectorDB" 42 | SuperBuilder_RemoveSession_FullMethodName = "/SuperBuilder.SuperBuilder/RemoveSession" 43 | SuperBuilder_SetSessionName_FullMethodName = "/SuperBuilder.SuperBuilder/SetSessionName" 44 | SuperBuilder_SetActiveAssistant_FullMethodName = "/SuperBuilder.SuperBuilder/SetActiveAssistant" 45 | SuperBuilder_SetAssistantViewModel_FullMethodName = "/SuperBuilder.SuperBuilder/SetAssistantViewModel" 46 | SuperBuilder_SetUserConfigViewModel_FullMethodName = "/SuperBuilder.SuperBuilder/SetUserConfigViewModel" 47 | SuperBuilder_ConvertModel_FullMethodName = "/SuperBuilder.SuperBuilder/ConvertModel" 48 | SuperBuilder_UploadModel_FullMethodName = "/SuperBuilder.SuperBuilder/UploadModel" 49 | SuperBuilder_ExportUserConfig_FullMethodName = "/SuperBuilder.SuperBuilder/ExportUserConfig" 50 | SuperBuilder_ImportUserConfig_FullMethodName = "/SuperBuilder.SuperBuilder/ImportUserConfig" 51 | ) 52 | 53 | // SuperBuilderClient is the client API for SuperBuilder service. 54 | // 55 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 56 | // 57 | // The greeting service definition. 58 | type SuperBuilderClient interface { 59 | // Send a greeting ( For connection testing ) 60 | SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) 61 | // Send a greeting ( For connection testing ) 62 | SayHelloPyllm(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) 63 | // Send a chat message and stream returns a response 64 | Chat(ctx context.Context, in *ChatRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ChatResponse], error) 65 | // Sends signal to safely stop the current chat request 66 | StopChat(ctx context.Context, in *StopChatRequest, opts ...grpc.CallOption) (*StopChatResponse, error) 67 | // Loads the models and any other backend components before chatting 68 | LoadModels(ctx context.Context, in *LoadModelsRequest, opts ...grpc.CallOption) (*LoadModelsResponse, error) 69 | // Check on health status backend system / service (for example: RAG check) 70 | CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*CheckHealthResponse, error) 71 | // Give LLM feedback on a question's response to improve future responses 72 | AddFeedback(ctx context.Context, in *AddFeedbackRequest, opts ...grpc.CallOption) (*AddFeedbackResponse, error) 73 | // Upload a list of files to the RAG module to be vector stored, stream the upload progress 74 | AddFiles(ctx context.Context, in *AddFilesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[AddFilesResponse], error) 75 | // Sends signal to stop the current upload file request 76 | StopAddFiles(ctx context.Context, in *StopAddFilesRequest, opts ...grpc.CallOption) (*StopAddFilesResponse, error) 77 | // Remove a list of files from RAG doc store 78 | RemoveFiles(ctx context.Context, in *RemoveFilesRequest, opts ...grpc.CallOption) (*RemoveFilesResponse, error) 79 | // Request to download a certain list of models, or just all required models if not specified 80 | DownloadFiles(ctx context.Context, in *DownloadFilesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DownloadFilesResponse], error) 81 | // Request list of all files uploaded to the loaded document store 82 | GetFileList(ctx context.Context, in *GetFileListRequest, opts ...grpc.CallOption) (*GetFileListResponse, error) 83 | // Set and load models in the backend given a model path 84 | SetModels(ctx context.Context, in *SetModelsRequest, opts ...grpc.CallOption) (*SetModelsResponse, error) 85 | // Unloads models that are in the backend 86 | UnloadModels(ctx context.Context, in *UnloadModelsRequest, opts ...grpc.CallOption) (*UnloadModelsResponse, error) 87 | // Change the RAG, LLM, and backend parameters 88 | SetParameters(ctx context.Context, in *SetParametersRequest, opts ...grpc.CallOption) (*SetParametersResponse, error) 89 | // Inform the server that the client has disconnected 90 | ClientDisconnected(ctx context.Context, in *ClientDisconnectedRequest, opts ...grpc.CallOption) (*ClientDisconnectedResponse, error) 91 | // Get config info from middleware 92 | GetClientConfig(ctx context.Context, in *GetClientConfigRequest, opts ...grpc.CallOption) (*GetClientConfigResponse, error) 93 | // Get chat history messages from middleware 94 | GetChatHistory(ctx context.Context, in *GetChatHistoryRequest, opts ...grpc.CallOption) (*GetChatHistoryResponse, error) 95 | // Send a greeting ( For connection testing ) 96 | GetSoftwareUpdate(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) 97 | // Setting Vector DB of default assistant in sqlite db. 98 | SetVectorDB(ctx context.Context, in *SetVectorDBRequest, opts ...grpc.CallOption) (*SetVectorDBResponse, error) 99 | // Removes a session and all data related to session from database given session id 100 | RemoveSession(ctx context.Context, in *RemoveSessionRequest, opts ...grpc.CallOption) (*RemoveSessionResponse, error) 101 | // Update a session name given a valid unique session id 102 | SetSessionName(ctx context.Context, in *SetSessionNameRequest, opts ...grpc.CallOption) (*SetSessionNameResponse, error) 103 | // Set Active Assistant or Models 104 | SetActiveAssistant(ctx context.Context, in *SetActiveAssistantRequest, opts ...grpc.CallOption) (*SetActiveAssistantResponse, error) 105 | // Using an AssistantViewModel it will set the sqlite database active assistant to those fields. 106 | SetAssistantViewModel(ctx context.Context, in *SetAssistantViewModelRequest, opts ...grpc.CallOption) (*SetAssistantViewModelResponse, error) 107 | // Using UserConfigViewModel, sets sqlite database userconfig jsonappsettings to the corresponding fields. 108 | SetUserConfigViewModel(ctx context.Context, in *SetUserConfigViewModelRequest, opts ...grpc.CallOption) (*SetUserConfigViewModelResponse, error) 109 | ConvertModel(ctx context.Context, in *ConvertModelRequest, opts ...grpc.CallOption) (*ConvertModelResponse, error) 110 | UploadModel(ctx context.Context, in *UploadModelRequest, opts ...grpc.CallOption) (*UploadModelResponse, error) 111 | ExportUserConfig(ctx context.Context, in *ExportUserConfigRequest, opts ...grpc.CallOption) (*ExportUserConfigResponse, error) 112 | ImportUserConfig(ctx context.Context, in *ImportUserConfigRequest, opts ...grpc.CallOption) (*ImportUserConfigResponse, error) 113 | } 114 | 115 | type superBuilderClient struct { 116 | cc grpc.ClientConnInterface 117 | } 118 | 119 | func NewSuperBuilderClient(cc grpc.ClientConnInterface) SuperBuilderClient { 120 | return &superBuilderClient{cc} 121 | } 122 | 123 | func (c *superBuilderClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { 124 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 125 | out := new(SayHelloResponse) 126 | err := c.cc.Invoke(ctx, SuperBuilder_SayHello_FullMethodName, in, out, cOpts...) 127 | if err != nil { 128 | return nil, err 129 | } 130 | return out, nil 131 | } 132 | 133 | func (c *superBuilderClient) SayHelloPyllm(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { 134 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 135 | out := new(SayHelloResponse) 136 | err := c.cc.Invoke(ctx, SuperBuilder_SayHelloPyllm_FullMethodName, in, out, cOpts...) 137 | if err != nil { 138 | return nil, err 139 | } 140 | return out, nil 141 | } 142 | 143 | func (c *superBuilderClient) Chat(ctx context.Context, in *ChatRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ChatResponse], error) { 144 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 145 | stream, err := c.cc.NewStream(ctx, &SuperBuilder_ServiceDesc.Streams[0], SuperBuilder_Chat_FullMethodName, cOpts...) 146 | if err != nil { 147 | return nil, err 148 | } 149 | x := &grpc.GenericClientStream[ChatRequest, ChatResponse]{ClientStream: stream} 150 | if err := x.ClientStream.SendMsg(in); err != nil { 151 | return nil, err 152 | } 153 | if err := x.ClientStream.CloseSend(); err != nil { 154 | return nil, err 155 | } 156 | return x, nil 157 | } 158 | 159 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 160 | type SuperBuilder_ChatClient = grpc.ServerStreamingClient[ChatResponse] 161 | 162 | func (c *superBuilderClient) StopChat(ctx context.Context, in *StopChatRequest, opts ...grpc.CallOption) (*StopChatResponse, error) { 163 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 164 | out := new(StopChatResponse) 165 | err := c.cc.Invoke(ctx, SuperBuilder_StopChat_FullMethodName, in, out, cOpts...) 166 | if err != nil { 167 | return nil, err 168 | } 169 | return out, nil 170 | } 171 | 172 | func (c *superBuilderClient) LoadModels(ctx context.Context, in *LoadModelsRequest, opts ...grpc.CallOption) (*LoadModelsResponse, error) { 173 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 174 | out := new(LoadModelsResponse) 175 | err := c.cc.Invoke(ctx, SuperBuilder_LoadModels_FullMethodName, in, out, cOpts...) 176 | if err != nil { 177 | return nil, err 178 | } 179 | return out, nil 180 | } 181 | 182 | func (c *superBuilderClient) CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*CheckHealthResponse, error) { 183 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 184 | out := new(CheckHealthResponse) 185 | err := c.cc.Invoke(ctx, SuperBuilder_CheckHealth_FullMethodName, in, out, cOpts...) 186 | if err != nil { 187 | return nil, err 188 | } 189 | return out, nil 190 | } 191 | 192 | func (c *superBuilderClient) AddFeedback(ctx context.Context, in *AddFeedbackRequest, opts ...grpc.CallOption) (*AddFeedbackResponse, error) { 193 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 194 | out := new(AddFeedbackResponse) 195 | err := c.cc.Invoke(ctx, SuperBuilder_AddFeedback_FullMethodName, in, out, cOpts...) 196 | if err != nil { 197 | return nil, err 198 | } 199 | return out, nil 200 | } 201 | 202 | func (c *superBuilderClient) AddFiles(ctx context.Context, in *AddFilesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[AddFilesResponse], error) { 203 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 204 | stream, err := c.cc.NewStream(ctx, &SuperBuilder_ServiceDesc.Streams[1], SuperBuilder_AddFiles_FullMethodName, cOpts...) 205 | if err != nil { 206 | return nil, err 207 | } 208 | x := &grpc.GenericClientStream[AddFilesRequest, AddFilesResponse]{ClientStream: stream} 209 | if err := x.ClientStream.SendMsg(in); err != nil { 210 | return nil, err 211 | } 212 | if err := x.ClientStream.CloseSend(); err != nil { 213 | return nil, err 214 | } 215 | return x, nil 216 | } 217 | 218 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 219 | type SuperBuilder_AddFilesClient = grpc.ServerStreamingClient[AddFilesResponse] 220 | 221 | func (c *superBuilderClient) StopAddFiles(ctx context.Context, in *StopAddFilesRequest, opts ...grpc.CallOption) (*StopAddFilesResponse, error) { 222 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 223 | out := new(StopAddFilesResponse) 224 | err := c.cc.Invoke(ctx, SuperBuilder_StopAddFiles_FullMethodName, in, out, cOpts...) 225 | if err != nil { 226 | return nil, err 227 | } 228 | return out, nil 229 | } 230 | 231 | func (c *superBuilderClient) RemoveFiles(ctx context.Context, in *RemoveFilesRequest, opts ...grpc.CallOption) (*RemoveFilesResponse, error) { 232 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 233 | out := new(RemoveFilesResponse) 234 | err := c.cc.Invoke(ctx, SuperBuilder_RemoveFiles_FullMethodName, in, out, cOpts...) 235 | if err != nil { 236 | return nil, err 237 | } 238 | return out, nil 239 | } 240 | 241 | func (c *superBuilderClient) DownloadFiles(ctx context.Context, in *DownloadFilesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DownloadFilesResponse], error) { 242 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 243 | stream, err := c.cc.NewStream(ctx, &SuperBuilder_ServiceDesc.Streams[2], SuperBuilder_DownloadFiles_FullMethodName, cOpts...) 244 | if err != nil { 245 | return nil, err 246 | } 247 | x := &grpc.GenericClientStream[DownloadFilesRequest, DownloadFilesResponse]{ClientStream: stream} 248 | if err := x.ClientStream.SendMsg(in); err != nil { 249 | return nil, err 250 | } 251 | if err := x.ClientStream.CloseSend(); err != nil { 252 | return nil, err 253 | } 254 | return x, nil 255 | } 256 | 257 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 258 | type SuperBuilder_DownloadFilesClient = grpc.ServerStreamingClient[DownloadFilesResponse] 259 | 260 | func (c *superBuilderClient) GetFileList(ctx context.Context, in *GetFileListRequest, opts ...grpc.CallOption) (*GetFileListResponse, error) { 261 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 262 | out := new(GetFileListResponse) 263 | err := c.cc.Invoke(ctx, SuperBuilder_GetFileList_FullMethodName, in, out, cOpts...) 264 | if err != nil { 265 | return nil, err 266 | } 267 | return out, nil 268 | } 269 | 270 | func (c *superBuilderClient) SetModels(ctx context.Context, in *SetModelsRequest, opts ...grpc.CallOption) (*SetModelsResponse, error) { 271 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 272 | out := new(SetModelsResponse) 273 | err := c.cc.Invoke(ctx, SuperBuilder_SetModels_FullMethodName, in, out, cOpts...) 274 | if err != nil { 275 | return nil, err 276 | } 277 | return out, nil 278 | } 279 | 280 | func (c *superBuilderClient) UnloadModels(ctx context.Context, in *UnloadModelsRequest, opts ...grpc.CallOption) (*UnloadModelsResponse, error) { 281 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 282 | out := new(UnloadModelsResponse) 283 | err := c.cc.Invoke(ctx, SuperBuilder_UnloadModels_FullMethodName, in, out, cOpts...) 284 | if err != nil { 285 | return nil, err 286 | } 287 | return out, nil 288 | } 289 | 290 | func (c *superBuilderClient) SetParameters(ctx context.Context, in *SetParametersRequest, opts ...grpc.CallOption) (*SetParametersResponse, error) { 291 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 292 | out := new(SetParametersResponse) 293 | err := c.cc.Invoke(ctx, SuperBuilder_SetParameters_FullMethodName, in, out, cOpts...) 294 | if err != nil { 295 | return nil, err 296 | } 297 | return out, nil 298 | } 299 | 300 | func (c *superBuilderClient) ClientDisconnected(ctx context.Context, in *ClientDisconnectedRequest, opts ...grpc.CallOption) (*ClientDisconnectedResponse, error) { 301 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 302 | out := new(ClientDisconnectedResponse) 303 | err := c.cc.Invoke(ctx, SuperBuilder_ClientDisconnected_FullMethodName, in, out, cOpts...) 304 | if err != nil { 305 | return nil, err 306 | } 307 | return out, nil 308 | } 309 | 310 | func (c *superBuilderClient) GetClientConfig(ctx context.Context, in *GetClientConfigRequest, opts ...grpc.CallOption) (*GetClientConfigResponse, error) { 311 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 312 | out := new(GetClientConfigResponse) 313 | err := c.cc.Invoke(ctx, SuperBuilder_GetClientConfig_FullMethodName, in, out, cOpts...) 314 | if err != nil { 315 | return nil, err 316 | } 317 | return out, nil 318 | } 319 | 320 | func (c *superBuilderClient) GetChatHistory(ctx context.Context, in *GetChatHistoryRequest, opts ...grpc.CallOption) (*GetChatHistoryResponse, error) { 321 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 322 | out := new(GetChatHistoryResponse) 323 | err := c.cc.Invoke(ctx, SuperBuilder_GetChatHistory_FullMethodName, in, out, cOpts...) 324 | if err != nil { 325 | return nil, err 326 | } 327 | return out, nil 328 | } 329 | 330 | func (c *superBuilderClient) GetSoftwareUpdate(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { 331 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 332 | out := new(SayHelloResponse) 333 | err := c.cc.Invoke(ctx, SuperBuilder_GetSoftwareUpdate_FullMethodName, in, out, cOpts...) 334 | if err != nil { 335 | return nil, err 336 | } 337 | return out, nil 338 | } 339 | 340 | func (c *superBuilderClient) SetVectorDB(ctx context.Context, in *SetVectorDBRequest, opts ...grpc.CallOption) (*SetVectorDBResponse, error) { 341 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 342 | out := new(SetVectorDBResponse) 343 | err := c.cc.Invoke(ctx, SuperBuilder_SetVectorDB_FullMethodName, in, out, cOpts...) 344 | if err != nil { 345 | return nil, err 346 | } 347 | return out, nil 348 | } 349 | 350 | func (c *superBuilderClient) RemoveSession(ctx context.Context, in *RemoveSessionRequest, opts ...grpc.CallOption) (*RemoveSessionResponse, error) { 351 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 352 | out := new(RemoveSessionResponse) 353 | err := c.cc.Invoke(ctx, SuperBuilder_RemoveSession_FullMethodName, in, out, cOpts...) 354 | if err != nil { 355 | return nil, err 356 | } 357 | return out, nil 358 | } 359 | 360 | func (c *superBuilderClient) SetSessionName(ctx context.Context, in *SetSessionNameRequest, opts ...grpc.CallOption) (*SetSessionNameResponse, error) { 361 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 362 | out := new(SetSessionNameResponse) 363 | err := c.cc.Invoke(ctx, SuperBuilder_SetSessionName_FullMethodName, in, out, cOpts...) 364 | if err != nil { 365 | return nil, err 366 | } 367 | return out, nil 368 | } 369 | 370 | func (c *superBuilderClient) SetActiveAssistant(ctx context.Context, in *SetActiveAssistantRequest, opts ...grpc.CallOption) (*SetActiveAssistantResponse, error) { 371 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 372 | out := new(SetActiveAssistantResponse) 373 | err := c.cc.Invoke(ctx, SuperBuilder_SetActiveAssistant_FullMethodName, in, out, cOpts...) 374 | if err != nil { 375 | return nil, err 376 | } 377 | return out, nil 378 | } 379 | 380 | func (c *superBuilderClient) SetAssistantViewModel(ctx context.Context, in *SetAssistantViewModelRequest, opts ...grpc.CallOption) (*SetAssistantViewModelResponse, error) { 381 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 382 | out := new(SetAssistantViewModelResponse) 383 | err := c.cc.Invoke(ctx, SuperBuilder_SetAssistantViewModel_FullMethodName, in, out, cOpts...) 384 | if err != nil { 385 | return nil, err 386 | } 387 | return out, nil 388 | } 389 | 390 | func (c *superBuilderClient) SetUserConfigViewModel(ctx context.Context, in *SetUserConfigViewModelRequest, opts ...grpc.CallOption) (*SetUserConfigViewModelResponse, error) { 391 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 392 | out := new(SetUserConfigViewModelResponse) 393 | err := c.cc.Invoke(ctx, SuperBuilder_SetUserConfigViewModel_FullMethodName, in, out, cOpts...) 394 | if err != nil { 395 | return nil, err 396 | } 397 | return out, nil 398 | } 399 | 400 | func (c *superBuilderClient) ConvertModel(ctx context.Context, in *ConvertModelRequest, opts ...grpc.CallOption) (*ConvertModelResponse, error) { 401 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 402 | out := new(ConvertModelResponse) 403 | err := c.cc.Invoke(ctx, SuperBuilder_ConvertModel_FullMethodName, in, out, cOpts...) 404 | if err != nil { 405 | return nil, err 406 | } 407 | return out, nil 408 | } 409 | 410 | func (c *superBuilderClient) UploadModel(ctx context.Context, in *UploadModelRequest, opts ...grpc.CallOption) (*UploadModelResponse, error) { 411 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 412 | out := new(UploadModelResponse) 413 | err := c.cc.Invoke(ctx, SuperBuilder_UploadModel_FullMethodName, in, out, cOpts...) 414 | if err != nil { 415 | return nil, err 416 | } 417 | return out, nil 418 | } 419 | 420 | func (c *superBuilderClient) ExportUserConfig(ctx context.Context, in *ExportUserConfigRequest, opts ...grpc.CallOption) (*ExportUserConfigResponse, error) { 421 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 422 | out := new(ExportUserConfigResponse) 423 | err := c.cc.Invoke(ctx, SuperBuilder_ExportUserConfig_FullMethodName, in, out, cOpts...) 424 | if err != nil { 425 | return nil, err 426 | } 427 | return out, nil 428 | } 429 | 430 | func (c *superBuilderClient) ImportUserConfig(ctx context.Context, in *ImportUserConfigRequest, opts ...grpc.CallOption) (*ImportUserConfigResponse, error) { 431 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 432 | out := new(ImportUserConfigResponse) 433 | err := c.cc.Invoke(ctx, SuperBuilder_ImportUserConfig_FullMethodName, in, out, cOpts...) 434 | if err != nil { 435 | return nil, err 436 | } 437 | return out, nil 438 | } 439 | 440 | // SuperBuilderServer is the server API for SuperBuilder service. 441 | // All implementations must embed UnimplementedSuperBuilderServer 442 | // for forward compatibility. 443 | // 444 | // The greeting service definition. 445 | type SuperBuilderServer interface { 446 | // Send a greeting ( For connection testing ) 447 | SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) 448 | // Send a greeting ( For connection testing ) 449 | SayHelloPyllm(context.Context, *SayHelloRequest) (*SayHelloResponse, error) 450 | // Send a chat message and stream returns a response 451 | Chat(*ChatRequest, grpc.ServerStreamingServer[ChatResponse]) error 452 | // Sends signal to safely stop the current chat request 453 | StopChat(context.Context, *StopChatRequest) (*StopChatResponse, error) 454 | // Loads the models and any other backend components before chatting 455 | LoadModels(context.Context, *LoadModelsRequest) (*LoadModelsResponse, error) 456 | // Check on health status backend system / service (for example: RAG check) 457 | CheckHealth(context.Context, *CheckHealthRequest) (*CheckHealthResponse, error) 458 | // Give LLM feedback on a question's response to improve future responses 459 | AddFeedback(context.Context, *AddFeedbackRequest) (*AddFeedbackResponse, error) 460 | // Upload a list of files to the RAG module to be vector stored, stream the upload progress 461 | AddFiles(*AddFilesRequest, grpc.ServerStreamingServer[AddFilesResponse]) error 462 | // Sends signal to stop the current upload file request 463 | StopAddFiles(context.Context, *StopAddFilesRequest) (*StopAddFilesResponse, error) 464 | // Remove a list of files from RAG doc store 465 | RemoveFiles(context.Context, *RemoveFilesRequest) (*RemoveFilesResponse, error) 466 | // Request to download a certain list of models, or just all required models if not specified 467 | DownloadFiles(*DownloadFilesRequest, grpc.ServerStreamingServer[DownloadFilesResponse]) error 468 | // Request list of all files uploaded to the loaded document store 469 | GetFileList(context.Context, *GetFileListRequest) (*GetFileListResponse, error) 470 | // Set and load models in the backend given a model path 471 | SetModels(context.Context, *SetModelsRequest) (*SetModelsResponse, error) 472 | // Unloads models that are in the backend 473 | UnloadModels(context.Context, *UnloadModelsRequest) (*UnloadModelsResponse, error) 474 | // Change the RAG, LLM, and backend parameters 475 | SetParameters(context.Context, *SetParametersRequest) (*SetParametersResponse, error) 476 | // Inform the server that the client has disconnected 477 | ClientDisconnected(context.Context, *ClientDisconnectedRequest) (*ClientDisconnectedResponse, error) 478 | // Get config info from middleware 479 | GetClientConfig(context.Context, *GetClientConfigRequest) (*GetClientConfigResponse, error) 480 | // Get chat history messages from middleware 481 | GetChatHistory(context.Context, *GetChatHistoryRequest) (*GetChatHistoryResponse, error) 482 | // Send a greeting ( For connection testing ) 483 | GetSoftwareUpdate(context.Context, *SayHelloRequest) (*SayHelloResponse, error) 484 | // Setting Vector DB of default assistant in sqlite db. 485 | SetVectorDB(context.Context, *SetVectorDBRequest) (*SetVectorDBResponse, error) 486 | // Removes a session and all data related to session from database given session id 487 | RemoveSession(context.Context, *RemoveSessionRequest) (*RemoveSessionResponse, error) 488 | // Update a session name given a valid unique session id 489 | SetSessionName(context.Context, *SetSessionNameRequest) (*SetSessionNameResponse, error) 490 | // Set Active Assistant or Models 491 | SetActiveAssistant(context.Context, *SetActiveAssistantRequest) (*SetActiveAssistantResponse, error) 492 | // Using an AssistantViewModel it will set the sqlite database active assistant to those fields. 493 | SetAssistantViewModel(context.Context, *SetAssistantViewModelRequest) (*SetAssistantViewModelResponse, error) 494 | // Using UserConfigViewModel, sets sqlite database userconfig jsonappsettings to the corresponding fields. 495 | SetUserConfigViewModel(context.Context, *SetUserConfigViewModelRequest) (*SetUserConfigViewModelResponse, error) 496 | ConvertModel(context.Context, *ConvertModelRequest) (*ConvertModelResponse, error) 497 | UploadModel(context.Context, *UploadModelRequest) (*UploadModelResponse, error) 498 | ExportUserConfig(context.Context, *ExportUserConfigRequest) (*ExportUserConfigResponse, error) 499 | ImportUserConfig(context.Context, *ImportUserConfigRequest) (*ImportUserConfigResponse, error) 500 | mustEmbedUnimplementedSuperBuilderServer() 501 | } 502 | 503 | // UnimplementedSuperBuilderServer must be embedded to have 504 | // forward compatible implementations. 505 | // 506 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 507 | // pointer dereference when methods are called. 508 | type UnimplementedSuperBuilderServer struct{} 509 | 510 | func (UnimplementedSuperBuilderServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) { 511 | return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") 512 | } 513 | func (UnimplementedSuperBuilderServer) SayHelloPyllm(context.Context, *SayHelloRequest) (*SayHelloResponse, error) { 514 | return nil, status.Errorf(codes.Unimplemented, "method SayHelloPyllm not implemented") 515 | } 516 | func (UnimplementedSuperBuilderServer) Chat(*ChatRequest, grpc.ServerStreamingServer[ChatResponse]) error { 517 | return status.Errorf(codes.Unimplemented, "method Chat not implemented") 518 | } 519 | func (UnimplementedSuperBuilderServer) StopChat(context.Context, *StopChatRequest) (*StopChatResponse, error) { 520 | return nil, status.Errorf(codes.Unimplemented, "method StopChat not implemented") 521 | } 522 | func (UnimplementedSuperBuilderServer) LoadModels(context.Context, *LoadModelsRequest) (*LoadModelsResponse, error) { 523 | return nil, status.Errorf(codes.Unimplemented, "method LoadModels not implemented") 524 | } 525 | func (UnimplementedSuperBuilderServer) CheckHealth(context.Context, *CheckHealthRequest) (*CheckHealthResponse, error) { 526 | return nil, status.Errorf(codes.Unimplemented, "method CheckHealth not implemented") 527 | } 528 | func (UnimplementedSuperBuilderServer) AddFeedback(context.Context, *AddFeedbackRequest) (*AddFeedbackResponse, error) { 529 | return nil, status.Errorf(codes.Unimplemented, "method AddFeedback not implemented") 530 | } 531 | func (UnimplementedSuperBuilderServer) AddFiles(*AddFilesRequest, grpc.ServerStreamingServer[AddFilesResponse]) error { 532 | return status.Errorf(codes.Unimplemented, "method AddFiles not implemented") 533 | } 534 | func (UnimplementedSuperBuilderServer) StopAddFiles(context.Context, *StopAddFilesRequest) (*StopAddFilesResponse, error) { 535 | return nil, status.Errorf(codes.Unimplemented, "method StopAddFiles not implemented") 536 | } 537 | func (UnimplementedSuperBuilderServer) RemoveFiles(context.Context, *RemoveFilesRequest) (*RemoveFilesResponse, error) { 538 | return nil, status.Errorf(codes.Unimplemented, "method RemoveFiles not implemented") 539 | } 540 | func (UnimplementedSuperBuilderServer) DownloadFiles(*DownloadFilesRequest, grpc.ServerStreamingServer[DownloadFilesResponse]) error { 541 | return status.Errorf(codes.Unimplemented, "method DownloadFiles not implemented") 542 | } 543 | func (UnimplementedSuperBuilderServer) GetFileList(context.Context, *GetFileListRequest) (*GetFileListResponse, error) { 544 | return nil, status.Errorf(codes.Unimplemented, "method GetFileList not implemented") 545 | } 546 | func (UnimplementedSuperBuilderServer) SetModels(context.Context, *SetModelsRequest) (*SetModelsResponse, error) { 547 | return nil, status.Errorf(codes.Unimplemented, "method SetModels not implemented") 548 | } 549 | func (UnimplementedSuperBuilderServer) UnloadModels(context.Context, *UnloadModelsRequest) (*UnloadModelsResponse, error) { 550 | return nil, status.Errorf(codes.Unimplemented, "method UnloadModels not implemented") 551 | } 552 | func (UnimplementedSuperBuilderServer) SetParameters(context.Context, *SetParametersRequest) (*SetParametersResponse, error) { 553 | return nil, status.Errorf(codes.Unimplemented, "method SetParameters not implemented") 554 | } 555 | func (UnimplementedSuperBuilderServer) ClientDisconnected(context.Context, *ClientDisconnectedRequest) (*ClientDisconnectedResponse, error) { 556 | return nil, status.Errorf(codes.Unimplemented, "method ClientDisconnected not implemented") 557 | } 558 | func (UnimplementedSuperBuilderServer) GetClientConfig(context.Context, *GetClientConfigRequest) (*GetClientConfigResponse, error) { 559 | return nil, status.Errorf(codes.Unimplemented, "method GetClientConfig not implemented") 560 | } 561 | func (UnimplementedSuperBuilderServer) GetChatHistory(context.Context, *GetChatHistoryRequest) (*GetChatHistoryResponse, error) { 562 | return nil, status.Errorf(codes.Unimplemented, "method GetChatHistory not implemented") 563 | } 564 | func (UnimplementedSuperBuilderServer) GetSoftwareUpdate(context.Context, *SayHelloRequest) (*SayHelloResponse, error) { 565 | return nil, status.Errorf(codes.Unimplemented, "method GetSoftwareUpdate not implemented") 566 | } 567 | func (UnimplementedSuperBuilderServer) SetVectorDB(context.Context, *SetVectorDBRequest) (*SetVectorDBResponse, error) { 568 | return nil, status.Errorf(codes.Unimplemented, "method SetVectorDB not implemented") 569 | } 570 | func (UnimplementedSuperBuilderServer) RemoveSession(context.Context, *RemoveSessionRequest) (*RemoveSessionResponse, error) { 571 | return nil, status.Errorf(codes.Unimplemented, "method RemoveSession not implemented") 572 | } 573 | func (UnimplementedSuperBuilderServer) SetSessionName(context.Context, *SetSessionNameRequest) (*SetSessionNameResponse, error) { 574 | return nil, status.Errorf(codes.Unimplemented, "method SetSessionName not implemented") 575 | } 576 | func (UnimplementedSuperBuilderServer) SetActiveAssistant(context.Context, *SetActiveAssistantRequest) (*SetActiveAssistantResponse, error) { 577 | return nil, status.Errorf(codes.Unimplemented, "method SetActiveAssistant not implemented") 578 | } 579 | func (UnimplementedSuperBuilderServer) SetAssistantViewModel(context.Context, *SetAssistantViewModelRequest) (*SetAssistantViewModelResponse, error) { 580 | return nil, status.Errorf(codes.Unimplemented, "method SetAssistantViewModel not implemented") 581 | } 582 | func (UnimplementedSuperBuilderServer) SetUserConfigViewModel(context.Context, *SetUserConfigViewModelRequest) (*SetUserConfigViewModelResponse, error) { 583 | return nil, status.Errorf(codes.Unimplemented, "method SetUserConfigViewModel not implemented") 584 | } 585 | func (UnimplementedSuperBuilderServer) ConvertModel(context.Context, *ConvertModelRequest) (*ConvertModelResponse, error) { 586 | return nil, status.Errorf(codes.Unimplemented, "method ConvertModel not implemented") 587 | } 588 | func (UnimplementedSuperBuilderServer) UploadModel(context.Context, *UploadModelRequest) (*UploadModelResponse, error) { 589 | return nil, status.Errorf(codes.Unimplemented, "method UploadModel not implemented") 590 | } 591 | func (UnimplementedSuperBuilderServer) ExportUserConfig(context.Context, *ExportUserConfigRequest) (*ExportUserConfigResponse, error) { 592 | return nil, status.Errorf(codes.Unimplemented, "method ExportUserConfig not implemented") 593 | } 594 | func (UnimplementedSuperBuilderServer) ImportUserConfig(context.Context, *ImportUserConfigRequest) (*ImportUserConfigResponse, error) { 595 | return nil, status.Errorf(codes.Unimplemented, "method ImportUserConfig not implemented") 596 | } 597 | func (UnimplementedSuperBuilderServer) mustEmbedUnimplementedSuperBuilderServer() {} 598 | func (UnimplementedSuperBuilderServer) testEmbeddedByValue() {} 599 | 600 | // UnsafeSuperBuilderServer may be embedded to opt out of forward compatibility for this service. 601 | // Use of this interface is not recommended, as added methods to SuperBuilderServer will 602 | // result in compilation errors. 603 | type UnsafeSuperBuilderServer interface { 604 | mustEmbedUnimplementedSuperBuilderServer() 605 | } 606 | 607 | func RegisterSuperBuilderServer(s grpc.ServiceRegistrar, srv SuperBuilderServer) { 608 | // If the following call pancis, it indicates UnimplementedSuperBuilderServer was 609 | // embedded by pointer and is nil. This will cause panics if an 610 | // unimplemented method is ever invoked, so we test this at initialization 611 | // time to prevent it from happening at runtime later due to I/O. 612 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 613 | t.testEmbeddedByValue() 614 | } 615 | s.RegisterService(&SuperBuilder_ServiceDesc, srv) 616 | } 617 | 618 | func _SuperBuilder_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 619 | in := new(SayHelloRequest) 620 | if err := dec(in); err != nil { 621 | return nil, err 622 | } 623 | if interceptor == nil { 624 | return srv.(SuperBuilderServer).SayHello(ctx, in) 625 | } 626 | info := &grpc.UnaryServerInfo{ 627 | Server: srv, 628 | FullMethod: SuperBuilder_SayHello_FullMethodName, 629 | } 630 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 631 | return srv.(SuperBuilderServer).SayHello(ctx, req.(*SayHelloRequest)) 632 | } 633 | return interceptor(ctx, in, info, handler) 634 | } 635 | 636 | func _SuperBuilder_SayHelloPyllm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 637 | in := new(SayHelloRequest) 638 | if err := dec(in); err != nil { 639 | return nil, err 640 | } 641 | if interceptor == nil { 642 | return srv.(SuperBuilderServer).SayHelloPyllm(ctx, in) 643 | } 644 | info := &grpc.UnaryServerInfo{ 645 | Server: srv, 646 | FullMethod: SuperBuilder_SayHelloPyllm_FullMethodName, 647 | } 648 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 649 | return srv.(SuperBuilderServer).SayHelloPyllm(ctx, req.(*SayHelloRequest)) 650 | } 651 | return interceptor(ctx, in, info, handler) 652 | } 653 | 654 | func _SuperBuilder_Chat_Handler(srv interface{}, stream grpc.ServerStream) error { 655 | m := new(ChatRequest) 656 | if err := stream.RecvMsg(m); err != nil { 657 | return err 658 | } 659 | return srv.(SuperBuilderServer).Chat(m, &grpc.GenericServerStream[ChatRequest, ChatResponse]{ServerStream: stream}) 660 | } 661 | 662 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 663 | type SuperBuilder_ChatServer = grpc.ServerStreamingServer[ChatResponse] 664 | 665 | func _SuperBuilder_StopChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 666 | in := new(StopChatRequest) 667 | if err := dec(in); err != nil { 668 | return nil, err 669 | } 670 | if interceptor == nil { 671 | return srv.(SuperBuilderServer).StopChat(ctx, in) 672 | } 673 | info := &grpc.UnaryServerInfo{ 674 | Server: srv, 675 | FullMethod: SuperBuilder_StopChat_FullMethodName, 676 | } 677 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 678 | return srv.(SuperBuilderServer).StopChat(ctx, req.(*StopChatRequest)) 679 | } 680 | return interceptor(ctx, in, info, handler) 681 | } 682 | 683 | func _SuperBuilder_LoadModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 684 | in := new(LoadModelsRequest) 685 | if err := dec(in); err != nil { 686 | return nil, err 687 | } 688 | if interceptor == nil { 689 | return srv.(SuperBuilderServer).LoadModels(ctx, in) 690 | } 691 | info := &grpc.UnaryServerInfo{ 692 | Server: srv, 693 | FullMethod: SuperBuilder_LoadModels_FullMethodName, 694 | } 695 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 696 | return srv.(SuperBuilderServer).LoadModels(ctx, req.(*LoadModelsRequest)) 697 | } 698 | return interceptor(ctx, in, info, handler) 699 | } 700 | 701 | func _SuperBuilder_CheckHealth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 702 | in := new(CheckHealthRequest) 703 | if err := dec(in); err != nil { 704 | return nil, err 705 | } 706 | if interceptor == nil { 707 | return srv.(SuperBuilderServer).CheckHealth(ctx, in) 708 | } 709 | info := &grpc.UnaryServerInfo{ 710 | Server: srv, 711 | FullMethod: SuperBuilder_CheckHealth_FullMethodName, 712 | } 713 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 714 | return srv.(SuperBuilderServer).CheckHealth(ctx, req.(*CheckHealthRequest)) 715 | } 716 | return interceptor(ctx, in, info, handler) 717 | } 718 | 719 | func _SuperBuilder_AddFeedback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 720 | in := new(AddFeedbackRequest) 721 | if err := dec(in); err != nil { 722 | return nil, err 723 | } 724 | if interceptor == nil { 725 | return srv.(SuperBuilderServer).AddFeedback(ctx, in) 726 | } 727 | info := &grpc.UnaryServerInfo{ 728 | Server: srv, 729 | FullMethod: SuperBuilder_AddFeedback_FullMethodName, 730 | } 731 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 732 | return srv.(SuperBuilderServer).AddFeedback(ctx, req.(*AddFeedbackRequest)) 733 | } 734 | return interceptor(ctx, in, info, handler) 735 | } 736 | 737 | func _SuperBuilder_AddFiles_Handler(srv interface{}, stream grpc.ServerStream) error { 738 | m := new(AddFilesRequest) 739 | if err := stream.RecvMsg(m); err != nil { 740 | return err 741 | } 742 | return srv.(SuperBuilderServer).AddFiles(m, &grpc.GenericServerStream[AddFilesRequest, AddFilesResponse]{ServerStream: stream}) 743 | } 744 | 745 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 746 | type SuperBuilder_AddFilesServer = grpc.ServerStreamingServer[AddFilesResponse] 747 | 748 | func _SuperBuilder_StopAddFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 749 | in := new(StopAddFilesRequest) 750 | if err := dec(in); err != nil { 751 | return nil, err 752 | } 753 | if interceptor == nil { 754 | return srv.(SuperBuilderServer).StopAddFiles(ctx, in) 755 | } 756 | info := &grpc.UnaryServerInfo{ 757 | Server: srv, 758 | FullMethod: SuperBuilder_StopAddFiles_FullMethodName, 759 | } 760 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 761 | return srv.(SuperBuilderServer).StopAddFiles(ctx, req.(*StopAddFilesRequest)) 762 | } 763 | return interceptor(ctx, in, info, handler) 764 | } 765 | 766 | func _SuperBuilder_RemoveFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 767 | in := new(RemoveFilesRequest) 768 | if err := dec(in); err != nil { 769 | return nil, err 770 | } 771 | if interceptor == nil { 772 | return srv.(SuperBuilderServer).RemoveFiles(ctx, in) 773 | } 774 | info := &grpc.UnaryServerInfo{ 775 | Server: srv, 776 | FullMethod: SuperBuilder_RemoveFiles_FullMethodName, 777 | } 778 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 779 | return srv.(SuperBuilderServer).RemoveFiles(ctx, req.(*RemoveFilesRequest)) 780 | } 781 | return interceptor(ctx, in, info, handler) 782 | } 783 | 784 | func _SuperBuilder_DownloadFiles_Handler(srv interface{}, stream grpc.ServerStream) error { 785 | m := new(DownloadFilesRequest) 786 | if err := stream.RecvMsg(m); err != nil { 787 | return err 788 | } 789 | return srv.(SuperBuilderServer).DownloadFiles(m, &grpc.GenericServerStream[DownloadFilesRequest, DownloadFilesResponse]{ServerStream: stream}) 790 | } 791 | 792 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 793 | type SuperBuilder_DownloadFilesServer = grpc.ServerStreamingServer[DownloadFilesResponse] 794 | 795 | func _SuperBuilder_GetFileList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 796 | in := new(GetFileListRequest) 797 | if err := dec(in); err != nil { 798 | return nil, err 799 | } 800 | if interceptor == nil { 801 | return srv.(SuperBuilderServer).GetFileList(ctx, in) 802 | } 803 | info := &grpc.UnaryServerInfo{ 804 | Server: srv, 805 | FullMethod: SuperBuilder_GetFileList_FullMethodName, 806 | } 807 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 808 | return srv.(SuperBuilderServer).GetFileList(ctx, req.(*GetFileListRequest)) 809 | } 810 | return interceptor(ctx, in, info, handler) 811 | } 812 | 813 | func _SuperBuilder_SetModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 814 | in := new(SetModelsRequest) 815 | if err := dec(in); err != nil { 816 | return nil, err 817 | } 818 | if interceptor == nil { 819 | return srv.(SuperBuilderServer).SetModels(ctx, in) 820 | } 821 | info := &grpc.UnaryServerInfo{ 822 | Server: srv, 823 | FullMethod: SuperBuilder_SetModels_FullMethodName, 824 | } 825 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 826 | return srv.(SuperBuilderServer).SetModels(ctx, req.(*SetModelsRequest)) 827 | } 828 | return interceptor(ctx, in, info, handler) 829 | } 830 | 831 | func _SuperBuilder_UnloadModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 832 | in := new(UnloadModelsRequest) 833 | if err := dec(in); err != nil { 834 | return nil, err 835 | } 836 | if interceptor == nil { 837 | return srv.(SuperBuilderServer).UnloadModels(ctx, in) 838 | } 839 | info := &grpc.UnaryServerInfo{ 840 | Server: srv, 841 | FullMethod: SuperBuilder_UnloadModels_FullMethodName, 842 | } 843 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 844 | return srv.(SuperBuilderServer).UnloadModels(ctx, req.(*UnloadModelsRequest)) 845 | } 846 | return interceptor(ctx, in, info, handler) 847 | } 848 | 849 | func _SuperBuilder_SetParameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 850 | in := new(SetParametersRequest) 851 | if err := dec(in); err != nil { 852 | return nil, err 853 | } 854 | if interceptor == nil { 855 | return srv.(SuperBuilderServer).SetParameters(ctx, in) 856 | } 857 | info := &grpc.UnaryServerInfo{ 858 | Server: srv, 859 | FullMethod: SuperBuilder_SetParameters_FullMethodName, 860 | } 861 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 862 | return srv.(SuperBuilderServer).SetParameters(ctx, req.(*SetParametersRequest)) 863 | } 864 | return interceptor(ctx, in, info, handler) 865 | } 866 | 867 | func _SuperBuilder_ClientDisconnected_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 868 | in := new(ClientDisconnectedRequest) 869 | if err := dec(in); err != nil { 870 | return nil, err 871 | } 872 | if interceptor == nil { 873 | return srv.(SuperBuilderServer).ClientDisconnected(ctx, in) 874 | } 875 | info := &grpc.UnaryServerInfo{ 876 | Server: srv, 877 | FullMethod: SuperBuilder_ClientDisconnected_FullMethodName, 878 | } 879 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 880 | return srv.(SuperBuilderServer).ClientDisconnected(ctx, req.(*ClientDisconnectedRequest)) 881 | } 882 | return interceptor(ctx, in, info, handler) 883 | } 884 | 885 | func _SuperBuilder_GetClientConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 886 | in := new(GetClientConfigRequest) 887 | if err := dec(in); err != nil { 888 | return nil, err 889 | } 890 | if interceptor == nil { 891 | return srv.(SuperBuilderServer).GetClientConfig(ctx, in) 892 | } 893 | info := &grpc.UnaryServerInfo{ 894 | Server: srv, 895 | FullMethod: SuperBuilder_GetClientConfig_FullMethodName, 896 | } 897 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 898 | return srv.(SuperBuilderServer).GetClientConfig(ctx, req.(*GetClientConfigRequest)) 899 | } 900 | return interceptor(ctx, in, info, handler) 901 | } 902 | 903 | func _SuperBuilder_GetChatHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 904 | in := new(GetChatHistoryRequest) 905 | if err := dec(in); err != nil { 906 | return nil, err 907 | } 908 | if interceptor == nil { 909 | return srv.(SuperBuilderServer).GetChatHistory(ctx, in) 910 | } 911 | info := &grpc.UnaryServerInfo{ 912 | Server: srv, 913 | FullMethod: SuperBuilder_GetChatHistory_FullMethodName, 914 | } 915 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 916 | return srv.(SuperBuilderServer).GetChatHistory(ctx, req.(*GetChatHistoryRequest)) 917 | } 918 | return interceptor(ctx, in, info, handler) 919 | } 920 | 921 | func _SuperBuilder_GetSoftwareUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 922 | in := new(SayHelloRequest) 923 | if err := dec(in); err != nil { 924 | return nil, err 925 | } 926 | if interceptor == nil { 927 | return srv.(SuperBuilderServer).GetSoftwareUpdate(ctx, in) 928 | } 929 | info := &grpc.UnaryServerInfo{ 930 | Server: srv, 931 | FullMethod: SuperBuilder_GetSoftwareUpdate_FullMethodName, 932 | } 933 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 934 | return srv.(SuperBuilderServer).GetSoftwareUpdate(ctx, req.(*SayHelloRequest)) 935 | } 936 | return interceptor(ctx, in, info, handler) 937 | } 938 | 939 | func _SuperBuilder_SetVectorDB_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 940 | in := new(SetVectorDBRequest) 941 | if err := dec(in); err != nil { 942 | return nil, err 943 | } 944 | if interceptor == nil { 945 | return srv.(SuperBuilderServer).SetVectorDB(ctx, in) 946 | } 947 | info := &grpc.UnaryServerInfo{ 948 | Server: srv, 949 | FullMethod: SuperBuilder_SetVectorDB_FullMethodName, 950 | } 951 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 952 | return srv.(SuperBuilderServer).SetVectorDB(ctx, req.(*SetVectorDBRequest)) 953 | } 954 | return interceptor(ctx, in, info, handler) 955 | } 956 | 957 | func _SuperBuilder_RemoveSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 958 | in := new(RemoveSessionRequest) 959 | if err := dec(in); err != nil { 960 | return nil, err 961 | } 962 | if interceptor == nil { 963 | return srv.(SuperBuilderServer).RemoveSession(ctx, in) 964 | } 965 | info := &grpc.UnaryServerInfo{ 966 | Server: srv, 967 | FullMethod: SuperBuilder_RemoveSession_FullMethodName, 968 | } 969 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 970 | return srv.(SuperBuilderServer).RemoveSession(ctx, req.(*RemoveSessionRequest)) 971 | } 972 | return interceptor(ctx, in, info, handler) 973 | } 974 | 975 | func _SuperBuilder_SetSessionName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 976 | in := new(SetSessionNameRequest) 977 | if err := dec(in); err != nil { 978 | return nil, err 979 | } 980 | if interceptor == nil { 981 | return srv.(SuperBuilderServer).SetSessionName(ctx, in) 982 | } 983 | info := &grpc.UnaryServerInfo{ 984 | Server: srv, 985 | FullMethod: SuperBuilder_SetSessionName_FullMethodName, 986 | } 987 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 988 | return srv.(SuperBuilderServer).SetSessionName(ctx, req.(*SetSessionNameRequest)) 989 | } 990 | return interceptor(ctx, in, info, handler) 991 | } 992 | 993 | func _SuperBuilder_SetActiveAssistant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 994 | in := new(SetActiveAssistantRequest) 995 | if err := dec(in); err != nil { 996 | return nil, err 997 | } 998 | if interceptor == nil { 999 | return srv.(SuperBuilderServer).SetActiveAssistant(ctx, in) 1000 | } 1001 | info := &grpc.UnaryServerInfo{ 1002 | Server: srv, 1003 | FullMethod: SuperBuilder_SetActiveAssistant_FullMethodName, 1004 | } 1005 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1006 | return srv.(SuperBuilderServer).SetActiveAssistant(ctx, req.(*SetActiveAssistantRequest)) 1007 | } 1008 | return interceptor(ctx, in, info, handler) 1009 | } 1010 | 1011 | func _SuperBuilder_SetAssistantViewModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1012 | in := new(SetAssistantViewModelRequest) 1013 | if err := dec(in); err != nil { 1014 | return nil, err 1015 | } 1016 | if interceptor == nil { 1017 | return srv.(SuperBuilderServer).SetAssistantViewModel(ctx, in) 1018 | } 1019 | info := &grpc.UnaryServerInfo{ 1020 | Server: srv, 1021 | FullMethod: SuperBuilder_SetAssistantViewModel_FullMethodName, 1022 | } 1023 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1024 | return srv.(SuperBuilderServer).SetAssistantViewModel(ctx, req.(*SetAssistantViewModelRequest)) 1025 | } 1026 | return interceptor(ctx, in, info, handler) 1027 | } 1028 | 1029 | func _SuperBuilder_SetUserConfigViewModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1030 | in := new(SetUserConfigViewModelRequest) 1031 | if err := dec(in); err != nil { 1032 | return nil, err 1033 | } 1034 | if interceptor == nil { 1035 | return srv.(SuperBuilderServer).SetUserConfigViewModel(ctx, in) 1036 | } 1037 | info := &grpc.UnaryServerInfo{ 1038 | Server: srv, 1039 | FullMethod: SuperBuilder_SetUserConfigViewModel_FullMethodName, 1040 | } 1041 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1042 | return srv.(SuperBuilderServer).SetUserConfigViewModel(ctx, req.(*SetUserConfigViewModelRequest)) 1043 | } 1044 | return interceptor(ctx, in, info, handler) 1045 | } 1046 | 1047 | func _SuperBuilder_ConvertModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1048 | in := new(ConvertModelRequest) 1049 | if err := dec(in); err != nil { 1050 | return nil, err 1051 | } 1052 | if interceptor == nil { 1053 | return srv.(SuperBuilderServer).ConvertModel(ctx, in) 1054 | } 1055 | info := &grpc.UnaryServerInfo{ 1056 | Server: srv, 1057 | FullMethod: SuperBuilder_ConvertModel_FullMethodName, 1058 | } 1059 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1060 | return srv.(SuperBuilderServer).ConvertModel(ctx, req.(*ConvertModelRequest)) 1061 | } 1062 | return interceptor(ctx, in, info, handler) 1063 | } 1064 | 1065 | func _SuperBuilder_UploadModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1066 | in := new(UploadModelRequest) 1067 | if err := dec(in); err != nil { 1068 | return nil, err 1069 | } 1070 | if interceptor == nil { 1071 | return srv.(SuperBuilderServer).UploadModel(ctx, in) 1072 | } 1073 | info := &grpc.UnaryServerInfo{ 1074 | Server: srv, 1075 | FullMethod: SuperBuilder_UploadModel_FullMethodName, 1076 | } 1077 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1078 | return srv.(SuperBuilderServer).UploadModel(ctx, req.(*UploadModelRequest)) 1079 | } 1080 | return interceptor(ctx, in, info, handler) 1081 | } 1082 | 1083 | func _SuperBuilder_ExportUserConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1084 | in := new(ExportUserConfigRequest) 1085 | if err := dec(in); err != nil { 1086 | return nil, err 1087 | } 1088 | if interceptor == nil { 1089 | return srv.(SuperBuilderServer).ExportUserConfig(ctx, in) 1090 | } 1091 | info := &grpc.UnaryServerInfo{ 1092 | Server: srv, 1093 | FullMethod: SuperBuilder_ExportUserConfig_FullMethodName, 1094 | } 1095 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1096 | return srv.(SuperBuilderServer).ExportUserConfig(ctx, req.(*ExportUserConfigRequest)) 1097 | } 1098 | return interceptor(ctx, in, info, handler) 1099 | } 1100 | 1101 | func _SuperBuilder_ImportUserConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1102 | in := new(ImportUserConfigRequest) 1103 | if err := dec(in); err != nil { 1104 | return nil, err 1105 | } 1106 | if interceptor == nil { 1107 | return srv.(SuperBuilderServer).ImportUserConfig(ctx, in) 1108 | } 1109 | info := &grpc.UnaryServerInfo{ 1110 | Server: srv, 1111 | FullMethod: SuperBuilder_ImportUserConfig_FullMethodName, 1112 | } 1113 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1114 | return srv.(SuperBuilderServer).ImportUserConfig(ctx, req.(*ImportUserConfigRequest)) 1115 | } 1116 | return interceptor(ctx, in, info, handler) 1117 | } 1118 | 1119 | // SuperBuilder_ServiceDesc is the grpc.ServiceDesc for SuperBuilder service. 1120 | // It's only intended for direct use with grpc.RegisterService, 1121 | // and not to be introspected or modified (even as a copy) 1122 | var SuperBuilder_ServiceDesc = grpc.ServiceDesc{ 1123 | ServiceName: "SuperBuilder.SuperBuilder", 1124 | HandlerType: (*SuperBuilderServer)(nil), 1125 | Methods: []grpc.MethodDesc{ 1126 | { 1127 | MethodName: "SayHello", 1128 | Handler: _SuperBuilder_SayHello_Handler, 1129 | }, 1130 | { 1131 | MethodName: "SayHelloPyllm", 1132 | Handler: _SuperBuilder_SayHelloPyllm_Handler, 1133 | }, 1134 | { 1135 | MethodName: "StopChat", 1136 | Handler: _SuperBuilder_StopChat_Handler, 1137 | }, 1138 | { 1139 | MethodName: "LoadModels", 1140 | Handler: _SuperBuilder_LoadModels_Handler, 1141 | }, 1142 | { 1143 | MethodName: "CheckHealth", 1144 | Handler: _SuperBuilder_CheckHealth_Handler, 1145 | }, 1146 | { 1147 | MethodName: "AddFeedback", 1148 | Handler: _SuperBuilder_AddFeedback_Handler, 1149 | }, 1150 | { 1151 | MethodName: "StopAddFiles", 1152 | Handler: _SuperBuilder_StopAddFiles_Handler, 1153 | }, 1154 | { 1155 | MethodName: "RemoveFiles", 1156 | Handler: _SuperBuilder_RemoveFiles_Handler, 1157 | }, 1158 | { 1159 | MethodName: "GetFileList", 1160 | Handler: _SuperBuilder_GetFileList_Handler, 1161 | }, 1162 | { 1163 | MethodName: "SetModels", 1164 | Handler: _SuperBuilder_SetModels_Handler, 1165 | }, 1166 | { 1167 | MethodName: "UnloadModels", 1168 | Handler: _SuperBuilder_UnloadModels_Handler, 1169 | }, 1170 | { 1171 | MethodName: "SetParameters", 1172 | Handler: _SuperBuilder_SetParameters_Handler, 1173 | }, 1174 | { 1175 | MethodName: "ClientDisconnected", 1176 | Handler: _SuperBuilder_ClientDisconnected_Handler, 1177 | }, 1178 | { 1179 | MethodName: "GetClientConfig", 1180 | Handler: _SuperBuilder_GetClientConfig_Handler, 1181 | }, 1182 | { 1183 | MethodName: "GetChatHistory", 1184 | Handler: _SuperBuilder_GetChatHistory_Handler, 1185 | }, 1186 | { 1187 | MethodName: "GetSoftwareUpdate", 1188 | Handler: _SuperBuilder_GetSoftwareUpdate_Handler, 1189 | }, 1190 | { 1191 | MethodName: "SetVectorDB", 1192 | Handler: _SuperBuilder_SetVectorDB_Handler, 1193 | }, 1194 | { 1195 | MethodName: "RemoveSession", 1196 | Handler: _SuperBuilder_RemoveSession_Handler, 1197 | }, 1198 | { 1199 | MethodName: "SetSessionName", 1200 | Handler: _SuperBuilder_SetSessionName_Handler, 1201 | }, 1202 | { 1203 | MethodName: "SetActiveAssistant", 1204 | Handler: _SuperBuilder_SetActiveAssistant_Handler, 1205 | }, 1206 | { 1207 | MethodName: "SetAssistantViewModel", 1208 | Handler: _SuperBuilder_SetAssistantViewModel_Handler, 1209 | }, 1210 | { 1211 | MethodName: "SetUserConfigViewModel", 1212 | Handler: _SuperBuilder_SetUserConfigViewModel_Handler, 1213 | }, 1214 | { 1215 | MethodName: "ConvertModel", 1216 | Handler: _SuperBuilder_ConvertModel_Handler, 1217 | }, 1218 | { 1219 | MethodName: "UploadModel", 1220 | Handler: _SuperBuilder_UploadModel_Handler, 1221 | }, 1222 | { 1223 | MethodName: "ExportUserConfig", 1224 | Handler: _SuperBuilder_ExportUserConfig_Handler, 1225 | }, 1226 | { 1227 | MethodName: "ImportUserConfig", 1228 | Handler: _SuperBuilder_ImportUserConfig_Handler, 1229 | }, 1230 | }, 1231 | Streams: []grpc.StreamDesc{ 1232 | { 1233 | StreamName: "Chat", 1234 | Handler: _SuperBuilder_Chat_Handler, 1235 | ServerStreams: true, 1236 | }, 1237 | { 1238 | StreamName: "AddFiles", 1239 | Handler: _SuperBuilder_AddFiles_Handler, 1240 | ServerStreams: true, 1241 | }, 1242 | { 1243 | StreamName: "DownloadFiles", 1244 | Handler: _SuperBuilder_DownloadFiles_Handler, 1245 | ServerStreams: true, 1246 | }, 1247 | }, 1248 | Metadata: "superbuilder_middleware.proto", 1249 | } 1250 | -------------------------------------------------------------------------------- /example/proto/superbuilder_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option csharp_namespace = "SuperBuilderWinService"; 4 | option go_package = "superbuilder/SuperBuilderWinService"; 5 | 6 | package SuperBuilder; 7 | 8 | // The greeting service definition. 9 | service SuperBuilder { 10 | // Send a greeting ( For connection testing ) 11 | rpc SayHello (SayHelloRequest) returns (SayHelloResponse); 12 | 13 | // Send a greeting ( For connection testing ) 14 | rpc SayHelloPyllm (SayHelloRequest) returns (SayHelloResponse); 15 | 16 | // Send a chat message and stream returns a response 17 | rpc Chat (ChatRequest) returns (stream ChatResponse); 18 | 19 | // Sends signal to safely stop the current chat request 20 | rpc StopChat (StopChatRequest) returns (StopChatResponse); 21 | 22 | // Loads the models and any other backend components before chatting 23 | rpc LoadModels (LoadModelsRequest) returns (LoadModelsResponse); 24 | 25 | // Check on health status backend system / service (for example: RAG check) 26 | rpc CheckHealth (CheckHealthRequest) returns (CheckHealthResponse); 27 | 28 | // Give LLM feedback on a question's response to improve future responses 29 | rpc AddFeedback (AddFeedbackRequest) returns (AddFeedbackResponse); 30 | 31 | // Upload a list of files to the RAG module to be vector stored, stream the upload progress 32 | rpc AddFiles (AddFilesRequest) returns (stream AddFilesResponse); 33 | 34 | // Sends signal to stop the current upload file request 35 | rpc StopAddFiles (StopAddFilesRequest) returns (StopAddFilesResponse); 36 | 37 | // Remove a list of files from RAG doc store 38 | rpc RemoveFiles (RemoveFilesRequest) returns (RemoveFilesResponse); 39 | 40 | // Request to download a certain list of models, or just all required models if not specified 41 | rpc DownloadFiles (DownloadFilesRequest) returns (stream DownloadFilesResponse); 42 | 43 | // Request list of all files uploaded to the loaded document store 44 | rpc GetFileList (GetFileListRequest) returns (GetFileListResponse); 45 | 46 | // Set and load models in the backend given a model path 47 | rpc SetModels (SetModelsRequest) returns (SetModelsResponse); 48 | 49 | // Unloads models that are in the backend 50 | rpc UnloadModels (UnloadModelsRequest) returns (UnloadModelsResponse); 51 | 52 | // Change the RAG, LLM, and backend parameters 53 | rpc SetParameters (SetParametersRequest) returns (SetParametersResponse); 54 | 55 | // Inform the server that the client has disconnected 56 | rpc ClientDisconnected (ClientDisconnectedRequest) returns (ClientDisconnectedResponse); 57 | 58 | // Get config info from middleware 59 | rpc GetClientConfig (GetClientConfigRequest) returns (GetClientConfigResponse); 60 | 61 | // Get chat history messages from middleware 62 | rpc GetChatHistory (GetChatHistoryRequest) returns (GetChatHistoryResponse); 63 | 64 | // Send a greeting ( For connection testing ) 65 | rpc GetSoftwareUpdate (SayHelloRequest) returns (SayHelloResponse); 66 | 67 | // Setting Vector DB of default assistant in sqlite db. 68 | rpc SetVectorDB (SetVectorDBRequest) returns (SetVectorDBResponse); 69 | 70 | // Removes a session and all data related to session from database given session id 71 | rpc RemoveSession (RemoveSessionRequest) returns (RemoveSessionResponse); 72 | 73 | // Update a session name given a valid unique session id 74 | rpc SetSessionName (SetSessionNameRequest) returns (SetSessionNameResponse); 75 | 76 | // Set Active Assistant or Models 77 | rpc SetActiveAssistant(SetActiveAssistantRequest) returns (SetActiveAssistantResponse); 78 | 79 | //Using an AssistantViewModel it will set the sqlite database active assistant to those fields. 80 | rpc SetAssistantViewModel(SetAssistantViewModelRequest) returns (SetAssistantViewModelResponse); 81 | 82 | //Using UserConfigViewModel, sets sqlite database userconfig jsonappsettings to the corresponding fields. 83 | rpc SetUserConfigViewModel(SetUserConfigViewModelRequest) returns (SetUserConfigViewModelResponse); 84 | 85 | rpc ConvertModel(ConvertModelRequest) returns (ConvertModelResponse); 86 | 87 | rpc UploadModel(UploadModelRequest) returns (UploadModelResponse); 88 | 89 | rpc ExportUserConfig(ExportUserConfigRequest) returns (ExportUserConfigResponse); 90 | rpc ImportUserConfig(ImportUserConfigRequest) returns (ImportUserConfigResponse); 91 | } 92 | 93 | // The request message containing the user's name. 94 | message SayHelloRequest { 95 | string name = 1; 96 | } 97 | 98 | // The response message containing the greetings. 99 | message SayHelloResponse { 100 | string message = 1; 101 | } 102 | 103 | // The request message for the chat. 104 | message ConversationHistory { 105 | string role = 1; 106 | string content = 2; 107 | } 108 | 109 | // The request message for the chat. 110 | message ChatRequest { 111 | string name = 1; 112 | string prompt = 2; 113 | repeated ConversationHistory history = 3; 114 | int32 sessionId = 4; // chat session that this chat belongs to 115 | optional string queryType = 5; // The type of query to do on the attached files 116 | optional string attachedFiles = 6; // The files to use specifically for this chat request 117 | } 118 | 119 | // The response message for the chat. 120 | message ChatResponse { 121 | string message = 1; 122 | } 123 | 124 | message StopChatRequest { 125 | } 126 | 127 | message StopChatResponse { 128 | } 129 | 130 | message LoadModelsRequest { 131 | } 132 | 133 | message LoadModelsResponse { 134 | bool status = 1; // returns true if successful load 135 | } 136 | 137 | // The request message containing a placeholder in case we need to send data 138 | message CheckHealthRequest { 139 | string typeOfCheck = 1; 140 | } 141 | 142 | // The response message containing the status of the system 143 | message CheckHealthResponse { 144 | string status = 1; 145 | } 146 | 147 | // The request message containing a question, its feedback, and type of feedback 148 | message AddFeedbackRequest { 149 | string question = 1; 150 | string feedback = 2; 151 | string feedbackType = 3; 152 | optional string answer = 4; 153 | } 154 | 155 | // The response message containing the feedback + question + feedback type 156 | message AddFeedbackResponse { 157 | string message = 1; 158 | } 159 | 160 | // The request message containing a list of files to be uploaded to RAG 161 | message AddFilesRequest { 162 | string filesToUpload = 1; 163 | } 164 | 165 | // The response message streamed back as a file is uploaded 166 | message AddFilesResponse { 167 | string filesUploaded = 1; // list of files able to be uploaded to vector db 168 | optional string currentFileUploading = 2; // current file being uploaded if any 169 | optional string currentFileProgress = 3; // upload progress percentage from 0 to 100 170 | } 171 | 172 | // The request message which currently contains nothing (but might be needed in the future) 173 | message GetFileListRequest { 174 | string fileType = 1; 175 | } 176 | 177 | message StopAddFilesRequest { 178 | } 179 | 180 | message StopAddFilesResponse { 181 | } 182 | 183 | // The request message when a client disconnects 184 | message ClientDisconnectedRequest { 185 | } 186 | 187 | // The response message containing list of all files found in document store 188 | message GetFileListResponse { 189 | string fileList = 1; 190 | } 191 | 192 | // The request message containing a list of files to be removed from RAG 193 | message RemoveFilesRequest { 194 | string filesToRemove = 1; 195 | } 196 | 197 | // The response message containing list of all files successfully removed from RAG 198 | message RemoveFilesResponse { 199 | string filesRemoved = 1; 200 | } 201 | 202 | // The request message containing list of models to download (if none, download missing) 203 | message DownloadFilesRequest { 204 | string FileUrl = 1; 205 | string localPath = 2; 206 | optional string tokenId =3; 207 | } 208 | 209 | // The response message containing a list of models actually downloaded 210 | message DownloadFilesResponse { 211 | int32 progress = 1; 212 | string FileDownloaded = 2; 213 | } 214 | 215 | // The request message which tells the backend which models to set 216 | message SetModelsRequest { 217 | optional string llm = 1; 218 | optional string embedder = 2; 219 | optional string ranker = 3; 220 | } 221 | 222 | // The response message of the models that were set 223 | message SetModelsResponse { 224 | string modelsLoaded = 1; 225 | } 226 | 227 | // The request message which tells the backend which models to unload (true means unload) 228 | message UnloadModelsRequest { 229 | bool llm = 1; 230 | bool embedder = 2; 231 | bool ranker = 3; 232 | } 233 | 234 | // The response message of the models that were unloaded 235 | message UnloadModelsResponse { 236 | string modelsUnloaded = 1; 237 | } 238 | 239 | // A bunch of optional parameters to set, leaving blank is the same as not changing 240 | message SetParametersRequest { 241 | string parameters_json = 1; //JSON string of any parameters present in the ModelParametersViewModel classes 242 | 243 | } 244 | 245 | // Response of setting the parameters, nothing for now 246 | message SetParametersResponse {} 247 | 248 | // The response message when a client disconnects 249 | message ClientDisconnectedResponse { 250 | } 251 | 252 | // The request message containing the user's name. 253 | message GetClientConfigRequest { 254 | string assistant = 1; 255 | } 256 | 257 | // The response message containing the greetings. 258 | message GetClientConfigResponse { 259 | string data = 1; 260 | } 261 | 262 | // The request message (currently empty) 263 | message GetChatHistoryRequest { 264 | } 265 | 266 | // The response message which returns all chat messages 267 | message GetChatHistoryResponse { 268 | string data = 1; 269 | } 270 | 271 | message SetVectorDBRequest { 272 | string connectionString = 1; 273 | } 274 | 275 | message SetVectorDBResponse { 276 | string message = 1; 277 | } 278 | 279 | message RemoveSessionRequest { 280 | int32 sessionId = 1; 281 | } 282 | 283 | message RemoveSessionResponse { 284 | bool success = 1; 285 | } 286 | 287 | message SetSessionNameRequest { 288 | int32 sessionId = 1; 289 | string sessionName = 2; 290 | } 291 | 292 | message SetSessionNameResponse { 293 | bool success = 1; 294 | } 295 | 296 | message SetActiveAssistantRequest { 297 | string assistant = 1; 298 | string models_json = 2; 299 | } 300 | 301 | message SetActiveAssistantResponse { 302 | bool success = 1; 303 | string message = 2; 304 | } 305 | 306 | message SetAssistantViewModelRequest { 307 | string view_model = 1; 308 | bool resetUXSettings=2; 309 | } 310 | 311 | message SetAssistantViewModelResponse { 312 | string message = 1; 313 | } 314 | 315 | message SetUserConfigViewModelRequest { 316 | string view_model = 1; 317 | } 318 | 319 | message SetUserConfigViewModelResponse { 320 | string message = 1; 321 | } 322 | 323 | message ConvertModelRequest { 324 | string model_path = 1; 325 | optional string parameters = 2; 326 | } 327 | 328 | message ConvertModelResponse { 329 | string message = 1; 330 | } 331 | 332 | message UploadModelRequest { 333 | string source_dir = 1; 334 | string model = 2; 335 | string model_type = 3; 336 | string download_link = 4; 337 | bool move_directory = 5; 338 | } 339 | 340 | message UploadModelResponse { 341 | string message = 1; 342 | } 343 | 344 | // Request message for exporting user configuration 345 | message ExportUserConfigRequest { 346 | string AssistantName = 1; 347 | string ExportPath = 2; 348 | } 349 | 350 | // Response message for exporting user configuration 351 | message ExportUserConfigResponse { 352 | bool Success = 1; 353 | string Message = 2; 354 | } 355 | 356 | // Request message for importing user configuration 357 | message ImportUserConfigRequest { 358 | string ImportPath = 1; 359 | } 360 | 361 | // Response message for importing user configuration 362 | message ImportUserConfigResponse { 363 | bool Success = 1; 364 | string Message = 2; 365 | } -------------------------------------------------------------------------------- /example/python/README.md: -------------------------------------------------------------------------------- 1 | # Python Client for Intel® AI Assistant Builder Service 2 | This folder contains a simple Python client designed to communicate with Intel® AI Assistant Builder Service. 3 | 4 | ## Install Dependencies 5 | - Download and install **[Python 3.12.9](https://www.python.org/downloads/release/python-3129/)**. 6 | - Use the script `example\python\install.bat` to install necessary dependencies. 7 | ``` 8 | cd path\to\example\python 9 | install.bat 10 | ``` 11 | 12 | ## How to Run 13 | - Execute the script `example\python\run.bat` to start the example. 14 | ``` 15 | cd path\to\example\python 16 | run.bat 17 | ``` 18 | 19 | - Execute the script `example\python\run_tests.bat` to perform tests. 20 | ``` 21 | cd path\to\example\python 22 | run_tests.bat 23 | ``` 24 | 25 | ## Generate Python Proto File 26 | - Use the PowerShell script `shared\recompile-client-proto.ps1` to regenerate the `pb`/`pb2` files for Python. 27 | ``` 28 | cd path\to\shared 29 | .\recompile-client-proto.ps1 30 | ``` 31 | -------------------------------------------------------------------------------- /example/python/client.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import time 4 | import signal 5 | import grpc 6 | 7 | import helpers.mw as mw 8 | import helpers.chat as chat 9 | 10 | from examples.chat_examples import simple_chat, simple_chat_w_rag, simple_chat_w_image_query 11 | from examples.client_examples import switch_model 12 | 13 | # Unset proxy environment variables 14 | os.environ.pop('http_proxy', None) 15 | os.environ.pop('https_proxy', None) 16 | os.environ.pop('HTTP_PROXY', None) 17 | os.environ.pop('HTTPS_PROXY', None) 18 | 19 | # Disable the proxy by setting the environment variable 20 | os.environ["grpc.enable_http_proxy"] = "0" 21 | 22 | stub = None 23 | channel = None 24 | 25 | def signal_handler(sig, frame): 26 | global stub 27 | print("Stopping execution.") 28 | if stub is not None: 29 | print("Disconnecting AAB") 30 | mw.disconnect(stub, channel) 31 | sys.exit(0) 32 | 33 | signal.signal(signal.SIGINT, signal_handler) 34 | 35 | def run_examples(): 36 | complete = False 37 | 38 | print("\n========================================") 39 | actionInput = "Select which example to run:\n1. Execute simple chat\n2. Execute simple chat with Knowledge Base\n3. Execute Image Query\n\n0. Exit\n\nEnter number: " 40 | option = input(actionInput).strip().lower() 41 | if option == "0": 42 | print("Exiting...") 43 | complete = True 44 | elif option == "1": 45 | print("Executing simple chat example...") 46 | simple_chat(stub) 47 | complete = True 48 | elif option == "2": 49 | print("Executing simple chat with knowledge base example...") 50 | simple_chat_w_rag(stub) 51 | complete = True 52 | elif option == "3": 53 | print("Executing image query example...") 54 | simple_chat_w_image_query(stub) 55 | complete = True 56 | ## This option is not available as getting 'ERROR: Access to the path 'UDDC0C1.tmp' is denied.' 57 | # elif option == "4": 58 | # print("Executing model switch example...") 59 | # switch_model(stub) 60 | # complete = True 61 | else: 62 | raise Exception('Invalid option. Exiting.') 63 | 64 | return complete, option 65 | 66 | def main(): 67 | # Connect to the AAB 68 | global successfulConnect, stub, channel 69 | grpc_address = 'localhost:5006' 70 | channel = grpc.insecure_channel(grpc_address) 71 | for attempt in range(5): 72 | successfulConnect, stub = mw.connect(channel) 73 | if successfulConnect: 74 | print("Connected successfully!") 75 | break 76 | else: 77 | print(f"Connection attempt {attempt + 1} failed. Retrying...\n") 78 | time.sleep(5) 79 | if successfulConnect: 80 | llm_ready = mw.check_pybackend(stub) 81 | if llm_ready: 82 | print("LLM backend is ready.") 83 | chat.warmup(stub) 84 | while True: 85 | try: 86 | complete, example = run_examples() 87 | if complete and example != "0": 88 | print(f"\n\nExample {example} completed.") 89 | continue 90 | else: 91 | mw.disconnect(stub, channel) 92 | break 93 | except Exception as e: 94 | print(f"Error: {e}") 95 | mw.disconnect(stub, channel) 96 | break 97 | else: 98 | print("LLM backend is not ready. Exiting.") 99 | mw.disconnect(stub, channel) 100 | exit() 101 | else: 102 | print("Connection failed. Exiting.") 103 | 104 | 105 | if __name__ == '__main__': 106 | main() 107 | -------------------------------------------------------------------------------- /example/python/examples/chat_examples.py: -------------------------------------------------------------------------------- 1 | import grpc 2 | import os 3 | import sys 4 | SCRIPT_DIR=os.path.dirname(os.path.realpath(__file__)) 5 | sys.path.append(os.path.abspath(os.path.join(SCRIPT_DIR,'..'))) 6 | 7 | import helpers.chat as chat 8 | import helpers.rag as rag 9 | import helpers.parameters as param 10 | 11 | def simple_chat(stub): 12 | try: 13 | prompt = "Who are you" 14 | 15 | session_id = chat.init_chat_session(stub) 16 | 17 | response_iterator = chat.set_chat_request(stub, prompt, session_id) 18 | response = chat.get_chat_response(response_iterator) 19 | chat.remove_session(stub, session_id) 20 | except grpc.RpcError as e: 21 | print(f"gRPC error: {e.details()}") 22 | except Exception as e: 23 | print(f"Error: {e}") 24 | 25 | def simple_chat_w_rag(stub): 26 | try: 27 | file_path = ["examples/resources/Minimum Wages Order 2022.pdf"] 28 | prompt = "What is the minimum wages order for 2022 in Malaysia?" 29 | 30 | # Upload the file to the knowledge base 31 | rag.upload_file_to_knowledge_base(stub, file_path) 32 | rag.list_uploaded_files(stub) 33 | session_id = chat.init_chat_session(stub) 34 | 35 | response_iterator = chat.set_chat_request(stub, prompt, session_id) 36 | response = chat.get_chat_response(response_iterator) 37 | 38 | rag.remove_uploaded_file(stub, file_path) 39 | chat.remove_session(stub, session_id) 40 | except grpc.RpcError as e: 41 | print(f"gRPC error: {e.details()}") 42 | except Exception as e: 43 | print(f"Error: {e}") 44 | 45 | def simple_chat_w_image_query(stub): 46 | try: 47 | file_input = ["examples/resources/image.jpg"] 48 | prompt = "Describe the images" 49 | 50 | session_id = chat.init_chat_session(stub) 51 | 52 | response_iterator = chat.set_chat_request(stub, name='SuperBuilder Python Clients!', prompt=prompt, session_id=session_id, attachments=file_input, query='image') 53 | response = chat.get_chat_response(response_iterator) 54 | 55 | chat.remove_session(stub, session_id) 56 | except grpc.RpcError as e: 57 | print(f"gRPC error: {e.details()}") 58 | except Exception as e: 59 | print(f"Error: {e}") 60 | -------------------------------------------------------------------------------- /example/python/examples/client_examples.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | SCRIPT_DIR=os.path.dirname(os.path.realpath(__file__)) 4 | sys.path.append(os.path.abspath(os.path.join(SCRIPT_DIR,'..'))) 5 | import helpers.chat as chat 6 | import helpers.parameters as param 7 | import helpers.config as config 8 | import helpers.model as model 9 | 10 | def switch_model(stub): 11 | model_name = None 12 | model_link = None 13 | db_config = config.get_config(stub) 14 | all_models = db_config["ActiveAssistant"]["all_models"] 15 | active_models = {} 16 | for active in db_config["ActiveAssistant"]["models"]: 17 | if active["model_type"] == "chat_model": 18 | active_models = active 19 | break 20 | for index, model_option in enumerate(all_models): 21 | if model_option["full_name"] == active_models["full_name"]: 22 | print(f"{index}. Model: {model_option["full_name"]} (Active)") 23 | else: 24 | print(f"{index}. Model: {model_option["full_name"]}") 25 | selected = input("Select the model to switch to: ") 26 | if int(selected) >= 0 and int(selected) < len(all_models): 27 | if all_models[int(selected)]["full_name"] == active_models["full_name"]: 28 | print("Model is already active.") 29 | return 30 | model_name = all_models[int(selected)]["full_name"] 31 | model_link = all_models[int(selected)]["download_link"] 32 | if model_name is None and model_link is None: 33 | print("Invalid selection.") 34 | return 35 | full_path = os.path.join(db_config["local_model_hub"], model_name) 36 | if not os.path.exists(full_path): 37 | print(f"Local folder for model '{model_name}' does not exist. Downloading...") 38 | try: 39 | model.download(stub, model_link, db_config["local_model_hub"]) 40 | except Exception as e: 41 | print(f"Error downloading model: {e}") 42 | else: 43 | print(f"Model '{model_name}' already exists. Switching...") 44 | # response = model.switch(stub, db_config["local_model_hub"], model_name) 45 | # return response -------------------------------------------------------------------------------- /example/python/examples/outlook_example.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import win32com.client 3 | import json 4 | import random 5 | from tzlocal import get_localzone 6 | 7 | import superbuilder_middleware_pb2 as sb 8 | 9 | def get_outlook_meetings(): 10 | meetings =[] 11 | # Connect to Outlook 12 | outlook = win32com.client.Dispatch("Outlook.Application") 13 | namespace = outlook.GetNamespace("MAPI") 14 | calendar_folder = namespace.GetDefaultFolder(9) # 9 refers to the Calendar folder 15 | 16 | # Get today's date 17 | today = datetime.datetime.now().date() 18 | start = datetime.datetime.combine(today, datetime.time.min) 19 | end = datetime.datetime.combine(today, datetime.time.max) 20 | 21 | # Restrict the calendar items to today's meetings 22 | restriction = "[Start] >= '{}' AND [End] <= '{}'".format(start.strftime("%m/%d/%Y %H:%M %p"), end.strftime("%m/%d/%Y %H:%M %p")) 23 | items = calendar_folder.Items 24 | items.IncludeRecurrences = False 25 | items.Sort("[Start]") 26 | restricted_items = items.Restrict(restriction) 27 | 28 | # Extract meeting details 29 | 30 | for item in restricted_items: 31 | if item.Class == 26: # 26 refers to AppointmentItem 32 | if item.Subject and item.Subject.find("KOR")==-1: 33 | meeting = { 34 | "Subject": item.Subject, 35 | "Start": item.Start.Format("%Y-%m-%d %H:%M:%S"), 36 | "End": item.End.Format("%Y-%m-%d %H:%M:%S"), 37 | "Location": item.Location, 38 | } 39 | meetings.append(meeting) 40 | return meetings 41 | 42 | 43 | def build_meetings_prompt(json_string): 44 | 45 | # Parse the JSON string 46 | calendar_items = json.loads(json_string) 47 | 48 | # Convert the start and end times to datetime objects and sort the items by start time 49 | for item in calendar_items: 50 | item['Start'] = datetime.datetime.strptime(item['Start'], '%Y-%m-%d %H:%M:%S') 51 | item['End'] = datetime.datetime.strptime(item['End'], '%Y-%m-%d %H:%M:%S') 52 | sorted_calendar_items = sorted(calendar_items, key=lambda x: x['Start']) 53 | 54 | # Build the prompt string 55 | current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') 56 | prompt_lines = [f"The following appointments are found from my calendar. Call out number of appointments and tell me if there are conflicts. Please suggest for preparation or follow-ups. Keep the reply brief and easy to understand. Important: Only use your own knowledge. Do not use any existing context. Do not add reference at the end. Here are the appointments:"] 57 | 58 | for appointment in sorted_calendar_items: 59 | prompt_lines.append( 60 | f"* {appointment['Subject']}, Location: {appointment['Location']}, Start time: {appointment['Start']}, End time: {appointment['End']}" 61 | ) 62 | prompt = "\n".join(prompt_lines) 63 | return prompt 64 | 65 | def gen_appointment(stub): 66 | session_id = init_chat_session(stub) 67 | success = False 68 | print(f"init_default_params") 69 | parametersReq = init_default_params() 70 | reply = stub.SetParameters(parametersReq) 71 | prompt = "suggest one family friendly fun activity to attend in Las Vegas area for today. Only list headline. do not elaborate. do not add note. do not summary. " 72 | request = sb.ChatRequest(name='SuperBuilder Python Clients!', prompt=prompt,sessionId=session_id, attachedFiles="[]") 73 | print("\nEvent: ") 74 | response = get_chat_response(stub.Chat(request)) 75 | return session_id,response 76 | 77 | 78 | # Note:: only works with enterprise outlook not new outlook 79 | def save_appointment(response, session_id, stub): 80 | start,end = generate_random_time_block() 81 | local_time_offset = datetime.datetime.now(get_localzone()).utcoffset() 82 | print(f"\ntime: {start - local_time_offset}-{end - local_time_offset}") 83 | outlook = win32com.client.Dispatch("Outlook.Application") 84 | namespace = outlook.GetNamespace("MAPI") 85 | calendar_folder = namespace.GetDefaultFolder(9) 86 | appointment = calendar_folder.Items.Add(1) 87 | appointment.Subject = response 88 | appointment.Start = start 89 | appointment.End = end 90 | ''' 91 | #appointment.Location = event_details.get('Location', '') 92 | #appointment.Body = responses['body'] 93 | #appointment.RequiredAttendees = "me@me.com; you@you.com" 94 | userInput = input("\nSave to calendar? (Y/N): ").strip().upper() 95 | if userInput == "Y": 96 | appointment.Save() 97 | print("saved appointment") 98 | ''' 99 | appointment.Save() 100 | clean_session(session_id,stub) 101 | success=True 102 | return success 103 | 104 | def generate_random_time_block(): 105 | now = datetime.datetime.now(get_localzone()) 106 | end_time_limit = now + datetime.timedelta(hours=4) 107 | # Calculate the total number of minutes from now to 4 hours from now 108 | total_minutes = int((end_time_limit - now).total_seconds() // 60) 109 | 110 | # Generate a random start time within this range 111 | random_start_minutes = random.randint(0, total_minutes - 30) 112 | random_start = now + datetime.timedelta(minutes=random_start_minutes) 113 | random_end = random_start + datetime.timedelta(minutes=30) 114 | 115 | local_time_offset = datetime.datetime.now(get_localzone()).utcoffset() 116 | start = random_start + local_time_offset 117 | end = random_end + local_time_offset 118 | 119 | return start, end -------------------------------------------------------------------------------- /example/python/examples/query_examples.py: -------------------------------------------------------------------------------- 1 | import superbuilder_middleware_pb2 as sb 2 | import helpers.chat as chat 3 | import helpers.parameters as param 4 | 5 | def image_query(stub): 6 | session_id = chat.init_chat_session(stub) 7 | success = False 8 | print(f"Start image query, setting params") 9 | parametersReq = param.init_default_params() 10 | reply = param.set_parameters(stub, parametersReq) 11 | 12 | # set up the image files 13 | file_input=input("Enter the path to the first image file: ") 14 | attached_files = [file_input] 15 | 16 | prompt = "Describe the images" 17 | response_iterator = chat.get_chat_response(stub, name='SuperBuilder Python Clients!', prompt=prompt, session_id=session_id, attachments=attached_files, query='image') 18 | response = chat.get_chat_response(response_iterator) 19 | 20 | return session_id,response -------------------------------------------------------------------------------- /example/python/examples/rag_examples.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/example/python/examples/rag_examples.py -------------------------------------------------------------------------------- /example/python/examples/resources/Minimum Wages Order 2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/example/python/examples/resources/Minimum Wages Order 2022.pdf -------------------------------------------------------------------------------- /example/python/examples/resources/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/example/python/examples/resources/image.jpg -------------------------------------------------------------------------------- /example/python/export2ov.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if "%1"=="" ( 3 | echo No first argument provided. 4 | goto :eof 5 | ) else ( 6 | set "mpath=%1" 7 | @REM Remove trailing backslash if present 8 | if "%mpath:~-1%"=="\" ( 9 | set "mpath=%mpath:~0,-1%" 10 | ) 11 | set "opath=%mpath%-ov-int4" 12 | echo %mpath% - %opath% 13 | 14 | @echo on 15 | optimum-cli export openvino --model %mpath% --task text-generation-with-past --weight-format int4 --group-size 128 --ratio 0.8 --sym --trust-remote-code %opath% 16 | ) 17 | 18 | :eof -------------------------------------------------------------------------------- /example/python/helpers/chat.py: -------------------------------------------------------------------------------- 1 | import json 2 | import random 3 | import string 4 | import superbuilder_middleware_pb2 as sb 5 | 6 | def warmup(stub): 7 | """ 8 | Sends a warmup request to the server to initialize LLM models. 9 | 10 | Args: 11 | stub: The gRPC stub for making requests to the server. 12 | """ 13 | if stub is not None: 14 | print("Warming Up LLM Models...") 15 | stub.LoadModels(sb.LoadModelsRequest()) 16 | 17 | def get_chat_history(stub): 18 | """ 19 | Retrieves the chat history from the server. 20 | 21 | Args: 22 | stub: The gRPC stub for making requests to the server. 23 | 24 | Returns: 25 | A list of chat history entries. 26 | """ 27 | if stub is not None: 28 | return json.loads(stub.GetChatHistory(sb.GetChatHistoryRequest()).data) 29 | 30 | def generate_random_session_id(chatHistory): 31 | """ 32 | Generates a unique random session ID that does not exist in the current chat history. 33 | 34 | Args: 35 | chatHistory: A list of existing chat sessions. 36 | 37 | Returns: 38 | A unique session ID as an integer. 39 | """ 40 | existing_ids = {session['sid'] for session in chatHistory} 41 | 42 | while True: 43 | new_session_id = ''.join(random.choices(string.digits, k=8)) 44 | if int(new_session_id) not in existing_ids: 45 | return int(new_session_id) 46 | 47 | def init_chat_session(stub): 48 | """ 49 | Initializes a new chat session by retrieving the chat history and generating a unique session ID. 50 | 51 | Args: 52 | stub: The gRPC stub for making requests to the server. 53 | 54 | Returns: 55 | A unique session ID as an integer. 56 | """ 57 | response = get_chat_history(stub) 58 | return generate_random_session_id(response) 59 | 60 | def set_chat_request(stub, prompt, session_id=None, name="Python Client Example", attachments=[], query=None): 61 | """ 62 | Sends a chat request to the server with the given prompt and session details. 63 | 64 | Args: 65 | stub: The gRPC stub for making requests to the server. 66 | prompt: The chat prompt to send. 67 | session_id: The session ID for the chat (optional). 68 | name: The name of the client (default is "Python Client Example"). 69 | attachments: A list of attachments to include in the request (default is an empty list). 70 | query: The query type for the request (optional). 71 | 72 | Returns: 73 | The server's response to the chat request. 74 | """ 75 | attachments_str = "[]" if attachments == [] else json.dumps(attachments) 76 | if session_id is None: 77 | session_id = init_chat_session(stub) 78 | request = sb.ChatRequest(name=name, prompt=prompt, sessionId=session_id, attachedFiles=attachments_str, queryType=query) 79 | print("\nPrompt:\n", prompt) 80 | return stub.Chat(request) 81 | 82 | def get_chat_response(response_iterator, verbose=True): 83 | """ 84 | Iterates over the chat response from the server and optionally prints the output. 85 | 86 | Args: 87 | response_iterator: An iterator for the server's chat response. 88 | verbose: Whether to print the response as it streams (default is True). 89 | 90 | Returns: 91 | The entire chat response as a string. 92 | """ 93 | entireResponse = "" 94 | if verbose: 95 | print("Response:") 96 | for jsonResponse in response_iterator: 97 | responseObj = json.loads(jsonResponse.message) 98 | response = responseObj.get('message', "") 99 | if verbose: 100 | print(response, end='', flush=True) 101 | entireResponse += response 102 | if verbose: 103 | print("\n") 104 | return entireResponse 105 | 106 | def remove_session(stub, session_id): 107 | """ 108 | Sends a request to the server to remove a chat session. 109 | 110 | Args: 111 | stub: The gRPC stub for making requests to the server. 112 | session_id: The session ID of the chat to remove. 113 | 114 | Returns: 115 | The server's response to the remove session request. 116 | """ 117 | if stub is not None: 118 | return stub.RemoveSession(sb.RemoveSessionRequest(sessionId=session_id)) -------------------------------------------------------------------------------- /example/python/helpers/config.py: -------------------------------------------------------------------------------- 1 | import grpc 2 | import json 3 | import superbuilder_middleware_pb2 as sb 4 | 5 | def get_config(stub): 6 | response = stub.GetClientConfig(sb.GetClientConfigRequest()) 7 | return json.loads(response.data) 8 | 9 | def set_config(stub, assistant, config_data): 10 | response = stub.SetActiveAssistant(sb.SetActiveAssistantRequest(assistant=assistant, models_json=config_data)) 11 | return response.message -------------------------------------------------------------------------------- /example/python/helpers/model.py: -------------------------------------------------------------------------------- 1 | import os 2 | import grpc 3 | from tqdm import tqdm 4 | import superbuilder_middleware_pb2 as sb 5 | import helpers.config as config 6 | 7 | def download(stub, url, local_path): 8 | progress_bar = tqdm(desc="Downloading", unit="%") 9 | try: 10 | for response in stub.DownloadFiles(sb.DownloadFilesRequest(FileUrl=url, localPath=local_path)): 11 | print(response.FileDownloaded) 12 | if int(response.progress) < 0: 13 | continue 14 | if "ERROR" in response.FileDownloaded: 15 | raise Exception(response.FileDownloaded) 16 | 17 | progress_bar.n = int(response.progress) 18 | progress_bar.refresh() 19 | if int(response.progress) == 100: 20 | break 21 | except grpc.RpcError as e: 22 | print(f"Model download failed: {e.details()}") 23 | 24 | def switch(stub, local_model_path, model_name): 25 | if not os.path.exists(local_model_path): 26 | return f"Local folder for model '{model_name}' does not exist." 27 | response = stub.SetModels(sb.SetModelsRequest(assistant=model_name)) 28 | return response.message -------------------------------------------------------------------------------- /example/python/helpers/mw.py: -------------------------------------------------------------------------------- 1 | import grpc 2 | import superbuilder_middleware_pb2 as sb 3 | import superbuilder_middleware_pb2_grpc as sbg 4 | 5 | def check_pybackend(stub): 6 | try: 7 | print("Calling superbuilder service APIs: SayHelloPyllm()") 8 | helloPyllmResponse = stub.SayHelloPyllm(sb.SayHelloRequest( 9 | name='SuperBuilder Python Clients!')) 10 | if not helloPyllmResponse.message: 11 | return False 12 | print("Server replied: " + helloPyllmResponse.message) 13 | return True 14 | except grpc.RpcError as e: 15 | print(f"gRPC error: {e.details()}") 16 | return False 17 | 18 | def connect(channel): 19 | success = False 20 | stub = None 21 | 22 | try: 23 | grpc.channel_ready_future(channel).result(timeout=15) # Wait until the channel is ready 24 | stub = sbg.SuperBuilderStub(channel) 25 | except grpc.RpcError as e: 26 | print(f"gRPC error: {e.details()}") 27 | except grpc.FutureTimeoutError: 28 | print("gRPC channel connection busy or missing") 29 | else: 30 | success = True 31 | 32 | return success, stub 33 | 34 | 35 | def disconnect(stub, channel): 36 | if stub is not None: 37 | stub.ClientDisconnected(sb.ClientDisconnectedRequest()) 38 | if channel is not None: 39 | channel.close() -------------------------------------------------------------------------------- /example/python/helpers/parameters.py: -------------------------------------------------------------------------------- 1 | import superbuilder_middleware_pb2 as sb 2 | 3 | def init_default_params(): 4 | parametersReq = sb.SetParametersRequest( 5 | max_token=1024, 6 | temperature=1.0, 7 | retriever_top_k=13, 8 | reranker_top_k=4, 9 | reranker_threshold=0.0, 10 | max_num_references=2, 11 | reference_threshold=0.1, 12 | input_prompt_safety_threshold=0.75, 13 | streaming_batch_size=1, 14 | rag_system_message=( 15 | "Using the information contained in the context, give a comprehensive answer to the question.\n\n" 16 | "Please provide answer with full sentence, and don't end a sentence with colon.\n\n" 17 | "If the context is not relevant, please answer the question by using your own knowledge about the topic." 18 | )) 19 | return parametersReq 20 | 21 | def set_parameters(stub, params): 22 | reply = stub.SetParameters(params) 23 | return reply -------------------------------------------------------------------------------- /example/python/helpers/rag.py: -------------------------------------------------------------------------------- 1 | import grpc 2 | import os 3 | import json 4 | from tqdm import tqdm 5 | import superbuilder_middleware_pb2 as sb 6 | 7 | def is_valid_file_path(file_path): 8 | """ 9 | Check if the given file path is valid. 10 | 11 | Args: 12 | file_path (str): The file path to check. 13 | 14 | Returns: 15 | bool: True if the file path is valid, False otherwise. 16 | """ 17 | return os.path.isfile(file_path) 18 | 19 | def upload_file_to_knowledge_base(stub, file_paths): 20 | """ 21 | Upload files to the knowledge base. 22 | 23 | Args: 24 | stub: The gRPC stub for making requests. 25 | file_paths (list): List of file paths to upload. 26 | """ 27 | absolute_file_paths = [] 28 | for file_path in file_paths: 29 | abs_path = os.path.abspath(file_path) 30 | if not is_valid_file_path(abs_path): 31 | print(f"Invalid file path: {abs_path}") 32 | continue 33 | absolute_file_paths.append(abs_path) 34 | 35 | if not absolute_file_paths: 36 | print("No valid file paths to upload.") 37 | return 38 | 39 | print("Files to Upload: ", absolute_file_paths) 40 | file_paths_str = json.dumps(absolute_file_paths) 41 | request = sb.AddFilesRequest(filesToUpload=file_paths_str) 42 | 43 | progress_bar = tqdm(desc="Uploading", unit="%") 44 | try: 45 | for response in stub.AddFiles(request): 46 | if "Error" in response.filesUploaded: 47 | raise Exception(f"File upload failed: {response.filesUploaded}") 48 | 49 | progress_bar.n = int(response.currentFileProgress) 50 | progress_bar.refresh() 51 | if int(response.currentFileProgress) == 100: 52 | break 53 | except grpc.RpcError as e: 54 | print(f"File upload failed: {e.details()}") 55 | 56 | def remove_uploaded_file(stub, file_paths): 57 | """ 58 | Remove uploaded files from the knowledge base. 59 | 60 | Args: 61 | stub: The gRPC stub for making requests. 62 | file_paths (list): List of file paths to remove. 63 | """ 64 | absolute_file_paths = [] 65 | for file_path in file_paths: 66 | abs_path = os.path.abspath(file_path) 67 | if not is_valid_file_path(abs_path): 68 | print(f"Invalid file path: {abs_path}") 69 | continue 70 | absolute_file_paths.append(abs_path) 71 | 72 | if not absolute_file_paths: 73 | print("No valid file paths to upload.") 74 | return 75 | 76 | print("Files to Remove: ", absolute_file_paths) 77 | file_paths_str = json.dumps(absolute_file_paths) 78 | request = sb.RemoveFilesRequest(filesToRemove=file_paths_str) 79 | try: 80 | response = stub.RemoveFiles(request) 81 | if "Error" in response.filesRemoved: 82 | raise Exception(response.filesRemoved) 83 | print(f"File removed: {response.filesRemoved}") 84 | except grpc.RpcError as e: 85 | print(f"File removal failed: {e.details()}") 86 | 87 | def list_uploaded_files(stub): 88 | """ 89 | List all uploaded files in the knowledge base. 90 | 91 | Args: 92 | stub: The gRPC stub for making requests. 93 | """ 94 | request = sb.GetFileListRequest(fileType="") 95 | try: 96 | response = stub.GetFileList(request) 97 | print("Uploaded Files:") 98 | for file in json.loads(response.fileList): 99 | print(file) 100 | except grpc.RpcError as e: 101 | print(f"Failed to list uploaded files: {e.details()}") -------------------------------------------------------------------------------- /example/python/install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM Check if the specified Python executable exists 4 | set python="C:\Program Files\Python312\python.exe" 5 | if not exist %python% ( 6 | echo Specified Python executable not found. Using default location. 7 | set python="%LocalAppData%\Programs\Python\Python312\python.exe" 8 | ) 9 | 10 | REM Check if the fallback Python executable exists 11 | if not exist %python% ( 12 | echo Python executable not found in both locations. Exiting. 13 | exit /b 1 14 | ) 15 | 16 | echo ===== Creating virtual environment... ===== 17 | %python% -m venv .venv 18 | 19 | echo ===== Activating virtual environment... ===== 20 | call .venv\Scripts\activate 21 | 22 | echo ===== Installing packages... ===== 23 | pip install -r requirements.txt 24 | 25 | echo ===== Deactivating virtual env... ===== 26 | call deactivate 27 | 28 | exit /b -------------------------------------------------------------------------------- /example/python/requirements.txt: -------------------------------------------------------------------------------- 1 | grpcio-tools 2 | tzlocal 3 | pywin32 4 | tqdm -------------------------------------------------------------------------------- /example/python/run.bat: -------------------------------------------------------------------------------- 1 | .venv\Scripts\activate & python .\client.py -------------------------------------------------------------------------------- /example/python/run_tests.bat: -------------------------------------------------------------------------------- 1 | .venv\Scripts\activate & python -m unittest discover -s .\tests -p "test*.py" -v -------------------------------------------------------------------------------- /example/python/superbuilder_middleware_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # NO CHECKED-IN PROTOBUF GENCODE 4 | # source: superbuilder_middleware.proto 5 | # Protobuf Python Version: 5.29.0 6 | """Generated protocol buffer code.""" 7 | from google.protobuf import descriptor as _descriptor 8 | from google.protobuf import descriptor_pool as _descriptor_pool 9 | from google.protobuf import runtime_version as _runtime_version 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import builder as _builder 12 | _runtime_version.ValidateProtobufRuntimeVersion( 13 | _runtime_version.Domain.PUBLIC, 14 | 5, 15 | 29, 16 | 0, 17 | '', 18 | 'superbuilder_middleware.proto' 19 | ) 20 | # @@protoc_insertion_point(imports) 21 | 22 | _sym_db = _symbol_database.Default() 23 | 24 | 25 | 26 | 27 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dsuperbuilder_middleware.proto\x12\x0cSuperBuilder\"\x1f\n\x0fSayHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"#\n\x10SayHelloResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"4\n\x13\x43onversationHistory\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"\xc6\x01\n\x0b\x43hatRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06prompt\x18\x02 \x01(\t\x12\x32\n\x07history\x18\x03 \x03(\x0b\x32!.SuperBuilder.ConversationHistory\x12\x11\n\tsessionId\x18\x04 \x01(\x05\x12\x16\n\tqueryType\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rattachedFiles\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_queryTypeB\x10\n\x0e_attachedFiles\"\x1f\n\x0c\x43hatResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x11\n\x0fStopChatRequest\"\x12\n\x10StopChatResponse\"\x13\n\x11LoadModelsRequest\"$\n\x12LoadModelsResponse\x12\x0e\n\x06status\x18\x01 \x01(\x08\")\n\x12\x43heckHealthRequest\x12\x13\n\x0btypeOfCheck\x18\x01 \x01(\t\"%\n\x13\x43heckHealthResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\"n\n\x12\x41\x64\x64\x46\x65\x65\x64\x62\x61\x63kRequest\x12\x10\n\x08question\x18\x01 \x01(\t\x12\x10\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x02 \x01(\t\x12\x14\n\x0c\x66\x65\x65\x64\x62\x61\x63kType\x18\x03 \x01(\t\x12\x13\n\x06\x61nswer\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_answer\"&\n\x13\x41\x64\x64\x46\x65\x65\x64\x62\x61\x63kResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"(\n\x0f\x41\x64\x64\x46ilesRequest\x12\x15\n\rfilesToUpload\x18\x01 \x01(\t\"\x9f\x01\n\x10\x41\x64\x64\x46ilesResponse\x12\x15\n\rfilesUploaded\x18\x01 \x01(\t\x12!\n\x14\x63urrentFileUploading\x18\x02 \x01(\tH\x00\x88\x01\x01\x12 \n\x13\x63urrentFileProgress\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x17\n\x15_currentFileUploadingB\x16\n\x14_currentFileProgress\"&\n\x12GetFileListRequest\x12\x10\n\x08\x66ileType\x18\x01 \x01(\t\"\x15\n\x13StopAddFilesRequest\"\x16\n\x14StopAddFilesResponse\"\x1b\n\x19\x43lientDisconnectedRequest\"\'\n\x13GetFileListResponse\x12\x10\n\x08\x66ileList\x18\x01 \x01(\t\"+\n\x12RemoveFilesRequest\x12\x15\n\rfilesToRemove\x18\x01 \x01(\t\"+\n\x13RemoveFilesResponse\x12\x14\n\x0c\x66ilesRemoved\x18\x01 \x01(\t\"\\\n\x14\x44ownloadFilesRequest\x12\x0f\n\x07\x46ileUrl\x18\x01 \x01(\t\x12\x11\n\tlocalPath\x18\x02 \x01(\t\x12\x14\n\x07tokenId\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_tokenId\"A\n\x15\x44ownloadFilesResponse\x12\x10\n\x08progress\x18\x01 \x01(\x05\x12\x16\n\x0e\x46ileDownloaded\x18\x02 \x01(\t\"p\n\x10SetModelsRequest\x12\x10\n\x03llm\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08\x65mbedder\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06ranker\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x06\n\x04_llmB\x0b\n\t_embedderB\t\n\x07_ranker\")\n\x11SetModelsResponse\x12\x14\n\x0cmodelsLoaded\x18\x01 \x01(\t\"D\n\x13UnloadModelsRequest\x12\x0b\n\x03llm\x18\x01 \x01(\x08\x12\x10\n\x08\x65mbedder\x18\x02 \x01(\x08\x12\x0e\n\x06ranker\x18\x03 \x01(\x08\".\n\x14UnloadModelsResponse\x12\x16\n\x0emodelsUnloaded\x18\x01 \x01(\t\"/\n\x14SetParametersRequest\x12\x17\n\x0fparameters_json\x18\x01 \x01(\t\"\x17\n\x15SetParametersResponse\"\x1c\n\x1a\x43lientDisconnectedResponse\"+\n\x16GetClientConfigRequest\x12\x11\n\tassistant\x18\x01 \x01(\t\"\'\n\x17GetClientConfigResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\t\"\x17\n\x15GetChatHistoryRequest\"&\n\x16GetChatHistoryResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\t\".\n\x12SetVectorDBRequest\x12\x18\n\x10\x63onnectionString\x18\x01 \x01(\t\"&\n\x13SetVectorDBResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\")\n\x14RemoveSessionRequest\x12\x11\n\tsessionId\x18\x01 \x01(\x05\"(\n\x15RemoveSessionResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"?\n\x15SetSessionNameRequest\x12\x11\n\tsessionId\x18\x01 \x01(\x05\x12\x13\n\x0bsessionName\x18\x02 \x01(\t\")\n\x16SetSessionNameResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"C\n\x19SetActiveAssistantRequest\x12\x11\n\tassistant\x18\x01 \x01(\t\x12\x13\n\x0bmodels_json\x18\x02 \x01(\t\">\n\x1aSetActiveAssistantResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"K\n\x1cSetAssistantViewModelRequest\x12\x12\n\nview_model\x18\x01 \x01(\t\x12\x17\n\x0fresetUXSettings\x18\x02 \x01(\x08\"0\n\x1dSetAssistantViewModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"3\n\x1dSetUserConfigViewModelRequest\x12\x12\n\nview_model\x18\x01 \x01(\t\"1\n\x1eSetUserConfigViewModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"Q\n\x13\x43onvertModelRequest\x12\x12\n\nmodel_path\x18\x01 \x01(\t\x12\x17\n\nparameters\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_parameters\"\'\n\x14\x43onvertModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"z\n\x12UploadModelRequest\x12\x12\n\nsource_dir\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x12\n\nmodel_type\x18\x03 \x01(\t\x12\x15\n\rdownload_link\x18\x04 \x01(\t\x12\x16\n\x0emove_directory\x18\x05 \x01(\x08\"&\n\x13UploadModelResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"D\n\x17\x45xportUserConfigRequest\x12\x15\n\rAssistantName\x18\x01 \x01(\t\x12\x12\n\nExportPath\x18\x02 \x01(\t\"<\n\x18\x45xportUserConfigResponse\x12\x0f\n\x07Success\x18\x01 \x01(\x08\x12\x0f\n\x07Message\x18\x02 \x01(\t\"-\n\x17ImportUserConfigRequest\x12\x12\n\nImportPath\x18\x01 \x01(\t\"<\n\x18ImportUserConfigResponse\x12\x0f\n\x07Success\x18\x01 \x01(\x08\x12\x0f\n\x07Message\x18\x02 \x01(\t2\x9b\x14\n\x0cSuperBuilder\x12I\n\x08SayHello\x12\x1d.SuperBuilder.SayHelloRequest\x1a\x1e.SuperBuilder.SayHelloResponse\x12N\n\rSayHelloPyllm\x12\x1d.SuperBuilder.SayHelloRequest\x1a\x1e.SuperBuilder.SayHelloResponse\x12?\n\x04\x43hat\x12\x19.SuperBuilder.ChatRequest\x1a\x1a.SuperBuilder.ChatResponse0\x01\x12I\n\x08StopChat\x12\x1d.SuperBuilder.StopChatRequest\x1a\x1e.SuperBuilder.StopChatResponse\x12O\n\nLoadModels\x12\x1f.SuperBuilder.LoadModelsRequest\x1a .SuperBuilder.LoadModelsResponse\x12R\n\x0b\x43heckHealth\x12 .SuperBuilder.CheckHealthRequest\x1a!.SuperBuilder.CheckHealthResponse\x12R\n\x0b\x41\x64\x64\x46\x65\x65\x64\x62\x61\x63k\x12 .SuperBuilder.AddFeedbackRequest\x1a!.SuperBuilder.AddFeedbackResponse\x12K\n\x08\x41\x64\x64\x46iles\x12\x1d.SuperBuilder.AddFilesRequest\x1a\x1e.SuperBuilder.AddFilesResponse0\x01\x12U\n\x0cStopAddFiles\x12!.SuperBuilder.StopAddFilesRequest\x1a\".SuperBuilder.StopAddFilesResponse\x12R\n\x0bRemoveFiles\x12 .SuperBuilder.RemoveFilesRequest\x1a!.SuperBuilder.RemoveFilesResponse\x12Z\n\rDownloadFiles\x12\".SuperBuilder.DownloadFilesRequest\x1a#.SuperBuilder.DownloadFilesResponse0\x01\x12R\n\x0bGetFileList\x12 .SuperBuilder.GetFileListRequest\x1a!.SuperBuilder.GetFileListResponse\x12L\n\tSetModels\x12\x1e.SuperBuilder.SetModelsRequest\x1a\x1f.SuperBuilder.SetModelsResponse\x12U\n\x0cUnloadModels\x12!.SuperBuilder.UnloadModelsRequest\x1a\".SuperBuilder.UnloadModelsResponse\x12X\n\rSetParameters\x12\".SuperBuilder.SetParametersRequest\x1a#.SuperBuilder.SetParametersResponse\x12g\n\x12\x43lientDisconnected\x12\'.SuperBuilder.ClientDisconnectedRequest\x1a(.SuperBuilder.ClientDisconnectedResponse\x12^\n\x0fGetClientConfig\x12$.SuperBuilder.GetClientConfigRequest\x1a%.SuperBuilder.GetClientConfigResponse\x12[\n\x0eGetChatHistory\x12#.SuperBuilder.GetChatHistoryRequest\x1a$.SuperBuilder.GetChatHistoryResponse\x12R\n\x11GetSoftwareUpdate\x12\x1d.SuperBuilder.SayHelloRequest\x1a\x1e.SuperBuilder.SayHelloResponse\x12R\n\x0bSetVectorDB\x12 .SuperBuilder.SetVectorDBRequest\x1a!.SuperBuilder.SetVectorDBResponse\x12X\n\rRemoveSession\x12\".SuperBuilder.RemoveSessionRequest\x1a#.SuperBuilder.RemoveSessionResponse\x12[\n\x0eSetSessionName\x12#.SuperBuilder.SetSessionNameRequest\x1a$.SuperBuilder.SetSessionNameResponse\x12g\n\x12SetActiveAssistant\x12\'.SuperBuilder.SetActiveAssistantRequest\x1a(.SuperBuilder.SetActiveAssistantResponse\x12p\n\x15SetAssistantViewModel\x12*.SuperBuilder.SetAssistantViewModelRequest\x1a+.SuperBuilder.SetAssistantViewModelResponse\x12s\n\x16SetUserConfigViewModel\x12+.SuperBuilder.SetUserConfigViewModelRequest\x1a,.SuperBuilder.SetUserConfigViewModelResponse\x12U\n\x0c\x43onvertModel\x12!.SuperBuilder.ConvertModelRequest\x1a\".SuperBuilder.ConvertModelResponse\x12R\n\x0bUploadModel\x12 .SuperBuilder.UploadModelRequest\x1a!.SuperBuilder.UploadModelResponse\x12\x61\n\x10\x45xportUserConfig\x12%.SuperBuilder.ExportUserConfigRequest\x1a&.SuperBuilder.ExportUserConfigResponse\x12\x61\n\x10ImportUserConfig\x12%.SuperBuilder.ImportUserConfigRequest\x1a&.SuperBuilder.ImportUserConfigResponseB>Z#superbuilder/SuperBuilderWinService\xaa\x02\x16SuperBuilderWinServiceb\x06proto3') 28 | 29 | _globals = globals() 30 | _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) 31 | _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'superbuilder_middleware_pb2', _globals) 32 | if not _descriptor._USE_C_DESCRIPTORS: 33 | _globals['DESCRIPTOR']._loaded_options = None 34 | _globals['DESCRIPTOR']._serialized_options = b'Z#superbuilder/SuperBuilderWinService\252\002\026SuperBuilderWinService' 35 | _globals['_SAYHELLOREQUEST']._serialized_start=47 36 | _globals['_SAYHELLOREQUEST']._serialized_end=78 37 | _globals['_SAYHELLORESPONSE']._serialized_start=80 38 | _globals['_SAYHELLORESPONSE']._serialized_end=115 39 | _globals['_CONVERSATIONHISTORY']._serialized_start=117 40 | _globals['_CONVERSATIONHISTORY']._serialized_end=169 41 | _globals['_CHATREQUEST']._serialized_start=172 42 | _globals['_CHATREQUEST']._serialized_end=370 43 | _globals['_CHATRESPONSE']._serialized_start=372 44 | _globals['_CHATRESPONSE']._serialized_end=403 45 | _globals['_STOPCHATREQUEST']._serialized_start=405 46 | _globals['_STOPCHATREQUEST']._serialized_end=422 47 | _globals['_STOPCHATRESPONSE']._serialized_start=424 48 | _globals['_STOPCHATRESPONSE']._serialized_end=442 49 | _globals['_LOADMODELSREQUEST']._serialized_start=444 50 | _globals['_LOADMODELSREQUEST']._serialized_end=463 51 | _globals['_LOADMODELSRESPONSE']._serialized_start=465 52 | _globals['_LOADMODELSRESPONSE']._serialized_end=501 53 | _globals['_CHECKHEALTHREQUEST']._serialized_start=503 54 | _globals['_CHECKHEALTHREQUEST']._serialized_end=544 55 | _globals['_CHECKHEALTHRESPONSE']._serialized_start=546 56 | _globals['_CHECKHEALTHRESPONSE']._serialized_end=583 57 | _globals['_ADDFEEDBACKREQUEST']._serialized_start=585 58 | _globals['_ADDFEEDBACKREQUEST']._serialized_end=695 59 | _globals['_ADDFEEDBACKRESPONSE']._serialized_start=697 60 | _globals['_ADDFEEDBACKRESPONSE']._serialized_end=735 61 | _globals['_ADDFILESREQUEST']._serialized_start=737 62 | _globals['_ADDFILESREQUEST']._serialized_end=777 63 | _globals['_ADDFILESRESPONSE']._serialized_start=780 64 | _globals['_ADDFILESRESPONSE']._serialized_end=939 65 | _globals['_GETFILELISTREQUEST']._serialized_start=941 66 | _globals['_GETFILELISTREQUEST']._serialized_end=979 67 | _globals['_STOPADDFILESREQUEST']._serialized_start=981 68 | _globals['_STOPADDFILESREQUEST']._serialized_end=1002 69 | _globals['_STOPADDFILESRESPONSE']._serialized_start=1004 70 | _globals['_STOPADDFILESRESPONSE']._serialized_end=1026 71 | _globals['_CLIENTDISCONNECTEDREQUEST']._serialized_start=1028 72 | _globals['_CLIENTDISCONNECTEDREQUEST']._serialized_end=1055 73 | _globals['_GETFILELISTRESPONSE']._serialized_start=1057 74 | _globals['_GETFILELISTRESPONSE']._serialized_end=1096 75 | _globals['_REMOVEFILESREQUEST']._serialized_start=1098 76 | _globals['_REMOVEFILESREQUEST']._serialized_end=1141 77 | _globals['_REMOVEFILESRESPONSE']._serialized_start=1143 78 | _globals['_REMOVEFILESRESPONSE']._serialized_end=1186 79 | _globals['_DOWNLOADFILESREQUEST']._serialized_start=1188 80 | _globals['_DOWNLOADFILESREQUEST']._serialized_end=1280 81 | _globals['_DOWNLOADFILESRESPONSE']._serialized_start=1282 82 | _globals['_DOWNLOADFILESRESPONSE']._serialized_end=1347 83 | _globals['_SETMODELSREQUEST']._serialized_start=1349 84 | _globals['_SETMODELSREQUEST']._serialized_end=1461 85 | _globals['_SETMODELSRESPONSE']._serialized_start=1463 86 | _globals['_SETMODELSRESPONSE']._serialized_end=1504 87 | _globals['_UNLOADMODELSREQUEST']._serialized_start=1506 88 | _globals['_UNLOADMODELSREQUEST']._serialized_end=1574 89 | _globals['_UNLOADMODELSRESPONSE']._serialized_start=1576 90 | _globals['_UNLOADMODELSRESPONSE']._serialized_end=1622 91 | _globals['_SETPARAMETERSREQUEST']._serialized_start=1624 92 | _globals['_SETPARAMETERSREQUEST']._serialized_end=1671 93 | _globals['_SETPARAMETERSRESPONSE']._serialized_start=1673 94 | _globals['_SETPARAMETERSRESPONSE']._serialized_end=1696 95 | _globals['_CLIENTDISCONNECTEDRESPONSE']._serialized_start=1698 96 | _globals['_CLIENTDISCONNECTEDRESPONSE']._serialized_end=1726 97 | _globals['_GETCLIENTCONFIGREQUEST']._serialized_start=1728 98 | _globals['_GETCLIENTCONFIGREQUEST']._serialized_end=1771 99 | _globals['_GETCLIENTCONFIGRESPONSE']._serialized_start=1773 100 | _globals['_GETCLIENTCONFIGRESPONSE']._serialized_end=1812 101 | _globals['_GETCHATHISTORYREQUEST']._serialized_start=1814 102 | _globals['_GETCHATHISTORYREQUEST']._serialized_end=1837 103 | _globals['_GETCHATHISTORYRESPONSE']._serialized_start=1839 104 | _globals['_GETCHATHISTORYRESPONSE']._serialized_end=1877 105 | _globals['_SETVECTORDBREQUEST']._serialized_start=1879 106 | _globals['_SETVECTORDBREQUEST']._serialized_end=1925 107 | _globals['_SETVECTORDBRESPONSE']._serialized_start=1927 108 | _globals['_SETVECTORDBRESPONSE']._serialized_end=1965 109 | _globals['_REMOVESESSIONREQUEST']._serialized_start=1967 110 | _globals['_REMOVESESSIONREQUEST']._serialized_end=2008 111 | _globals['_REMOVESESSIONRESPONSE']._serialized_start=2010 112 | _globals['_REMOVESESSIONRESPONSE']._serialized_end=2050 113 | _globals['_SETSESSIONNAMEREQUEST']._serialized_start=2052 114 | _globals['_SETSESSIONNAMEREQUEST']._serialized_end=2115 115 | _globals['_SETSESSIONNAMERESPONSE']._serialized_start=2117 116 | _globals['_SETSESSIONNAMERESPONSE']._serialized_end=2158 117 | _globals['_SETACTIVEASSISTANTREQUEST']._serialized_start=2160 118 | _globals['_SETACTIVEASSISTANTREQUEST']._serialized_end=2227 119 | _globals['_SETACTIVEASSISTANTRESPONSE']._serialized_start=2229 120 | _globals['_SETACTIVEASSISTANTRESPONSE']._serialized_end=2291 121 | _globals['_SETASSISTANTVIEWMODELREQUEST']._serialized_start=2293 122 | _globals['_SETASSISTANTVIEWMODELREQUEST']._serialized_end=2368 123 | _globals['_SETASSISTANTVIEWMODELRESPONSE']._serialized_start=2370 124 | _globals['_SETASSISTANTVIEWMODELRESPONSE']._serialized_end=2418 125 | _globals['_SETUSERCONFIGVIEWMODELREQUEST']._serialized_start=2420 126 | _globals['_SETUSERCONFIGVIEWMODELREQUEST']._serialized_end=2471 127 | _globals['_SETUSERCONFIGVIEWMODELRESPONSE']._serialized_start=2473 128 | _globals['_SETUSERCONFIGVIEWMODELRESPONSE']._serialized_end=2522 129 | _globals['_CONVERTMODELREQUEST']._serialized_start=2524 130 | _globals['_CONVERTMODELREQUEST']._serialized_end=2605 131 | _globals['_CONVERTMODELRESPONSE']._serialized_start=2607 132 | _globals['_CONVERTMODELRESPONSE']._serialized_end=2646 133 | _globals['_UPLOADMODELREQUEST']._serialized_start=2648 134 | _globals['_UPLOADMODELREQUEST']._serialized_end=2770 135 | _globals['_UPLOADMODELRESPONSE']._serialized_start=2772 136 | _globals['_UPLOADMODELRESPONSE']._serialized_end=2810 137 | _globals['_EXPORTUSERCONFIGREQUEST']._serialized_start=2812 138 | _globals['_EXPORTUSERCONFIGREQUEST']._serialized_end=2880 139 | _globals['_EXPORTUSERCONFIGRESPONSE']._serialized_start=2882 140 | _globals['_EXPORTUSERCONFIGRESPONSE']._serialized_end=2942 141 | _globals['_IMPORTUSERCONFIGREQUEST']._serialized_start=2944 142 | _globals['_IMPORTUSERCONFIGREQUEST']._serialized_end=2989 143 | _globals['_IMPORTUSERCONFIGRESPONSE']._serialized_start=2991 144 | _globals['_IMPORTUSERCONFIGRESPONSE']._serialized_end=3051 145 | _globals['_SUPERBUILDER']._serialized_start=3054 146 | _globals['_SUPERBUILDER']._serialized_end=5641 147 | # @@protoc_insertion_point(module_scope) 148 | -------------------------------------------------------------------------------- /example/python/tests/test_chat.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import json 3 | from unittest.mock import MagicMock, patch 4 | from helpers.chat import warmup, get_chat_history, generate_random_session_id, init_chat_session, set_chat_request, get_chat_response, remove_session 5 | 6 | class TestChatHelpers(unittest.TestCase): 7 | 8 | @patch('helpers.chat.sb.LoadModelsRequest') 9 | def test_warmup(self, MockLoadModelsRequest): 10 | stub = MagicMock() 11 | warmup(stub) 12 | stub.LoadModels.assert_called_once_with(MockLoadModelsRequest()) 13 | 14 | @patch('helpers.chat.sb.GetChatHistoryRequest') 15 | def test_get_chat_history(self, MockGetChatHistoryRequest): 16 | stub = MagicMock() 17 | stub.GetChatHistory.return_value.data = json.dumps([{"sid": 1}, {"sid": 2}]) 18 | result = get_chat_history(stub) 19 | self.assertEqual(result, [{"sid": 1}, {"sid": 2}], "Test get_chat_history failed") 20 | 21 | def test_generate_random_session_id(self): 22 | chat_history = [{"sid": 1}, {"sid": 2}] 23 | result = generate_random_session_id(chat_history) 24 | self.assertNotIn(result, [1, 2], "Test generate_random_session_id failed: ID is in existing IDs") 25 | self.assertIsInstance(result, int, "Test generate_random_session_id failed: ID is not an integer") 26 | 27 | @patch('helpers.chat.get_chat_history') 28 | @patch('helpers.chat.generate_random_session_id') 29 | def test_init_chat_session(self, mock_generate_random_session_id, mock_get_chat_history): 30 | stub = MagicMock() 31 | mock_get_chat_history.return_value = [{"sid": 1}, {"sid": 2}] 32 | mock_generate_random_session_id.return_value = 3 33 | result = init_chat_session(stub) 34 | self.assertEqual(result, 3, "Test init_chat_session failed") 35 | 36 | @patch('helpers.chat.init_chat_session') 37 | @patch('helpers.chat.sb.ChatRequest') 38 | def test_set_chat_request(self, MockChatRequest, mock_init_chat_session): 39 | stub = MagicMock() 40 | mock_init_chat_session.return_value = 12345678 41 | prompt = "Hello, world!" 42 | result = set_chat_request(stub, prompt) 43 | MockChatRequest.assert_called_once_with( 44 | name="Python Client Example", 45 | prompt=prompt, 46 | sessionId=12345678, 47 | attachedFiles="[]", 48 | queryType=None 49 | ) 50 | stub.Chat.assert_called_once_with(MockChatRequest()) 51 | 52 | @patch('helpers.chat.sb.RemoveSessionRequest') 53 | def test_remove_session(self, MockRemoveSessionRequest): 54 | stub = MagicMock() 55 | session_id = 12345678 56 | remove_session(stub, session_id) 57 | stub.RemoveSession.assert_called_once_with(MockRemoveSessionRequest(sessionId=session_id)) 58 | 59 | def test_get_chat_response(self): 60 | response_iterator = [ 61 | MagicMock(message=json.dumps({"message": "Hello"})), 62 | MagicMock(message=json.dumps({"message": "World"})) 63 | ] 64 | result = get_chat_response(response_iterator, verbose=False) 65 | self.assertEqual(result, "HelloWorld", "Test get_chat_response_non_verbose failed") 66 | 67 | 68 | if __name__ == '__main__': 69 | unittest.main() -------------------------------------------------------------------------------- /example/python/tests/test_config.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import json 3 | from unittest.mock import MagicMock, patch 4 | from helpers.config import get_config, set_config 5 | 6 | class TestConfigHelpers(unittest.TestCase): 7 | 8 | @patch('helpers.config.sb.GetClientConfigRequest') 9 | def test_get_config(self, MockGetClientConfigRequest): 10 | stub = MagicMock() 11 | stub.GetClientConfig.return_value.data = json.dumps({"key": "value"}) 12 | result = get_config(stub) 13 | self.assertEqual(result, {"key": "value"}, "Test get_config failed") 14 | stub.GetClientConfig.assert_called_once_with(MockGetClientConfigRequest()) 15 | 16 | @patch('helpers.config.sb.SetActiveAssistantRequest') 17 | def test_set_config(self, MockSetActiveAssistantRequest): 18 | stub = MagicMock() 19 | config_data = json.dumps({"model": "example_model"}) 20 | assistant = "example_assistant" 21 | response_message = "Config set successfully" 22 | stub.SetActiveAssistant.return_value.message = response_message 23 | result = set_config(stub, assistant, config_data) 24 | self.assertEqual(result, response_message, "Test set_config failed") 25 | MockSetActiveAssistantRequest.assert_called_once_with(assistant=assistant, models_json=config_data) 26 | stub.SetActiveAssistant.assert_called_once_with(MockSetActiveAssistantRequest()) 27 | 28 | if __name__ == '__main__': 29 | unittest.main() -------------------------------------------------------------------------------- /example/python/tests/test_mw.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest.mock import MagicMock, patch 3 | import grpc 4 | from helpers.mw import check_pybackend, connect, disconnect 5 | 6 | class TestMWHelpers(unittest.TestCase): 7 | 8 | @patch('helpers.mw.sb.SayHelloRequest') 9 | def test_check_pybackend_success(self, MockSayHelloRequest): 10 | stub = MagicMock() 11 | stub.SayHelloPyllm.return_value.message = "Hello from server" 12 | result = check_pybackend(stub) 13 | self.assertTrue(result, "Test check_pybackend_success failed") 14 | stub.SayHelloPyllm.assert_called_once_with(MockSayHelloRequest(name='SuperBuilder Python Clients!')) 15 | 16 | @patch('helpers.mw.sb.SayHelloRequest') 17 | def test_check_pybackend_failure(self, MockSayHelloRequest): 18 | stub = MagicMock() 19 | stub.SayHelloPyllm.return_value.message = "" 20 | result = check_pybackend(stub) 21 | self.assertFalse(result, "Test check_pybackend_failure failed") 22 | stub.SayHelloPyllm.assert_called_once_with(MockSayHelloRequest(name='SuperBuilder Python Clients!')) 23 | 24 | @patch('helpers.mw.sbg.SuperBuilderStub') 25 | @patch('grpc.channel_ready_future') 26 | def test_connect_success(self, mock_channel_ready_future, MockSuperBuilderStub): 27 | channel = MagicMock() 28 | mock_channel_ready_future.return_value.result.return_value = None 29 | success, stub = connect(channel) 30 | self.assertTrue(success, "Test connect_success failed") 31 | MockSuperBuilderStub.assert_called_once_with(channel) 32 | 33 | @patch('helpers.mw.sbg.SuperBuilderStub') 34 | @patch('grpc.channel_ready_future') 35 | def test_connect_failure(self, mock_channel_ready_future, MockSuperBuilderStub): 36 | channel = MagicMock() 37 | mock_channel_ready_future.return_value.result.side_effect = grpc.FutureTimeoutError() 38 | success, stub = connect(channel) 39 | self.assertFalse(success, "Test connect_failure failed") 40 | MockSuperBuilderStub.assert_not_called() 41 | 42 | @patch('helpers.mw.sb.ClientDisconnectedRequest') 43 | def test_disconnect(self, MockClientDisconnectedRequest): 44 | stub = MagicMock() 45 | channel = MagicMock() 46 | disconnect(stub, channel) 47 | stub.ClientDisconnected.assert_called_once_with(MockClientDisconnectedRequest()) 48 | channel.close.assert_called_once() 49 | 50 | if __name__ == '__main__': 51 | unittest.main() -------------------------------------------------------------------------------- /example/python/tests/test_parameters.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest.mock import MagicMock, patch 3 | import superbuilder_middleware_pb2 as sb 4 | from helpers.parameters import set_parameters, init_default_params 5 | 6 | class TestParametersHelpers(unittest.TestCase): 7 | 8 | @patch('helpers.parameters.sb.SetParametersRequest') 9 | def test_init_default_params(self, MockSetParametersRequest): 10 | params = init_default_params() 11 | MockSetParametersRequest.assert_called_once_with( 12 | max_token=1024, 13 | temperature=1.0, 14 | retriever_top_k=13, 15 | reranker_top_k=4, 16 | reranker_threshold=0.0, 17 | max_num_references=2, 18 | reference_threshold=0.1, 19 | input_prompt_safety_threshold=0.75, 20 | streaming_batch_size=1, 21 | rag_system_message=( 22 | "Using the information contained in the context, give a comprehensive answer to the question.\n\n" 23 | "Please provide answer with full sentence, and don't end a sentence with colon.\n\n" 24 | "If the context is not relevant, please answer the question by using your own knowledge about the topic." 25 | ) 26 | ) 27 | self.assertEqual(params, MockSetParametersRequest(), "Test init_default_params failed") 28 | 29 | @patch('helpers.parameters.sb.SetParametersRequest') 30 | def test_set_parameters(self, MockSetParametersRequest): 31 | stub = MagicMock() 32 | params = init_default_params() 33 | stub.SetParameters.return_value = "Parameters set successfully" 34 | result = set_parameters(stub, params) 35 | self.assertEqual(result, "Parameters set successfully", "Test set_parameters failed") 36 | stub.SetParameters.assert_called_once_with(params) 37 | 38 | if __name__ == '__main__': 39 | unittest.main() -------------------------------------------------------------------------------- /example/python/tests/test_rag.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import os 3 | import json 4 | from unittest.mock import MagicMock, patch 5 | from helpers.rag import is_valid_file_path, upload_file_to_knowledge_base, remove_uploaded_file, list_uploaded_files 6 | 7 | class TestRagHelpers(unittest.TestCase): 8 | 9 | @patch('helpers.rag.is_valid_file_path') 10 | @patch('helpers.rag.os.path.abspath') 11 | @patch('helpers.rag.sb.AddFilesRequest') 12 | @patch('helpers.rag.tqdm') 13 | def test_upload_file_to_knowledge_base(self, mock_tqdm, MockAddFilesRequest, mock_abspath, mock_is_valid_file_path): 14 | stub = MagicMock() 15 | mock_is_valid_file_path.side_effect = [True, False] 16 | mock_abspath.side_effect = lambda x: f"/abs/{x}" 17 | file_paths = ["file1", "file2"] 18 | upload_file_to_knowledge_base(stub, file_paths) 19 | mock_abspath.assert_any_call("file1") 20 | mock_abspath.assert_any_call("file2") 21 | mock_is_valid_file_path.assert_any_call("/abs/file1") 22 | mock_is_valid_file_path.assert_any_call("/abs/file2") 23 | MockAddFilesRequest.assert_called_once_with(filesToUpload=json.dumps(["/abs/file1"])) 24 | stub.AddFiles.assert_called_once_with(MockAddFilesRequest()) 25 | 26 | @patch('helpers.rag.is_valid_file_path') 27 | @patch('helpers.rag.os.path.abspath') 28 | @patch('helpers.rag.sb.RemoveFilesRequest') 29 | def test_remove_uploaded_file(self, MockRemoveFilesRequest, mock_abspath, mock_is_valid_file_path): 30 | stub = MagicMock() 31 | mock_is_valid_file_path.side_effect = [True, False] 32 | mock_abspath.side_effect = lambda x: f"/abs/{x}" 33 | file_paths = ["file1", "file2"] 34 | remove_uploaded_file(stub, file_paths) 35 | mock_abspath.assert_any_call("file1") 36 | mock_abspath.assert_any_call("file2") 37 | mock_is_valid_file_path.assert_any_call("/abs/file1") 38 | mock_is_valid_file_path.assert_any_call("/abs/file2") 39 | MockRemoveFilesRequest.assert_called_once_with(filesToRemove=json.dumps(["/abs/file1"])) 40 | stub.RemoveFiles.assert_called_once_with(MockRemoveFilesRequest()) 41 | 42 | @patch('helpers.rag.sb.GetFileListRequest') 43 | def test_list_uploaded_files(self, MockGetFileListRequest): 44 | stub = MagicMock() 45 | stub.GetFileList.return_value.fileList = json.dumps(["file1", "file2"]) 46 | list_uploaded_files(stub) 47 | MockGetFileListRequest.assert_called_once_with(fileType="") 48 | stub.GetFileList.assert_called_once_with(MockGetFileListRequest()) 49 | 50 | if __name__ == '__main__': 51 | unittest.main() -------------------------------------------------------------------------------- /example/run-smoke-test.ps1: -------------------------------------------------------------------------------- 1 | $root_dir="$PSScriptRoot" | Resolve-Path 2 | 3 | try { Get-Process -Id (Get-NetTCPConnection -LocalPort 5006).OwningProcess } 4 | catch { "Superbuilder service is not running on port 5006. Force quit"; exit 1 } 5 | 6 | "" 7 | "" 8 | "running python client" 9 | "=====================" 10 | cd $root_dir\\python 11 | ./install.bat 12 | ./run_tests.bat 13 | $python_unit_test_exit_code=$? 14 | 15 | cd $PSScriptRoot # return to script's directory 16 | "" 17 | "" 18 | "running go client" 19 | "=================" 20 | cd $root_dir\\golang 21 | go mod download 22 | go run . 23 | $go_client_exit_code = $? 24 | cd $PSScriptRoot # return to script's directory 25 | "" 26 | "" 27 | "running csharp client" 28 | "=================" 29 | cd $root_dir\\csharp\\CSharpClientExample 30 | dotnet restore 31 | dotnet build 32 | dotnet run 33 | $csharp_client_exit_code = $? 34 | cd $PSScriptRoot # return to script's directory 35 | 36 | 37 | "Python client exit gracefully: $python_unit_test_exit_code" 38 | "Go client exit gracefully: $go_client_exit_code" 39 | "C# client exit gracefully: $csharp_client_exit_code" 40 | if (-not $python_unit_test_exit_code) { 41 | throw "Python client tests failed with exit code $python_unit_test_exit_code" 42 | } 43 | 44 | if (-not $go_client_exit_code) { 45 | throw "Go client tests failed with exit code $go_client_exit_code" 46 | } 47 | 48 | if (-not $csharp_client_exit_code) { 49 | throw "C# client tests failed with exit code $csharp_client_exit_code" 50 | } 51 | -------------------------------------------------------------------------------- /media/12203a5085925a8714a0b28efa36423e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/12203a5085925a8714a0b28efa36423e.png -------------------------------------------------------------------------------- /media/1c963aec81be29b3d949e5f6231af2fe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/1c963aec81be29b3d949e5f6231af2fe.png -------------------------------------------------------------------------------- /media/24e3d8d9071449014e01ac1399c93b9c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/24e3d8d9071449014e01ac1399c93b9c.png -------------------------------------------------------------------------------- /media/40986ed2aad5910769328c62d5497d7e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/40986ed2aad5910769328c62d5497d7e.png -------------------------------------------------------------------------------- /media/56896a80bc165e94ad83392a67239ec9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/56896a80bc165e94ad83392a67239ec9.png -------------------------------------------------------------------------------- /media/596a08fd2d25c663654baed1113da405.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/596a08fd2d25c663654baed1113da405.png -------------------------------------------------------------------------------- /media/8e0e5bdf9efab056bf271f95906cf93d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/8e0e5bdf9efab056bf271f95906cf93d.png -------------------------------------------------------------------------------- /media/917896de1185740322e7ad5f45d79c15.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/917896de1185740322e7ad5f45d79c15.jpeg -------------------------------------------------------------------------------- /media/9bf109917571555fefb578d4fd005e27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/9bf109917571555fefb578d4fd005e27.png -------------------------------------------------------------------------------- /media/9e1c571d44058fd8acf1ce4e04b8a343.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/9e1c571d44058fd8acf1ce4e04b8a343.png -------------------------------------------------------------------------------- /media/SuperBuilder_1_2_Feature_Review_20250529.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/SuperBuilder_1_2_Feature_Review_20250529.mp4 -------------------------------------------------------------------------------- /media/SuperBuilder_Demo_AIPC_to_Cluster_20250529.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/SuperBuilder_Demo_AIPC_to_Cluster_20250529.mp4 -------------------------------------------------------------------------------- /media/SuperBuilder_Demo_Multi_Agent_20250529.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/SuperBuilder_Demo_Multi_Agent_20250529.mp4 -------------------------------------------------------------------------------- /media/api_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/api_service.png -------------------------------------------------------------------------------- /media/api_service_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/api_service_border.png -------------------------------------------------------------------------------- /media/b7ee6629bd1d637ab0c16dfcf186b306.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/b7ee6629bd1d637ab0c16dfcf186b306.png -------------------------------------------------------------------------------- /media/d4303d539460099455c351596781655e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/d4303d539460099455c351596781655e.png -------------------------------------------------------------------------------- /media/e02aa4c73fade1e31f7c426b7cdcd194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/e02aa4c73fade1e31f7c426b7cdcd194.png -------------------------------------------------------------------------------- /media/f48b205f630b9807f1b2c65f3a908698.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/f48b205f630b9807f1b2c65f3a908698.png -------------------------------------------------------------------------------- /media/models_action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/models_action.png -------------------------------------------------------------------------------- /media/models_action_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/models_action_border.png -------------------------------------------------------------------------------- /media/notification_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/notification_border.png -------------------------------------------------------------------------------- /media/resume_match1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/resume_match1.png -------------------------------------------------------------------------------- /media/resume_match2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/resume_match2.png -------------------------------------------------------------------------------- /media/superbuild_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/superbuild_ui.png -------------------------------------------------------------------------------- /media/superbuild_ui_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/superbuild_ui_border.png -------------------------------------------------------------------------------- /media/webportal.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/webportal.jpeg -------------------------------------------------------------------------------- /media/webportal_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/webportal_border.png -------------------------------------------------------------------------------- /media/white_title_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/intel-ai-assistant-builder/d99fbfe15542ec8f74f5caa576898958d312bae7/media/white_title_bar.png -------------------------------------------------------------------------------- /special_query.md: -------------------------------------------------------------------------------- 1 | # Special Query Types 2 | 3 | Special queries are used to `focus` the assistant on specific documents. This can yield better, more accurate results and help the assistant answer more sophisticated questions based on the context of the specified document(s). To use the special queries click the attach file icon (the paperclip icon next to the question entry field). 4 | 5 | 6 | 7 | **PRO TIP:** Using small files which only contain information relevant to the topic at hand will yield the best results. 8 | 9 | To close `Special query mode` click the `Clear` icon from the list of special queries. Starting a new chat session will also exit special query mode. 10 | 11 | ![image](https://github.com/user-attachments/assets/87fa56d3-8abe-476d-97ac-62e030b1a6c7) 12 | 13 | 14 | ### Query Tabular Data 15 | This feature is meant for analysing and querying tabular files (XLSX, CSV). 16 | 17 | **NOTE:** Before using this feature, ensure that the data is structured as a relational SQL table. The first row should contain the column headers, with each following row representing corresponding data entries. Avoid duplicate column names within any worksheet. For XLSX files with multiple worksheets, each worksheet will be treated as a separate table. 18 | 19 | ![image](https://github.com/user-attachments/assets/0d7d92e9-4bb6-445e-85a5-336aeabd0a6d) 20 | 21 | 22 | ### Resume Match 23 | This feature provides HR professionals with a powerful tool to quickly identify the most qualified candidates from large applicant pools, while maintaining the ability to dive deeper into specific candidate qualifications through natural conversation. It intelligently scores resumes against job descriptions, extracts key details from top candidates using RAG, and facilitates continuous conversational analysis of resume documents. The system is designed to deliver all relevant information in a streamlined, concise, and efficient way. 24 | 25 | **Note:** It utilizes an in-house proprietary document scoring algorithm capable of leveraging an LLM to evaluate an unlimited number of documents against specific criteria. This algorithm is customizable and can be applied to a wide range of document scoring use cases. For optimal results, use the Qwen2.5 or Qwen2 models. 26 | 27 | ![image](https://github.com/user-attachments/assets/5b83c4dc-8f02-4a7a-90c7-c8be4b673bee) 28 | 29 | --------------------------------------------------------------------------------