Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Larai Kit Laravel Package

laraigent/larai-kit

View on GitHub
Deep Wiki
Context7

Testing

Agent Fakes

Use Laravel AI SDK's fake() method to test without calling real APIs:

use LarAIgent\AiKit\Agents\SupportAgent;

SupportAgent::fake(['This is a test response.']);

$response = (new SupportAgent())->prompt('Hello');
$this->assertEquals('This is a test response.', (string) $response);

Testing the ChatService

use LarAIgent\AiKit\Agents\SupportAgent;
use LarAIgent\AiKit\Services\Chat\ChatService;

SupportAgent::fake(['Mocked reply.']);

$chat = app(ChatService::class);
$result = $chat->sendMessage('Hello');

$this->assertEquals('Mocked reply.', $result['reply']);

Testing with NullVectorStore

When LARAI_VECTOR_STORE=none in your test environment, the NullVectorStore is used automatically. RAG features return empty results gracefully.

In phpunit.xml:

<env name="LARAI_VECTOR_STORE" value="none"/>
<env name="LARAI_AI_PROVIDER" value="openai"/>

FeatureDetector in Tests

use LarAIgent\AiKit\Services\FeatureDetector;

$detector = app(FeatureDetector::class);

config(['larai-kit.vector_store' => 'none']);
$this->assertFalse($detector->ragEnabled());

config(['larai-kit.ai_provider' => 'openai']);
$this->assertEquals('openai', $detector->aiProvider());

Chunker Unit Test

use LarAIgent\AiKit\Services\Ingestion\Chunker;

$chunker = new Chunker(chunkSize: 20, overlap: 5);
$chunks = $chunker->chunk('Your long document text here...');

$this->assertNotEmpty($chunks);
$this->assertEquals(0, $chunks[0]['chunk_index']);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed