File tree 11 files changed +16
-27
lines changed
11 files changed +16
-27
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace LlmLaraHub \LlmDriver \Functions ;
4
4
5
- use App \Domains \Documents \StatusEnum ;
6
- use App \Domains \Documents \TypesEnum ;
7
- use App \Domains \Sources \WebSearch \Response \SearchResponseDto ;
8
- use App \Domains \Sources \WebSearch \WebSearchFacade ;
9
- use App \Models \Document ;
10
- use Facades \App \Domains \Tokenizer \Templatizer ;
11
5
use App \Helpers \ChatHelperTrait ;
6
+ use App \Models \Document ;
12
7
use App \Models \Message ;
13
- use Facades \App \Domains \Sources \WebSearch \GetPage ;
14
8
use Illuminate \Support \Facades \Log ;
15
- use LlmLaraHub \LlmDriver \LlmDriverFacade ;
16
9
use LlmLaraHub \LlmDriver \Responses \FunctionResponse ;
17
10
use LlmLaraHub \LlmDriver \ToolsHelper ;
18
11
Original file line number Diff line number Diff line change @@ -186,7 +186,6 @@ public function completion(string $prompt): CompletionResponse
186
186
'stream ' => false ,
187
187
]);
188
188
189
-
190
189
return OllamaCompletionResponse::from ($ response ->json ());
191
190
}
192
191
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public function __construct(
12
12
#[WithCastable(ClaudeContentCaster::class)]
13
13
public mixed $ content ,
14
14
public string |Optional $ stop_reason ,
15
- public string | null $ tool_used = "" ,
15
+ public ? string $ tool_used = '' ,
16
16
/** @var array<ToolDto> */
17
17
#[WithCastable(ClaudeToolCaster::class)]
18
18
#[MapInputName('content ' )]
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class CompletionResponse extends \Spatie\LaravelData\Data
9
9
public function __construct (
10
10
public mixed $ content ,
11
11
public string |Optional $ stop_reason ,
12
- public string | null $ tool_used = "" ,
12
+ public ? string $ tool_used = '' ,
13
13
/** @var array<ToolDto> */
14
14
public array $ tool_calls = [],
15
15
public ?int $ input_tokens = null ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public function __construct(
12
12
public mixed $ content ,
13
13
#[MapInputName('done_reason ' )]
14
14
public string |Optional $ stop_reason ,
15
- public string | null $ tool_used = "" ,
15
+ public ? string $ tool_used = '' ,
16
16
/** @var array<OllamaToolDto> */
17
17
#[MapInputName('message.tool_calls ' )]
18
18
public array $ tool_calls = [],
Original file line number Diff line number Diff line change @@ -92,10 +92,10 @@ public function handle(): void
92
92
Bus::batch ([
93
93
[
94
94
new TagDocumentJob ($ document ),
95
- new DocumentProcessingCompleteJob ($ document )
96
- ]
95
+ new DocumentProcessingCompleteJob ($ document ),
96
+ ],
97
97
])
98
- ->name (" Finalizing Documents " )
98
+ ->name (' Finalizing Documents ' )
99
99
->allowFailures ()
100
100
->dispatch ();
101
101
})
Original file line number Diff line number Diff line change 19
19
use Illuminate \Support \Facades \Bus ;
20
20
use Illuminate \Support \Facades \Log ;
21
21
use LlmLaraHub \LlmDriver \HasDrivers ;
22
- use LlmLaraHub \LlmDriver \LlmDriverFacade ;
23
22
use LlmLaraHub \TagFunction \Contracts \TaggableContract ;
24
23
use LlmLaraHub \TagFunction \Helpers \Taggable ;
25
24
use LlmLaraHub \TagFunction \Jobs \TagDocumentJob ;
@@ -164,7 +163,7 @@ public static function make(
164
163
string $ content ,
165
164
Collection $ collection ,
166
165
?string $ filePath = null
167
- ) : Document {
166
+ ): Document {
168
167
return Document::create ([
169
168
'file_path ' => $ filePath ,
170
169
'collection_id ' => $ collection ->id ,
@@ -213,10 +212,10 @@ public function vectorizeDocument(): void
213
212
[
214
213
new SummarizeDocumentJob ($ document ),
215
214
new TagDocumentJob ($ document ),
216
- new DocumentProcessingCompleteJob ($ document )
217
- ]
215
+ new DocumentProcessingCompleteJob ($ document ),
216
+ ],
218
217
])
219
- ->name (" Finalizing Documents " )
218
+ ->name (' Finalizing Documents ' )
220
219
->allowFailures ()
221
220
->dispatch ();
222
221
})
Original file line number Diff line number Diff line change 9
9
use App \Events \MessageCreatedEvent ;
10
10
use App \Jobs \OrchestrateJob ;
11
11
use App \Jobs \SimpleRetrieveRelatedOrchestrateJob ;
12
- use App \Jobs \SimpleSearchAndSummarizeOrchestrateJob ;
13
12
use Facades \App \Domains \Tokenizer \Templatizer ;
14
13
use Illuminate \Bus \Batch ;
15
14
use Illuminate \Database \Eloquent \Factories \HasFactory ;
Original file line number Diff line number Diff line change 11
11
use App \Models \User ;
12
12
use Facades \App \Domains \Agents \VerifyResponseAgent ;
13
13
use Facades \LlmLaraHub \LlmDriver \Orchestrate ;
14
- use Illuminate \Support \Facades \Bus ;
15
14
use LlmLaraHub \LlmDriver \LlmDriverFacade ;
16
15
use LlmLaraHub \LlmDriver \Responses \CompletionResponse ;
17
16
use Tests \TestCase ;
@@ -178,8 +177,6 @@ public function test_kick_off_chat_makes_system()
178
177
179
178
}
180
179
181
-
182
-
183
180
public function test_standard_checker ()
184
181
{
185
182
Orchestrate::shouldReceive ('handle ' )->once ()->andReturn ('Yo ' );
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ public function test_parent()
37
37
$ model ->parent ->id );
38
38
}
39
39
40
- public function test_document_make () {
40
+ public function test_document_make ()
41
+ {
41
42
$ collection = \App \Models \Collection::factory ()->create ();
42
43
$ document = Document::make ('Foo bar ' ,
43
44
$ collection );
@@ -48,7 +49,8 @@ public function test_document_make() {
48
49
$ this ->assertNotNull ($ document ->collection ->documents ()->first ()->id );
49
50
}
50
51
51
- public function test_document_vectorize () {
52
+ public function test_document_vectorize ()
53
+ {
52
54
Bus::fake ();
53
55
$ collection = \App \Models \Collection::factory ()->create ();
54
56
$ document = Document::make ('Foo bar ' ,
Original file line number Diff line number Diff line change 4
4
5
5
use App \Domains \Agents \VerifyPromptOutputDto ;
6
6
use App \Domains \Chat \MetaDataDto ;
7
- use App \Domains \Messages \RoleEnum ;
8
7
use App \Domains \Messages \RetrieveRelatedChatRepo ;
8
+ use App \Domains \Messages \RoleEnum ;
9
9
use App \Models \Chat ;
10
10
use App \Models \Collection ;
11
11
use App \Models \Document ;
You can’t perform that action at this time.
0 commit comments