diff --git a/src/main/java/org/myrobotlab/service/Gpt3.java b/src/main/java/org/myrobotlab/service/Gpt3.java index 19da929f49..67ed717639 100644 --- a/src/main/java/org/myrobotlab/service/Gpt3.java +++ b/src/main/java/org/myrobotlab/service/Gpt3.java @@ -119,10 +119,7 @@ public Response getResponse(String text) { @SuppressWarnings({ "unchecked", "rawtypes" }) Map textObject = (Map) choices.get(0); responseText = (String) textObject.get("text"); - if (responseText != null) { - // /completions - invoke("publishText", responseText); - } else { + if (responseText == null) { // /chat/completions @SuppressWarnings({ "unchecked", "rawtypes" }) Map content = (Map)textObject.get("message"); @@ -156,6 +153,7 @@ public Response getResponse(String text) { if (responseText != null && responseText.length() > 0) { invoke("publishUtterance", utterance); invoke("publishResponse", response); + invoke("publishText", responseText); } return response;