Parenting & Family Leisure · Family Activity App Developers

Classifying Family Activity Settings: TypeSafe Choice Tutorial

Community members submit unstructured weekend activity ideas that vary widely in setting detail and venue phrasing. This example shows how to evaluate submission text using a Choice question to distinguish indoor, outdoor, and hybrid environments. Application code then uses the setting judgment to route activities into weather-dependent discovery lists or flag ambiguous posts for clarification.

Updated · Examples verified with jev-1.13.0

activitycategorizationparenting familysetting

Interactive demo

Sun and Rain Weather Splitter

A split canvas features a sunny park canopy on one side and a rain-sheltered reading nook on the other. Community activity submissions move dynamically toward the environment matching their weather exposure.

The visitor selects or types a local activity title and description. Each run sends one live request to the public API; results are model judgments and can vary.

Verified sample results (3 inputs, jev-1.13.0)
  • Outdoor splash park & lawn picnic

    {
      "state": {
        "description": "Sunny splash park picnic with open-air water play and grass lawn games at Riverside Park."
      },
      "answers": {
        "setting_type": {
          "type": "choice",
          "choice": "outdoor_dependent",
          "confidence": 1,
          "probabilities": {
            "hybrid_facility": 0,
            "indoor_sheltered": 0,
            "insufficient_info": 0,
            "outdoor_dependent": 1
          }
        },
        "rain_disruption": {
          "noul": 0.95,
          "type": "noul"
        }
      }
    }
  • Indoor library story hour

    {
      "state": {
        "description": "Children's story hour and clay crafting workshop inside the downtown public library main hall."
      },
      "answers": {
        "setting_type": {
          "type": "choice",
          "choice": "indoor_sheltered",
          "confidence": 1,
          "probabilities": {
            "hybrid_facility": 0,
            "indoor_sheltered": 1,
            "insufficient_info": 0,
            "outdoor_dependent": 0
          }
        },
        "rain_disruption": {
          "noul": 0.1,
          "type": "noul"
        }
      }
    }
  • Vague activity suggestion without location

    {
      "state": {
        "description": "Weekend family hangout idea."
      },
      "answers": {
        "setting_type": {
          "type": "choice",
          "choice": "insufficient_info",
          "confidence": 1,
          "probabilities": {
            "hybrid_facility": 0,
            "indoor_sheltered": 0,
            "insufficient_info": 1,
            "outdoor_dependent": 0
          }
        },
        "rain_disruption": {
          "noul": 0.56,
          "type": "noul"
        }
      }
    }

The problem

The input consists of a community-submitted activity title and narrative description. User submissions range from explicit venue descriptions to ambiguous phrases that make automated setting classification difficult without semantic interpretation. The application needs to categorize each activity into indoor, outdoor, or hybrid settings so downstream code can apply rain-safe display filters or request missing location context.

How TypeSafe helps

In this setup, application code submits a family activity title and description to the setting_classification Choice question to evaluate the event environment. In the observed examples, explicit indoor library text returned indoor_sheltered, an open park splash pad description returned outdoor_weather_dependent, and text missing venue details returned needs_location_context. Downstream application code can read this judgment to tag posts with rainy-day filters, display weather alerts for outdoor events, or flag ambiguous submissions for user clarification. The API provides the setting classification, while your application executes the actual discovery filtering, alert rules, and follow-up prompts.

Input
A short description of a family activity submitted by a community member.
Decision
Choice: Classify the activity setting into outdoor-weather-dependent, indoor-sheltered, or hybrid-indoor-outdoor.
Next action
Family app applies weather alerts and filters the activity under rainy-day or sunny-day recommendations.

Three verified examples

These responses were returned during a previous API verification. New probabilities can differ.

Indoor public library storytime submission (primary)

Expected behavior: The title and description explicitly state the event is inside a public library children's room, so indoor_sheltered is selected.

Input

{
  "title": "Rainy Day Storytime and Craft Hour",
  "description": "Join us inside the downtown public library children's room for read-alongs and paper crafts."
}

Previous verification response

jev-1.13.0 ·

{
  "model": "jev-1.13.0",
  "usage": {
    "input_tokens": 459,
    "output_tokens": 73
  },
  "answers": {
    "setting_classification": {
      "type": "choice",
      "choice": "indoor_sheltered",
      "confidence": 1,
      "probabilities": {
        "indoor_sheltered": 1,
        "hybrid_indoor_outdoor": 0,
        "needs_location_context": 0,
        "outdoor_weather_dependent": 0
      }
    }
  }
}
Outdoor splash park and picnic submission (alternative)

Expected behavior: The text describes an open park splash pad and lawn picnic, so outdoor_weather_dependent is selected.

Input

{
  "title": "Splash Park & Picnic Lunch",
  "description": "Meet at Riverside Park near the outdoor splash pad and lawn for water play and picnic benches."
}

Previous verification response

jev-1.13.0 ·

{
  "model": "jev-1.13.0",
  "usage": {
    "input_tokens": 455,
    "output_tokens": 75
  },
  "answers": {
    "setting_classification": {
      "type": "choice",
      "choice": "outdoor_weather_dependent",
      "confidence": 1,
      "probabilities": {
        "indoor_sheltered": 0,
        "hybrid_indoor_outdoor": 0,
        "needs_location_context": 0,
        "outdoor_weather_dependent": 1
      }
    }
  }
}
Ambiguous meetup title without venue details (edge case)

Expected behavior: The submission lacks any venue name or environment details, requiring the fallback option needs_location_context.

Input

{
  "title": "Weekend Fun & Games",
  "description": "Fun weekend meetup for kids and parents to hang out and play games."
}

Previous verification response

jev-1.13.0 ·

{
  "model": "jev-1.13.0",
  "usage": {
    "input_tokens": 451,
    "output_tokens": 71
  },
  "answers": {
    "setting_classification": {
      "type": "choice",
      "choice": "needs_location_context",
      "confidence": 0.98,
      "probabilities": {
        "indoor_sheltered": 0.01,
        "hybrid_indoor_outdoor": 0,
        "needs_location_context": 0.99,
        "outdoor_weather_dependent": 0
      }
    }
  }
}

Try online

Start with a verified example, edit the request, then ask Jev. A live request is sent only when you press Try online.

Expected behavior: The title and description explicitly state the event is inside a public library children's room, so indoor_sheltered is selected.

Use non-sensitive test data. Live input goes to typesafe.pro and TypeSafe. Anonymous requests use the gateway’s free rate limit.

3Answer
Previous verification

The best-fitting label

indoor_sheltered
indoor_sheltered100%
hybrid_indoor_outdoor0%
needs_location_context0%
outdoor_weather_dependent0%
Model confidence1.00

Probabilities compare your labels. Confidence describes how decisive the model is, not whether it is correct.

Next step

The title and description explicitly state the event is inside a public library children's room, so indoor_sheltered is selected.

jev-1.13.0 · verified 2026-09-28 · new probabilities may differ

The current request, in code
import jsonfrom urllib.error import HTTPError, URLErrorfrom urllib.request import Request, urlopenBASE_URL = "https://api.typesafe.pro"payload = {    "model": "jev-latest",    "state": {        "title": "Rainy Day Storytime and Craft Hour",        "description": "Join us inside the downtown public library children's room for read-alongs and paper crafts.",    },    "questions": {        "setting_classification": {            "type": "choice",            "criteria": {                "indoor_sheltered": "The activity takes place primarily indoors or inside a fully sheltered venue.",                "hybrid_indoor_outdoor": "The activity spans both indoor and outdoor areas or facilities during the event.",                "needs_location_context": "The setting cannot be determined because venue details or activity descriptions are missing or ambiguous.",                "outdoor_weather_dependent": "The activity takes place outdoors and is affected by weather conditions.",            },            "instructions": "Determine the physical setting type for the submitted family activity based on the title and description provided in state.",        },    },}request = Request(    f"{BASE_URL}/v1/systemone",    data=json.dumps(payload).encode("utf-8"),    headers={"Content-Type": "application/json"},    method="POST",)try:    with urlopen(request, timeout=20) as response:        result = json.load(response)except HTTPError as error:    raise SystemExit(f"API returned HTTP {error.code}") from errorexcept URLError as error:    raise SystemExit(f"Connection failed: {error.reason}") from errorprint(json.dumps(result["answers"], indent=2))

Limitations and review

  • A single Choice question selects only one environment option per evaluation, though you can use separate questions if your application requires multi-label setting tags.
  • Categorizing a venue based on submission text checks setting context but does not verify whether the named location is active, open to the public, or authorized for events.
  • The needs_location_context fallback option is an application design choice rather than an API requirement, so you can adjust criteria definitions or review boundaries for your workflow.

Set thresholds against your own examples before relying on an automated decision.

← Explore all TypeSafe use cases