Each stream is composed by a DAG of processors though which the data is processed.
Each processor has a set of properties that can be configured to customize its behavior.
Those properties are defined inside a stream configuration template, and it can look similar to this:
The system follows a convention over configuration approach, where the default values are defined in the processor implementation.
Generally, the default values are good enough for most of the cases, but sometimes you may need to customize the behavior of a processor.
For example, you may want to change the tone of the summary generated by the LLM processor from Conversational to Formal.
This can be done by creating a configuration patch that overrides the default value of the tone property.
A configuration patch is a JSON Patch that respects the RFC 6902 standard, with some imposed limitations.
The limitations are:
the only supported operations are add, replace, and remove
it can only apply to the properties object of a processor
the added/replaced values can be either a primitive value or an array of primitive values
The accepted primitive values are:
string
number
boolean
null
For example, the configuration patch that changes the tone of the summary generated by the LLM processor from Conversational to Formal looks like this:
The JSON Patch format proposed in the RFC 6902 standard is not always suitable for specifying configuration patches.
For this reason, the system allows specifying configuration patches as query parameters in the URL (all gateways) or using a configuration message (WS Gateway only).
The query parameters are specified in the URL of the request, and they are used to specify the configuration patches that should be applied to the stream configuration template.
Every patch query parameter can be explicitly marked as a patch by using the patches. prefix. If the prefix is not specified, all undocumented query parameters are considered as patches.
To use the add operation, prefix the patch value with +. For example, to add the language property with the value en, use the following query parameter:
The rules of the configuration patches are the same as for the query parameters.
For example, the configuration message that changes the tone of the summary generated by the LLM processor from Conversational to Formal looks like this:
A configuration message can contain as many patches as needed, and without any (reasonable) length limitation.
The configuration message can be used alongside the query parameters, and the patches from the configuration message will overwrite the patches from the query parameters.
Use the configuration message only when you need to specify a longer value that would not fit in the URL.
Each patch path must contain the index of the processor to which the patch should be applied.
This may be problematic if the processors order is changed, and the indexes are not updated accordingly.
This can be avoided by using the processor ID instead of the index.