LLM Models without Agent Frameworks

Choose this approach when you want direct control over LLM interactions and custom tool execution. Perfect for simple automations and specific use cases.

Single Query (Quick Start)

Send one-off queries to your preferred LLM with built-in tool support.

response = openai_client.chat.completions.create(
    model="gpt-4-turbo",
    messages=agent.messages,
    tools=agent.get_tools(llm_provider=LLMProvider.OPENAI),
    tool_choice="auto",
    temperature=0.0
)

# Process and execute tools
agent.process_llm_response(
    response.model_dump(), 
    llm_provider=LLMProvider.OPENAI
)

Event streaming (Slack, Teams, RestAPI, Realtime voice)

Handle real-time events and messages from various platforms with continuous LLM interactions.

def handle_event(event):
    response = openai_client.chat.completions.create(
        model="gpt-4-turbo",
        messages=agent.messages,
        tools=agent.get_tools(llm_provider=LLMProvider.OPENAI),
        tool_choice="auto",
        temperature=0.0
    )
    
    agent.process_llm_response(
        response.model_dump(), 
        llm_provider=LLMProvider.OPENAI
    )

xpander_agent.start_event_listener()

Multi-Step Tasks

Break down complex tasks into manageable steps with automatic tool execution and state management.

task = """
Find employees of xpander.ai and their roles.
Then check their LinkedIn profiles for recent updates.
"""
agent.add_task(task)

while not agent.is_finished():
    response = openai_client.chat.completions.create(
        model="gpt-4-turbo",
        messages=agent.messages,
        tools=agent.get_tools(llm_provider=LLMProvider.OPENAI),
        tool_choice="auto",
        temperature=0.0
    )
    
    agent.process_llm_response(
        response.model_dump(), 
        llm_provider=LLMProvider.OPENAI
    )

Next Steps