Miscellaneous functions
fromAi(value)
Camunda Extension
Returns the unmodified value
parameter.
- The purpose of this function is solely to tag the value as being generated by an AI integration.
- The actual handling is not performed by the FEEL engine, but by a custom integration such as a connector or a job worker.
See the following function overloads for additional function parameters.
Function signature
fromAi(value: Any): Any
Examples
fromAi(toolCall.searchQuery)
// toolCall.searchQuery contents
fromAi(toolCall.userId)
// toolCall.userId contents
fromAi("A")
// "A" - does not make much sense and might be flagged as an error by the integration consuming the definition
fromAi(value, description)
Camunda Extension
Returns the unmodified value
parameter.
In addition to the previous overload, it also accepts an optional description
parameter to provide a textual description of the value.
Function signature
fromAi(value: Any, description: string): Any
Examples
fromAi(toolCall.searchQuery, "The search query used to find the best match.")
// toolCall.searchQuery contents
fromAi(toolCall.searchQuery, null)
// toolCall.searchQuery contents
fromAi(value, description, type)
Camunda Extension
Returns the unmodified value
parameter.
In addition to the previous overload, it also accepts an optional type
parameter to provide type information about the value.
Function signature
fromAi(value: Any, description: string, type: string): Any
Examples
fromAi(toolCall.searchQuery, "The search query used to find the best match.", "string")
// toolCall.searchQuery contents
fromAi(toolCall.userId, "The user's ID", "number")
// toolCall.userId contents
fromAi(toolCall.userId, null, "number")
// toolCall.userId contents
fromAi(value: toolCall.userId, type: "number")
// toolCall.userId contents
fromAi(value, description, type, schema)
Camunda Extension
Returns the unmodified value
parameter.
In addition to the previous overload, it also accepts an optional schema
parameter to provide a (partial) JSON schema for the value.
- The schema is not validated by the FEEL engine but might be by a custom integration consuming the information.
- From the engine side it is possible to specify both a
type
and aschema
, and it depends on the integration as to which value takes precedence.
Function signature
fromAi(value: Any, description: string, type: string, schema: context): Any
Examples
fromAi(toolCall.documentType, "The document type to provide", "string", {
enum: ["invoice", "receipt", "contract"]
})
// toolCall.documentType contents
fromAi(value: toolCall.documentType, description: "The document type to provide", schema: {
type: "string",
enum: ["invoice", "receipt", "contract"]
})
// toolCall.documentType contents
fromAi(toolCall.tags, "Tags to apply to the blog post", "array", {
items: {
type: "string"
}
})
// toolCall.tags contents
fromAi(value, description, type, schema, options)
Camunda Extension
Returns the unmodified value
parameter.
In addition to the previous overload, it also accepts an optional options
parameter to provide additional options for the integration handling the value definition.
Function signature
fromAi(value: Any, description: string, type: string, schema: context, options: context): Any
Examples
fromAi(toolCall.documentType, "The document type to provide", "string", null, {
strict: true,
required: false
})
// toolCall.documentType contents
fromAi(value: toolCall.documentType, options: {
strict: true,
required: false
})
// toolCall.documentType contents