File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace LLM \Agents \OpenAI \Client \Integration \Laravel ;
6
6
7
+ use Illuminate \Contracts \Foundation \Application ;
7
8
use Illuminate \Support \ServiceProvider ;
8
9
use LLM \Agents \LLM \LLMInterface ;
9
10
use LLM \Agents \OpenAI \Client \LLM ;
@@ -22,13 +23,14 @@ public function register(): void
22
23
23
24
$ this ->app ->singleton (
24
25
StreamResponseParser::class,
25
- static function (
26
- ChatResponseParser $ chatResponseParser ,
27
- ): StreamResponseParser {
26
+ static function (Application $ app ): StreamResponseParser {
28
27
$ parser = new StreamResponseParser ();
29
28
30
29
// Register parsers here
31
- $ parser ->registerParser (CreateStreamedResponse::class, $ chatResponseParser );
30
+ $ parser ->registerParser (
31
+ CreateStreamedResponse::class,
32
+ $ app ->make (ChatResponseParser::class),
33
+ );
32
34
33
35
return $ parser ;
34
36
},
Original file line number Diff line number Diff line change 4
4
5
5
namespace LLM \Agents \OpenAI \Client \Integration \Spiral ;
6
6
7
- use Illuminate \Contracts \Foundation \Application ;
8
7
use LLM \Agents \LLM \LLMInterface ;
9
8
use LLM \Agents \OpenAI \Client \LLM ;
10
9
use LLM \Agents \OpenAI \Client \Parsers \ChatResponseParser ;
@@ -19,14 +18,13 @@ public function defineSingletons(): array
19
18
return [
20
19
LLMInterface::class => LLM ::class,
21
20
22
- StreamResponseParser::class => static function (Application $ app ): StreamResponseParser {
21
+ StreamResponseParser::class => static function (
22
+ ChatResponseParser $ chatResponseParser ,
23
+ ): StreamResponseParser {
23
24
$ parser = new StreamResponseParser ();
24
25
25
26
// Register parsers here
26
- $ parser ->registerParser (
27
- CreateStreamedResponse::class,
28
- $ app ->make (ChatResponseParser::class)
29
- );
27
+ $ parser ->registerParser (CreateStreamedResponse::class, $ chatResponseParser );
30
28
31
29
return $ parser ;
32
30
},
You can’t perform that action at this time.
0 commit comments