blob: cfc0bd347768edfad7546788de9dcb2775b736d2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
---
title: 'Supermemory SDKs'
sidebarTitle: "Python and JavaScript SDKs"
description: 'Learn how to use supermemory with Python and JavaScript'
---
For more information, see the full updated references at
<Columns cols={2}>
<Card title="Python SDK" icon="python" href="https://pypi.org/project/supermemory/">
</Card>
<Card title="Javascript SDK" icon="js" href="https://www.npmjs.com/package/supermemory">
</Card>
</Columns>
## Python SDK
## Installation
```sh
# install from PyPI
pip install --pre supermemory
```
## Usage
```python
import os
from supermemory import Supermemory
client = Supermemory(
api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted
)
response = client.search.documents(
q="documents related to python",
)
print(response.results)
```
## JavaScript SDK
## Installation
```sh
npm install supermemory
```
## Usage
```js
import Supermemory from 'supermemory';
const client = new Supermemory({
apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.search.documents({ q: 'documents related to python' });
console.debug(response.results);
}
main();
```
|