Skip to content

Commit 43242f8

Browse files
Moloejoegitbook-bot
authored andcommitted
GitBook: No commit message
1 parent 09e4bb4 commit 43242f8

File tree

4 files changed

+63
-12
lines changed

4 files changed

+63
-12
lines changed

pgml-cms/docs/SUMMARY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
* [Overview](README.md)
44
* [Getting Started](getting-started/README.md)
5-
* [Create a database](getting-started/sign-up.md)
6-
* [Connecting](getting-started/connect-to-the-database.md)
7-
* [Importing data](getting-started/importing-data.md)
5+
* [Create your database](getting-started/sign-up.md)
6+
* [Connect your app](getting-started/connect-to-the-database.md)
7+
* [Import your data](getting-started/import-your-data.md)
88
* [Machine Learning](machine-learning/README.md)
99
* [Natural Language Processing](machine-learning/natural-language-processing/README.md)
1010
* [Embeddings](machine-learning/natural-language-processing/embeddings.md)
@@ -77,7 +77,7 @@
7777
* [Monitoring](monitoring.md)
7878
* [FAQs](faqs.md)
7979
* [Developer Docs](developer-docs/README.md)
80-
* [Quick Start with Docker](developer-docs/quick-start-with-docker.md)
80+
* [Local Docker Development](developer-docs/quick-start-with-docker.md)
8181
* [Installation](developer-docs/installation.md)
8282
* [Contributing](developer-docs/contributing.md)
8383
* [Distributed Training](developer-docs/distributed-training.md)

pgml-cms/docs/benchmarks/mindsdb-vs-postgresml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The architectural implementations for these projects is significantly different.
4242

4343
\\
4444

45-
<figure><img src="../.gitbook/assets/mindsdb-architecture (1).png" alt=""><figcaption></figcaption></figure>
45+
<figure><img src="../.gitbook/assets/mindsdb-pgml-architecture.png" alt=""><figcaption></figcaption></figure>
4646

4747
| | MindsDB | PostgresML |
4848
| ------------- | ------------- | ---------- |

pgml-cms/docs/getting-started/connect-to-the-database.md

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
description: PostgresML is compatible with all standard PostgreSQL clients
33
---
44

5-
# Connecting
6-
7-
### Connecting
5+
# Connect your app
86

97
You can connect to your database from any Postgres compatible client. PostgresML is intended to serve in the traditional role of an application database, along with it's extended role as an MLOps platform to make it easy to build and maintain AI applications.&#x20;
108

11-
#### Application SDKs
9+
### Application SDKs
1210

13-
We provide client SDKs for JavaScript, Python and Rust apps that manage connections to the Postgres database and make it easy to construct efficient queries for AI use cases, like managing a document collection for RAG, or building a chatbot. All of the ML & AI still happens in the database, with centralized operations, hardware and dependency management.
11+
We provide client SDKs for JavaScript, Python and Rust apps that manage connections to the Postgres database and make it easy to construct efficient queries for AI use cases, like managing a document collection for RAG, or building a chatbot. All of the ML & AI still happens in the database, with centralized operations, hardware and dependency management.
1412

1513
These SDKs are under rapid development to add new features and use cases, but we release non breaking changes with minor version updates in accordance with SemVer. It's easy to install into your existing application.
1614

15+
#### Installation
16+
1717
{% tabs %}
1818
{% tab title="JavaScript" %}
1919
```
@@ -28,7 +28,58 @@ pip install pgml
2828
{% endtab %}
2929
{% endtabs %}
3030

31-
#### Native Language Bindings
31+
#### Test the connection
32+
33+
{% tabs %}
34+
{% tab title="JavaScript" %}
35+
```
36+
const pgml = require("pgml");
37+
38+
const main = async () => {
39+
const client = pgml.newOpenSourceAI();
40+
const results = client.chat_completions_create(
41+
"mistralai/Mistral-7B-Instruct-v0.1",
42+
[
43+
{
44+
role: "system",
45+
content: "You are a friendly chatbot who always responds in the style of a pirate",
46+
},
47+
{
48+
role: "user",
49+
content: "How many helicopters can a human eat in one sitting?",
50+
},
51+
],
52+
);
53+
console.log(results);
54+
```
55+
{% endtab %}
56+
57+
{% tab title="Python" %}
58+
```
59+
import pgml
60+
61+
async def main():
62+
client = pgml.OpenSourceAI()
63+
results = client.chat_completions_create(
64+
"mistralai/Mistral-7B-Instruct-v0.1",
65+
[
66+
{
67+
"role": "system",
68+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
69+
},
70+
{
71+
"role": "user",
72+
"content": "How many helicopters can a human eat in one sitting?",
73+
},
74+
],
75+
temperature=0.85,
76+
)
77+
print(results)
78+
```
79+
{% endtab %}
80+
{% endtabs %}
81+
82+
### Native Language Bindings
3283

3384
You can also connect directly to the database with your favorite bindings or ORM:
3485

@@ -49,7 +100,7 @@ You can also connect directly to the database with your favorite bindings or ORM
49100
* Rust: [postgres](https://crates.io/crates/postgres), [SQLx](https://github.com/launchbadge/sqlx) or [Diesel](https://github.com/diesel-rs/diesel)
50101
* Swift: [PostgresNIO](https://github.com/vapor/postgres-nio) or [PostgresClientKit](https://github.com/codewinsdotcom/PostgresClientKit)
51102

52-
#### SQL Editors
103+
### SQL Editors
53104

54105
Use any of these popular tools to execute SQL queries directly against the database:
55106

File renamed without changes.

0 commit comments

Comments
 (0)