All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.launchableinc.openai.completion.chat.ChatFunctionParameters Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
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