From 386f57e1fa5db279d40e1d611ba61a91aeb5fb1c Mon Sep 17 00:00:00 2001 From: grog Date: Wed, 15 Nov 2023 18:00:47 -0800 Subject: [PATCH] gpt3 prefix --- src/main/java/org/myrobotlab/service/Gpt3.java | 6 +++++- src/main/java/org/myrobotlab/service/config/Gpt3Config.java | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/myrobotlab/service/Gpt3.java b/src/main/java/org/myrobotlab/service/Gpt3.java index 67ed717639..82d9ad90d2 100644 --- a/src/main/java/org/myrobotlab/service/Gpt3.java +++ b/src/main/java/org/myrobotlab/service/Gpt3.java @@ -61,7 +61,7 @@ public class Gpt3 extends Service implements TextListener, TextPubli private String currentChannelName; private String currentChannelType; - + public Gpt3(String n, String id) { super(n, id); } @@ -85,6 +85,10 @@ public Response getResponse(String text) { sleep(); responseText = "Ok, I will go to sleep"; } + + if (c.prefix != null) { + text = c.prefix + " " + text; + } if (!c.sleeping) { diff --git a/src/main/java/org/myrobotlab/service/config/Gpt3Config.java b/src/main/java/org/myrobotlab/service/config/Gpt3Config.java index 62a6627a1d..48f3612f17 100644 --- a/src/main/java/org/myrobotlab/service/config/Gpt3Config.java +++ b/src/main/java/org/myrobotlab/service/config/Gpt3Config.java @@ -18,6 +18,11 @@ public class Gpt3Config extends ServiceConfig { public String engine = "gpt-3.5-turbo"; // "text-davinci-003" public String wakeWord = "wake"; public String sleepWord = "sleep"; + /** + * static prefix to send to gpt3 + * e.g. " talk like a pirate when responding, " + */ + public String prefix = null; @Override public Plan getDefault(Plan plan, String name) {