Skip to content
Fieldwork
Esc
↑↓navigate↵open⌘Jpreview

make_decisions

Answer closed questions about a context: yes or no, one choice from a list, or a score on a rubric. Each answer carries probabilities, not only a verdict. Use to classify or judge a piece of text or data. Do not use for open questions (use answer_question). Defaults to parallel. Set provider to choose another supported provider; Fieldwork never switches providers after an error.

POST/api/v1/tools/make_decisions
Authorization
AuthorizationBearer token · headerrequired

A Fieldwork gateway key, issued per agent by the operator. Send it as Authorization: Bearer <key>.

Request body
requiredapplication/json
providerstring
Allowed:parallel
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
One of:
object
contextanyrequired

What the questions are about: text, or any JSON value.

questionsobjectrequired

The questions, each under a name of your choice: letters, digits, _ and -. The answers come back under the same names.

countrystring

Search from this country, as a two-letter ISO code such as GB.

matches ^[A-Za-z]{2}$
maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
object
contextanyrequired

What the questions are about: text, or any JSON value.

questionsobjectrequired

The questions, each under a name of your choice: letters, digits, _ and -. The answers come back under the same names.

countrystring

Search from this country, as a two-letter ISO code such as GB.

matches ^[A-Za-z]{2}$
maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
Responses
200

The provider that ran the call and its normalized result.

providerstringrequired
Allowed:parallel
requestIdstringrequired
resultobjectrequired
Show properties
answersobjectrequired

One answer per question, under the question's name.

citationsobject[]required
Show properties
Array of object
excerptsstring[]
titlestring
urlstringrequired
metaobject

Request details from the provider: its request id, what it charged and any warnings.

Show properties
requestIdstring
usageobject
Show properties
costUsdnumber
creditsnumber
unitsobject
warningsstring[]
truncatedobject[]

One entry for each cut text field; absent when nothing was cut.

Show properties
Array of object
lengthintegerrequired

Original character length.

min 0
pathstringrequired
shownintegerrequired

Characters shown before the inline cut note.

min 0
default

A refusal or a failed call. Branch on error.code; never parse the message.

errorobjectrequired
Show properties
codestringrequired
Allowed:AbortedInvalidRequestJobFailedNotAFileNotFoundProviderErrorRateLimitedTimeoutTooLargeUnauthorizedUnsupported
jobIdstring

A job that was already started. Pass it as resume instead of repeating the call.

messagestringrequired
providerstring
retryAfternumber

Seconds to wait.

retryablebooleanrequired

Whether repeating the same call can succeed.

requestIdstring
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST '/api/v1/tools/make_decisions' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "parallel",
  "timeout": 1,
  "context": null,
  "questions": {
    "property1": {
      "question": "string",
      "type": "yesno"
    },
    "property2": {
      "question": "string",
      "type": "yesno"
    }
  },
  "country": "string",
  "maxCharacters": 1
}'
Response
{
  "provider": "parallel",
  "requestId": "string",
  "result": {
    "answers": {
      "property1": {
        "choice": "string",
        "confidence": null,
        "probabilities": {
          "property1": 0,
          "property2": 0
        },
        "probability": 0,
        "refusal": "string"
      },
      "property2": {
        "choice": "string",
        "confidence": null,
        "probabilities": {
          "property1": 0,
          "property2": 0
        },
        "probability": 0,
        "refusal": "string"
      }
    },
    "citations": [
      {
        "excerpts": [
          "string"
        ],
        "title": "string",
        "url": "string"
      }
    ],
    "meta": {
      "requestId": "string",
      "usage": {
        "costUsd": 0,
        "credits": 0,
        "units": {
          "property1": 0,
          "property2": 0
        }
      },
      "warnings": [
        "string"
      ]
    },
    "truncated": [
      {
        "length": 0,
        "path": "string",
        "shown": 0
      }
    ]
  }
}

Was this page helpful?