packages feed

shikumi-compile 0.1.0.1 → 0.1.1.0

raw patch · 4 files changed

+24/−11 lines, 4 filesdep ~generic-lensdep ~lensdep ~shikumiPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: generic-lens, lens, shikumi, shikumi-compile

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,6 +2,13 @@  ## Unreleased +## 0.1.1.0 - 2026-06-28++### Changed++- Refreshed the internal `shikumi` bound for the `0.2` series.+- Updated compiler internals to use label-based record updates.+ ## 0.1.0.1 - 2026-06-21  ### Changed
shikumi-compile.cabal view
@@ -1,6 +1,6 @@ cabal-version:   3.4 name:            shikumi-compile-version:         0.1.0.1+version:         0.1.1.0 synopsis:        The compiler layer for shikumi LM programs (EP-9) category:        AI description:@@ -49,11 +49,13 @@    build-depends:     , aeson-    , base        >=4.20     && <5+    , base          >=4.20     && <5     , bytestring     , effectful-    , shikumi     ^>=0.1.0.1-    , text        ^>=2.1+    , generic-lens  ^>=2.2+    , lens          ^>=5.3+    , shikumi       ^>=0.2.0.0+    , text          ^>=2.1  test-suite shikumi-compile-test   import:         common-options@@ -73,8 +75,8 @@     , effectful     , generic-lens     , lens-    , shikumi          ^>=0.1.0.1-    , shikumi-compile  ^>=0.1.0.1+    , shikumi          ^>=0.2.0.0+    , shikumi-compile  ^>=0.1.1.0     , tasty     , tasty-hunit     , text
src/Shikumi/Compile/FewShot.hs view
@@ -15,16 +15,18 @@   ) where +import Control.Lens ((&), (.~)) import Data.Aeson (ToJSON, toJSON)+import Data.Generics.Labels () import Shikumi.Compile.Types (Compiler (..))-import Shikumi.Program (Demo (..), Params (..), mapParams)+import Shikumi.Program (Demo (..), mapParams)  -- | Inject the given demos at every node, /replacing/ (not appending) the node's -- demo list so that re-compiling is idempotent — compiling twice yields the same -- demos, never duplicates. (If append semantics are ever wanted that is a separate -- combinator, deliberately out of scope here.) fewShot :: [Demo] -> Compiler-fewShot ds = Compiler $ mapParams (\ps -> ps {demos = ds})+fewShot ds = Compiler $ mapParams (\ps -> ps & #demos .~ ds)  -- | Build a few-shot compiler from typed input/output pairs, serializing each to a -- JSON 'Demo'. This is the recommended path when demos must line up with a node's
src/Shikumi/Compile/ZeroShot.hs view
@@ -7,9 +7,11 @@   ) where +import Control.Lens ((&), (.~))+import Data.Generics.Labels () import Data.Text (Text) import Shikumi.Compile.Types (Compiler (..))-import Shikumi.Program (Params (..), mapParams)+import Shikumi.Program (mapParams)  -- | Override every node's instruction with @instr@ and remove all demos. Reaches -- every 'Shikumi.Program.Predict' node in the program — including nodes nested@@ -17,10 +19,10 @@ zeroShot :: Text -> Compiler zeroShot instr =   Compiler $-    mapParams (\ps -> ps {instructionOverride = Just instr, demos = []})+    mapParams (\ps -> ps & #instructionOverride .~ Just instr & #demos .~ [])  -- | Clear demos at every node but keep each node's existing instruction override -- (i.e. fall back to the signature default where none was set). Useful to strip a -- few-shot program back to zero-shot without choosing a new instruction. zeroShotClear :: Compiler-zeroShotClear = Compiler $ mapParams (\ps -> ps {demos = []})+zeroShotClear = Compiler $ mapParams (\ps -> ps & #demos .~ [])