Shiro Python Client
Project description
Shiro Python Library
This is the official Shiro API Python library maintained by OpenShiro. The Shiro Python library provides convenient access to the Shiro API from applications written in the Python language.
Documentation
See the API docs and also this post on Getting Started with the Shiro API.
Usage
The library needs to be configured with your account's api key which is available in your Shiro account under API Keys.
Initialize the client with your API key
from shiro import ShiroClient
client = ShiroClient("your_api_key_here")
List all deployments
deployments = client.deployments.list()
Retrieve a specific deployment
deployment = client.deployments.retrieve("dpmt_lWokJnPAwQCeV2ZWovjG7BNr")
Update a deployment
update_data = {"name": "Updated Deployment Name"}
updated_deployment = client.deployments.update("dpmt_lWokJnPAwQCeV2ZWovjG7BNr", update_data)
List all prompts
prompts = client.prompts.list()
Retrieve a specific prompt
prompt = client.prompts.retrieve("prmt_9nORYX8zAYHGo2AVQ1a2w03p")
Create a new completion
completion_data = {
"deployment_id": "dpmt_lWokJnPAwQCeV2ZWovjG7BNr",
"prompt_id": "prmt_9nORYX8zAYHGo2AVQ1a2w03p", # Optional
"input_variables": {
"review_text": "I loved the movie."
}
}
completion = client.generate_completion.create(completion_data)
Support
New features and bug fixes are released on the latest major version of the Shiro Python library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
Development
Run all tests
python -m unittest discover tests
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 shiro-0.1.1.tar.gz
.
File metadata
- Download URL: shiro-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 612ab3dad1785c1c4dbb2540814053bf7773044e24009b9085cd22911a527cf6 |
|
MD5 | 7b26dd8af43c41c3386875f91db1f00d |
|
BLAKE2b-256 | 180c9b5ec9782e511a57001ae7263f9cdabd2ea8e3bb769eac5b433c43147cd7 |
File details
Details for the file shiro-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: shiro-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9089e48de963c9c9a745834a4ad58cf10fba1aad3d60f42a2904d2fbebf5293 |
|
MD5 | 88eca32bf37ee8d8ddd0c92dce8240b2 |
|
BLAKE2b-256 | 215bbc05892ca475285903f88d4babbd54163fbda447edde5e4e17b27d315cfe |