Skip to content

Commit 4180f84

Browse files
committed
Moved examples to separate directories [skip ci]
1 parent c1b4507 commit 4180f84

9 files changed

Lines changed: 55 additions & 9 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Follow the instructions for your database library:
1313

1414
Or check out some examples:
1515

16-
- [Embeddings](examples/openai_embeddings.php) with OpenAI
17-
- [Binary embeddings](examples/cohere_embeddings.php) with Cohere
16+
- [Embeddings](examples/openai/example.php) with OpenAI
17+
- [Binary embeddings](examples/cohere/example.php) with Cohere
1818
- [Morgan fingerprints](examples/rdkit/example.php) with RDKit
1919
- [Recommendations](examples/disco/example.php) with Disco
20-
- [Bulk loading](examples/bulk_loading.php) with `COPY`
20+
- [Bulk loading](examples/loading/example.php) with `COPY`
2121

2222
### Laravel
2323

@@ -141,7 +141,7 @@ pg_query($db, 'CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)');
141141
pg_query($db, 'CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)');
142142
```
143143

144-
See a [full example](examples/pgsql.php)
144+
See a [full example](examples/pgsql/example.php)
145145

146146
## Upgrading
147147

@@ -175,6 +175,8 @@ composer test
175175
To run an example:
176176

177177
```sh
178+
cd examples/loading
179+
composer install
178180
createdb pgvector_example
179-
php examples/bulk_loading.php
181+
php example.php
180182
```

examples/cohere/composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"repositories": [
3+
{
4+
"type": "path",
5+
"url": "../.."
6+
}
7+
],
8+
"require": {
9+
"pgvector/pgvector": "dev-master"
10+
}
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once __DIR__ . '/../vendor/autoload.php';
3+
require_once __DIR__ . '/vendor/autoload.php';
44

55
$db = pg_connect('postgres://localhost/pgvector_example');
66

examples/loading/composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"repositories": [
3+
{
4+
"type": "path",
5+
"url": "../.."
6+
}
7+
],
8+
"require": {
9+
"pgvector/pgvector": "dev-master"
10+
}
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once __DIR__ . '/../vendor/autoload.php';
3+
require_once __DIR__ . '/vendor/autoload.php';
44

55
use Pgvector\Vector;
66

examples/openai/composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"repositories": [
3+
{
4+
"type": "path",
5+
"url": "../.."
6+
}
7+
],
8+
"require": {
9+
"pgvector/pgvector": "dev-master"
10+
}
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once __DIR__ . '/../vendor/autoload.php';
3+
require_once __DIR__ . '/vendor/autoload.php';
44

55
use Pgvector\Vector;
66

examples/pgsql/composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"repositories": [
3+
{
4+
"type": "path",
5+
"url": "../.."
6+
}
7+
],
8+
"require": {
9+
"pgvector/pgvector": "dev-master"
10+
}
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once __DIR__ . '/../vendor/autoload.php';
3+
require_once __DIR__ . '/vendor/autoload.php';
44

55
use Pgvector\Vector;
66

0 commit comments

Comments
 (0)