mixpeek 0.11.1__tar.gz → 0.11.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.11.1 → mixpeek-0.11.2}/PKG-INFO +1 -1
- mixpeek-0.11.2/mixpeek/endpoints/search.py +44 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek.egg-info/PKG-INFO +1 -1
- {mixpeek-0.11.1 → mixpeek-0.11.2}/setup.py +1 -1
- mixpeek-0.11.1/mixpeek/endpoints/search.py +0 -67
- {mixpeek-0.11.1 → mixpeek-0.11.2}/MANIFEST.in +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/README.md +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/__init__.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/client.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/__init__.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/collections.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/embed.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/index.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/register.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/tasks.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/endpoints/tools.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek/exceptions.py +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek.egg-info/SOURCES.txt +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek.egg-info/dependency_links.txt +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek.egg-info/requires.txt +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/mixpeek.egg-info/top_level.txt +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/requirements.txt +0 -0
- {mixpeek-0.11.1 → mixpeek-0.11.2}/setup.cfg +0 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
import requests
|
2
|
+
import os
|
3
|
+
import json
|
4
|
+
|
5
|
+
class Search:
|
6
|
+
def __init__(self, base_url, headers):
|
7
|
+
self.base_url = base_url
|
8
|
+
self.headers = headers
|
9
|
+
|
10
|
+
def text(self, query, model_id=None, filters=None, page=1, page_size=10):
|
11
|
+
try:
|
12
|
+
url = f"{self.base_url}search/text"
|
13
|
+
data = {
|
14
|
+
"query": query,
|
15
|
+
"model_id": model_id,
|
16
|
+
"filters": filters or {},
|
17
|
+
"pagination": {
|
18
|
+
"page": page,
|
19
|
+
"page_size": page_size
|
20
|
+
}
|
21
|
+
}
|
22
|
+
response = requests.post(url, json=data, headers=self.headers)
|
23
|
+
response.raise_for_status()
|
24
|
+
return response.json()
|
25
|
+
except requests.RequestException as e:
|
26
|
+
return {"error": str(e)}
|
27
|
+
|
28
|
+
def url(self, target_url, model_id=None, filters=None, page=1, page_size=10):
|
29
|
+
try:
|
30
|
+
url = f"{self.base_url}search/url"
|
31
|
+
data = {
|
32
|
+
"url": target_url,
|
33
|
+
"model_id": model_id,
|
34
|
+
"filters": filters or {},
|
35
|
+
"pagination": {
|
36
|
+
"page": page,
|
37
|
+
"page_size": page_size
|
38
|
+
}
|
39
|
+
}
|
40
|
+
response = requests.post(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,67 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
import os
|
3
|
-
import json
|
4
|
-
|
5
|
-
class Search:
|
6
|
-
def __init__(self, base_url, headers):
|
7
|
-
self.base_url = base_url
|
8
|
-
self.headers = headers
|
9
|
-
|
10
|
-
def text(self, input, modality, input_type="text", filters=None, group_by_file=True, page=1, page_size=10):
|
11
|
-
try:
|
12
|
-
url = f"{self.base_url}search/text"
|
13
|
-
data = {
|
14
|
-
"input": input,
|
15
|
-
"modality": modality,
|
16
|
-
"input_type": input_type,
|
17
|
-
"filters": filters or {},
|
18
|
-
"group_by_file": group_by_file,
|
19
|
-
"pagination": {
|
20
|
-
"page": page,
|
21
|
-
"page_size": page_size
|
22
|
-
}
|
23
|
-
}
|
24
|
-
response = requests.post(url, json=data, headers=self.headers)
|
25
|
-
response.raise_for_status()
|
26
|
-
return response.json()
|
27
|
-
except requests.RequestException as e:
|
28
|
-
return {"error": str(e)}
|
29
|
-
|
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)}
|
50
|
-
|
51
|
-
def url(self, target_url, filters=None, modality="text", page=1, page_size=10):
|
52
|
-
try:
|
53
|
-
url = f"{self.base_url}search/url"
|
54
|
-
data = {
|
55
|
-
"url": target_url,
|
56
|
-
"filters": filters or {},
|
57
|
-
"modality": modality,
|
58
|
-
"pagination": {
|
59
|
-
"page": page,
|
60
|
-
"page_size": page_size
|
61
|
-
}
|
62
|
-
}
|
63
|
-
response = requests.post(url, json=data, headers=self.headers)
|
64
|
-
response.raise_for_status()
|
65
|
-
return response.json()
|
66
|
-
except requests.RequestException as e:
|
67
|
-
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|