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

io.github.sashirestela.openai.common.tool.ToolChoice Maven / Gradle / Ivy

There is a newer version: 3.8.1
Show newest version
package io.github.sashirestela.openai.common.tool;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.github.sashirestela.slimvalidator.constraints.Required;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor
@Getter
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ToolChoice {

    @Required
    private ToolType type;

    @Required
    private FunctionName function;

    public static ToolChoice function(String name) {
        return new ToolChoice(ToolType.FUNCTION, new FunctionName(name));
    }

    @AllArgsConstructor
    @NoArgsConstructor
    @Getter
    @ToString
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class FunctionName {

        @Required
        private String name;

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy