mixpeek 0.2__tar.gz → 0.5.1__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.2/mixpeek.egg-info → mixpeek-0.5.1}/PKG-INFO +1 -1
- {mixpeek-0.2 → mixpeek-0.5.1}/mixpeek/__init__.py +16 -3
- {mixpeek-0.2 → mixpeek-0.5.1/mixpeek.egg-info}/PKG-INFO +1 -1
- {mixpeek-0.2 → mixpeek-0.5.1}/pyproject.toml +4 -3
- {mixpeek-0.2 → mixpeek-0.5.1}/setup.py +1 -1
- {mixpeek-0.2 → mixpeek-0.5.1}/LICENSE.rst +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/MANIFEST.in +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/README.md +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/mixpeek.egg-info/SOURCES.txt +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/mixpeek.egg-info/dependency_links.txt +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/mixpeek.egg-info/requires.txt +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/mixpeek.egg-info/top_level.txt +0 -0
- {mixpeek-0.2 → mixpeek-0.5.1}/setup.cfg +0 -0
@@ -5,19 +5,32 @@ import json
|
|
5
5
|
|
6
6
|
class Mixpeek:
|
7
7
|
def __init__(self, api_key):
|
8
|
-
self.base_url = "
|
8
|
+
self.base_url = "https://api.mixpeek.com"
|
9
9
|
self.headers = {
|
10
10
|
"Authorization": f"Bearer {api_key}",
|
11
11
|
"Content-Type": "application/json",
|
12
12
|
}
|
13
|
+
|
13
14
|
self.generate = self.Generate(self)
|
14
15
|
self.parse = self.Parse(self)
|
16
|
+
self.embed = self.Embed(self)
|
15
17
|
|
16
18
|
def _send_post(self, url, payload):
|
17
19
|
return requests.post(url, headers=self.headers, data=json.dumps(payload)).json()
|
18
20
|
|
19
|
-
def _send_get(self, url):
|
20
|
-
return requests.get(url, headers=self.headers).json()
|
21
|
+
def _send_get(self, url, payload=None):
|
22
|
+
return requests.get(url, headers=self.headers, data=json.dumps(payload)).json()
|
23
|
+
|
24
|
+
class Embed:
|
25
|
+
def __init__(self, mixpeek):
|
26
|
+
self.mixpeek = mixpeek
|
27
|
+
self.embed_url = f"{self.mixpeek.base_url}/embed"
|
28
|
+
|
29
|
+
def text(self, text, additional_data=None):
|
30
|
+
payload = {"input": text}
|
31
|
+
if additional_data is not None:
|
32
|
+
payload.update(additional_data)
|
33
|
+
return self.mixpeek._send_get(self.embed_url, payload)
|
21
34
|
|
22
35
|
class Generate:
|
23
36
|
def __init__(self, mixpeek):
|
@@ -1,5 +1,5 @@
|
|
1
1
|
[tool.poetry]
|
2
|
-
name = "mixpeek
|
2
|
+
name = "mixpeek"
|
3
3
|
version = "0.1.0"
|
4
4
|
description = ""
|
5
5
|
authors = ["Ethan Steininger <esteininger21@gmail.com>"]
|
@@ -9,11 +9,12 @@ readme = "README.md"
|
|
9
9
|
python = "^3.11"
|
10
10
|
pydantic = "^2.6.4"
|
11
11
|
requests = "^2.31.0"
|
12
|
+
|
13
|
+
[tool.poetry.dev-dependencies]
|
12
14
|
setuptools = "^69.2.0"
|
13
15
|
wheel = "^0.43.0"
|
14
16
|
twine = "^5.0.0"
|
15
17
|
|
16
|
-
|
17
18
|
[build-system]
|
18
|
-
requires = ["poetry-core"]
|
19
|
+
requires = ["poetry-core>=1.0.0"]
|
19
20
|
build-backend = "poetry.core.masonry.api"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|