Skip to content

Commit

Permalink
gpt3 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed Nov 16, 2023
1 parent 10eb2f5 commit 386f57e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/myrobotlab/service/Gpt3.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class Gpt3 extends Service<Gpt3Config> implements TextListener, TextPubli
private String currentChannelName;

private String currentChannelType;

public Gpt3(String n, String id) {
super(n, id);
}
Expand All @@ -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) {

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/myrobotlab/service/config/Gpt3Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 386f57e

Please sign in to comment.