We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68219a7 commit 6eea4dbCopy full SHA for 6eea4db
src/Services/GrokVision.php
@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+namespace GrokPHP\Laravel\Services;
4
5
+use GrokPHP\Client\Clients\GrokClient;
6
+use GrokPHP\Client\Enums\Model;
7
+use GrokPHP\Client\Exceptions\GrokException;
8
+use GrokPHP\Laravel\Support\GrokResponse;
9
10
+class GrokVision
11
+{
12
+ protected GrokClient $client;
13
14
+ public function __construct(GrokClient $client)
15
+ {
16
+ $this->client = $client;
17
+ }
18
19
+ /**
20
+ * Analyze an image using Grok Vision models.
21
+ * @throws GrokException
22
+ */
23
+ public function analyze(string $imagePath, string $prompt, ?Model $model = null): GrokResponse
24
25
+ $response = $this->client->vision()->analyze($imagePath, $prompt, $model);
26
27
+ return new GrokResponse($response);
28
29
+}
0 commit comments