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 expressionWithExpression<T>- Either a literal value or an expressionInputValue- The input data structure passed to expressionsParams- Context available during expression evaluation
§Expression Context
Expressions can access:
input- The function’s input datatasks- Results from previously executed tasksmap- Current map element (when in mapped task context)
Structs§
- AnyOf
Input Schema - Schema for a union of possible types - input must match at least one.
- Array
Input Schema - Schema for an array input.
- Audio
Input Schema - Schema for an audio input.
- Boolean
Input Schema - Schema for a boolean input.
- File
Input Schema - Schema for a file input.
- Image
Input Schema - Schema for an image input (URL or base64-encoded).
- Integer
Input Schema - Schema for an integer input.
- Modalities
- Which media modalities are present in a schema.
- Number
Input Schema - Schema for a floating-point number input.
- Object
Input Schema - Schema for an object input with named properties.
- Params
Owned - Owned version of expression parameters.
- Params
Ref - Borrowed version of expression parameters.
- String
Input Schema - Schema for a string input.
- Video
Input Schema - Schema for a video input (URL or base64-encoded).
Enums§
- Array
Input Schema Type - Audio
Input Schema Type - Boolean
Input Schema Type - Expression
- An expression that can be either JMESPath or Starlark.
- Expression
Error - Errors that can occur when compiling expressions.
- File
Input Schema Type - Image
Input Schema Type - Input
Schema - Schema for validating Function input.
- Input
Value - A concrete input value (post-compilation).
- Input
Value Expression - An input value that may contain expressions (pre-compilation).
- Integer
Input Schema Type - Number
Input Schema Type - Object
Input Schema Type - OneOr
Many - 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.
- String
Input Schema Type - Task
Output - Output from an executed task.
- Task
Output Owned - Owned task output variants.
- Task
Output Ref - Borrowed task output variants.
- Video
Input Schema Type - With
Expression - A value that can be either a literal or an expression.
Statics§
- JMESPATH_
RUNTIME - Global JMESPath runtime instance with custom functions.
Traits§
- From
Special - Trait for types that can be produced from a
Specialexpression variant. - From
Starlark Value - Trait for converting a Starlark runtime value into a Rust type.
- ToStarlark
Value - Trait for direct conversion to Starlark values (bypassing serde_json).