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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
superduper_openai-0.4.0.tar.gz
(15.3 kB
view details)
Built Distribution
File details
Details for the file superduper_openai-0.4.0.tar.gz
.
File metadata
- Download URL: superduper_openai-0.4.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bff3f57abff03fdf490185c068ddcbe83a3c9950aa991dbb69dae002f488d43 |
|
MD5 | 958a63528c38650b9156aae75437e81d |
|
BLAKE2b-256 | 2bdd7a43e73661acd82b4720d0a7558bafedeec0d50ffedf24cbed342f2c5c9d |
Provenance
The following attestation bundles were made for superduper_openai-0.4.0.tar.gz
:
Publisher:
release_plugins.yaml
on superduper-io/superduper
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
superduper_openai-0.4.0.tar.gz
- Subject digest:
8bff3f57abff03fdf490185c068ddcbe83a3c9950aa991dbb69dae002f488d43
- Sigstore transparency entry: 146081653
- Sigstore integration time:
- Predicate type:
File details
Details for the file superduper_openai-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: superduper_openai-0.4.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e578c22d38467a5cefc4825aede2a364ad7f5eb3468a8b32be8cb1d540939ca7 |
|
MD5 | be352495a38d37a82a08e5dbde545e19 |
|
BLAKE2b-256 | 6204f52f90d3f76da1f684daf215594352a869471e69de31e3921be501c8e258 |
Provenance
The following attestation bundles were made for superduper_openai-0.4.0-py3-none-any.whl
:
Publisher:
release_plugins.yaml
on superduper-io/superduper
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
superduper_openai-0.4.0-py3-none-any.whl
- Subject digest:
e578c22d38467a5cefc4825aede2a364ad7f5eb3468a8b32be8cb1d540939ca7
- Sigstore transparency entry: 146081654
- Sigstore integration time:
- Predicate type: