Superduper allows users to work with openai API models.
Project description
superduper_openai
Superduper allows users to work with openai API models.
Installation
pip install superduper_openai
API
| Class | Description |
|---|---|
superduper_openai.model.OpenAIEmbedding |
OpenAI embedding predictor. |
superduper_openai.model.OpenAIChatCompletion |
OpenAI chat completion predictor. |
superduper_openai.model.OpenAIImageCreation |
OpenAI image creation predictor. |
superduper_openai.model.OpenAIImageEdit |
OpenAI image edit predictor. |
superduper_openai.model.OpenAIAudioTranscription |
OpenAI audio transcription predictor. |
superduper_openai.model.OpenAIAudioTranslation |
OpenAI audio translation predictor. |
Examples
OpenAIEmbedding
from superduper_openai.model import OpenAIEmbedding
model = OpenAIEmbedding(identifier='text-embedding-ada-002')
model.predict('Hello, world!')
OpenAIChatCompletion
from superduper_openai.model import OpenAIChatCompletion
model = OpenAIChatCompletion(model='gpt-3.5-turbo', prompt='Hello, {context}')
model.predict('Hello, world!')
OpenAIImageCreation
from superduper_openai.model import OpenAIImageCreation
model = OpenAIImageCreation(
model="dall-e",
prompt="a close up, studio photographic portrait of a {context}",
response_format="url",
)
model.predict("cat")
OpenAIImageEdit
import io
from superduper_openai.model import OpenAIImageEdit
model = OpenAIImageEdit(
model="dall-e",
prompt="A celebration party at the launch of {context}",
response_format="url",
)
with open("test/material/data/rickroll.png", "rb") as f:
buffer = io.BytesIO(f.read())
model.predict(buffer, context=["superduper"])
OpenAIAudioTranscription
import io
from superduper_openai.model import OpenAIAudioTranscription
with open('test/material/data/test.wav', 'rb') as f:
buffer = io.BytesIO(f.read())
buffer.name = 'test.wav'
prompt = (
'i have some advice for you. write all text in lower-case.'
'only make an exception for the following words: {context}'
)
model = OpenAIAudioTranscription(identifier='whisper-1', prompt=prompt)
model.predict(buffer, context=['United States'])
OpenAIAudioTranslation
import io
from superduper_openai.model import OpenAIAudioTranslation
with open('test/material/data/german.wav', 'rb') as f:
buffer = io.BytesIO(f.read())
buffer.name = 'test.wav'
prompt = (
'i have some advice for you. write all text in lower-case.'
'only make an exception for the following words: {context}'
)
e = OpenAIAudioTranslation(identifier='whisper-1', prompt=prompt)
resp = e.predict(buffer, context=['Emmerich'])
buffer.close()
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
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 superduper_openai-0.7.0.tar.gz.
File metadata
- Download URL: superduper_openai-0.7.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47ee957f533f33d8166f2c60a2cf93c4c37061e43a09ecea27ec29f057f068d0
|
|
| MD5 |
a77e848156e3e5c3c5db991f4f468da8
|
|
| BLAKE2b-256 |
b3380bde6aca5f8e916f9d86478e601f1634fa31e2b8683f79a3fcb90df1f266
|
Provenance
The following attestation bundles were made for superduper_openai-0.7.0.tar.gz:
Publisher:
release_plugins.yaml on superduper-io/superduper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superduper_openai-0.7.0.tar.gz -
Subject digest:
47ee957f533f33d8166f2c60a2cf93c4c37061e43a09ecea27ec29f057f068d0 - Sigstore transparency entry: 220001119
- Sigstore integration time:
-
Permalink:
superduper-io/superduper@95b457380d0a4447df6735693dd4d9f09ae8af4b -
Branch / Tag:
refs/heads/0.7 - Owner: https://github.com/superduper-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_plugins.yaml@95b457380d0a4447df6735693dd4d9f09ae8af4b -
Trigger Event:
push
-
Statement type:
File details
Details for the file superduper_openai-0.7.0-py3-none-any.whl.
File metadata
- Download URL: superduper_openai-0.7.0-py3-none-any.whl
- Upload date:
- Size: 12.6 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 |
5e28b7d110c86ca92c80226eb28fe6b6db48faed1f908cfe7a80383dfb540205
|
|
| MD5 |
2d1c6987ffc4428b6868253486d0d125
|
|
| BLAKE2b-256 |
92b063b4237efb0f4a16610a0a4b209b7bb58196b4b30aeaaddee981f8b9310a
|
Provenance
The following attestation bundles were made for superduper_openai-0.7.0-py3-none-any.whl:
Publisher:
release_plugins.yaml on superduper-io/superduper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superduper_openai-0.7.0-py3-none-any.whl -
Subject digest:
5e28b7d110c86ca92c80226eb28fe6b6db48faed1f908cfe7a80383dfb540205 - Sigstore transparency entry: 220001121
- Sigstore integration time:
-
Permalink:
superduper-io/superduper@95b457380d0a4447df6735693dd4d9f09ae8af4b -
Branch / Tag:
refs/heads/0.7 - Owner: https://github.com/superduper-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_plugins.yaml@95b457380d0a4447df6735693dd4d9f09ae8af4b -
Trigger Event:
push
-
Statement type: