A short description of your project
Project description
Hexa SDK
A small SDK that exposes the hexapackage entry point and provides a ContextVar-backed global context store for AI endpoints.
Requirements
The incoming request JSON must include the following keys so the SDK can seed the global context:
prompt: the instruction template for your LLM.context: the data or background you want to feed into the prompt.schema: the JSON schema describing how to interpret the model output.
🚀 Usage
hexa-sdk lets you standardize how inputs are received and outputs are reported by relying on a global context instead of threading variables through every helper.
1. Basic setup
Install the package:
pip install hexa-sdk
2. Integration in your endpoint
Load the incoming request into the context store and then treat prompt, context, and schema as globally accessible values.
from hexa import hexapackage
from hexa.main import set_value, get_value
def my_ai_endpoint(request):
payload = request.json()
# 1. Push the incoming data into the global context.
set_value("prompt", payload["prompt"])
set_value("context", payload["context"])
set_value("schema", payload["schema"])
# 2. Consume the values anywhere in your flow without passing them through every call.
final_input = f"Instructions: {get_value('prompt')}\n\nData: {get_value('context')}"
# 3. Call your LLM (OpenAI, Anthropic, etc.)
ai_output = "The result from your model"
# 4. Pack and return — you can reuse the store to compile whatever payload the Hexa dashboard expects.
set_value("result", ai_output)
return {
"prompt": get_value("prompt"),
"context": get_value("context"),
"schema": get_value("schema"),
"output": get_value("result"),
}
3. Key properties
Once the values are stored, they are available everywhere in the current execution context:
hexapackage()returns the full store so the SDK can inspect or serialize every tracked value.get_value("prompt"),get_value("context"), andget_value("schema")read the global context without threading arguments through helpers.set_valueis the simplest way to seed or update any piece of shared data.
This usage flow emphasizes how hexa-sdk removes the boilerplate of passing prompt/context/schema through many helper layers and keeps your AI wiring clean and focused on the model call.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hexa_sdk-0.1.1.tar.gz.
File metadata
- Download URL: hexa_sdk-0.1.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.8 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3333e20bbb13ee7ce87c9e1ce4a5c7904b9c459607c4ec3244c30e94e9021956
|
|
| MD5 |
f4490b3bd7bd1b72a8637bd352766f63
|
|
| BLAKE2b-256 |
3467cd3b3fdc84fe606676944d7b64b38a8ee6131597442b2d522c3be8afd316
|
File details
Details for the file hexa_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hexa_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.8 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
788289940b82f37433762abe79d87f8f0662f4e0f7f4a87eb4a9b1eae0cdd0d0
|
|
| MD5 |
9e561de8960485151e6c78b7d6158d02
|
|
| BLAKE2b-256 |
55312345f3ee23a57e900973c29b7708c180bcb90a346d11ee98b9bbececf4b5
|