File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3737 indexName: 'movies ' ,
3838);
3939
40- // initialize the index
41- $ store ->setup ();
42-
4340// create embeddings and documents
4441$ documents = [];
4542foreach (Movies::all () as $ i => $ movie ) {
5047 );
5148}
5249
50+ // initialize the index
51+ $ store ->setup ();
52+
5353// create embeddings for documents
5454$ platform = PlatformFactory::create (env ('OPENAI_API_KEY ' ), http_client ());
5555$ vectorizer = new Vectorizer ($ platform , $ embeddings = new Embeddings ());
Original file line number Diff line number Diff line change 3838 vectorFieldName: 'vector ' ,
3939);
4040
41- // initialize the index
42- $ store ->setup ();
43-
4441// create embeddings and documents
4542foreach (Movies::all () as $ movie ) {
4643 $ documents [] = new TextDocument (
5047 );
5148}
5249
50+ // initialize the index
51+ $ store ->setup ();
52+
5353// create embeddings for documents
5454$ platform = PlatformFactory::create (env ('OPENAI_API_KEY ' ));
5555$ vectorizer = new Vectorizer ($ platform , $ embeddings = new Embeddings ());
Original file line number Diff line number Diff line change 3636 tableName: 'my_table ' ,
3737);
3838
39- // initialize the table
40- $ store ->setup ();
41-
4239// create embeddings and documents
4340$ documents = [];
4441foreach (Movies::all () as $ i => $ movie ) {
4946 );
5047}
5148
49+ // initialize the table
50+ $ store ->setup ();
51+
5252// create embeddings for documents
5353$ platform = PlatformFactory::create (env ('OPENAI_API_KEY ' ), http_client ());
5454$ vectorizer = new Vectorizer ($ platform , $ embeddings = new Embeddings ());
You can’t perform that action at this time.
0 commit comments