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 generatetop_pโ nucleus samplingfrequency_penaltyโ reduce repetitionpresence_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! ๐