Skip to main content
Use the Go SDK to get structured judgments - probabilities, choices, and rubric scores - from judgment models such as TypeSafe’s jev family, OpenAI’s gpt-6-luna, Cloudflare’s Clef, Perplexity’s deciders, Azure’s Microsoft-Decision-1, or Databricks’ ai_decide. Provider/model examples:
  • TypeSafe: Provider: schemas.Typesafe, Model: "jev-1.13.0" (aliases: jev-latest, jev-preview)
  • OpenAI: Provider: schemas.OpenAI, Model: "gpt-6-luna"
  • OpenRouter: Provider: schemas.OpenRouter, Model: "~typesafe/jev-latest"
  • Cloudflare: Provider: schemas.Cloudflare, Model: "clef-flash" (the key needs CloudflareKeyConfig.AccountID)
  • Perplexity: Provider: schemas.Perplexity, Model: "pplx-decider-v1.1-27b" or "pplx-decider-v1-27b"
  • Ollama: Provider: schemas.Ollama, Model: "nimble" (any pulled System One model)
  • Azure: Provider: schemas.Azure, Model: "Microsoft-Decision-1" (a key alias maps it to your deployment)
  • Databricks: Provider: schemas.Databricks, Model: "ai_decide" (the key needs DatabricksKeyConfig.WorkspaceURL)
  • Laya or Nimble: the name of your custom provider, for example Provider: "laya", Model: "english"
See Decisions for which providers read image parts.

Basic Example

The account must serve keys for schemas.Typesafe - the OpenAI-only account from the setup guide returns “provider not supported” for this example. A minimal TypeSafe-capable account:

Request

A model that cannot read part of a request (an image or any other non-text part sent to a TypeSafe or custom TypeSafe-based model) rejects that attempt with a 400, so a fallback can serve it. Fallbacks work like every other request type via the Fallbacks field. A chat model with no native decisions endpoint (for example openai/gpt-4o-mini) returns unsupported_operation unless the compat plugin is registered with compat.Config{ConvertDecisionToResponses: true}, which emulates the answer through the model’s Responses API. See Decision-to-Responses Emulation.

Answers

response.Answers follows the order of the questions. Each schemas.DecisionAnswer carries: Probabilities entries carry each option’s Value, its Label for score levels, and its Probability. For Laya’s extra answer fields, see Provider-Specific Fields. An array in Input.Structured is sent to TypeSafe-based models as a JSON array state. Over HTTP, though, an array input always reads as messages, so send structured arrays from the Go SDK, or wrap them in an object.

Migrating from the Map Form

The map form (State, questions and answers keyed by name, Kind/Criteria) is deprecated. The Go SDK only has the shape above, so code written against the old types no longer compiles; move it to the new fields using the table below. The HTTP map form is still served at /v1/decisions for now, but new and existing integrations should switch.
Score levels are identified by their position in Levels, as the earlier criteria list was: a Probabilities entry’s Value is the level index.