Skip to main content

Module functions

Module functions 

Source
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 schema
  • InlineFunction - 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

§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 types
  • expression - 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§

InlineTasksProfile
An inline tasks-based profile definition without metadata.
PlaceholderScalarFunctionTask
A compiled placeholder scalar function task.
PlaceholderScalarFunctionTaskExpression
Expression for a placeholder scalar function task (pre-compilation).
PlaceholderVectorFunctionTask
A compiled placeholder vector function task.
PlaceholderVectorFunctionTaskExpression
Expression for a placeholder vector function task (pre-compilation).
RemoteTasksProfile
A remote tasks-based profile with full metadata.
ScalarFunctionTask
A compiled scalar function task ready for execution.
ScalarFunctionTaskExpression
Expression for a task that calls a scalar function (pre-compilation).
VectorCompletionTask
A compiled vector completion task ready for execution.
VectorCompletionTaskExpression
Expression for a task that runs a vector completion (pre-compilation).
VectorFunctionTask
A compiled vector function task ready for execution.
VectorFunctionTaskExpression
Expression for a task that calls a vector function (pre-compilation).

Enums§

AlphaInlineFunction
AlphaRemoteFunction
CompiledTask
The result of compiling a task expression.
FullFunction
A full function, either remote or inline.
FullInlineFunction
FullInlineFunctionOrRemoteCommitOptional
A function specification that is either a full inline function definition or a remote path reference.
FullRemoteFunction
Function
A Function definition, either remote or inline.
FunctionType
InlineFunction
An inline function definition without metadata.
InlineProfile
An inline profile, either tasks-based or auto.
InlineProfileOrRemoteCommitOptional
A profile specification that is either an inline profile definition or a remote path reference.
Profile
A Profile definition, either remote or inline.
RemoteFunction
A remote function with full metadata.
RemoteProfile
A remote profile, either tasks-based or auto.
Task
A compiled task ready for execution.
TaskExpression
A task definition with expressions (pre-compilation).
TaskProfile
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.