Nyx Client SDK provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.
Project description
Nyx Client SDK
🌟 Nyx Client SDK provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.
It enables decentralized data transfer, offering additional context (via a RAG setup) to language models within the trusted IOTICS network.
🚧 Status
The Nyx ecosystem is at an early stage of its development, please give us feedback through the Github issues.
What is the Nyx Client SDK
The Nyx Client SDK is a Python library that provides an API for easy interaction with the Nyx Platform. It enables end users to seamlessly connect their data to the Nyx ecosystem, search for data, subscribe to it, and consume it. With this SDK, users can ultimately build powerful AI applications.
Several examples of SDK usage in an AI context are available:
- RAG demo examples
https://[nyx_host]/try-me-now
See also What is Nyx
🔥 Quick Start
Installation
The Nyx Client SDK is available on PyPI and can be installed via pip
running the following command.
pip install nyx-client
First time set up
Once the library is installed you can run nyx-client init
to generate the .env file. You'll be asked to provide your Nyx username, password and Nyx endpoint.
Example output
#### Autogenerated by nyx_client - do not edit manually
DID_USER_DID=did:iotics:iotDJ1ftN8LM6WUKZp1Zo8Ha1dkm8yyQvFAx
DID_AGENT_DID=did:iotics:iotZ7kSUpmAcAjdVzKKF4JUmC42tBPG7JRoQ
DID_AGENT_KEY_NAME="#agent-competent_hello"
DID_AGENT_NAME="#agent-competent_hello"
DID_AGENT_SECRET=54d133....ebdc9d
HOST_VERIFY_SSL=true # Set to false for development
####
NYX_URL=<ENTER URL>
NYX_USERNAME=<ENTER USERNAME>
NYX_EMAIL=<ENTER EMAIL>
NYX_PASSWORD=<ENTER PASSWORD>
As a data producer
I want to connect my Data
from nyx_client import NyxClient
client = NyxClient()
client.create_data(
name="MyData1",
title="My Data #1",
description="The description of the data #1",
size=1080,
genre="ai",
categories=["cat1", "cat2", "cat3"],
download_url="http://storage/dataset1.csv",
content_type="text/csv",
lang="fr",
preview="col1, col2, col3\naaa, bbb, ccc",
license_url="https://opensource.org/licenses/MIT",
)
I want to delete/disconnect my Data
from nyx_client import NyxClient
client = NyxClient()
client.delete_data_by_name(name="MyData1")
As an application builder
I want to subscribe to some data
Coming soon 👷🚧
I want to consume the data
from nyx_client import NyxClient
client = NyxClient()
subscribed_data = client.get_subscribed_data()
for data in subscribed_data:
print(f"Downloading data {data.name}")
content = data.as_string() # Note if binary file use as_bytes to get content as bytes
👉 Gotchas
- If the Data has been deleted/disconnected from Nyx, the SDK will no longer be able to access it. Ensure that the data is still available.
The Nyx ecosystem is at an early stage of its development, please give us feedback through Github issues.
- If you get the SSL error
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
then it may be that you need to set some environment variables like this before running your script:
CERT_PATH=$(python -m certifi)
export SSL_CERT_FILE=${CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}
🐞 Troubleshooting
If you encounter any issues, ensure that:
- Your virtual environment is activated.
- All required dependencies are installed.
- Environment variables are set correctly.
- If an issue persists, check the Issues section on github
For further assistance:
- Refer to the project documentation
- 💡 If you have cloned the Git repo, you can run
make docs
and then viewdocs/index.html
.
- 💡 If you have cloned the Git repo, you can run
- Raise an issue on GitHub
- Chat with us on Discord
🤝 Contributing
We welcome contributions! Please see our CONTRIBUTING.md for guidelines.
⚖️ Terms and conditions
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
File details
Details for the file nyx_client-0.1.4.tar.gz
.
File metadata
- Download URL: nyx_client-0.1.4.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3e063c48a6f4936784e29ce551e621764922757921e7e3030ec79ab99cb4bd6 |
|
MD5 | c9c06a93d8ace92d856968c542e03e99 |
|
BLAKE2b-256 | 5d849c1bbcdc96f44e0b225ecd33539282e1cfc4e38132b9f1575e7ce7472058 |
File details
Details for the file nyx_client-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: nyx_client-0.1.4-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e8741f7a1f11b37deedefdd147c21d8e86b52a76b704074d038e4e9a648376d |
|
MD5 | 394bb86cd80bf28be037157a4b96b5c2 |
|
BLAKE2b-256 | fd3f7ed759dcda650ba5b94b8937e3f25b2b76079a18f43f26386e6db2573f68 |