packages feed

openai-2.5.4 / src / OpenAI / V1 / ChunkingStrategy.hs

-- | The `ChunkingStrategy` typemodule OpenAI.V1.ChunkingStrategy    ( -- * Main types      ChunkingStrategy(..)      -- * Other types    , Static(..)    ) whereimport OpenAI.Prelude-- | Static chunking strategydata Static = Static    { max_chunk_size_tokens :: Natural    , chunk_overlap_tokens :: Natural    } deriving stock (Generic, Show)      deriving anyclass (FromJSON, ToJSON)-- | The chunking strategy used to chunk the file(s)data ChunkingStrategy = ChunkingStrategy_Static{ static :: Static }    deriving stock (Generic, Show)chunkingStrategyOptions :: OptionschunkingStrategyOptions = aesonOptions    { sumEncoding =        TaggedObject{ tagFieldName = "type", contentsFieldName = "" }    , tagSingleConstructors = True    , constructorTagModifier = stripPrefix "ChunkingStrategy_"    }instance FromJSON ChunkingStrategy where    parseJSON = genericParseJSON chunkingStrategyOptionsinstance ToJSON ChunkingStrategy where    toJSON = genericToJSON chunkingStrategyOptions