No project description provided
Project description
OpenVoid Python Client
The OpenVoid Python Client facilitates interaction with the OpenVoid AI API, which is currently in closed beta. This client enables developers to easily incorporate AI functionalities into Python applications, utilizing the OpenVoid AI platform's robust features.
Features
- Easy integration with the OpenVoid AI API in closed beta.
- Simplified API response handling.
- Comprehensive examples to jumpstart your application development.
Getting Started
Prerequisites
Make sure Python 3.6 or later is installed on your system before installing the OpenVoid Python client.
Installing
To install the OpenVoid Python client via pip, execute:
pip install openvoid
This command installs the OpenVoid client and all necessary dependencies.
Installing from Source
For source installations, poetry
is used for dependency management and packaging:
pip install poetry
After installing poetry, clone the OpenVoid client repository:
git clone https://github.com/openvoidai/openvoid-python.git
cd openvoid-python
Then, install the package and its dependencies:
poetry install
Poetry will create a virtual environment and manage all dependencies for you.
Configuration
API Key Setup (Closed Beta)
During the closed beta phase, OpenVoid AI API keys are exclusively available to beta testers.
- Beta testers can obtain their OpenVoid AI API key as detailed in the OpenVoid Documentation.
- Configure your environment with your API key:
# For zsh users
echo 'export OPENVOID_API_KEY=[your_key_here]' >> ~/.zshenv
source ~/.zshenv
# For bash users
echo 'export OPENVOID_API_KEY=[your_key_here]' >> ~/.bashrc
source ~/.bashrc
Usage
Running Examples
The examples/
directory includes scripts that demonstrate the OpenVoid Python client's usage. Run these examples with poetry run
or within a poetry shell
environment.
Using poetry run
cd examples
poetry run python chat_no_streaming.py
Using poetry shell
poetry shell
cd examples
python chat_no_streaming.py
Usage Example
Here is a simple example that demonstrates how to use the OpenVoid Python client to ask a question and receive an answer:
#!/usr/bin/env python
import os
from openvoid.client import OpenVoidClient
from openvoid.models.chat_completion import ChatMessage
def main():
api_key = os.environ["OPENVOID_API_KEY"]
model = "prox"
client = OpenVoidClient(api_key=api_key)
chat_response = client.chat(
model=model,
messages=[ChatMessage(role="user", content="What is SQL Injection?")],
)
print(chat_response.choices[0].message.content)
if __name__ == "__main__":
main()
This script demonstrates initiating a chat session with the OpenVoid AI and asking it to explain SQL Injection. Ensure you have set your OPENVOID_API_KEY
in your environment variables to use this example.
Improvements
- API Key Management for Closed Beta: Enhanced configuration process for closed beta participants' API keys.
- Expanded Examples: More detailed examples demonstrate the OpenVoid AI API's capabilities.
- Improved Error Handling: Better error reporting for easier debugging and issue resolution.
Contributing
Contributions are welcome! Check the repository's contribution guidelines for more information.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 openvoid-0.0.1.tar.gz
.
File metadata
- Download URL: openvoid-0.0.1.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2e7991ea6891ab5ff008a3a35358bb5dd42798a23847ab788775d90e9a56ce |
|
MD5 | 8a2893962280c07e9c9894f89163857d |
|
BLAKE2b-256 | 0fe59fb2a9bc31415910f933fa078d9fed4228ba25604a714734fbcf16978fda |
File details
Details for the file openvoid-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: openvoid-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908f9320165810c5df4525ff20b3f34b05935cd882e8e9dcd3a1d8ae6af95514 |
|
MD5 | 1567f3fecb45c49ce2faaead9445c0d2 |
|
BLAKE2b-256 | 13f7556948d35e8207be541dadcf4167d244e98c79cdbf1ad2e92025f9d02ad7 |