mixpeek 0.7.0__tar.gz → 0.7.2__tar.gz
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-0.7.0 → mixpeek-0.7.2}/PKG-INFO +1 -3
- {mixpeek-0.7.0 → mixpeek-0.7.2}/README.md +0 -2
- mixpeek-0.7.2/mixpeek/endpoints/index.py +44 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/endpoints/search.py +24 -17
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek.egg-info/PKG-INFO +1 -3
- {mixpeek-0.7.0 → mixpeek-0.7.2}/setup.py +1 -1
- mixpeek-0.7.0/mixpeek/endpoints/index.py +0 -51
- {mixpeek-0.7.0 → mixpeek-0.7.2}/MANIFEST.in +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/__init__.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/client.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/endpoints/__init__.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/endpoints/collections.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/endpoints/embed.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/endpoints/tools.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek/exceptions.py +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek.egg-info/SOURCES.txt +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek.egg-info/dependency_links.txt +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek.egg-info/requires.txt +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/mixpeek.egg-info/top_level.txt +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/requirements.txt +0 -0
- {mixpeek-0.7.0 → mixpeek-0.7.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mixpeek
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.2
|
4
4
|
Summary: Mixpeek Python SDK
|
5
5
|
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
6
|
Author: Ethan Steininger
|
@@ -233,8 +233,6 @@ response = client.collections.delete_collection(collection_id="collection_id")
|
|
233
233
|
|
234
234
|
- `collection_id` (str): The ID of the collection to delete.
|
235
235
|
|
236
|
-
Certainly! I'll update the README to include information about the `tools` service, specifically the video processing functionality. Here's the addition to the README:
|
237
|
-
|
238
236
|
### Tools
|
239
237
|
|
240
238
|
The `tools` module provides utility functions for processing various types of data before embedding or indexing.
|
@@ -216,8 +216,6 @@ response = client.collections.delete_collection(collection_id="collection_id")
|
|
216
216
|
|
217
217
|
- `collection_id` (str): The ID of the collection to delete.
|
218
218
|
|
219
|
-
Certainly! I'll update the README to include information about the `tools` service, specifically the video processing functionality. Here's the addition to the README:
|
220
|
-
|
221
219
|
### Tools
|
222
220
|
|
223
221
|
The `tools` module provides utility functions for processing various types of data before embedding or indexing.
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
class Index:
|
4
|
+
def __init__(self, base_url, headers):
|
5
|
+
self.base_url = base_url
|
6
|
+
self.headers = headers
|
7
|
+
|
8
|
+
def _prepare_data(self, base_data, metadata=None, settings=None):
|
9
|
+
if metadata is not None:
|
10
|
+
base_data["metadata"] = metadata
|
11
|
+
if settings is not None:
|
12
|
+
base_data["settings"] = settings
|
13
|
+
return base_data
|
14
|
+
|
15
|
+
# def upload(self, file, collection_id, metadata=None, settings=None):
|
16
|
+
# try:
|
17
|
+
# api_url = f"{self.base_url}index/upload"
|
18
|
+
# files = {"file": file}
|
19
|
+
# data = self._prepare_data({"collection_id": collection_id}, metadata, settings)
|
20
|
+
# response = requests.post(api_url, files=files, data=data, headers=self.headers)
|
21
|
+
# response.raise_for_status()
|
22
|
+
# return response.json()
|
23
|
+
# except requests.RequestException as e:
|
24
|
+
# return {"error": str(e)}
|
25
|
+
|
26
|
+
def url(self, target_url, collection_id, metadata=None, settings=None):
|
27
|
+
try:
|
28
|
+
endpoint = f"{self.base_url}index/url"
|
29
|
+
data = self._prepare_data({"url": target_url, "collection_id": collection_id}, metadata, settings)
|
30
|
+
response = requests.post(endpoint, json=data, headers=self.headers)
|
31
|
+
response.raise_for_status()
|
32
|
+
return response.json()
|
33
|
+
except requests.RequestException as e:
|
34
|
+
return {"error": str(e)}
|
35
|
+
|
36
|
+
def youtube(self, youtube_video_id, collection_id, metadata=None, settings=None):
|
37
|
+
try:
|
38
|
+
api_url = f"{self.base_url}index/youtube"
|
39
|
+
data = self._prepare_data({"youtube_video_id": youtube_video_id, "collection_id": collection_id}, metadata, settings)
|
40
|
+
response = requests.post(api_url, json=data, headers=self.headers)
|
41
|
+
response.raise_for_status()
|
42
|
+
return response.json()
|
43
|
+
except requests.RequestException as e:
|
44
|
+
return {"error": str(e)}
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import requests
|
2
|
+
import os
|
3
|
+
import json
|
2
4
|
|
3
5
|
class Search:
|
4
6
|
def __init__(self, base_url, headers):
|
@@ -25,27 +27,32 @@ class Search:
|
|
25
27
|
except requests.RequestException as e:
|
26
28
|
return {"error": str(e)}
|
27
29
|
|
28
|
-
def upload(self,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
30
|
+
# def upload(self, file_path, filters=None, page=1, page_size=10):
|
31
|
+
# try:
|
32
|
+
# url = f"{self.base_url}search/upload"
|
33
|
+
|
34
|
+
# filename = os.path.basename(file_path)
|
35
|
+
# files = {
|
36
|
+
# 'file': (filename, open(file_path, 'rb'), 'application/octet-stream')
|
37
|
+
# }
|
38
|
+
|
39
|
+
# payload = {
|
40
|
+
# 'filters': json.dumps(filters or {}),
|
41
|
+
# 'page': str(page),
|
42
|
+
# 'page_size': str(page_size)
|
43
|
+
# }
|
44
|
+
|
45
|
+
# response = requests.post(url, headers=self.headers, data=payload, files=files)
|
46
|
+
# response.raise_for_status()
|
47
|
+
# return response.json()
|
48
|
+
# except requests.RequestException as e:
|
49
|
+
# return {"error": str(e)}
|
42
50
|
|
43
|
-
def url(self,
|
51
|
+
def url(self, target_url, filters=None, modality="text", page=1, page_size=10):
|
44
52
|
try:
|
45
53
|
url = f"{self.base_url}search/url"
|
46
54
|
data = {
|
47
|
-
"url":
|
48
|
-
"input_type": input_type,
|
55
|
+
"url": target_url,
|
49
56
|
"filters": filters or {},
|
50
57
|
"modality": modality,
|
51
58
|
"pagination": {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mixpeek
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.2
|
4
4
|
Summary: Mixpeek Python SDK
|
5
5
|
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
6
|
Author: Ethan Steininger
|
@@ -233,8 +233,6 @@ response = client.collections.delete_collection(collection_id="collection_id")
|
|
233
233
|
|
234
234
|
- `collection_id` (str): The ID of the collection to delete.
|
235
235
|
|
236
|
-
Certainly! I'll update the README to include information about the `tools` service, specifically the video processing functionality. Here's the addition to the README:
|
237
|
-
|
238
236
|
### Tools
|
239
237
|
|
240
238
|
The `tools` module provides utility functions for processing various types of data before embedding or indexing.
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
|
3
|
-
class Index:
|
4
|
-
def __init__(self, base_url, headers):
|
5
|
-
self.base_url = base_url
|
6
|
-
self.headers = headers
|
7
|
-
|
8
|
-
def upload(self, file, collection_id, metadata=None, settings=None):
|
9
|
-
try:
|
10
|
-
url = f"{self.base_url}index/upload"
|
11
|
-
files = {"file": file}
|
12
|
-
data = {
|
13
|
-
"collection_id": collection_id,
|
14
|
-
"metadata": metadata,
|
15
|
-
"settings": settings
|
16
|
-
}
|
17
|
-
response = requests.post(url, files=files, data=data, headers=self.headers)
|
18
|
-
response.raise_for_status()
|
19
|
-
return response.json()
|
20
|
-
except requests.RequestException as e:
|
21
|
-
return {"error": str(e)}
|
22
|
-
|
23
|
-
def url(self, url, collection_id, metadata=None, settings=None):
|
24
|
-
try:
|
25
|
-
url = f"{self.base_url}index/url"
|
26
|
-
data = {
|
27
|
-
"url": url,
|
28
|
-
"collection_id": collection_id,
|
29
|
-
"metadata": metadata,
|
30
|
-
"settings": settings
|
31
|
-
}
|
32
|
-
response = requests.post(url, json=data, headers=self.headers)
|
33
|
-
response.raise_for_status()
|
34
|
-
return response.json()
|
35
|
-
except requests.RequestException as e:
|
36
|
-
return {"error": str(e)}
|
37
|
-
|
38
|
-
def youtube(self, youtube_video_id, collection_id, metadata=None, settings=None):
|
39
|
-
try:
|
40
|
-
url = f"{self.base_url}index/youtube"
|
41
|
-
data = {
|
42
|
-
"youtube_video_id": youtube_video_id,
|
43
|
-
"collection_id": collection_id,
|
44
|
-
"metadata": metadata,
|
45
|
-
"settings": settings
|
46
|
-
}
|
47
|
-
response = requests.post(url, json=data, headers=self.headers)
|
48
|
-
response.raise_for_status()
|
49
|
-
return response.json()
|
50
|
-
except requests.RequestException as e:
|
51
|
-
return {"error": str(e)}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|