Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Add new AI business functions

albert10364f316dcc
diff --git a/core/frontend/src/assets/icons/ai/big-model.svg b/core/frontend/src/assets/icons/ai/big-model.svg
new file mode 100644
index 00000000..b0c435ee
--- /dev/null
+++ b/core/frontend/src/assets/icons/ai/big-model.svg
@@ -0,0 +1 @@
+<svg t="1751947525846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8882" width="256" height="256"><path d="M179.32 355.99c-3.433 9.036-5.18 18.433-5.18 27.95V629.7c0 31.382 18.914 60.476 49.875 76.62l230.701 120.108c5.24 2.65 10.662 4.94 16.264 6.807v140.71a109.086 109.086 0 0 1-11.626-5.18l-359.002-186.85c-30.9-16.083-49.875-45.177-49.875-76.5V326.055c0-10.843 2.29-21.504 6.626-31.383l122.217 61.26z m794.203-29.936v379.301c0 31.383-18.974 60.416-49.935 76.5l-358.942 186.97c-3.795 1.867-7.65 3.614-11.626 5.12V829.8c2.41-1.084 4.82-2.168 7.108-3.373L790.829 706.32c30.961-16.143 49.935-45.176 49.935-76.62V383.94c0-5.059-0.482-10.059-1.445-15.058l130.83-65.536c2.17 7.349 3.374 14.938 3.374 22.709zM564.646 62.704l354.002 184.2-124.325 62.284a122.458 122.458 0 0 0-3.494-1.807L560.19 187.15a115.893 115.893 0 0 0-105.413 0L235.038 301.598l-119.627-59.994 343.943-178.96c32.467-16.865 72.885-16.865 105.412 0z" fill="#3888FF" p-id="8883"></path><path d="M256.301 383.277L483.147 496.52v248.29a110.29 110.29 0 0 1-32.888-10.843L297.864 655c-30.48-15.842-49.152-44.514-49.152-75.415V416.708c0-11.686 2.71-23.01 7.59-33.43z" fill="#3888FF" p-id="8884"></path><path d="M755.11 579.584c0 30.9-18.673 59.573-49.273 75.415l-152.275 78.908c-2.65 1.385-5.42 2.71-8.192 3.855V504.23l207.993-103.726c1.205 5.361 1.747 10.783 1.747 16.204v162.876z" fill="#A6C6FD" p-id="8885"></path><path d="M705.958 341.353c6.385 3.313 12.408 7.289 17.83 11.807l-200.102 99.81h-3.253L297.382 341.593l0.542-0.3 152.335-78.97a114.025 114.025 0 0 1 103.303 0l152.396 79.03z" fill="#3888FF" p-id="8886"></path></svg>
\ No newline at end of file
diff --git a/core/frontend/src/assets/icons/ai/deep-seek.svg b/core/frontend/src/assets/icons/ai/deep-seek.svg
new file mode 100644
index 00000000..9084fd16
--- /dev/null
+++ b/core/frontend/src/assets/icons/ai/deep-seek.svg
@@ -0,0 +1 @@
+<svg t="1751945914949" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4423" width="256" height="256"><path d="M938.7008 289.0752c-8.6016-4.1984-12.288 3.7888-17.339733 7.850667-1.706667 1.365333-3.1744 3.072-4.608 4.608-12.561067 13.482667-27.204267 22.254933-46.353067 21.1968-28.023467-1.536-51.9168 7.2704-73.045333 28.740266-4.539733-26.487467-19.456-42.257067-42.154667-52.394666-11.912533-5.290667-23.927467-10.5472-32.221867-22.016-5.8368-8.123733-7.406933-17.2032-10.3424-26.112-1.8432-5.4272-3.6864-10.922667-9.898666-11.8784-6.724267-1.058133-9.352533 4.608-12.014934 9.3184-10.581333 19.3536-14.677333 40.686933-14.301866 62.293333 0.955733 48.503467 21.435733 87.176533 62.122666 114.688 4.642133 3.1744 5.802667 6.3488 4.369067 10.9568-2.7648 9.454933-6.075733 18.670933-9.0112 28.125867-1.8432 6.075733-4.608 7.406933-11.0592 4.778666a185.9584 185.9584 0 0 1-58.6752-39.901866c-28.945067-27.989333-55.0912-58.914133-87.722667-83.114667-7.68-5.666133-15.325867-10.922667-23.2448-15.940267-33.314133-32.426667 4.369067-59.016533 13.073067-62.122666 9.1136-3.2768 3.1744-14.609067-26.282667-14.472534-29.457067 0.136533-56.4224 10.001067-90.760533 23.108267a94.958933 94.958933 0 0 1-15.701333 4.608 326.109867 326.109867 0 0 0-97.3824-3.413333c-63.6928 7.168-114.551467 37.2736-151.9616 88.746666-44.885333 61.781333-55.466667 132.096-42.530134 205.4144 13.6192 77.175467 52.974933 141.175467 113.527467 191.1808 62.702933 51.8144 134.997333 77.2096 217.429333 72.362667 50.039467-2.901333 105.813333-9.6256 168.686934-62.8736 15.872 7.850667 32.494933 10.990933 60.142933 13.380267 21.265067 2.013867 41.745067-1.058133 57.582933-4.334934 24.849067-5.256533 23.108267-28.2624 14.1312-32.529066-72.772267-33.928533-56.832-20.138667-71.338666-31.266134 37.000533-43.861333 92.740267-89.3952 114.551466-236.885333 1.706667-11.707733 0.238933-19.0464 0-28.5696-0.136533-5.7344 1.160533-8.021333 7.748267-8.669867a139.400533 139.400533 0 0 0 52.224-16.042666c47.172267-25.838933 66.1504-68.164267 70.656-118.954667 0.682667-7.748267-0.136533-15.803733-8.2944-19.8656zM527.701333 746.154667c-70.5536-55.534933-104.789333-73.796267-118.8864-72.977067-13.2096 0.7168-10.8544 15.872-7.953066 25.736533 3.037867 9.728 6.997333 16.452267 12.561066 24.9856 3.857067 5.666133 6.485333 14.1312-3.822933 20.411734-22.7328 14.1312-62.225067-4.744533-64.1024-5.666134-45.9776-27.067733-84.411733-62.8736-111.5136-111.8208-26.112-47.104-41.301333-97.655467-43.8272-151.586133-0.682667-13.073067 3.1744-17.681067 16.110933-20.002133a160.1536 160.1536 0 0 1 51.677867-1.365334c71.9872 10.581333 133.290667 42.837333 184.661333 93.832534 29.354667 29.115733 51.541333 63.863467 74.410667 97.792 24.2688 36.078933 50.449067 70.417067 83.7632 98.542933 11.707733 9.864533 21.128533 17.408 30.071467 22.9376-27.067733 3.003733-72.260267 3.652267-103.150934-20.821333z m33.792-217.770667a10.376533 10.376533 0 1 1 20.7872 0c0 5.802667-4.642133 10.376533-10.4448 10.376533a10.24 10.24 0 0 1-10.3424-10.410666z m105.028267 53.998933c-6.724267 2.730667-13.448533 5.12-19.933867 5.393067a42.530133 42.530133 0 0 1-26.965333-8.6016c-9.216-7.748267-15.803733-12.0832-18.6368-25.668267a59.8016 59.8016 0 0 1 0.546133-19.8656c2.389333-11.093333-0.273067-18.1248-8.021333-24.576-6.382933-5.290667-14.404267-6.690133-23.278933-6.690133a18.807467 18.807467 0 0 1-8.6016-2.6624c-3.6864-1.877333-6.724267-6.485333-3.822934-12.151467 0.9216-1.809067 5.4272-6.2464 6.485334-7.0656 12.014933-6.8608 25.873067-4.608 38.7072 0.546134 11.912533 4.846933 20.855467 13.789867 33.792 26.385066 13.243733 15.2576 15.598933 19.524267 23.1424 30.9248 5.9392 9.0112 11.3664 18.2272 15.0528 28.740267 2.2528 6.5536-0.682667 11.946667-8.465067 15.291733z" fill="#4D6BFE" p-id="4424"></path></svg>
\ No newline at end of file
diff --git a/core/frontend/src/assets/icons/ai/kimi.svg b/core/frontend/src/assets/icons/ai/kimi.svg
new file mode 100644
index 00000000..b39bb576
--- /dev/null
+++ b/core/frontend/src/assets/icons/ai/kimi.svg
@@ -0,0 +1 @@
+<svg t="1751963069816" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2408" width="256" height="256"><path d="M1024 0m0 186.197333l0 651.605334q0 186.197333-186.197333 186.197333l-651.605334 0q-186.197333 0-186.197333-186.197333l0-651.605334q0-186.197333 186.197333-186.197333l651.605334 0q186.197333 0 186.197333 186.197333Z" fill="#000000" p-id="2409"></path><path d="M580.181333 459.946667c57.173333 1.322667 104.192 52.352 104.192 115.2v232.533333a2.090667 2.090667 0 0 1-2.133333 2.133333h-99.925333a2.090667 2.090667 0 0 1-2.133334-2.133333l-1.706666-294.016c0-1.28-2.218667-1.493333-2.56-0.298667-13.397333 43.946667-52.736 56.32-99.84 56.32H304.384a2.090667 2.090667 0 0 0-2.090667 2.090667v235.946667a2.090667 2.090667 0 0 1-2.090666 2.090666H194.858667a2.090667 2.090667 0 0 1-2.048-2.133333V241.578667c0-1.152 0.896-2.048 2.048-2.048h105.386666c1.109333 0 2.048 0.896 2.048 2.048v216.32c0 1.152 0.938667 2.133333 2.090667 2.133333h135.253333a2.133333 2.133333 0 0 0 1.877334-1.28l96.896-218.026667a2.090667 2.090667 0 0 1 1.92-1.194666h116.778666c1.493333 0 2.517333 1.578667 1.877334 2.944l-66.261334 142.293333c-19.754667 36.224-34.304 61.866667-67.242666 72.789333-1.194667 0.426667-0.938667 2.432 0.298666 2.432h54.4z" fill="#FFFFFF" p-id="2410"></path><path d="M727.338667 227.968c-11.733333 9.856-19.413333 25.941333-19.413334 50.218667 0 22.741333 7.253333 40.405333 18.133334 50.986666-5.674667 9.386667-11.434667 15.957333-15.786667 19.498667-0.725333 0.554667-0.170667 2.218667 0.725333 2.133333l64.426667-4.693333c14.378667-1.066667 26.709333-6.485333 37.034667-15.744 12.373333-10.496 19.498667-28.544 19.498666-52.181333 0-24.277333-7.125333-40.362667-19.498666-50.218667-11.776-9.813333-26.112-14.762667-43.050667-14.762667-16.298667 0-30.293333 4.949333-42.069333 14.762667z" fill="#007AFF" p-id="2411"></path></svg>
\ No newline at end of file
diff --git a/core/frontend/src/assets/icons/ai/ollama.svg b/core/frontend/src/assets/icons/ai/ollama.svg
new file mode 100644
index 00000000..10e9ea57
--- /dev/null
+++ b/core/frontend/src/assets/icons/ai/ollama.svg
@@ -0,0 +1 @@
+<svg t="1751963228035" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1063" width="256" height="256"><path d="M273.3048636 15.26488785c-45.17573645 27.26905599-73.30831183 125.66489933-63.08241691 218.97051958l3.86311663 37.08591616-21.31531246 21.31531245c-69.03616043 68.17263997-86.48835628 173.84023194-43.03965968 259.05603189l11.4984523 22.5878677-10.63493184 26.3600878c-27.72354061 69.49064399-25.58746384 153.43388873 4.68118723 213.92574425l12.36197276 24.26945983-7.68078446 15.77060369c-17.45219583 35.81335984-25.99649968 114.62093166-15.77060368 150.43429256l4.27215139 16.17963954h64.35497214l-3.408632-14.08901263c-2.1360757-7.22629984-3.86311663-32.76831597-3.86311556-56.21970305 0-40.44909937 0.86352046-44.31221598 16.22508832-76.26246027 8.49885613-18.31571629 15.72515598-36.63143152 15.72515491-40.44909936 0-3.86311663-5.90829582-16.63412415-13.634528-28.58706107-37.90398782-59.21930028-38.76750829-131.66409165-2.95414738-202.790879 15.77060369-31.54120845 15.31612014-41.35806861-2.13607569-62.62793228-23.86042399-28.17802416-35.35887629-73.71734767-28.13257646-111.21229966 10.225896-53.72004031 43.03965969-98.85032796 87.35187567-119.75660457 21.31531245-10.225896 31.08672383-12.3619717 58.35577982-12.3619717h33.2682483l8.49885614-17.04315999c19.58827153-38.76750829 53.67459152-65.58207966 99.71384843-78.8075718 59.21930028-17.45219583 132.52761211 15.77060369 164.88689116 74.98990396l10.225896 18.77019985 36.22239676 2.09062798c61.8098606 4.27215246 99.2593638 28.99609585 126.11938394 83.12517199 27.26905599 55.35618366 23.86042399 114.1664481-8.95334075 157.20610777-18.31571629 23.86042399-18.31571629 34.08631999-2.54511154 65.62752845 35.76791213 71.12678735 34.94984045 143.61702857-2.99959616 202.790879-7.68078446 11.95293586-13.634528 24.72394446-13.63452799 28.54161228 0 3.86311663 7.27174861 22.17883186 15.77060368 40.44909937 15.36156785 31.99569201 16.17963953 35.81335984 16.1796406 76.35335676 0 23.40593937-1.68159214 48.9479555-3.81766784 56.21970413l-3.40863199 14.04356384h64.35497212l4.22670369-15.7706037c10.225896-36.22239568 1.72703986-115.02996749-15.77060476-150.8433284l-7.63533568-15.77060369 12.36197276-24.26945983c30.22320337-60.49185551 32.35928013-144.43510024 4.22670368-214.74381592l-10.63493183-26.81457243 11.49845123-23.45138816c25.58746384-52.85651984 28.99609585-115.89348796 8.54430493-175.56727178-11.54390001-34.08631999-26.86002015-58.35577981-54.12907615-84.35227951L810.59616309 271.32132359l3.81766783-37.08591616c7.68078446-70.30871567-9.36237554-158.06962825-37.90398782-195.56458021-22.58786769-29.81416752-52.85651984-38.76750829-84.35227951-25.54201507-28.99609585 11.90748814-54.12907614 54.9925966-66.08201306 113.30292763-5.49925998 27.72354061-8.49885613 33.67728415-13.63452799 31.54120739-36.17694798-16.58867537-64.30952336-22.99690353-100.94095488-22.99690354-37.49495198 0-56.67418767 4.6811883-99.30481258 22.99690354-5.09022415 2.1360757-8.0898203-3.81766784-13.634528-31.54120739-11.90748814-58.35577981-37.04046736-101.34999178-66.03656427-113.30292763-19.58827153-8.54430386-43.90318015-7.27174861-59.21929921 2.1360757z m479.75359134 185.33868423c0-45.58477229-7.68078446-86.07932043-21.31531244-112.48485596-4.6811883-9.40782431-10.225896-17.04315999-12.31652292-17.04316001-12.81645632 0-33.67728415 60.49185551-37.49495199 106.48566365-3.86311663 51.58396461-2.59056032 53.72004031 31.49575967 57.53770813 15.36156785 1.72703986 30.67768799 3.81766784 34.08631999 5.13567187 4.27215246 1.68159214 5.5447077-6.81726399 5.54470769-39.63102768z m-412.44447184 26.40553552c10.225896-15.36156785-1.68159214-98.44129212-18.72475213-133.34568379-5.5447077-10.68038062-12.3619717-20.45179199-14.90708323-21.36076018-6.81726399-2.49966383-21.36076017 27.26905599-28.99609691 59.26474801-3.40863201 14.9070843-6.36277937 45.58477229-6.36277937 68.62712459 0 37.90398782 0.81807168 41.72165566 7.63533567 39.58557891 3.86311663-1.2725563 18.77019985-3.40863201 32.81376368-5.09022308 14.08901262-1.72703986 26.81457136-5.13567185 28.54161229-7.68078446z m17.90668046 303.36824788c11.08941645-38.35847244 43.44869553-69.85423212 91.1695435-89.07891659 16.22508831-6.36277937 29.40513169-7.63533568 66.90008368-6.81726399 43.44869553 0.90896818 49.44788784 1.72703986 75.44438859 14.95253307 53.26555569 26.40553553 84.35227951 75.4443886 78.80757182 124.84682766-5.09022415 40.90358399-29.40513169 71.58127197-73.26286412 92.03306396-24.31490862 11.04396767-28.99609585 11.90748814-85.26124769 11.90748814-56.21970412 0-60.90089135-0.86352046-85.21579996-11.90748814-59.62833612-28.17802416-85.21579997-78.39853597-68.58167582-135.93624411z m328.50122712-87.7609115c-13.634528 7.68078446-18.72475213 17.04315999-19.1792357 34.08631998 0 21.31531245 20.90627661 45.99380813 39.22199184 45.99380707 24.67849567 0 41.31261983-14.9070843 41.72165567-37.49495199 0-34.90439167-34.08631999-58.35577981-61.76441181-42.58517506z m-388.12956324-0.45448462c-19.63372031 9.81686016-29.85961631 47.72084798-17.49764461 63.94593628 7.68078446 9.77141138 22.13338414 16.58867537 36.22239674 16.58867539 18.31571629 0 39.17654412-24.67849567 39.17654306-45.99380707 0-8.54430386-2.54511154-18.77019985-5.54470769-22.58786876a43.63048958 43.63048958 0 0 0-52.40203628-11.95293584z m298.23257603 63.94593628c-10.63493183-9.40782431-28.13257645-20.04275616-38.76750828-23.45138814-24.26945984-8.49885613-69.89967983-8.0898203-93.76010383 0-9.77141138 3.81766784-26.36008782 14.08901262-37.04046843 23.45138814-37.49495198 33.17735181-40.44909937 72.85382827-7.27174756 103.07703165 23.04235232 20.90627661 42.63062384 26.45098431 92.03306397 26.45098432 49.44788784 0 69.08160815-5.5447077 92.07851169-26.45098432 33.17735181-30.22320337 30.22320337-69.85423212-7.27174756-103.07703165zM484.18556289 557.64641147c-7.63533568-5.09022415-11.4984523-25.99649968-5.49925999-31.95024429 4.22670368-3.81766784 58.76481565-2.1360757 64.76400798 2.5451126 8.0898203 6.36277937 5.90829582 18.77019985-4.27215138 28.54161123-5.95374353 5.5447077-9.36237554 13.634528-9.36237661 24.31490862-0.45448462 15.77060369-0.90896818 16.17963953-17.49764355 16.17963952s-17.04315999-0.45448462-18.31571629-17.04315999c-0.86352046-10.63493183-4.6811883-18.77019985-9.81686016-22.58786769z" fill="#000000" p-id="1064"></path></svg>
\ No newline at end of file
diff --git a/core/frontend/src/assets/icons/ai/openai.svg b/core/frontend/src/assets/icons/ai/openai.svg
new file mode 100644
index 00000000..f0dd88d9
--- /dev/null
+++ b/core/frontend/src/assets/icons/ai/openai.svg
@@ -0,0 +1 @@
+<svg t="1751963240719" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1220" width="256" height="256"><path d="M0 0m256 0l512 0q256 0 256 256l0 512q0 256-256 256l-512 0q-256 0-256-256l0-512q0-256 256-256Z" fill="#03A4EE" p-id="1221"></path><path d="M843.776 494.762667a177.621333 177.621333 0 0 1 11.434667 109.397333c-3.882667 18.261333-10.666667 35.797333-20.053334 51.925333a175.530667 175.530667 0 0 1-117.12 85.034667 176.213333 176.213333 0 0 1-25.258666 49.664 175.445333 175.445333 0 0 1-39.296 39.338667 177.066667 177.066667 0 0 1-104.618667 33.877333c-12.416 0.085333-24.874667-1.28-37.077333-3.754667a178.048 178.048 0 0 1-67.541334-30.208 174.506667 174.506667 0 0 1-27.434666-25.088 177.664 177.664 0 0 1-109.568-11.434666 176.213333 176.213333 0 0 1-46.634667-30.378667 179.626667 179.626667 0 0 1-50.261333-77.354667 175.786667 175.786667 0 0 1 0.213333-109.866666 178.090667 178.090667 0 0 1-21.76-208A176.256 176.256 0 0 1 238.165333 312.746667a173.866667 173.866667 0 0 1 67.797334-29.866667 177.066667 177.066667 0 0 1 169.173333-122.88 174.933333 174.933333 0 0 1 104.661333 33.877333c10.069333 7.424 19.285333 15.786667 27.52 25.130667a178.090667 178.090667 0 0 1 156.032 41.813333c13.866667 12.458667 25.685333 27.050667 34.986667 43.264a176.810667 176.810667 0 0 1 23.04 70.357334 176.042667 176.042667 0 0 1-7.978667 73.642666c12.544 13.866667 22.741333 29.568 30.378667 46.677334z m-244.48 313.173333a131.584 131.584 0 0 0 71.424-71.424c6.570667-16 10.026667-33.194667 10.026667-50.517333v-163.584a7.338667 7.338667 0 0 1-0.128-0.512 1.92 1.92 0 0 0-0.213334-0.426667 1.365333 1.365333 0 0 0-0.384-0.384 1.237333 1.237333 0 0 0-0.426666-0.298667l-59.221334-34.133333v197.589333a23.04 23.04 0 0 1-11.52 19.968l-140.202666 80.896c-1.152 0.768-3.157333 1.792-4.181334 2.346667 5.802667 4.949333 12.117333 9.258667 18.730667 13.098667 6.656 3.797333 13.568 7.04 20.736 9.685333a132.309333 132.309333 0 0 0 95.36-2.261333z m-333.866667-111.061333a131.797333 131.797333 0 0 0 180.181334 48.256l141.738666-81.792 0.384-0.341334a0.896 0.896 0 0 0 0.213334-0.426666 1.792 1.792 0 0 0 0.213333-0.469334v-68.949333l-171.093333 98.986667a25.941333 25.941333 0 0 1-5.504 2.304 23.765333 23.765333 0 0 1-17.493334-2.346667L253.866667 611.114667a146.986667 146.986667 0 0 1-4.138667-2.517334 132.48 132.48 0 0 0 0.085333 45.653334 132.693333 132.693333 0 0 0 15.616 42.752v-0.128z m-36.821333-305.92a132.693333 132.693333 0 0 0-13.141333 100.138666 131.84 131.84 0 0 0 61.44 80.042667l141.653333 81.877333a7.082667 7.082667 0 0 0 0.512 0.128h0.512a0.896 0.896 0 0 0 0.512-0.128 1.92 1.92 0 0 0 0.426667-0.213333l59.434666-34.346667-171.093333-98.730666a23.594667 23.594667 0 0 1-10.709333-13.994667 20.053333 20.053333 0 0 1-0.725334-5.973333V333.141333a133.589333 133.589333 0 0 0-20.778666 9.685334 134.826667 134.826667 0 0 0-47.914667 48.128h-0.128z m486.613333 113.28a23.381333 23.381333 0 0 1 8.533334 8.405333 26.368 26.368 0 0 1 2.261333 5.589333c0.426667 2.005333 0.725333 3.968 0.682667 6.016v166.613334a131.413333 131.413333 0 0 0 59.264-43.818667 132.138667 132.138667 0 0 0 12.117333-141.013333 131.328 131.328 0 0 0-50.986667-53.162667l-141.653333-81.877333a7.466667 7.466667 0 0 0-0.554667-0.128h-0.512a6.656 6.656 0 0 1-0.512 0.128 1.792 1.792 0 0 0-0.426666 0.213333l-59.136 34.218667 171.093333 98.816h-0.170667z m59.050667-88.746667h-0.042667 0.085334z m-0.042667-0.128a131.925333 131.925333 0 0 0-195.84-136.618667l-141.738666 81.834667a1.322667 1.322667 0 0 0-0.341334 0.384l-0.298666 0.426667a6.954667 6.954667 0 0 0-0.213334 1.024v68.394666l171.093334-98.858666a26.368 26.368 0 0 1 5.546666-2.346667 23.552 23.552 0 0 1 17.493334 2.346667l140.16 81.024 4.138666 2.389333zM403.498667 339.669333a23.637333 23.637333 0 0 1 6.784-16.298666 20.906667 20.906667 0 0 1 4.736-3.584l140.202666-80.938667c1.322667-0.768 3.157333-1.834667 4.181334-2.346667-19.2-16.042667-42.666667-26.325333-67.541334-29.44A131.882667 131.882667 0 0 0 343.168 337.92v163.584a6.869333 6.869333 0 0 0 0.128 0.512 1.877333 1.877333 0 0 0 0.213333 0.426667 3.114667 3.114667 0 0 0 0.341334 0.426666 1.706667 1.706667 0 0 0 0.426666 0.341334l59.221334 34.133333V339.712z m32.128 216.192l76.245333 44.032 76.245333-44.032v-87.936l-76.16-44.032-76.245333 44.032-0.085333 87.936z" fill="#FFFFFF" p-id="1222"></path></svg>
\ No newline at end of file
diff --git a/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts b/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts
index 53a92098..15f3c751 100644
--- a/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts
+++ b/core/frontend/src/views/domain/pages/editDomain/controller/projectDetail.controller.ts
@@ -2,7 +2,6 @@ import { getEditDomainStoreData } from "../store";
import { instance } from "@/api";
import { instanceOptions } from "./companyProfile.controller"
import { KnowledgeBase } from "../dto";
-import { confirm } from "@/utils";
/**
* @description Get project detail
*/
diff --git a/core/frontend/src/views/settings/ai-model/components/AddProvider.vue b/core/frontend/src/views/settings/ai-model/components/AddProvider.vue
new file mode 100644
index 00000000..0deadc76
--- /dev/null
+++ b/core/frontend/src/views/settings/ai-model/components/AddProvider.vue
@@ -0,0 +1,63 @@
+<template>
+ <n-modal preset="card" v-model:show="show" :close-on-esc="false" :mask-closable="false" draggable class="w-150"
+ title="Add Provider">
+ <n-form :model="addProviderFormData" :rules="rules" ref="addProviderFormDataRef">
+ <n-form-item label="供应商标题" path="supplierTitle">
+ <n-input v-model:value="addProviderFormData.supplierTitle"></n-input>
+ </n-form-item>
+ <n-form-item label="供应商名称" path="supplierName">
+ <n-input v-model:value="addProviderFormData.supplierName"></n-input>
+ </n-form-item>
+ <n-form-item label="接口地址" path="baseUrl">
+ <n-input v-model:value="addProviderFormData.baseUrl"></n-input>
+ </n-form-item>
+ <n-form-item label="密钥" path="apiKey">
+ <n-input v-model:value="addProviderFormData.apiKey"></n-input>
+ </n-form-item>
+ </n-form>
+ <template #footer>
+ <div class="flex justify-end gap-5">
+ <n-button>Cancel</n-button>
+ <n-button type="primary" @click="confirmAddProvider(store)">Confirm</n-button>
+ </div>
+ </template>
+ </n-modal>
+</template>
+
+<script setup lang="ts">
+ import { confirmAddProvider } from "../controller"
+ import { ModelStore } from '../dto';
+ const store = inject<ModelStore>("modelStore")!
+ const { addProviderFormData, addProviderFormDataRef } = store
+ const show = ref(false)
+ const rules = {
+ supplierTitle: [{ required: true, message: "supplierTitle is required", trigger: "blur" }],
+ supplierName: [{ required: true, message: "supplierName is required", trigger: "blur" }],
+ baseUrl: [{ required: true, message: "baseUrl is required", trigger: "blur" }],
+ apiKey: [{ required: true, message: "apiKey is required", trigger: "blur" }],
+ }
+
+
+
+
+ /**
+ * @description Open modal
+ */
+ function open() {
+ show.value = true
+ }
+
+ /**
+ * @description Close modal
+ */
+ function close() {
+ show.value = false
+ }
+
+ defineExpose({
+ open,
+ close
+ })
+</script>
+
+<style scoped></style>
\ No newline at end of file
diff --git a/core/frontend/src/views/settings/ai-model/components/ModelManager.vue b/core/frontend/src/views/settings/ai-model/components/ModelManager.vue
new file mode 100644
index 00000000..f5ee080d
--- /dev/null
+++ b/core/frontend/src/views/settings/ai-model/components/ModelManager.vue
@@ -0,0 +1,301 @@
+<template>
+ <n-modal preset="card" draggable :close-on-esc="false" :mask-closable="false" title="Model manager"
+ class="w-180 customer-modal" segmented v-model:show="show">
+ <div class="manager-wrapper">
+ <!-- Provider list -->
+ <div class="left-provider">
+ <div class="provider-list">
+ <div :class="['provider-item', { active: item.supplierName == currentProvider?.supplierName }]"
+ v-for="item in providerList" :key="item.supplierName"
+ @click="getModelListBySupplier(item)">
+ <i class="i-ai:deep-seek w-8 h-8"></i>
+ <span class="tit">{{ item.supplierTitle }}</span>
+ </div>
+ </div>
+ <div class="add-privider">
+ <n-button @click="handleAddProvider">
+ <template #icon>
+ <i class="i-ic:baseline-add-circle"></i>
+ </template>
+ Add model service provider
+ </n-button>
+ </div>
+ </div>
+
+ <!-- Configuration -->
+ <n-spin :show="configurationLoading">
+ <div class="right-configuration">
+ <div class="top-switch">
+ <div class="switch-info">
+ <i class="i-ic:baseline-error text-5"></i>
+ <span class="tit">DeepSeek</span>
+ </div>
+ <n-switch></n-switch>
+ </div>
+ <div class="center-api">
+ <n-form class="mt-15px">
+ <n-form-item label="API密钥">
+ <div class="w-100%">
+ <n-input-group>
+ <n-input v-model:value="currentProvider.apiKey"></n-input>
+ <n-button>检查</n-button>
+ </n-input-group>
+ <n-button text type="info" class="mt-5px">点击获取密钥</n-button>
+ </div>
+ </n-form-item>
+ <n-form-item label="API地址">
+ <div class="w-100%">
+ <n-input v-model:value="currentProvider.baseUrl"></n-input>
+ <span class="text-[var(--color-text-3)] mt-5">示例: https://api.deepseek.com/v1</span>
+ </div>
+ </n-form-item>
+ </n-form>
+ <n-button type="primary">保存API</n-button>
+ </div>
+ <div class="bottom-model-list">
+ <div class="header-tit">
+ <div>
+ <span class="tit">模型</span>
+ <span class="sub-tit">默认从/models获取所有模型</span>
+ </div>
+ <div class="add-model">
+ <i class="i-ic:baseline-control-point text-4"></i>
+ <span class="tit">新建模型</span>
+ </div>
+ </div>
+ <!-- <n-scrollbar style="height: 100px;">
+ <div class="model-list">
+ <div class="model-item">
+ <i class="i-ic:round-check-circle-outline text-5"></i>
+ <span class="model-name">DeepSeek/deepseek-reasoner</span>
+ </div>
+ </div>
+ </n-scrollbar> -->
+ <n-select :options="modelList" label-field="title" value-field="title"
+ v-model:value="modelName"></n-select>
+ </div>
+ </div>
+ </n-spin>
+ </div>
+ <template #footer>
+ <div class="flex justify-end gap-5">
+ <n-button>Cancel</n-button>
+ <n-button type="primary">Create</n-button>
+ </div>
+ </template>
+ </n-modal>
+
+ <!-- Add Provider -->
+ <AddProvider ref="addProviderRef" />
+
+</template>
+
+<script setup lang="ts">
+ import AddProvider from './AddProvider.vue';
+ import { ModelStore, Provider } from '../dto';
+ import { getModelList, getProviderList } from "../controller"
+ const modelStore = inject<ModelStore>("modelStore")!
+ const {
+ providerList,
+ modelList,
+ modelName,
+ currentProvider,
+ configurationLoading,
+ addProviderRef
+ } = modelStore
+ const show = ref(false)
+ /**
+ * @description open modal
+ */
+ function open() {
+ /**
+ * @description Get provider list
+ */
+ getProviderList(modelStore)
+ show.value = true
+ }
+
+ /**
+ * @description close modal
+ */
+ function close() {
+ show.value = false
+ }
+ defineExpose({
+ open,
+ close
+ })
+
+ /**
+ * @description Get model list
+ */
+ function getModelListBySupplier(provider: Provider) {
+ currentProvider.value = provider
+ getModelList(provider.supplierName, modelStore)
+ }
+
+ /**
+ * @description Handle add provider
+ */
+ function handleAddProvider() {
+ addProviderRef.value.open()
+ }
+
+</script>
+
+<style scoped lang="scss">
+ @use "@/styles/index.scss" as base;
+
+ .manager-wrapper {
+ height: 480px;
+ display: grid;
+ grid-template-columns: 230px 1fr;
+ border-top: 1px solid var(--color-border-2);
+ border-bottom: 1px solid var(--color-border-2);
+
+ .left-provider {
+ height: 100%;
+ display: grid;
+ grid-template-rows: 1fr 60px;
+ border-right: 1px solid var(--color-border-2);
+
+ .provider-list {
+ @include base.col-flex;
+ gap: 0;
+
+ .provider-item {
+ height: 50px;
+ width: 100%;
+ box-sizing: border-box;
+ padding-left: 10px;
+ border-bottom: 1px solid var(--color-border-1);
+ @include base.row-flex-start;
+ gap: 5px;
+ align-items: center;
+ transition: .15s all ease-in-out;
+ cursor: pointer;
+
+ .tit {
+ font-size: 14px;
+ font-weight: bold;
+ }
+
+ &:hover {
+ background: #eef9ee;
+ }
+
+ &.active {
+ background: #eef9ee;
+ }
+ }
+
+ }
+
+ .add-privider {
+ @include base.row-flex-center;
+
+ }
+ }
+
+ .right-configuration {
+ padding: 0 15px 15px;
+
+ .top-switch {
+ height: 50px;
+ @include base.row-flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1px solid var(--color-border-2);
+
+ .switch-info {
+ @include base.row-flex-start;
+ align-items: center;
+ gap: 5px;
+
+ .tit {
+ font-size: 14px;
+ font-weight: bold;
+ }
+ }
+ }
+
+ .center-api {
+ padding-bottom: 15px;
+ border-bottom: 1px solid var(--color-border-2);
+ }
+
+ .bottom-model-list {
+ margin-top: 15px;
+
+ .header-tit {
+ @include base.row-flex;
+ justify-content: space-between;
+ margin-bottom: 15px;
+
+ .tit {
+ font-weight: bold;
+ font-size: 14px;
+ margin-right: 5px;
+ }
+
+ .sub-tit {
+ color: var(--color-text-3);
+ }
+
+ .add-model {
+ @include base.row-flex-start;
+ gap: 5px;
+ align-items: center;
+ cursor: pointer;
+
+ .tit {
+ font-size: 14px;
+ }
+ }
+ }
+
+ .model-list {
+ @include base.col-flex;
+ justify-content: flex-start;
+
+
+ .model-item {
+ @include base.row-flex-start;
+ width: 100%;
+ align-items: center;
+ gap: 5px;
+ padding: 10px 5px;
+ transition: .15s all ease-in-out;
+ cursor: pointer;
+
+ i.active {
+ color: var(--color-primary-1);
+ }
+
+ .model-name {
+ font-weight: bold;
+ font-size: 14px;
+ }
+
+ &:hover {
+ background: #eef9ee;
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+
+
+
+</style>
+
+<style>
+ .customer-modal {
+ .n-card__content {
+ padding: 0 !important;
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/core/frontend/src/views/settings/ai-model/controller/index.ts b/core/frontend/src/views/settings/ai-model/controller/index.ts
new file mode 100644
index 00000000..c06605db
--- /dev/null
+++ b/core/frontend/src/views/settings/ai-model/controller/index.ts
@@ -0,0 +1,57 @@
+import { instance } from "@/api"
+import { Model, ModelStore, Provider } from "../dto"
+export const instanceOptions = {
+ fetchOptions: {
+ loading: 'Loading... Please wait.',
+ successMessage: true,
+ }
+}
+
+
+/**
+ * @description Get provider list
+ */
+export async function getProviderList(modelStore: ModelStore) {
+ const { providerList, currentProvider } = modelStore
+ try {
+ const res = await instance.post("/askai/supplier/list") as Provider[];
+ providerList.value = res
+ if (res.length) {
+ currentProvider.value = res[0]
+ }
+ } catch (error) {
+ console.warn(error)
+ }
+}
+
+/**
+ * @description Get model list
+ */
+export async function getModelList(supplierName: string, modelStore: ModelStore) {
+ const { modelList, modelName, configurationLoading } = modelStore
+ try {
+ configurationLoading.value = true
+ const res = await instance.post("/askai/supplier/models", { supplierName }) as Model[]
+ modelList.value = res
+ modelName.value = res[0] ? res[0].title : ""
+ } catch (error) {
+ console.warn(error)
+ } finally {
+ configurationLoading.value = false
+ }
+}
+
+/***
+ * @description Confirm add provider
+ */
+export async function confirmAddProvider(modelStore: ModelStore) {
+ const { addProviderFormData, addProviderFormDataRef, addProviderRef } = modelStore
+ try {
+ await addProviderFormDataRef.value?.validate()
+ await instance.post("/askai/supplier/add_supplier", addProviderFormData.value, instanceOptions)
+ addProviderRef.value.close()
+ await getProviderList(modelStore)
+ } catch (error) {
+ console.warn(error)
+ }
+}
\ No newline at end of file
diff --git a/core/frontend/src/views/settings/ai-model/dto/index.ts b/core/frontend/src/views/settings/ai-model/dto/index.ts
new file mode 100644
index 00000000..2c37f216
--- /dev/null
+++ b/core/frontend/src/views/settings/ai-model/dto/index.ts
@@ -0,0 +1,38 @@
+import { FormInst } from "naive-ui"
+
+export type Provider = {
+ supplierTitle: string
+ supplierName: string
+ baseUrl: string
+ baseUrlExample: string
+ isUseUrlExample: boolean
+ apiKey: string
+ home: string
+ help: string
+ status: boolean
+}
+
+export type Model = {
+ supplierName: string
+ modelName: string
+ capability: string[]
+ title: string
+}
+
+export type AddProviderFormData = {
+ supplierTitle: string
+ supplierName: string
+ baseUrl: string
+ apiKey: string
+}
+
+export type ModelStore = {
+ providerList: Ref<Provider[]>
+ modelList: Ref<Model[]>
+ modelName: Ref<string>
+ currentProvider: Ref<Provider>
+ configurationLoading: Ref<boolean>
+ addProviderFormData: Ref<AddProviderFormData>,
+ addProviderFormDataRef: Ref<FormInst | null | undefined>
+ addProviderRef: Ref<any>
+}
\ No newline at end of file
diff --git a/core/frontend/src/views/settings/ai-model/index.vue b/core/frontend/src/views/settings/ai-model/index.vue
index 2cba6bba..38c24929 100644
--- a/core/frontend/src/views/settings/ai-model/index.vue
+++ b/core/frontend/src/views/settings/ai-model/index.vue
@@ -11,9 +11,9 @@
</span>
</div>
<div class="right-tit">
- <n-button type="primary">
+ <n-button type="primary" @click="openModelManager">
<template #icon>
- <i class="i-ai:test w-5 h-5"></i>
+ <i class="i-ic:baseline-add-circle"></i>
</template>
Add model
</n-button>
@@ -23,23 +23,96 @@
<n-card>
<div class="model-item">
- <div>
-
- <span>Deep Seek</span>
- <span></span>
+ <div class="item-header">
+ <div class="header-left">
+ <i class="i-ai:deep-seek w-10 h-10"></i>
+ <span class="model-tit">DeepSeek</span>
+ </div>
+ <div class="header-right">
+ <div class="remove-model">
+ <i class="i-material-symbols:close-rounded text-5"></i>
+ </div>
+ </div>
+ </div>
+ <n-divider style="margin: 10px 0;"></n-divider>
+ <div class="item-desc">
+ <div class="desc">
+ <span class="label">调用次数:</span>
+ <span>20次</span>
+ </div>
+ <div class="desc">
+ <span class="label">Token使用量:</span>
+ <span>2018</span>
+ </div>
</div>
</div>
</n-card>
</div>
+
+ <!-- Model maneger modal -->
+ <ModelManager ref="modelManagerRef" />
</template>
-<script setup lang="ts">
+<script setup lang="tsx">
+ import ModelManager from './components/ModelManager.vue';
+ import { ModelStore } from './dto';
+ import { useModelManagerStore } from './store/index,';
+ const modelManagerStore = useModelManagerStore()
+ provide<ModelStore>("modelStore", modelManagerStore)
+ const modelManagerRef = ref()
+ /**
+ * @description Open model manager modal
+ */
+ function openModelManager() {
+ modelManagerRef.value.open()
+ }
</script>
<style scoped lang="scss">
+ @use "@/styles/index.scss" as base;
@use "@/views/domain/pages/editDomain/components/mixin.scss";
+
.page-tit {
@include mixin.page-tit;
}
+
+ .model-item {
+ .item-header {
+ @include base.row-flex;
+ justify-content: space-between;
+
+ .header-left {
+ @include base.row-flex-start;
+ gap: 10px;
+
+ .model-tit {
+ font-size: 16px;
+ font-weight: bold;
+ }
+ }
+
+ .header-right {
+ .remove-model {
+ padding: 5px;
+ cursor: pointer;
+ @include base.row-flex-center;
+ transition: .15s all ease-in-out;
+
+ &:hover {
+ background: var(--color-bg-4)
+ }
+ }
+ }
+ }
+
+ .item-desc {
+ @include base.row-flex-start;
+ gap: 15px;
+
+ .label {
+ font-weight: bold;
+ }
+ }
+ }
</style>
\ No newline at end of file
diff --git a/core/frontend/src/views/settings/ai-model/store/index,.ts b/core/frontend/src/views/settings/ai-model/store/index,.ts
new file mode 100644
index 00000000..a9e4261f
--- /dev/null
+++ b/core/frontend/src/views/settings/ai-model/store/index,.ts
@@ -0,0 +1,40 @@
+import { FormInst } from "naive-ui";
+import { AddProviderFormData, Model, ModelStore, Provider } from "../dto";
+
+export function useModelManagerStore(): ModelStore {
+ const providerList = ref<Provider[]>([])
+ const modelList = ref<Model[]>([])
+ const modelName = ref("")
+ const addProviderRef = ref<any>()
+ const currentProvider = ref<Provider>({
+ supplierTitle: "",
+ supplierName: "",
+ baseUrl: "",
+ baseUrlExample: "",
+ isUseUrlExample: false,
+ apiKey: "",
+ home: "",
+ help: "",
+ status: false,
+ })
+ const configurationLoading = ref(false)
+ const addProviderFormData = ref<AddProviderFormData>({
+ supplierTitle: "",
+ supplierName: "",
+ baseUrl: "",
+ apiKey: ""
+ })
+ const addProviderFormDataRef = ref<FormInst | null | undefined>()
+
+
+ return {
+ providerList,
+ modelList,
+ modelName,
+ addProviderRef,
+ currentProvider,
+ configurationLoading,
+ addProviderFormData,
+ addProviderFormDataRef
+ }
+}
\ No newline at end of file
diff --git a/core/frontend/types/components.d.ts b/core/frontend/types/components.d.ts
index 78615437..f8c6098e 100644
--- a/core/frontend/types/components.d.ts
+++ b/core/frontend/types/components.d.ts
@@ -35,6 +35,7 @@ declare module 'vue' {
NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
NButton: typeof import('naive-ui')['NButton']
+ NButtton: typeof import('naive-ui')['NButtton']
NCard: typeof import('naive-ui')['NCard']
NCollapse: typeof import('naive-ui')['NCollapse']
NCollapseItem: typeof import('naive-ui')['NCollapseItem']