File tree Expand file tree Collapse file tree 10 files changed +10
-3
lines changed Expand file tree Collapse file tree 10 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1818$ splitter = new TextSplitTransformer ();
1919$ source = dirname (__DIR__ , 2 ).'/fixtures/lorem.txt ' ;
2020
21- $ documents = iterator_to_array ($ splitter ($ loader ($ source )));
21+ $ documents = iterator_to_array ($ splitter-> transform ($ loader-> load ($ source )));
2222
2323dump ($ documents );
Original file line number Diff line number Diff line change 3434$ store = new CacheStore (new ArrayAdapter ());
3535
3636// create embeddings and documents
37+ $ documents = [];
3738foreach (Movies::all () as $ i => $ movie ) {
3839 $ documents [] = new TextDocument (
3940 id: Uuid::v4 (),
Original file line number Diff line number Diff line change 3434$ store = new Store (
3535 (new Codewithkyrian \ChromaDB \Factory ())
3636 ->withHost (env ('CHROMADB_HOST ' ))
37- ->withPort (env ('CHROMADB_PORT ' ))
37+ ->withPort (( int ) env ('CHROMADB_PORT ' ))
3838 ->connect (),
3939 'movies ' ,
4040);
Original file line number Diff line number Diff line change 3333$ store = new InMemoryStore ();
3434
3535// create embeddings and documents
36+ $ documents = [];
3637foreach (Movies::all () as $ i => $ movie ) {
3738 $ documents [] = new TextDocument (
3839 id: Uuid::v4 (),
Original file line number Diff line number Diff line change 4040);
4141
4242// create embeddings and documents
43+ $ documents = [];
4344foreach (Movies::all () as $ i => $ movie ) {
4445 $ documents [] = new TextDocument (
4546 id: Uuid::v4 (),
Original file line number Diff line number Diff line change 3939);
4040
4141// create embeddings and documents
42+ $ documents = [];
4243foreach (Movies::all () as $ i => $ movie ) {
4344 $ documents [] = new TextDocument (
4445 id: Uuid::v4 (),
Original file line number Diff line number Diff line change 4040);
4141
4242// create embeddings and documents
43+ $ documents = [];
4344foreach (Movies::all () as $ movie ) {
4445 $ documents [] = new TextDocument (
4546 id: Uuid::v4 (),
Original file line number Diff line number Diff line change 3434$ store = new Store (Pinecone::client (env ('PINECONE_API_KEY ' ), env ('PINECONE_HOST ' )));
3535
3636// create embeddings and documents
37+ $ documents = [];
3738foreach (Movies::all () as $ movie ) {
3839 $ documents [] = new TextDocument (
3940 id: Uuid::v4 (),
Original file line number Diff line number Diff line change 4141$ store ->setup ();
4242
4343// create embeddings and documents
44+ $ documents = [];
4445foreach (Movies::all () as $ movie ) {
4546 $ documents [] = new TextDocument (
4647 id: Uuid::v4 (),
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function adc_aware_http_client(): HttpClientInterface
2020{
2121 $ credentials = ApplicationDefaultCredentials::getCredentials (['https://www.googleapis.com/auth/cloud-platform ' ]);
2222 $ httpClient = HttpClient::create ([
23- 'auth_bearer ' => $ credentials? ->fetchAuthToken()['access_token ' ] ?? null ,
23+ 'auth_bearer ' => $ credentials ->fetchAuthToken ()['access_token ' ] ?? null ,
2424 ]);
2525
2626 if ($ httpClient instanceof LoggerAwareInterface) {
You can’t perform that action at this time.
0 commit comments