Object.LLMIntegration (object v0.1.2)
Enhanced LLM integration for AAOS objects using DSPy.
This module enables objects to:
- Respond to messages using LLM-powered natural language
- Generate contextual responses based on object state and history
- Adapt their communication style based on interaction patterns
- Use structured reasoning for complex decisions
Usage Examples:
# Basic LLM response generation
{:ok, response} = Object.LLMIntegration.generate_response(object, incoming_message)
# Contextual conversation
{:ok, response} = Object.LLMIntegration.conversational_response(object, message, conversation_history)
# Goal-oriented reasoning
{:ok, plan} = Object.LLMIntegration.reason_about_goal(object, goal, current_situation)
Summary
Functions
Enables objects to engage in collaborative reasoning with other objects.
Generates contextual conversation responses maintaining conversation state.
Creates a custom DSPy signature for specific object interactions.
Generates an LLM-powered response to an incoming message.
Uses LLM reasoning for complex goal-oriented decisions.
Registers a custom signature for reuse across objects.
Functions
Enables objects to engage in collaborative reasoning with other objects.
Parameters
objects
: List of objects participating in reasoningshared_problem
: Problem to solve collaborativelycollaboration_type
: Type of collaboration (:consensus
,:negotiation
, etc.)
Returns
{:ok, collaboration_result}
with synthesized solution and role assignments
Generates contextual conversation responses maintaining conversation state.
Parameters
object
: The object in conversationmessage
: Current message to respond toconversation_history
: Previous messages in conversation (default: [])
Returns
{:ok, response, updated_object}
with conversational response
Creates a custom DSPy signature for specific object interactions.
Parameters
name
: Name for the signaturedescription
: Description of what the signature doesinputs
: List of input fieldsoutputs
: List of output fieldsinstructions
: Instructions for the LLM
Returns
Signature specification map
Generates an LLM-powered response to an incoming message.
Parameters
object
: The object generating the responsemessage
: Incoming message to respond toopts
: Options like:style
,:max_length
Returns
{:ok, response, updated_object}
with generated response and updated object state
Examples
iex> Object.LLMIntegration.generate_response(object, message)
{:ok, %{content: "I understand your request...", tone: "helpful"}, updated_object}
Uses LLM reasoning for complex goal-oriented decisions.
Parameters
object
: The reasoning objectgoal
: Goal to reason aboutcurrent_situation
: Current state and contextconstraints
: Limitations to consider (default: [])
Returns
{:ok, reasoning_result, updated_object}
with detailed reasoning analysis
Registers a custom signature for reuse across objects.
Parameters
signature
: Signature specification to register
Returns
{:ok, signature_name}
on successful registration