Once you set up the parameters necessary to connect to the APIs of an LLM, when you create a policy in Witboost, you can select the LLM Engine to use for the evaluation.
When you select LLM Engine, you will be able to provide the prompt written in natural language which provides the instructions to the LLM for the evaluation of the resource.
The LLM Engine service is not meant to be called directly by users from their browsers, but instead it is called by the Witboost Computational Governance. Therefore, the base URL of the API will depend on the network address given by the Kubernetes network e.g. http://<service k8s endpoint name>.<namespace>:<port>. Below, we are providing an example base URL, yours may differ.
Evaluate a resource
Computes a result based on the input resource. The result will be a policy result.
Request Body schema: application/jsonrequired
An object containing the resource to evaluate using this executor
| content required | string The content of the resource to be evaluated. The content can be any type of data, such as a JSON object, a string, a number, etc but always in its string representation. e.g. For a system resource, the content will be a stringified YAML descriptor. |
| policy required | string Policy written in natural language which will be applied by the LLM to the content of the resource. |
| resourceId required | string A unique Resource Identifier inside the Witboost platform. |
| resourceType required | string Resource type that is being sent in the content. This has to be agreed between the LLM Engine implementation and the platform's registered resource types. |
Responses
Request samples
- Payload
{- "content": "apiVersion: v1\nkind: dataproduct\ndomain: marketing\nmetadata:\n name: my-dataproduct\n namespace: my-namespace\n labels:\n app: my-app",
- "policy": "The data product domain must be defined as finance.",
- "resourceType": "dataproduct",
- "resourceId": 123456
}Response samples
- 200
- 400
- 500
{- "satisfiesPolicy": false,
- "errors": [
- "The data product domain is defined as 'marketing'. The expected domain is 'finance'."
], - "details": {
- "suggestion": "Change the domain from 'marketing' to 'finance'."
}
}