optimize retrieve logic
This commit is contained in:
@@ -34,9 +34,11 @@ final readonly class ShopSearchService
|
||||
if (!$this->enabled) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$response = [];
|
||||
$query = $this->queryParser->parse($originalPrompt, $commerceIntent);
|
||||
$criteria = $this->criteriaBuilder->build($query, $this->maxResults);
|
||||
|
||||
try {
|
||||
$response = $this->storeApiClient->searchProducts($criteria);
|
||||
} catch (ClientExceptionInterface|DecodingExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface $e) {
|
||||
|
||||
Reference in New Issue
Block a user