File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,11 @@ public function vectorizeTextDocuments(array $documents): array
67
67
return $ vectorDocuments ;
68
68
}
69
69
70
- public function vectorize (string $ string ): Vector
70
+ public function vectorize (string | \ Stringable $ string ): Vector
71
71
{
72
- $ this ->logger ->debug ('Vectorizing string ' , ['string ' => $ string ]);
72
+ $ this ->logger ->debug ('Vectorizing string ' , ['string ' => ( string ) $ string ]);
73
73
74
- $ result = $ this ->platform ->invoke ($ this ->model , $ string );
74
+ $ result = $ this ->platform ->invoke ($ this ->model , ( string ) $ string );
75
75
$ vectors = $ result ->asVectors ();
76
76
77
77
if (!isset ($ vectors [0 ])) {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ interface VectorizerInterface
29
29
public function vectorizeTextDocuments (array $ documents ): array ;
30
30
31
31
/**
32
- * Vectorizes a single string into a Vector.
32
+ * Vectorizes a single string or Stringable object into a Vector.
33
33
*/
34
- public function vectorize (string $ string ): Vector ;
34
+ public function vectorize (string | \ Stringable $ string ): Vector ;
35
35
}
You can’t perform that action at this time.
0 commit comments