Skip to content

Commit 6e1894b

Browse files
committed
[Store] Support \Stringable in VectorizerInterface::vectorize
1 parent afd238c commit 6e1894b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/store/src/Document/Vectorizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ public function vectorizeTextDocuments(array $documents): array
6767
return $vectorDocuments;
6868
}
6969

70-
public function vectorize(string $string): Vector
70+
public function vectorize(string|\Stringable $string): Vector
7171
{
72-
$this->logger->debug('Vectorizing string', ['string' => $string]);
72+
$this->logger->debug('Vectorizing string', ['string' => (string) $string]);
7373

74-
$result = $this->platform->invoke($this->model, $string);
74+
$result = $this->platform->invoke($this->model, (string) $string);
7575
$vectors = $result->asVectors();
7676

7777
if (!isset($vectors[0])) {

src/store/src/Document/VectorizerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface VectorizerInterface
2929
public function vectorizeTextDocuments(array $documents): array;
3030

3131
/**
32-
* Vectorizes a single string into a Vector.
32+
* Vectorizes a single string or Stringable object into a Vector.
3333
*/
34-
public function vectorize(string $string): Vector;
34+
public function vectorize(string|\Stringable $string): Vector;
3535
}

0 commit comments

Comments
 (0)