Object.FunctionCalling (object v0.1.2)

LLM-powered function calling system for Object self-organization.

This module enables Objects to:

  1. Dynamically discover and call functions on other Objects
  2. Use LLM reasoning to select appropriate functions and parameters
  3. Compose complex workflows through chained function calls
  4. Adapt function calling strategies based on outcomes
  5. Self-organize through coordinated function execution

The system treats each Object method as a callable function that can be invoked remotely with LLM-generated parameters and context.

Summary

Functions

Adapts function calling strategies based on execution outcomes.

Discovers and suggests optimal function calls for achieving a goal.

Executes a composed workflow of function calls with dependency management.

Executes a function call using LLM reasoning to determine parameters.

Initializes the function calling system.

Registers an Object and its callable functions in the system.

Types

execution_record()

@type execution_record() :: %{
  function_id: String.t(),
  caller_object: String.t(),
  target_object: String.t(),
  parameters: map(),
  result: any(),
  success: boolean(),
  timestamp: DateTime.t(),
  reasoning_chain: [String.t()]
}

policy()

@type policy() :: %{condition: function(), adaptation: atom(), threshold: float()}

t()

@type t() :: %Object.FunctionCalling{
  adaptation_policies: [policy()],
  execution_history: [execution_record()],
  function_catalog: map(),
  object_registry: map()
}

Functions

adapt_execution_strategy(system, caller_object, performance_metrics)

Adapts function calling strategies based on execution outcomes.

collaborative_function_execution(system, participating_objects, shared_goal, coordination_strategy \\ :consensus)

Enables collaborative function calling between multiple Objects.

discover_function_composition(system, caller_object, goal_description, constraints \\ [])

Discovers and suggests optimal function calls for achieving a goal.

execute_function_composition(system, caller_object, composition)

Executes a composed workflow of function calls with dependency management.

execute_llm_function_call(system, caller_object, target_function, intent, context \\ %{})

Executes a function call using LLM reasoning to determine parameters.

new(opts \\ [])

Initializes the function calling system.

register_object(system, object)

Registers an Object and its callable functions in the system.