From 16ac274254325e7e393c3259dea0dce766740c53 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 21 Aug 2025 21:16:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0iOS=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/chat_api/ChatApiService.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/local_plugins/chat_api/ios/chat_api/Sources/chat_api/ChatApiService.swift b/local_plugins/chat_api/ios/chat_api/Sources/chat_api/ChatApiService.swift index 524feda90..8c6a37f0f 100644 --- a/local_plugins/chat_api/ios/chat_api/Sources/chat_api/ChatApiService.swift +++ b/local_plugins/chat_api/ios/chat_api/Sources/chat_api/ChatApiService.swift @@ -524,14 +524,16 @@ getSessionCallback(sessionId)?.onFunctionCall(sessionId, jsonFunctionCall) functionCall, result ) - - // 将结果发送回OpenAI继续对话 - await self.sendFunctionCallResultInternal( - sessionId: sessionId, - messages: self.currentMessages, - functionCall: functionCall, - functionResult: self.jsonToString(result) ?? "{}" - ) + if (firstToolCall.name != "set_user_profile_field"){ + // 将结果发送回OpenAI继续对话 + await self.sendFunctionCallResultInternal( + sessionId: sessionId, + messages: self.currentMessages, + functionCall: functionCall, + functionResult: self.jsonToString(result) ?? "{}" + ) + } + } } } catch {