lwazi 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lwazi",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Lwazi is an AI assistant for Laravel. Install with one command to add an AI assistant to your Laravel app.",
5
5
  "main": "bin/lwazi.js",
6
6
  "bin": {
@@ -122,7 +122,9 @@ class RagService
122
122
 
123
123
  $summary .= "MODELS:\n";
124
124
  foreach ($this->projectKnowledge['models'] ?? [] as $model) {
125
- $summary .= "- {$model['name']} (table: {$model['table']})\n";
125
+ $modelName = $model['name'] ?? $model['class'] ?? 'Unknown';
126
+ $modelTable = $model['table'] ?? 'N/A';
127
+ $summary .= "- {$modelName} (table: {$modelTable})\n";
126
128
  if (!empty($model['fields'])) {
127
129
  $summary .= ' fields: ' . implode(', ', $model['fields']) . "\n";
128
130
  }
@@ -20,11 +20,12 @@ class ToolRegistry
20
20
  $context = $ragService?->getContextConfig() ?? [];
21
21
  $this->contextColumn = $context['column'] ?? (config('lwazi.context_column') ?: null);
22
22
  $this->contextParam = $context['param'] ?? config('lwazi.context_param', 'context_id');
23
- $this->modelPaths =
24
- $ragService?->getModelPaths() ?: config('lwazi.model_paths', ['app/Models', 'app']);
25
- if (is_string($this->modelPaths)) {
26
- $this->modelPaths = array_map('trim', explode(',', $this->modelPaths));
23
+
24
+ $modelPaths = $ragService?->getModelPaths() ?: config('lwazi.model_paths', 'app/Models,app');
25
+ if (is_string($modelPaths)) {
26
+ $modelPaths = array_map('trim', explode(',', $modelPaths));
27
27
  }
28
+ $this->modelPaths = $modelPaths;
28
29
 
29
30
  $this->discoverModels();
30
31
  $this->registerDynamicTools();