Skip to main content

Pre-Processor (or Task-Generator)

The Pre-Processor service is expected to generate a list of JSON objects for on-demand model runs.

The request to generate comes in the form of a HTTP POST request to a pre-defined endpoint at /taskGenerator. Using the example setup in configuration, the request will be sent to http://pre-processor:8080/taskGenerator.

The JSON object that is sent together with the task generation request is derived from the Model Inputs data store. However there are additional hierarchies in the JSON object. For example, if the Model Input data store contains the following content,

{
"case0": "hello, world!"
}

then the JSON object that accompanies the task generation request is as follows.

{
"inputs": {
"standard": {
"case0": "hello, world!"
}
}
}

The expected response from the Pre-Processor service is a newline delimited JSON stream, one for each case. For example, the following example response has 3 cases in the stream.

{"case1": "hello, world!", "control": {"seed": 1}}\n{"case2": "salve, mondo!", "control": {"seed": 1}}\n{"case3": "hallo, welt!", "control": {"seed": 1}}\n

Note the extra path, control.seed, in the returned JSON stream. Dais requires that the JSON objects in the stream to have such a path for it to insert seed information for different runs.