@@ -71,6 +71,7 @@ public function getResponseBody(): ?stdClass
71
71
72
72
/**
73
73
* Convert the exception details to an array.
74
+ *
74
75
* @throws JsonException
75
76
*/
76
77
public function toArray (): array
@@ -86,6 +87,7 @@ public function toArray(): array
86
87
87
88
/**
88
89
* Convert the exception details to JSON.
90
+ *
89
91
* @throws JsonException
90
92
*/
91
93
public function toJson (): string
@@ -95,6 +97,7 @@ public function toJson(): string
95
97
96
98
/**
97
99
* Create a `GrokException` from an API response.
100
+ *
98
101
* @throws JsonException
99
102
*/
100
103
public static function fromResponse (ResponseInterface $ response ): self
@@ -125,6 +128,7 @@ public static function fromResponse(ResponseInterface $response): self
125
128
126
129
/**
127
130
* Handle exceptions from Guzzle.
131
+ *
128
132
* @throws JsonException
129
133
*/
130
134
public static function fromGuzzleException (ClientException $ exception ): self
@@ -138,7 +142,7 @@ public static function fromGuzzleException(ClientException $exception): self
138
142
public static function missingApiKey (): self
139
143
{
140
144
return new self (
141
- " No API key provided. Specify your API key in an Authorization header using Bearer auth. " ,
145
+ ' No API key provided. Specify your API key in an Authorization header using Bearer auth. ' ,
142
146
400 ,
143
147
'authentication_error '
144
148
);
@@ -150,7 +154,7 @@ public static function missingApiKey(): self
150
154
public static function invalidApiKey (): self
151
155
{
152
156
return new self (
153
- " Incorrect API key provided. Obtain an API key from https://console.x.ai. " ,
157
+ ' Incorrect API key provided. Obtain an API key from https://console.x.ai. ' ,
154
158
400 ,
155
159
'invalid_api_key '
156
160
);
@@ -162,7 +166,7 @@ public static function invalidApiKey(): self
162
166
public static function invalidRequest (): self
163
167
{
164
168
return new self (
165
- " Failed to deserialize the JSON body into the target type. Ensure request structure is correct. " ,
169
+ ' Failed to deserialize the JSON body into the target type. Ensure request structure is correct. ' ,
166
170
422 ,
167
171
'invalid_request '
168
172
);
0 commit comments