Flowise SDK - Python
The Flowise SDK for Python provides an easy way to interact with the Flowise API for creating predictions, supporting both streaming and non-streaming responses. This SDK allows users to create predictions with customizable options, including history, file uploads, and more.
Features
- Support for streaming and non-streaming API responses
- Ability to include message history and file uploads
Installation
You can install the SDK via pip:
pip install flowise
Example
from flowise import Flowise, PredictionData, IMessage, IFileUpload
def example_non_streaming():
# Initialize Flowise client
client = Flowise()
# Create a prediction without streaming
completion = client.create_prediction(
PredictionData(
chatflowId="abc",
question="What is the capital of France?",
streaming=False # Non-streaming mode
)
)
# Process and print the full response
for response in completion:
print("Non-streaming response:", response)
def example_streaming():
# Initialize Flowise client
client = Flowise()
# Create a prediction with streaming enabled
completion = client.create_prediction(
PredictionData(
chatflowId="abc",
question="Tell me a joke!",
streaming=True # Enable streaming
)
)
# Process and print each streamed chunk
print("Streaming response:")
for chunk in completion:
print(chunk)
if __name__ == "__main__":
# Run the non-streaming example
example_non_streaming()
# Run the streaming example
example_streaming()
Build & Publish
- Increment version on
setup.py pip install wheelpython setup.py sdist bdist_wheeltwine upload dist/*
Metadata
Release files for flowise 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flowise-1.0.3.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flowise-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / flowise-1.0.3.tar.gz
| Download URL | flowise-1.0.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96c8f658616b7bac67a55e237dd2398e34534d52eaf0099d84ea932bc22319d4
|
|
BLAKE2b-256 checksum How to use checksums |
0ace88d139621a28f56a30e16254d021476a082ce49f0477d6e4deb2c727db60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.11
|
Release files / flowise-1.0.3-py3-none-any.whl
| Download URL | flowise-1.0.3-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c41735808a1686b972905563e6ddb506513c870cd528bac380efab6ff40c946
|
|
BLAKE2b-256 checksum How to use checksums |
a88a0646b23216f007965b16cd7835877240022adf01369ce9828c416b7f9cd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.11
|