From 2d1f980a47e9aa9e736a5677339f1b3180e71cea Mon Sep 17 00:00:00 2001 From: van Date: Sun, 5 Apr 2026 21:35:50 +0800 Subject: [PATCH] 1 --- src/api/jarvis/socialMediaPrompt.js | 9 ++++ .../system/social-media/prompt-config.vue | 43 +++++++++++++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/api/jarvis/socialMediaPrompt.js b/src/api/jarvis/socialMediaPrompt.js index e6e61cf..2446c57 100644 --- a/src/api/jarvis/socialMediaPrompt.js +++ b/src/api/jarvis/socialMediaPrompt.js @@ -91,3 +91,12 @@ export function resetAllLlmConfig() { method: 'delete' }) } + +/** 连通测试:可选 profileId、message,不传 profileId 则用 Jarvis 当前激活/默认 */ +export function testLlmProfile(data) { + return request({ + url: '/jarvis/social-media/llm-config/test', + method: 'post', + data: data || {} + }) +} diff --git a/src/views/system/social-media/prompt-config.vue b/src/views/system/social-media/prompt-config.vue index 4a4eb3b..d9cd8ad 100644 --- a/src/views/system/social-media/prompt-config.vue +++ b/src/views/system/social-media/prompt-config.vue @@ -116,6 +116,7 @@
新增配置 + 测试当前激活 刷新
@@ -175,9 +176,10 @@ - + @@ -234,6 +236,35 @@ 保 存 + + +

+ 将使用配置「{{ llmTestRow.name }}」的参数请求(与是否已激活无关)。 +

+

+ 未指定某一套配置:将使用 Jarvis 当前已激活的一套;若未激活则使用 Jarvis application.yml 默认 Ollama。 +

+ + + + + +
+ +
{{ llmTestResult.reply }}
+
+ +
+ +
@@ -251,7 +282,8 @@ import { deleteLlmProfile, setActiveLlmProfile, clearActiveLlmProfile, - resetAllLlmConfig + resetAllLlmConfig, + testLlmProfile } from '@/api/jarvis/socialMediaPrompt' export default { @@ -277,7 +309,12 @@ export default { llmHasApiKey: false, llmApiKeyMasked: null, llmClearApiKey: false, - llmSaving: false + llmSaving: false, + llmTestDialogVisible: false, + llmTestRow: null, + llmTestMessage: '1+1等于几?请只回答一个数字或最简结果,不要多余解释。', + llmTestLoading: false, + llmTestResult: null } }, computed: {