Back to Blog
#laravel#ai#gemini#function-calling

Introducing Obi: Supercharge Laravel with Google Gemini

Author Obelaw Team
Published
Introducing Obi: Supercharge Laravel with Google Gemini

We are thrilled to introduce Obi, a powerful new package that supercharges your Laravel applications with Google Gemini.

What is Obi?

Obi is designed to bridge the gap between Large Language Models (LLMs) and your application’s business logic. By seamlessly integrating LLM function-calling, Obi allows you to build intelligent, conversational interfaces that can actually do things—not just talk.

Imagine an AI assistant that can check stock levels, create orders, update user profiles, or trigger complex workflows, all through natural language conversations. That’s the power of Obi.

Powered by Google Gemini

Obi leverages the cutting-edge multimodal capabilities of Gemini 1.5 Pro and Flash. These models excel at understanding complex user intent, reasoning through problems, and executing precise actions via function calling.

Key capabilities include:

  • 1M+ Token Context: Handle massive amounts of information.
  • Text & Images: Process multimodal inputs.
  • Fast Inference: Low latency for real-time interactions.
  • JSON Mode: Structured output for reliable machine parsing.

How It Works

Connecting your Laravel app to Gemini with Obi is a simple three-step process:

  1. Define: Create tool declarations that map your PHP classes and methods to Gemini functions using simple, type-safe classes.
  2. Connect: Obi automatically handles the schema generation and communication with the Google Gemini API.
  3. Execute: Gemini intelligently calls your tools based on user input, and Obi executes the code securely within your application.

Key Features

  • Gemini Function Calling: Zero boilerplate integration.
  • Typed Declarations: Define tools with type-safe parameter schemas.
  • Database Registry: Fast O(1) lookup for tool execution.
  • Multiple Pools: Organize declarations for modular applications.
  • Artisan Commands: Scaffold, list, and build declarations effortlessly.
  • Simple Facade: Interact with Gemini easily using the Obi::prompt() interface.

Use Cases

What can you build with Obi? The possibilities are endless:

1. Customer Support Agents

Build bots that can authenticate users, look up order status from your database, process refunds according to policy, and update shipping details—all without human intervention.

2. Internal Admin Tools

Create a natural language interface for your admin panel. “Show me sales from last week,” “Banning user ID 45,” or “Generate the monthly report” become executable commands.

3. Automated Data Processing

Parse unstructured emails or documents and extract structured data directly into your Eloquent models.

Get Started

Ready to build intelligent agents? Check out the repositories:

Stay tuned for more tutorials and deep dives into building with Obi!

Thanks for reading!