Current collected state Current
Observed since 21 Oct, 10:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
With these command you can build and install it in your enviourment
python -m pip venv .venv
source ./venv/bin/activate
pip install -q build
python -m build
pip install ./dist/aibrary-0.1.0-py3-none-any.whl
pip install ./dist/aibrary-0.1.0.tar.gz
from aibrary import AiBrary
aibrary = AiBrary(api_key=None) # either passing api_key to the client or setting the AIBRARY_API_KEY in environment variable
aibrary.get_all_models(filter_category="TTS",return_as_objects=False)
aibrary.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "How are you today?"},
{"role": "assistant", "content": "I'm doing great, thank you!"},
],
temperature=0.7,
)
aibrary.chat.completions.create(
model="claude-3-5-haiku-20241022",
messages=[
{"role": "user", "content": "How are you today?"},
{"role": "assistant", "content": "what is computer"},
],
temperature=0.7,
system="you are a teacher of cmputer",
)
aibrary.audio.transcriptions.create(
model="whisper-large-v3", file=open("path/to/audio", "rb")
)
response = aibrary.audio.speech.create(
input="Hey Cena", model="tts-1", response_format="mp3", voice="alloy"
)
open("file.mp3", "wb").write(response.content)
aibrary.images.generate(model="dall-e-2", size="256x256", prompt="Draw cat")
aibrary.translation.automatic_translation("HI", "phedone", "en", "fa")
aibrary.ocr(providers='amazon',file=open('tests/assets/ocr-test.jpg','rb').read(),file_name="test.jpg")
# OR only send path
aibrary.ocr(providers='amazon',file='tests/assets/ocr-test.jpg')
# OR send url
aibrary.ocr(providers='amazon',file_url="https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/5_python-ocr.jpg")
For async version of client you can import from aibrary import AsyncAiBrary and only put await behind above exmpale like this example:
from aibrary import AsyncAiBrary
aibrary = AsyncAiBrary(api_key=None)
await aibrary.chat.completions.create(
model="claude-3-5-haiku-20241022",
messages=[
{"role": "user", "content": "who are you what is your role??"},
],
temperature=0.7,
system="you are a math teacher"
)
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.3 | 15 Jan 2025 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 10:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c31534b8744d507b9ebc7182bfdab8c87689cd1482396f1088f4fc097e9fc8cb