feat(harness): add chat application use case
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.superbiz.agent.harness.application;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public record SystemChatContent(@JsonProperty("answer") String answer)
|
||||
implements ChatApplicationContent {
|
||||
|
||||
public SystemChatContent {
|
||||
requireText(answer, "answer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatContentType contentType() {
|
||||
return ChatContentType.SYSTEM_CHAT;
|
||||
}
|
||||
|
||||
private static void requireText(String value, String name) {
|
||||
if (value == null || value.isBlank()) {
|
||||
throw new IllegalArgumentException(name + " must not be blank");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user