From 36ff3e9eb063d1b83440afae63b1028102339083 Mon Sep 17 00:00:00 2001
From: Song367 <601337784@qq.com>
Date: Thu, 19 Jun 2025 16:25:45 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9E=81=E5=85=89=E5=A4=A7?=
=?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=B0=83=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
simple.html | 59 ++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 45 insertions(+), 14 deletions(-)
diff --git a/simple.html b/simple.html
index 8408574..678e4cf 100644
--- a/simple.html
+++ b/simple.html
@@ -163,6 +163,10 @@
+
会话ID
@@ -180,7 +184,7 @@
}
let conversationL = ""
const sex_audio = {
- "male": "gongzheng-v2",
+ "male": "gongzheng-v4",
"female": "presenter_female"
}
const audio = document.getElementById('audio')
@@ -300,20 +304,47 @@
if (trigger_status) {
try {
trigger_status = false;
- const response = await fetch('http://14.103.170.252:6211/chat', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- query: data,
- response_mode: 'streaming',
- user: 'SYS002',
- conversation_id: conversationL,
- audio: audio.value
- })
- });
+
+ let plu = document.getElementById('answer_type')
+ api_data = {}
+ if (plu.value=="jiguang"){
+ api_data = {
+ "model": "bot-20250522162100-44785",
+ "llm_type": "ours",
+ "conversation_id": conversationL,
+ "audio": audio.value,
+ "stream": true,
+ "stream_options": {"include_usage": true},
+ "messages": [
+ {
+ "role": "system",
+ "content": "你是一个知识渊博的马克思主义研究者,能够深入且清晰地阐述马克思主义相关的理论、思想等内容,以通俗易懂的语言向用户讲解,还能结合实际案例来加深用户对马克思主义的理解。"
+ },
+ {
+ "role": "user",
+ "content": data
+ }
+ ]
+ }
+
+ } else{
+ api_data = {
+ query: data,
+ response_mode: 'streaming',
+ user: 'SYS002',
+ conversation_id: conversationL,
+ audio: audio.value
+ }
+
+ }
+ const response = await fetch('http://14.103.170.252:6211/chat', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(api_data)
+ });
const reader = response.body.getReader();
const decoder = new TextDecoder();
let pre_talk = '';