Set Body Policy
The Set Body policy allows you to set or override the incoming request body. GET or HEAD requests do not support bodies on Zuplo, so be sure to use the Change Method policy to update the method to a POST
or whatever is appropriate. You might also need to use the Set Header policy to set a content-type
.
Configuration
{
"name": "my-set-body-inbound-policy",
"policyType": "set-body-inbound",
"handler": {
"export": "SetBodyInboundPolicy",
"module": "$import(@zuplo/runtime)",
"options": {
"body": "{ \"model\": \"babbage\", \"prompt\": \"Say this is a test\", \"max_tokens\": 7, \"temperature\": 0, \"stream\": true }"
}
}
}
Read more about how policies work