优化
This commit is contained in:
@@ -25,6 +25,7 @@ export function getAgentList() {
|
||||
* @param {number} options.agentId - 智能体ID
|
||||
* @param {string} options.content - 用户输入内容
|
||||
* @param {string} [options.conversationId] - 会话ID(可选,首次对话不传)
|
||||
* @param {string} [options.modelMode] - 模型模式:pro-深度版 standard-标准版
|
||||
* @param {AbortController} [options.ctrl] - 取消控制器
|
||||
* @param {Function} options.onMessage - 消息回调
|
||||
* @param {Function} [options.onError] - 错误回调
|
||||
@@ -35,6 +36,7 @@ export async function sendChatStream(options) {
|
||||
agentId,
|
||||
content,
|
||||
conversationId,
|
||||
modelMode = 'pro',
|
||||
ctrl,
|
||||
onMessage,
|
||||
onError,
|
||||
@@ -54,7 +56,8 @@ export async function sendChatStream(options) {
|
||||
body: JSON.stringify({
|
||||
agentId,
|
||||
content,
|
||||
conversationId
|
||||
conversationId,
|
||||
modelMode
|
||||
}),
|
||||
onmessage: (event) => {
|
||||
if (typeof onMessage === 'function') {
|
||||
|
||||
@@ -207,6 +207,7 @@ const handleSend = async () => {
|
||||
agentId: props.agent?.id,
|
||||
content: question,
|
||||
conversationId: conversationId.value,
|
||||
modelMode: modelMode.value,
|
||||
ctrl: abortController.value,
|
||||
onMessage: (result) => {
|
||||
if (result.event === 'message' && result.content) {
|
||||
|
||||
Reference in New Issue
Block a user