VarArgsSerializer

A serializer for the VarArgs class, enabling Kotlin serialization for arguments provided dynamically to a callable function (KCallable). This serializer facilitates encoding and decoding of arguments via their corresponding KParameter mappings.

Constructors

Link copied to clipboard
constructor(kCallable: KCallable<*>)

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor
Link copied to clipboard

A reference to the KCallable instance this serializer is associated with. The callable's parameters are used to generate the serialization descriptor and process argument values.

Functions

Link copied to clipboard

Provides a custom serializer for tools, wrapping and unwrapping values that do not serialize into JsonObject into a custom JsonObject with value key. This wrapping/unwrapping is needed because for LLM APIs tool arguments must always be JsonObject.

Link copied to clipboard
open override fun deserialize(decoder: Decoder): ToolFromCallable.VarArgs
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: ToolFromCallable.VarArgs)