mixpeek 0.6.20__py3-none-any.whl → 0.6.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mixpeek/client.py +3 -0
- mixpeek/endpoints/connections.py +14 -0
- mixpeek/endpoints/pipelines.py +26 -0
- {mixpeek-0.6.20.dist-info → mixpeek-0.6.22.dist-info}/METADATA +44 -2
- {mixpeek-0.6.20.dist-info → mixpeek-0.6.22.dist-info}/RECORD +7 -7
- .DS_Store +0 -0
- {mixpeek-0.6.20.dist-info → mixpeek-0.6.22.dist-info}/WHEEL +0 -0
- {mixpeek-0.6.20.dist-info → mixpeek-0.6.22.dist-info}/top_level.txt +0 -0
mixpeek/client.py
CHANGED
@@ -5,6 +5,8 @@ from .endpoints.embed import Embed
|
|
5
5
|
from .endpoints.generate import Generate
|
6
6
|
from .endpoints.connections import Connections
|
7
7
|
from .endpoints.tools import Tools
|
8
|
+
from .endpoints.pipelines import Pipelines
|
9
|
+
|
8
10
|
|
9
11
|
class Mixpeek:
|
10
12
|
def __init__(self, api_key: str):
|
@@ -19,3 +21,4 @@ class Mixpeek:
|
|
19
21
|
self.generate = Generate(self.base_url, self.headers)
|
20
22
|
self.connections = Connections(self.base_url, self.headers)
|
21
23
|
self.tools = Tools(self.base_url, self.headers)
|
24
|
+
self.pipelines = Pipelines(self.base_url, self.headers)
|
mixpeek/endpoints/connections.py
CHANGED
@@ -4,6 +4,7 @@ class Connections:
|
|
4
4
|
def __init__(self, base_url, headers):
|
5
5
|
self.base_url = base_url
|
6
6
|
self.headers = headers
|
7
|
+
self.data = self.Data(self)
|
7
8
|
|
8
9
|
def create(self, alias: str, engine: str, details: dict):
|
9
10
|
url = f"{self.base_url}connections/"
|
@@ -14,3 +15,16 @@ class Connections:
|
|
14
15
|
}
|
15
16
|
response = requests.post(url, json=data, headers=self.headers)
|
16
17
|
return response.json()
|
18
|
+
|
19
|
+
class Data:
|
20
|
+
def __init__(self, parent):
|
21
|
+
self.base_url = parent.base_url
|
22
|
+
self.headers = parent.headers
|
23
|
+
|
24
|
+
def insert(self, connection_id: str, payload: dict):
|
25
|
+
pass
|
26
|
+
|
27
|
+
def delete(self, connection_id: str, filters: dict):
|
28
|
+
pass
|
29
|
+
|
30
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
class Pipelines:
|
4
|
+
def __init__(self, base_url, headers):
|
5
|
+
self.base_url = base_url
|
6
|
+
self.headers = headers
|
7
|
+
|
8
|
+
def create(self, alias: str, code: str, destination: dict, source: dict):
|
9
|
+
url = f"{self.base_url}pipelines/"
|
10
|
+
data = {
|
11
|
+
"alias": alias,
|
12
|
+
"code": code,
|
13
|
+
"destination": destination,
|
14
|
+
"source": source
|
15
|
+
}
|
16
|
+
response = requests.post(url, json=data, headers=self.headers)
|
17
|
+
return response.json()
|
18
|
+
|
19
|
+
def invoke(self, pipeline_id: str, payload: dict, options: dict):
|
20
|
+
url = f"{self.base_url}pipelines/invoke/{pipeline_id}"
|
21
|
+
data = {
|
22
|
+
"payload": payload,
|
23
|
+
"options": options
|
24
|
+
}
|
25
|
+
response = requests.post(url, json=data, headers=self.headers)
|
26
|
+
return response.json()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mixpeek
|
3
|
-
Version: 0.6.
|
3
|
+
Version: 0.6.22
|
4
4
|
Summary: Mixpeek Python SDK
|
5
5
|
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
6
|
Author: Ethan Steininger
|
@@ -23,24 +23,38 @@ A Python SDK for the Mixpeek API.
|
|
23
23
|
pip install mixpeek
|
24
24
|
```
|
25
25
|
|
26
|
+
## Usage
|
27
|
+
|
26
28
|
```python
|
27
29
|
from mixpeek import Mixpeek
|
28
30
|
from pydantic import BaseModel
|
29
31
|
|
30
32
|
mixpeek = Mixpeek("YOUR_API_KEY")
|
31
33
|
|
32
|
-
|
34
|
+
```
|
35
|
+
|
36
|
+
### Extract
|
37
|
+
|
38
|
+
```python
|
33
39
|
extraction = mixpeek.extract.text(
|
34
40
|
input="s3://document.pdf",
|
35
41
|
input_type="url"
|
36
42
|
)
|
43
|
+
```
|
44
|
+
|
45
|
+
### Embed
|
37
46
|
|
47
|
+
```python
|
38
48
|
embedding = mixpeek.embed.video(
|
39
49
|
model="mixpeek/vuse-generic-v1",
|
40
50
|
input="s3://waving_boy.mp4",
|
41
51
|
input_type="url"
|
42
52
|
)
|
53
|
+
```
|
43
54
|
|
55
|
+
### Generate
|
56
|
+
|
57
|
+
```python
|
44
58
|
class ResponseFormat(BaseModel):
|
45
59
|
city: int
|
46
60
|
weather: float
|
@@ -49,7 +63,13 @@ generated_content = mixpeek.generate.text(
|
|
49
63
|
response_format=ResponseFormat,
|
50
64
|
context="Please tell me the weather and make sure to respond in the provided JSON schema"
|
51
65
|
)
|
66
|
+
```
|
67
|
+
|
68
|
+
### Connections
|
69
|
+
|
70
|
+
Create connection
|
52
71
|
|
72
|
+
```python
|
53
73
|
mixpeek.connections.create(
|
54
74
|
alias="my-mongo-test",
|
55
75
|
engine="mongodb",
|
@@ -60,7 +80,29 @@ mixpeek.connections.create(
|
|
60
80
|
"password": "your_password"
|
61
81
|
}
|
62
82
|
)
|
83
|
+
```
|
84
|
+
|
85
|
+
Insert data
|
86
|
+
|
87
|
+
```python
|
88
|
+
mixpeek.connections.data.insert(
|
89
|
+
connection_id="conn_123",
|
90
|
+
payload={}
|
91
|
+
)
|
92
|
+
```
|
93
|
+
|
94
|
+
Insert data
|
95
|
+
|
96
|
+
```python
|
97
|
+
mixpeek.connections.data.delete(
|
98
|
+
connection_id="conn_321"
|
99
|
+
filters={}
|
100
|
+
)
|
101
|
+
```
|
102
|
+
|
103
|
+
### Tools
|
63
104
|
|
105
|
+
```python
|
64
106
|
response = mixpeek.tools.video.process(
|
65
107
|
url="https://s3/video.mp4",
|
66
108
|
frame_interval=5,
|
@@ -1,14 +1,14 @@
|
|
1
|
-
.DS_Store,sha256=sh_0Bq1MSejTZG2HyqIO9aDnVz8tkfcv6WYZCXFhuD0,6148
|
2
1
|
mixpeek/__init__.py,sha256=XDdcK7wTEOEcF1cp-GeWmgPJ21Ny1R9pB0PPNrdDTMo,28
|
3
|
-
mixpeek/client.py,sha256=
|
2
|
+
mixpeek/client.py,sha256=mrMHTmWX0c1XIxDqgx404ZNOmWRnjnm8Bs_21MYcNS0,897
|
4
3
|
mixpeek/exceptions.py,sha256=Orhdo5UFLn3fcWVJtlgkznW8Iy5ndL96h0qTY8zOlDA,235
|
5
4
|
mixpeek/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
mixpeek/endpoints/connections.py,sha256
|
5
|
+
mixpeek/endpoints/connections.py,sha256=ctzbdZV7ophrYOSqfHne0HE3sxxRXOep00qcujE0NKs,832
|
7
6
|
mixpeek/endpoints/embed.py,sha256=D_xOYllx4cdPZZVXejRYhfvPOyJylum5aJ5gki-lbVQ,1562
|
8
7
|
mixpeek/endpoints/extract.py,sha256=1KWxvgbQanRwYcFPWGthyv32LVj2gAhxDERwY3QgHUg,476
|
9
8
|
mixpeek/endpoints/generate.py,sha256=TAJ79KCchwHYQBWZSnOZBFeXprXBZqAb2mNrQrT8VWM,513
|
9
|
+
mixpeek/endpoints/pipelines.py,sha256=HgU00smP4guE0Qf601Up2mk9LqTimg4Dg27kkhE_H-Q,840
|
10
10
|
mixpeek/endpoints/tools.py,sha256=Yw6mvBqbrREY79l_BM6ek_CjxDPbFUdkmZqiaZcYSe8,787
|
11
|
-
mixpeek-0.6.
|
12
|
-
mixpeek-0.6.
|
13
|
-
mixpeek-0.6.
|
14
|
-
mixpeek-0.6.
|
11
|
+
mixpeek-0.6.22.dist-info/METADATA,sha256=QhrAUnXZM4ZpNF6VvkBPCcx2JNr1Dmzth88fZiK-bUA,1914
|
12
|
+
mixpeek-0.6.22.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
13
|
+
mixpeek-0.6.22.dist-info/top_level.txt,sha256=EJ8Jc4IhqyUwnUlBwKbs498Ju4O9a-IDh2kXc_lo6Vg,8
|
14
|
+
mixpeek-0.6.22.dist-info/RECORD,,
|
.DS_Store
DELETED
Binary file
|
File without changes
|
File without changes
|