glixin-tools 0.1.0__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.
- glixin_tools-0.1.0/PKG-INFO +16 -0
- glixin_tools-0.1.0/README.md +8 -0
- glixin_tools-0.1.0/glixin/__init__.py +3 -0
- glixin_tools-0.1.0/glixin/client.py +36 -0
- glixin_tools-0.1.0/glixin_tools.egg-info/PKG-INFO +16 -0
- glixin_tools-0.1.0/glixin_tools.egg-info/SOURCES.txt +9 -0
- glixin_tools-0.1.0/glixin_tools.egg-info/dependency_links.txt +1 -0
- glixin_tools-0.1.0/glixin_tools.egg-info/requires.txt +1 -0
- glixin_tools-0.1.0/glixin_tools.egg-info/top_level.txt +1 -0
- glixin_tools-0.1.0/pyproject.toml +13 -0
- glixin_tools-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: glixin-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lightweight Python client for Glixin AWS Marketplace APIs
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: requests>=2.25.0
|
|
8
|
+
|
|
9
|
+
# glixin-tools
|
|
10
|
+
|
|
11
|
+
Lightweight Python wrapper for Glixin AWS Marketplace APIs, starting with the Semiotic Prompt Dehydrator (SPD) API.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install glixin-tools
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import requests
|
|
3
|
+
|
|
4
|
+
class GlixinClient:
|
|
5
|
+
def __init__(self, api_key: str = None, base_url: str = None):
|
|
6
|
+
self.api_key = api_key or os.getenv("GLIXIN_API_KEY")
|
|
7
|
+
if not self.api_key:
|
|
8
|
+
raise ValueError("API key must be provided or set via GLIXIN_API_KEY environment variable.")
|
|
9
|
+
|
|
10
|
+
# Default to Glixin AWS Gateway production endpoint for SPD
|
|
11
|
+
self.base_url = base_url or "https://api.glixin.com/v1"
|
|
12
|
+
self.session = requests.Session()
|
|
13
|
+
self.session.headers.update({
|
|
14
|
+
"x-api-key": self.api_key,
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
"User-Agent": "glixin-tools/0.1.0"
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
def dehydrate_prompt(self, prompt: str, policy: str = "standard") -> dict:
|
|
20
|
+
"""
|
|
21
|
+
Submits raw text prompt to the Semiotic Prompt Dehydrator (SPD) API.
|
|
22
|
+
"""
|
|
23
|
+
url = f"{self.base_url}/spd/dehydrate"
|
|
24
|
+
payload = {"prompt": prompt, "policy": policy}
|
|
25
|
+
|
|
26
|
+
response = self.session.post(url, json=payload)
|
|
27
|
+
|
|
28
|
+
if response.status_code == 401:
|
|
29
|
+
raise PermissionError("Unauthorized: Check your Glixin API key.")
|
|
30
|
+
elif response.status_code == 429:
|
|
31
|
+
raise RuntimeError("Rate limit exceeded. Please check your quarterly tier cap.")
|
|
32
|
+
elif response.status_code >= 500:
|
|
33
|
+
raise RuntimeError(f"Glixin Gateway Error ({response.status_code}): {response.text}")
|
|
34
|
+
|
|
35
|
+
response.raise_for_status()
|
|
36
|
+
return response.json()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: glixin-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lightweight Python client for Glixin AWS Marketplace APIs
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: requests>=2.25.0
|
|
8
|
+
|
|
9
|
+
# glixin-tools
|
|
10
|
+
|
|
11
|
+
Lightweight Python wrapper for Glixin AWS Marketplace APIs, starting with the Semiotic Prompt Dehydrator (SPD) API.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install glixin-tools
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests>=2.25.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
glixin
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "glixin-tools"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Lightweight Python client for Glixin AWS Marketplace APIs"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"requests>=2.25.0"
|
|
13
|
+
]
|