Object.DSPyBridge (object v0.1.2)
Bridge module integrating DSPy framework with AAOS objects for advanced reasoning capabilities. Enables objects to use DSPy signatures and LM Studio inference for intelligent behavior.
Summary
Functions
Returns a specification to start this module under a supervisor.
Executes a DSPy signature directly with the provided specification.
Gets performance metrics for the DSPy bridge.
Callback implementation for GenServer.handle_continue/2
.
Callback implementation for GenServer.init/1
.
Executes reasoning using a registered DSPy signature.
Registers a new DSPy signature for an object.
Starts a DSPy bridge process for the given object.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Executes a DSPy signature directly with the provided specification.
Parameters
object_id
: ID of the objectsignature
: Signature specification to execute
Returns
{:ok, result}
with structured output or {:error, reason}
Gets performance metrics for the DSPy bridge.
Parameters
object_id
: ID of the object
Returns
Map with query count, cache hits, and average latency
Callback implementation for GenServer.handle_continue/2
.
Callback implementation for GenServer.init/1
.
Executes reasoning using a registered DSPy signature.
Parameters
object_id
: ID of the objectsignature_name
: Name of the signature to useinputs
: Input data for reasoningoptions
: Optional parameters like max_tokens, temperature
Returns
{:ok, result}
with structured reasoning output or {:error, reason}
Examples
iex> Object.DSPyBridge.reason_with_signature("obj1", :message_analysis, %{content: "Hello"})
{:ok, %{intent: "greeting", confidence: 0.9}}
Registers a new DSPy signature for an object.
Parameters
object_id
: ID of the objectsignature_name
: Name for the signaturesignature_spec
: Specification with description, inputs, outputs, instructions
Returns
:ok
on successful registration
Starts a DSPy bridge process for the given object.
Parameters
object_id
: ID of the object to create bridge for
Returns
{:ok, pid}
on successful startup