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
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 ])) {
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments