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 = '';