File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 3
3
use PhpLlm \LlmChain \Bridge \OpenAI \DallE ;
4
4
use PhpLlm \LlmChain \Bridge \OpenAI \DallE \ImageResponse ;
5
5
use PhpLlm \LlmChain \Bridge \OpenAI \PlatformFactory ;
6
- use PhpLlm \LlmChain \Model \Response \AsyncResponse ;
7
6
use Symfony \Component \Dotenv \Dotenv ;
8
7
9
8
require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
24
23
],
25
24
);
26
25
27
- if ($ response instanceof AsyncResponse) {
28
- $ response = $ response ->unwrap ();
29
- }
30
-
31
26
assert ($ response instanceof ImageResponse);
32
27
33
28
echo 'Revised Prompt: ' .$ response ->revisedPrompt .PHP_EOL .PHP_EOL ;
Original file line number Diff line number Diff line change @@ -36,4 +36,17 @@ public function unwrap(): ResponseInterface
36
36
37
37
return $ this ->convertedResponse ;
38
38
}
39
+
40
+ /**
41
+ * @param array<int, mixed> $arguments
42
+ */
43
+ public function __call (string $ name , array $ arguments ): mixed
44
+ {
45
+ return $ this ->unwrap ()->{$ name }(...$ arguments );
46
+ }
47
+
48
+ public function __get (string $ name ): mixed
49
+ {
50
+ return $ this ->unwrap ()->{$ name };
51
+ }
39
52
}
You can’t perform that action at this time.
0 commit comments