Skip to main content

Module expression

Module expression 

Source
Expand description

Expression evaluation engine for Function compilation.

This module provides the expression system used by Functions to define dynamic behavior. Expressions are evaluated against input data and task results to produce concrete values.

§Supported Languages

  • JMESPath ({"$jmespath": "..."}) - JSON query language
  • Starlark ({"$starlark": "..."}) - Python-like configuration language

§Key Types

  • Expression - Either a JMESPath or Starlark expression
  • WithExpression<T> - Either a literal value or an expression
  • InputValue - The input data structure passed to expressions
  • Params - Context available during expression evaluation

§Expression Context

Expressions can access:

  • input - The function’s input data
  • tasks - Results from previously executed tasks
  • map - Current map element (when in mapped task context)

Structs§

AnyOfInputSchema
Schema for a union of possible types - input must match at least one.
ArrayInputSchema
Schema for an array input.
AudioInputSchema
Schema for an audio input.
BooleanInputSchema
Schema for a boolean input.
FileInputSchema
Schema for a file input.
ImageInputSchema
Schema for an image input (URL or base64-encoded).
IntegerInputSchema
Schema for an integer input.
Modalities
Which media modalities are present in a schema.
NumberInputSchema
Schema for a floating-point number input.
ObjectInputSchema
Schema for an object input with named properties.
ParamsOwned
Owned version of expression parameters.
ParamsRef
Borrowed version of expression parameters.
StringInputSchema
Schema for a string input.
VideoInputSchema
Schema for a video input (URL or base64-encoded).

Enums§

ArrayInputSchemaType
AudioInputSchemaType
BooleanInputSchemaType
Expression
An expression that can be either JMESPath or Starlark.
ExpressionError
Errors that can occur when compiling expressions.
FileInputSchemaType
ImageInputSchemaType
InputSchema
Schema for validating Function input.
InputValue
A concrete input value (post-compilation).
InputValueExpression
An input value that may contain expressions (pre-compilation).
IntegerInputSchemaType
NumberInputSchemaType
ObjectInputSchemaType
OneOrMany
Result of an expression that may produce one or many values.
Params
Context for evaluating expressions (JMESPath or Starlark).
Special
Predefined expression behaviors that require no user-authored code.
StringInputSchemaType
TaskOutput
Output from an executed task.
TaskOutputOwned
Owned task output variants.
TaskOutputRef
Borrowed task output variants.
VideoInputSchemaType
WithExpression
A value that can be either a literal or an expression.

Statics§

JMESPATH_RUNTIME
Global JMESPath runtime instance with custom functions.

Traits§

FromSpecial
Trait for types that can be produced from a Special expression variant.
FromStarlarkValue
Trait for converting a Starlark runtime value into a Rust type.
ToStarlarkValue
Trait for direct conversion to Starlark values (bypassing serde_json).