Request decisions from a model
POST /v1/decision-models/{id}/decide: Sends the supplied questions and content to the registered provider.
Sends the supplied questions and content to the registered provider. Requires READ_DECISION_MODEL and EXECUTE_DECISION_MODEL. Each request calls the provider once and may incur charges, so do not retry automatically. GoodMem does not store the input or answers. Unsupported questions or media return 400. Problems with the stored provider credentials or settings return 412.
In: header
Path Parameters
UUID of the decision model
Header Parameters
Optional waiting budget in milliseconds, measured from REST servlet ingress and shared across all internal gRPC calls. Supply one decimal integer from 1 to 86400000. Omission adds no deadline. Existing shorter deadlines still apply. Expiry returns HTTP 504 before streaming starts; after streaming starts, no successful completion event is sent. Use SSE or opt into GoodMem-Stream-Terminal for an explicit terminal outcome. Retrieval work is cooperatively cancelled. An accepted mutation may still commit after timeout or disconnect; a failed response does not imply rollback.
int641 <= value <= 86400000Content evaluated by all questions.
Set exactly one of text, jsonValue, objectValue, arrayValue, or media. Use text for ordinary text. Use jsonValue to preserve a complete JSON value, including the exact precision of its numbers.
Ordinary text without JSON quoting.
"hello"Set exactly one of text, jsonValue, objectValue, arrayValue, or media. Use text for ordinary text. Use jsonValue to preserve a complete JSON value, including the exact precision of its numbers.
A complete JSON value encoded as a string. For example, {"jsonValue":"null"} represents JSON null. For ordinary text, use the text field.
"\"hello\""Set exactly one of text, jsonValue, objectValue, arrayValue, or media. Use text for ordinary text. Use jsonValue to preserve a complete JSON value, including the exact precision of its numbers.
Object whose fields can contain nested media.
Set exactly one of text, jsonValue, objectValue, arrayValue, or media. Use text for ordinary text. Use jsonValue to preserve a complete JSON value, including the exact precision of its numbers.
Ordered array whose elements can contain nested media.
Set exactly one of text, jsonValue, objectValue, arrayValue, or media. Use text for ordinary text. Use jsonValue to preserve a complete JSON value, including the exact precision of its numbers.
Media file included in the request. GoodMem does not download media from URLs.
{"mimeType":"image/png"}Media files included with the request. Their order is preserved within each media type.
Questions keyed by names that you choose. The model must support each question type and its media.
Empty Object
Response Body
curl -X POST "https://your-goodmem-server.example.com/v1/decision-models/550e8400-e29b-41d4-a716-446655440000/decide" \ -H "GoodMem-Timeout-Ms: 30000" \ -H "Content-Type: application/json" \ -d '{ "state": { "text": "hello" }, "attachments": [ { "mimeType": "image/png" } ] }'{
"model": "string",
"answers": {
"property1": {
"choice": {
"choice": "string",
"probabilities": {
"property1": 0.1,
"property2": 0.1
},
"confidence": 0,
"confidenceMeaning": "ADJUSTED_TOP_PROBABILITY"
}
},
"property2": {
"choice": {
"choice": "string",
"probabilities": {
"property1": 0.1,
"property2": 0.1
},
"confidence": 0,
"confidenceMeaning": "ADJUSTED_TOP_PROBABILITY"
}
}
},
"usage": {
"inputTokens": 0,
"outputTokens": 0
}
}