FunctionSchema

class FunctionSchema


Defines the schema of parameters or responses for a tool.

Summary

Public constructors

FunctionSchema(
    @FunctionType type: Int,
    description: String?,
    properties: Map<String, FunctionSchema>?,
    required: List<String>?,
    enum: List<String>?,
    format: String?,
    nullable: Boolean?,
    items: FunctionSchema?,
    minItems: Long?,
    maxItems: Long?,
    minimum: Double?,
    maximum: Double?,
    minLength: Long?,
    maxLength: Long?,
    pattern: String?,
    anyOf: List<FunctionSchema>?,
    title: String?,
    minProperties: Long?,
    maxProperties: Long?
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

List<FunctionSchema>?

optional list of subschemas that the value must validate against at least one of

String?

optional human-readable description of the schema used by the model

List<String>?

optional list of allowed values for FunctionType.STRING or numeric types

String?

optional format of the data type (e.g., "float", "double", "int32", "int64")

FunctionSchema?

optional schema of items in an array for FunctionType.ARRAY type

Long?

optional maximum number of items for FunctionType.ARRAY type

Long?

optional maximum length for FunctionType.STRING type

Long?

optional maximum number of properties for FunctionType.OBJECT type

Double?

optional maximum value for numeric types

Long?

optional minimum number of items for FunctionType.ARRAY type

Long?

optional minimum length for FunctionType.STRING type

Long?

optional minimum number of properties for FunctionType.OBJECT type

Double?

optional minimum value for numeric types

Boolean?

optional boolean indicating whether the value may be null

String?

optional regex pattern that string values must match

Map<String, FunctionSchema>?

optional map of property names to their respective FunctionSchema definitions for FunctionType.OBJECT type

List<String>?

optional list of property names that must be present for FunctionType.OBJECT type

String?

optional title for the schema

Int

the data type of the schema, must be one of the constants defined in FunctionType

Public constructors

FunctionSchema

FunctionSchema(
    @FunctionType type: Int,
    description: String? = null,
    properties: Map<String, FunctionSchema>? = null,
    required: List<String>? = null,
    enum: List<String>? = null,
    format: String? = null,
    nullable: Boolean? = null,
    items: FunctionSchema? = null,
    minItems: Long? = null,
    maxItems: Long? = null,
    minimum: Double? = null,
    maximum: Double? = null,
    minLength: Long? = null,
    maxLength: Long? = null,
    pattern: String? = null,
    anyOf: List<FunctionSchema>? = null,
    title: String? = null,
    minProperties: Long? = null,
    maxProperties: Long? = null
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

anyOf

val anyOf: List<FunctionSchema>?

optional list of subschemas that the value must validate against at least one of

description

val description: String?

optional human-readable description of the schema used by the model

enum

val enum: List<String>?

optional list of allowed values for FunctionType.STRING or numeric types

format

val format: String?

optional format of the data type (e.g., "float", "double", "int32", "int64")

items

val items: FunctionSchema?

optional schema of items in an array for FunctionType.ARRAY type

maxItems

val maxItems: Long?

optional maximum number of items for FunctionType.ARRAY type

maxLength

val maxLength: Long?

optional maximum length for FunctionType.STRING type

maxProperties

val maxProperties: Long?

optional maximum number of properties for FunctionType.OBJECT type

maximum

val maximum: Double?

optional maximum value for numeric types

minItems

val minItems: Long?

optional minimum number of items for FunctionType.ARRAY type

minLength

val minLength: Long?

optional minimum length for FunctionType.STRING type

minProperties

val minProperties: Long?

optional minimum number of properties for FunctionType.OBJECT type

minimum

val minimum: Double?

optional minimum value for numeric types

nullable

val nullable: Boolean?

optional boolean indicating whether the value may be null

pattern

val pattern: String?

optional regex pattern that string values must match

properties

val properties: Map<String, FunctionSchema>?

optional map of property names to their respective FunctionSchema definitions for FunctionType.OBJECT type

required

val required: List<String>?

optional list of property names that must be present for FunctionType.OBJECT type

title

val title: String?

optional title for the schema

type

val type: Int

the data type of the schema, must be one of the constants defined in FunctionType