com.launchableinc.openai.completion.chat.ChatFunctionParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
Basic java objects for the OpenAI GPT APIs
package com.launchableinc.openai.completion.chat;
import lombok.Data;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Data
public class ChatFunctionParameters {
private final String type = "object";
private final HashMap properties = new HashMap<>();
private List required;
public void addProperty(ChatFunctionProperty property) {
properties.put(property.getName(), property);
if (Boolean.TRUE.equals(property.getRequired())) {
if (this.required == null) {
this.required = new ArrayList<>();
}
this.required.add(property.getName());
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy