TypeSafe AI client for sending requests, validating payloads, and parsing responses with error handling.
// Source: https://github.com/esengine/DeepSeek-Reasonix | License: MIT | Copyright 2026 Reasonix Contributors
// Provided via justclaw.it.com; keep this notice with the code.
// Package typesafe implements TypeSafe AI's System One decision protocol.
package typesafe
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"reasonix/internal/safety/redirectguard"
)
const DefaultBaseURL = "https://api.typesafe.ai"
var (
ErrKeyMissing = errors.New("TypeSafe API key is not configured")
ErrMalformedResponse = errors.New("TypeSafe response is not a System One answer")
)
type Question struct {
Type string `json:"type"`
Instructions any `json:"instructions"`
Criteria any `json:"criteria,omitempty"`
}
type Request s
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key