LarAgent v0.5 Preview: Smarter Streaming, Better Control, and New OpenAI Parameters!

LarAgent keeps evolving to give Laravel developers the most reliable, configurable, and developer-friendly AI agent experience.

In this upcoming release, we're tackling streaming reliability, adding advanced OpenAI tuning parameters, and giving you fine-grained control over tool selection.

Let’s dig in 👇


🔹 Reliable Streaming with Usage Tracking

Streaming responses just got smarter.

We’ve improved how LarAgent handles streamed responses by:

  • ✅ Fixing a bug that duplicated the final chunk of streamed messages
  • ✅ Making sure usage statistics are updated correctly — even during streaming
  • ✅ Ensuring consistency between streamed and non-streamed behavior

This means no more inaccurate token counts and no more broken UI experiences during long responses.


🔹 Support for OpenAI Parameters

You now have full access to fine-tuning parameters available in OpenAI’s API:

  • n – number of completions to generate
  • top_p – nucleus sampling
  • frequency_penalty – reduce repetition
  • presence_penalty – encourage topic diversity

These are now:

  • ✅ Included in the LarAgent config
  • ✅ Passed from provider defaults
  • ✅ Fully overrideable per-agent or per-request

Perfect for developers who want precise control over generation behavior. 🔬


🔹 Tool Choice Configuration in Agents

Use tools your way — with precision.

We’ve added new methods in your Agent to let you control how the LLM selects and uses tools:

$this->toolAuto();      // Default behavior (model decides)
$this->toolNone();      // Disable tool use
$this->toolRequired();  // Only respond with a tool
$this->forceTool('myTool'); // Force a specific tool
$this->getToolChoice(); // Get current setting

This makes your agents more predictable, testable, and production-safe when using tools for function calling, external APIs, or DB access.


🧪 These features are already merged and will be released in v0.5 very soon.

LarAgent is on a mission to make AI development in Laravel not just possible — but powerful, clean, and fun.

Stay tuned and star the repo if you haven’t already — we’re just getting started.
Happy building! 🚀

Read more