mirror of
https://gitee.com/agents-flex/agents-flex.git
synced 2024-11-29 18:38:17 +08:00
refactor: refactor BaseLlmClientListener.java
This commit is contained in:
parent
50d6d7bea8
commit
074d1f03ec
@ -79,9 +79,8 @@ public class BaseLlmClientListener implements LlmClientListener {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
JSONObject jsonObject = JSON.parseObject(response);
|
||||
|
||||
|
||||
if (isFunctionCalling) {
|
||||
FunctionMessage functionMessage = functionMessageParser.parse(jsonObject);
|
||||
List<Function> functions = ((FunctionPrompt) prompt).getFunctions();
|
||||
@ -96,6 +95,9 @@ public class BaseLlmClientListener implements LlmClientListener {
|
||||
//noinspection unchecked
|
||||
streamResponseListener.onMessage(context, aiMessageResponse);
|
||||
}
|
||||
} catch (Exception err) {
|
||||
streamResponseListener.onFailure(context, err);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user