Expand description
Function definitions, profiles, and execution types.
Functions are composable scoring pipelines that transform structured input into scores. They are the primary interface for most ObjectiveAI users.
§Overview
A Function consists of:
- Input schema - Defines expected input structure
- Input maps - Optional expressions to transform input into arrays for mapped tasks
- Tasks - A list of operations (Vector Completions or nested Functions)
- Output - Expression that combines task results into final score(s)
§Function Types
RemoteFunction- Remote function with description and schemaInlineFunction- Inline function definition without metadata- Scalar - Produces a single score in [0, 1]
- Vector - Produces a vector of scores that sums to 1
§Task Types
ScalarFunctionTask- Calls a scalar functionVectorFunctionTask- Calls a vector functionVectorCompletionTask- Runs a vector completion
§Client-Side Compilation
Functions use expressions (JMESPath or Starlark) for dynamic behavior. The SDK can compile these expressions client-side to preview results during Function authoring:
Function::compile_tasks- Resolves task expressions to show final tasks for a given input- [
Function::compile_output] - Computes the final output given input and task outputs
§Submodules
executions- Function execution request/response typesexpression- Expression evaluation engine (JMESPath and Starlark)profiles- Profile management and computation
Modules§
- alpha_
scalar - alpha_
vector - check
- Shared quality-check helpers for function definitions.
- executions
- Function execution request and response types.
- expression
- Expression evaluation engine for Function compilation.
- inventions
- profiles
- Profile management and computation types.
- request
- Request types for function listing endpoints.
- response
- Function listing and usage response types.
Structs§
- Inline
Tasks Profile - An inline tasks-based profile definition without metadata.
- Placeholder
Scalar Function Task - A compiled placeholder scalar function task.
- Placeholder
Scalar Function Task Expression - Expression for a placeholder scalar function task (pre-compilation).
- Placeholder
Vector Function Task - A compiled placeholder vector function task.
- Placeholder
Vector Function Task Expression - Expression for a placeholder vector function task (pre-compilation).
- Remote
Tasks Profile - A remote tasks-based profile with full metadata.
- Scalar
Function Task - A compiled scalar function task ready for execution.
- Scalar
Function Task Expression - Expression for a task that calls a scalar function (pre-compilation).
- Vector
Completion Task - A compiled vector completion task ready for execution.
- Vector
Completion Task Expression - Expression for a task that runs a vector completion (pre-compilation).
- Vector
Function Task - A compiled vector function task ready for execution.
- Vector
Function Task Expression - Expression for a task that calls a vector function (pre-compilation).
Enums§
- Alpha
Inline Function - Alpha
Remote Function - Compiled
Task - The result of compiling a task expression.
- Full
Function - A full function, either remote or inline.
- Full
Inline Function - Full
Inline Function OrRemote Commit Optional - A function specification that is either a full inline function definition or a remote path reference.
- Full
Remote Function - Function
- A Function definition, either remote or inline.
- Function
Type - Inline
Function - An inline function definition without metadata.
- Inline
Profile - An inline profile, either tasks-based or auto.
- Inline
Profile OrRemote Commit Optional - A profile specification that is either an inline profile definition or a remote path reference.
- Profile
- A Profile definition, either remote or inline.
- Remote
Function - A remote function with full metadata.
- Remote
Profile - A remote profile, either tasks-based or auto.
- Task
- A compiled task ready for execution.
- Task
Expression - A task definition with expressions (pre-compilation).
- Task
Profile - Configuration for a single task within a Profile.
Functions§
- get_
function - Retrieves a function definition.
- get_
function_ profile_ pair_ usage - Gets usage statistics for a specific function-profile pair.
- get_
function_ usage - Gets usage statistics for a specific function.
- list_
function_ profile_ pairs - Lists all function-profile pairs accessible to the authenticated user.
- list_
functions - Lists all functions accessible to the authenticated user.