ToolChoiceSerializer

Custom serializer for ToolChoice that handles both string and object formats.

According to the OpenAI specification, tool_choice can be:

  • A simple string ("auto" or "none")

  • An object with type "function" and a function field

This serializer automatically converts between these formats.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

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