Skip to content

Commit

Permalink
Merge pull request #1350 from MyRobotLab/gpt3-fix
Browse files Browse the repository at this point in the history
removed inconsistent publishing from Gpt3
  • Loading branch information
kwatters authored Oct 12, 2023
2 parents d911a82 + 74337a1 commit 5ed741a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/myrobotlab/service/Gpt3.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ public Response getResponse(String text) {
@SuppressWarnings({ "unchecked", "rawtypes" })
Map<String, Object> 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<String, Object> content = (Map)textObject.get("message");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5ed741a

Please sign in to comment.