Integrations

curl

A shell script that POSTs the documented judge body and the documented consensus body.

All integrations

#!/bin/sh
set -eu
if [ -z "${SCREWTAPE_API_KEY:-}" ]; then
  echo "Set SCREWTAPE_API_KEY" >&2
  exit 1
fi

curl -sS https://screwtape.ai/v1/judge \
  -H "Authorization: Bearer ${SCREWTAPE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d @- <<'JSON'
{
  "task": "State the crew size and launch site.",
  "agent_output": "The crew size was 4. The mission launched from Cape Canaveral.",
  "evidence": [
    "The mission launched on 2024-03-01 from Cape Canaveral.",
    "The crew size was 4."
  ],
  "criteria": [
    "crew size",
    "Cape Canaveral"
  ]
}
JSON

echo

curl -sS https://screwtape.ai/v1/consensus \
  -H "Authorization: Bearer ${SCREWTAPE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d @- <<'JSON'
{
  "task": "State the crew size.",
  "answers": [
    {
      "agent_id": "alpha",
      "output": "The crew size was 4."
    },
    {
      "agent_id": "beta",
      "output": "The crew size was 4."
    },
    {
      "agent_id": "gamma",
      "output": "The crew size was 4."
    }
  ]
}
JSON