Python SDK to access Kintsugi Voice API V2.
Project description
Kintsugi Python SDK
Python SDK to access Kintsugi Voice API V2.
Installation
pip install kintsugi-python
Code Example
import os,time
from kintsugi.api import Api
if __name__ == '__main__':
# Configuration Parameters
x_api_key = os.environ['X_API_KEY']
user_id = os.environ['USER_ID']
# Arguments
audio_file_1 = open('/Users/jackson/Downloads/test_audio.wav', 'rb')
audio_file_2 = open('/Users/jackson/Downloads/test_audio.wav', 'rb')
allowed_sample_rate = 44100
metadata = {
'age': 39,
'gender': 'male'
}
# API instantiation
api = Api(x_api_key=x_api_key)
# Prediction using all arguments
api.prediction().predict(
user_id,
audio_file_1,
metadata=metadata,
allowed_sample_rate=allowed_sample_rate,
)
# Prediction using fewer arguments
session_id = api.prediction().predict(user_id, audio_file_2)
# Get prediction by session
prediction_response = api.prediction().get_prediction_by_session(session_id)
while prediction_response.status == "processing":
time.sleep(5)
prediction_response = api.prediction().get_prediction_by_session(session_id)
print(f'Score for depression: {prediction_response.get_score("depression")}')
print(f'Score for anxiety: {prediction_response.get_score("anxiety")}')
# Get predictions by user
predictions_user = api.prediction().get_prediction_by_user(user_id)
# Depression feedback
api.feedback().depression(session_id, 'false')
# PHQ-2 feedback
api.feedback().phq_2(session_id, [1, 2])
# PHQ-9 feedback
api.feedback().phq_9(session_id, [1, 2, 1, 2, 1, 2, 3, 1, 2])
# GAD-7 feedback
api.feedback().gad_7(session_id, [1, 2, 1, 2, 1, 2, 3])
print('Done.')
Project details
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 kintsugi_python-0.1.8.tar.gz.
File metadata
- Download URL: kintsugi_python-0.1.8.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c7e90e6a76cffa0a9346a3cbd82aead9a3350da6e08fda0c7bc14f42f036cb8
|
|
| MD5 |
b4d14c1929633a2a174e115c6c7c95cc
|
|
| BLAKE2b-256 |
2cb34df6eae187e95c98f12b9b26d31619969b10cb2d2ad8936f9fe5b2011d85
|
Provenance
The following attestation bundles were made for kintsugi_python-0.1.8.tar.gz:
Publisher:
publish-pypi.yml on KintsugiMindfulWellness/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kintsugi_python-0.1.8.tar.gz -
Subject digest:
6c7e90e6a76cffa0a9346a3cbd82aead9a3350da6e08fda0c7bc14f42f036cb8 - Sigstore transparency entry: 243397410
- Sigstore integration time:
-
Permalink:
KintsugiMindfulWellness/python-sdk@e00b5990a7f9b201bb9e551928e3423fef8e2bbd -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/KintsugiMindfulWellness
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e00b5990a7f9b201bb9e551928e3423fef8e2bbd -
Trigger Event:
release
-
Statement type:
File details
Details for the file kintsugi_python-0.1.8-py3-none-any.whl.
File metadata
- Download URL: kintsugi_python-0.1.8-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30511bf171f0ea5e9a4d81ce0a47a55ec55f31d69b9ba1bfa86ff1ab142cdb81
|
|
| MD5 |
b4e7ec2aa8426552012698b26f9385a6
|
|
| BLAKE2b-256 |
db71af2ae2723c6c624a038cab9412c8170cc56e6349a762dfb541b85041b42c
|
Provenance
The following attestation bundles were made for kintsugi_python-0.1.8-py3-none-any.whl:
Publisher:
publish-pypi.yml on KintsugiMindfulWellness/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kintsugi_python-0.1.8-py3-none-any.whl -
Subject digest:
30511bf171f0ea5e9a4d81ce0a47a55ec55f31d69b9ba1bfa86ff1ab142cdb81 - Sigstore transparency entry: 243397412
- Sigstore integration time:
-
Permalink:
KintsugiMindfulWellness/python-sdk@e00b5990a7f9b201bb9e551928e3423fef8e2bbd -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/KintsugiMindfulWellness
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e00b5990a7f9b201bb9e551928e3423fef8e2bbd -
Trigger Event:
release
-
Statement type: