Light Logo
CLI (v0.40.0)Reference

wriftai predictions create

CLI reference for wriftai predictions create

wriftai predictions create

Create a prediction

Synopsis

Create a prediction using either the latest version of a model or a specific model version

wriftai predictions create [flags]

Examples

  Create a prediction against the latest version of a model
  $ wriftai predictions create \
    --model  johndoe/sentiment-analyzer \
    --input '{"text": "Great job!"}' \

  Create a prediction against a specific model version
  $ wriftai predictions create \
   --model  johndoe/sentiment-analyzer:1 \
   --input '{"text": "Hello world"}'

  Create a prediction with input validation enabled against model version's schema before processing
  $ wriftai predictions create \
   --model  johndoe/sentiment-analyzer \
   --input '{"text": "Hello world"}'
   --validate-input

  Create a prediction and send updates to the specified webhook
  $ wriftai predictions create \
    --model  johndoe/sentiment-analyzer \
    --input '{"text": "Great job!"}' \
	--webhook-url https://example.com/webhook \
	--webhook-secret a7b6e3f1a9d8c4b2

  Create a prediction and wait until it reaches a terminal state, polling at the default interval
  $ wriftai predictions create \
   --model  johndoe/sentiment-analyzer \
   --input '{"text": "Hello world"}' \
   --wait

  Create a prediction and wait until it reaches a terminal state, polling at a custom interval
  $ wriftai predictions create \
   --model  johndoe/sentiment-analyzer \
   --input '{"text": "Hello world"}' \
   --wait
   --wait-poll-interval 3s

Options

  -h, --help                          help for create
      --input string                  JSON string for input data provided for the prediction (required)
      --model string                  Model reference in either owner/name or owner/name:version-number format (required)
  -o, --output format                 Set output format. Supported formats: json, yaml (default json)
      --validate-input                Enable input validation against the schema before processing
      --wait                          If set, waits until the prediction reaches a terminal state otherwise returns the prediction immediately
      --wait-poll-interval duration   Time duration between polling attempts to check the prediction status. Applies when --wait is enabled (default 1s)
      --webhook-secret string         Secret to generate the signature for the webhook
      --webhook-url string            HTTP URL to POST updates to

Options inherited from parent commands

      --debug   Enable debug mode

SEE ALSO