typesafe-ai-core: Types, JSON codecs and typed questions for the TypeSafe AI API

[ ai, api, bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

Transport-agnostic bindings to the TypeSafe System One API (https://docs.typesafe.ai): typed Noul, Choice and Score questions whose answers decode to your own Haskell types, a one-to-one mirror of the OpenAPI schemas, and API calls as plain values. . This package does no networking, so it can be used with servant or any other HTTP stack. For a ready-to-use client, depend on typesafe-ai. . Start with TypeSafe.Core and TypeSafe.Question. . This is a community SDK, not affiliated with or endorsed by TypeSafe AI.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies aeson (>=2.1 && <2.4), base (>=4.18 && <4.23), bytestring (>=0.11.3 && <0.13), containers (>=0.6.7 && <0.9), deepseq (>=1.4.8 && <1.6), http-types (>=0.12.3 && <0.13), text (>=2.0 && <2.2), time (>=1.12 && <1.17), vector (>=0.13 && <0.14) [details]
Tested with ghc ==9.6.7 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1
License BSD-3-Clause
Copyright 2026 byteally
Author Magesh B
Maintainer magesh85@gmail.com
Uploaded by magesh at 2026-09-22T14:59:08Z
Category AI, Web, API
Home page https://github.com/byteally/typesafe-sdk
Bug tracker https://github.com/byteally/typesafe-sdk/issues
Source repo head: git clone https://github.com/byteally/typesafe-sdk.git(typesafe-ai-core)
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 0 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for typesafe-ai-core-0.1.0.0

[back to package description]

typesafe-ai-core

Transport-agnostic bindings to TypeSafe AI's System One API: typed Noul, Choice and Score questions whose answers decode to your own Haskell types, a one-to-one mirror of the OpenAPI schemas with JSON codecs, and API calls as plain values.

This package does no networking. Use it with servant or any other HTTP stack. For a ready-to-use client, depend on typesafe-ai instead; it re-exports everything here.

data Department = Billing | Technical | Sales
  deriving stock (Show, Eq, Generic)
  deriving anyclass (ChoiceOption)

routing :: Questions (Choice Department, Noul)
routing =
  (,) <$> ask "department" (choice "Which team should handle this?")
      <*> ask "is_urgent" (noul "Does this convey urgency?")

-- The request, for any HTTP client:
request :: Either RequestError Wire.SystemOneRequest
request = systemOneRequest jevLatest "Help! My payouts have been failing." routing

-- And the typed answers, from its response:
answers :: Wire.SystemOneResponse -> Either (NonEmpty AnswerError) (Evaluation (Choice Department, Noul))
answers = decodeEvaluation routing Nothing

Start with the documentation of TypeSafe.Core and TypeSafe.Question. The repository has more examples.

The bindings are checked against version 0.2.0 of the TypeSafe OpenAPI specification (apiSpecVersion), which is included in the package (spec/openapi.json).

This is a community SDK, not affiliated with or endorsed by TypeSafe AI.