🌐 AI搜索 & 代理 主页
Skip to content

Commit a852681

Browse files
committed
Updated javascript examples a bit
1 parent fe5ba1b commit a852681

File tree

5 files changed

+15
-89
lines changed

5 files changed

+15
-89
lines changed

pgml-sdks/pgml/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Suported Languages
44

55
We support a number of different languages:
6-
- [Python](/python)
7-
- [JavaScript](/javascript)
6+
- [Python](python)
7+
- [JavaScript](javascript)
88
- Rust
99

1010
Our SDK is written completely in Rust and translated by Rust to our other supported languages. See each individual language for an overview and specification on how to use the SDK.
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
## Examples
1+
# Examples
22

3-
### [Semantic Search](./semantic_search.js)
3+
## Prerequisites
4+
Before running any examples first install dependencies and set the DATABASE_URL environment variable:
5+
```
6+
npm i
7+
export DATABASE_URL={YOUR DATABASE URL}
8+
```
9+
10+
## [Semantic Search](./semantic_search.js)
411
This is a basic example to perform semantic search on a collection of documents. Embeddings are created using `intfloat/e5-small` model. The results are semantically similar documemts to the query. Finally, the collection is archived.
512

6-
### [Question Answering](./question_answering.js)
13+
## [Question Answering](./question_answering.js)
714
This is an example to find documents relevant to a question from the collection of documents. The query is passed to vector search to retrieve documents that match closely in the embeddings space. A score is returned with each of the search result.
815

9-
### [Question Answering using Instructore Model](./question_answering_instructor.js)
16+
## [Question Answering using Instructore Model](./question_answering_instructor.js)
1017
In this example, we will use `hknlp/instructor-base` model to build text embeddings instead of the default `intfloat/e5-small` model.
1118

12-
### [Extractive Question Answering](./extractive_question_answering.js)
19+
## [Extractive Question Answering](./extractive_question_answering.js)
1320
In this example, we will show how to use `vector_recall` result as a `context` to a HuggingFace question answering model. We will use `Builtins.transform()` to run the model on the database.
1421

15-
### [Summarizing Question Answering](./summarizing_question_answering.js)
22+
## [Summarizing Question Answering](./summarizing_question_answering.js)
1623
This is an example to find documents relevant to a question from the collection of documents and then summarize those documents.

pgml-sdks/pgml/javascript/examples/getting-started/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

pgml-sdks/pgml/javascript/examples/getting-started/index.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

pgml-sdks/pgml/javascript/examples/getting-started/package.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)