diff --git a/api/src/main/java/com/theokanning/openai/completion/chat/ChatFunction.java b/api/src/main/java/com/theokanning/openai/completion/chat/ChatFunction.java index 7d72829a..67162edf 100644 --- a/api/src/main/java/com/theokanning/openai/completion/chat/ChatFunction.java +++ b/api/src/main/java/com/theokanning/openai/completion/chat/ChatFunction.java @@ -3,11 +3,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.NonNull; import java.util.function.Function; @Data +@NoArgsConstructor public class ChatFunction { @NonNull @@ -46,7 +48,8 @@ public Builder executor(Class requestClass, Function executor) } public ChatFunction build() { - ChatFunction chatFunction = new ChatFunction(name); + ChatFunction chatFunction = new ChatFunction(); + chatFunction.setName(name); chatFunction.setDescription(description); chatFunction.setParametersClass(parameters); chatFunction.setExecutor(executor);