Skip to content
System One

GenieRobot/typesafe-ai-rails

Community Rails integration for TypeSafe's System One API, built on the community typesafe-sdk Ruby gem. Adds Rails configuration, persisted usage and cost telemetry, and an opt-in confidence policy for Choice and Score answers.

GenieRobot/typesafe-ai-rails on GitHub

Stars
3
Forks
0
Language
Ruby
License
MIT
Last push
16 Sep 2026

Read from GitHub on . Counts change daily.

How it uses Jev

def ask(decision_type:, state:, questions:, **call_options)
  started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  response = @sdk.system_one(state: state, questions: questions, **call_options)
  latency_ms = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - started_at) * 1000.0

  record_call(response, decision_type: decision_type, latency_ms: latency_ms)
  Result.new(response: response, decision_type: decision_type)
end

def models
  @sdk.models
end

def close
  @sdk.close if @sdk.respond_to?(:close)

View in lib/typesafe/rails/client.rb

Open on GitHub

PrimitivesChoiceScoreNoul

More like this

Keep browsing