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 5bef6fb commit eac5146Copy full SHA for eac5146
src/Tools/DTO/Tool.php
@@ -183,14 +183,13 @@ public static function fromArray(array $array): Tool
183
return FunctionDeclaration::fromArray($declarationData);
184
}, $declarationsData);
185
return new self($declarations);
186
- } elseif ($type->isWebSearch()) {
+ } else {
187
+ // Web search is the only remaining option
188
if (!isset($array['webSearch'])) {
189
throw new \InvalidArgumentException('Web search tool requires webSearch field.');
190
}
191
$webSearchData = $array['webSearch'];
192
return new self(WebSearch::fromArray($webSearchData));
193
-
194
- throw new \InvalidArgumentException(sprintf('Unknown tool type: %s', $array['type']));
195
196
0 commit comments