23 lines
613 B
Java
23 lines
613 B
Java
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");
|
|
}
|
|
}
|
|
}
|