Get structured output from multimodal AI models and integrate them into multitool agents
Project description
OmniModKit
Use convenient multimodal toolkit that operates with structured output.
Easily build agent tools on top of that.
Implementation
This package utilizes the implemented langchain structured output pipelines.
Installation
pip install omnimodkit
Usage
- Import ModelsToolkit
- Run appropriate models
- Get structured output response
from omnimodkit import ModelsToolkit
# Initialize the model toolkit
modkit = ModelsToolkit()
# Run the model synchronously
modkit.text_model.run(
user_input="What is the capital of France?",
)
# Stream responses from the model
for response in modkit.text_model.stream(
user_input="What is the capital of France?",
):
print(response, end="|", flush=True)
# Generate images
modkit.image_generation_model.run(
user_input="Draw a cat",
)
# Use audio recognition
import io
import requests
url = "https://cdn.openai.com/API/examples/data/ZyntriQix.wav"
audio_bytes = io.BytesIO(requests.get(url, timeout=10).content)
audio_bytes.name = "audio.wav"
modkit.audio_recognition_model.run(
in_memory_audio_stream=audio_bytes,
)
# Use image recognition
import io
import requests
url = "https://raw.githubusercontent.com/Flagro/treefeeder/main/logo.png"
image_bytes = io.BytesIO(requests.get(url, timeout=10).content)
image_bytes.name = "image.png"
modkit.vision_model.run(
in_memory_image_stream=image_bytes,
)
License
MIT license
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
omnimodkit-0.0.2.tar.gz
(8.5 kB
view details)
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 omnimodkit-0.0.2.tar.gz.
File metadata
- Download URL: omnimodkit-0.0.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcd1610166c7f9a91c079398df6040a17fb88605b0c4c59668c5038c129675ad
|
|
| MD5 |
633fbd9ecaf6e9fb3bfe228fb1ed8a15
|
|
| BLAKE2b-256 |
dc2464e01f9b026007906cb3f6ff5e3362f5c70e936be581e810f11e68d836ea
|
File details
Details for the file omnimodkit-0.0.2-py3-none-any.whl.
File metadata
- Download URL: omnimodkit-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37495653267379fbc7041518d1983728218f81fe0ea734a8b3cb6b49d09ebfcc
|
|
| MD5 |
ef47c2dcc116f7253ba1841ee89e5619
|
|
| BLAKE2b-256 |
576aa2361a001432cb9f4690d818279ffe9cc4a9f3d1e399f98c72ab6d8321cd
|