Python SDK for Aionis Memory Graph API
Project description
aionis-sdk
Python SDK for Aionis Memory Graph API.
Install
pip install aionis-sdk
Usage
import os
from aionis_sdk import AionisClient
client = AionisClient(
base_url="http://localhost:3001",
timeout_s=10.0,
api_key=os.getenv("API_KEY"), # optional: X-Api-Key
auth_bearer=os.getenv("AUTH_BEARER"), # optional: Authorization: Bearer <token>
admin_token=os.getenv("ADMIN_TOKEN"), # optional: X-Admin-Token
)
out = client.write(
{
"scope": "default",
"input_text": "python sdk write",
"auto_embed": False,
"nodes": [{"client_id": "py_evt_1", "type": "event", "text_summary": "hello python sdk"}],
"edges": [],
}
)
print(out["status"], out["request_id"], out["data"]["commit_id"])
Typed payloads
0.1.5+ exports TypedDict API payloads from aionis_sdk.types:
from aionis_sdk import AionisClient
from aionis_sdk.types import ToolsFeedbackInput, ToolsSelectInput
client = AionisClient(base_url="http://localhost:3001")
select_payload: ToolsSelectInput = {
"scope": "default",
"run_id": "run_001",
"context": {"intent": "json", "provider": "minimax", "tool": {"name": "curl"}},
"candidates": ["curl", "bash"],
"strict": True,
}
select_out = client.tools_select(select_payload)
decision_id = (select_out.get("data") or {}).get("decision", {}).get("decision_id")
feedback_payload: ToolsFeedbackInput = {
"scope": "default",
"run_id": "run_001",
"decision_id": decision_id,
"outcome": "positive",
"context": {"intent": "json", "provider": "minimax", "tool": {"name": "curl"}},
"candidates": ["curl", "bash"],
"selected_tool": "curl",
}
client.tools_feedback(feedback_payload)
Auth Options
api_key: sendsX-Api-Key.auth_bearer: sendsAuthorization: Bearer <token>.admin_token: sendsX-Admin-Token(debug/admin flows).
Covered methods
writerecallrecall_textfindcreate_sessionwrite_eventlist_session_eventspack_exportpack_importrules_evaluatetools_selecttools_feedback
Error model
AionisApiError: API returned non-2xx response.AionisNetworkError: request timeout/network failure.
Smoke
cd /Users/lucio/Desktop/Aionis
set -a; source .env; set +a
npm run sdk:py:smoke
Build check (repo local)
cd /Users/lucio/Desktop/Aionis
npm run sdk:py:compile
npm run sdk:py:release-check
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
aionis_sdk-0.1.5.tar.gz
(7.8 kB
view details)
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 aionis_sdk-0.1.5.tar.gz.
File metadata
- Download URL: aionis_sdk-0.1.5.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
747c13880c9ce10556850471e053f4226b388b5d697557b09a3bc0ba6c45b199
|
|
| MD5 |
491d162963e3c1de7020e44052834f44
|
|
| BLAKE2b-256 |
a22a7d06d11ec10963765398b830973e7e542520000b87c2da85c8347cb9aacc
|
File details
Details for the file aionis_sdk-0.1.5-py3-none-any.whl.
File metadata
- Download URL: aionis_sdk-0.1.5-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97df682c3ba70936c66141b50a9336c46b7cef4c129c522094c7f0356c49aff9
|
|
| MD5 |
06a2d206918f92ac0d1e58d6f6cc15b1
|
|
| BLAKE2b-256 |
242c4df130af367b6a022d950127879fd531f7b7a974da4d707f5042287ec72c
|