Skip to content

Commit

Permalink
reformat and re-arrange all code
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterjackson committed Sep 28, 2023
1 parent 6efb5f7 commit 854f365
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/meta/chatbridge/ServicesRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

public class ServicesRunner implements AutoCloseable {
private final Javalin app = Javalin.create();
private final Set<Service<?>> services = new HashSet<>();
private boolean started = false;
private int port = 8080;

private final Set<Service<?>> services = new HashSet<>();

private ServicesRunner() {}

public static ServicesRunner newInstance() {
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/meta/chatbridge/message/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

public interface Message {

static Identifier threadId(Identifier id1, Identifier id2) {
if (id1.compareTo(id2) <= 0) {
return Identifier.from(id1.toString() + '|' + id2);
}
return Identifier.from(id2.toString() + '|' + id1);
}

Instant timestamp();

Identifier instanceId();
Expand All @@ -25,20 +32,13 @@ public interface Message {

Role role();

default Identifier threadId() {
return threadId(senderId(), recipientId());
}

enum Role {
ASSISTANT,
USER,
SYSTEM
}

static Identifier threadId(Identifier id1, Identifier id2) {
if (id1.compareTo(id2) <= 0) {
return Identifier.from(id1.toString() + '|' + id2);
}
return Identifier.from(id2.toString() + '|' + id1);
}

default Identifier threadId() {
return threadId(senderId(), recipientId());
}
}

0 comments on commit 854f365

Please sign in to comment.