Structured Output
Creating a run allows you to pass a JSON schema to format the response as structured output.
The schema must be a strict subset of JSON Schema draft-07:
the root type must be object
combinators (oneOf, anyOf, allOf) are not supported
$ref is limited to internal #/definitions/ entries (prefer fully-resolved schemas)
additionalProperties defaults to false.
Supported data types are: string, number, integer, boolean, null, object, and array
Max depth of schema is 10 and up to 200 nodes total.
An example of a Create Run request body:
{
"intent": "Give me deals in 'Proposal Made' stage and activities added for those deals",
"selectedCustomerIntegrationIds": ["*"],
"context": "Pipedrive",
"ownerId": "xx_150",
"userId": "user_441",
"outputSchema": {
"$schema": "https://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"deals": {
"type": "array",
"description": "List of deals found",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "deal id"
},
"value": {
"type": "number",
"description": "value of the deal"
},
"currency": {
"type": "string",
"description": "Currency of the deal value"
},
"activityId": {
"type": ["number", "null"],
"description": "ID of the acitivity assigned to the deal"
}
},
"required": [
"id",
"value",
"currency",
"activityId"
]
}
},
"activities": {
"type": "array",
"description": "List of all activities",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "activity id"
},
"name": {
"type": "string",
"description": "name of the activity"
},
"scheduledDateTime": {
"type": "string",
"description": "time when the activity takes place"
}
},
"required": [
"id",
"name",
"scheduledDateTime"
]
}
}
},
"required": [
"activities",
"deals"
]
}
}Response
Last updated