Skip to main content
Version: 8.8

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.

The main use case of this function is for tool definitions used by the AI Agent connector.

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(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. The description must be null or a string constant.

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. The type must be null or a string constant.

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 must be null or a context (map) containing only constant values. For example, function calls within the schema are not supported.
  • 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 a schema, and it depends on the integration as to which value takes precedence. The AI Agent connector will override any type specified in the schema if the type parameter is also provided.

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.

  • The options parameter must be null or a context (map) containing only constant values. For example, function calls within options are not supported.

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, {
required: false
})
// toolCall.documentType contents

fromAi(value: toolCall.documentType, options: {
required: false
})
// toolCall.documentType contents