Skip to main content

asyncflows classify

Built for asyncflows

main repo Discord

Introduction

A module for prototyping asyncflows actions that classify data.

This repo contains a classify action, which prompts the LLM to return a classification for a piece of data, given a provided list of labels.

To use this action in your own flows, simply:

pip install asyncflows-classify 

And include the action in your flow yaml file:

flow:
  sentiment_analysis:
    action: classify
    labels:
      - positive
      - negative
    data:
      var: data

Running the Example

The repo also includes an example of how to use the classify action in sentiment analysis:

  • sentiment_analysis_example.yaml, a flow that classifies a piece of data as either funky, janky, or serious, and says hello world in that way
  • sentiment_analysis_example.py, a script that runs the flow on a hardcoded piece of data

To run the example:

  1. Set up Ollama or configure another language model

  2. Clone the repository

git clone ssh://git@github.com/asynchronous-flows/asyncflows-classify
  1. Change into the directory
cd asyncflows-classify
  1. Create and activate your virtual environment (with, for example)
python3.11 -m venv .venv
source .venv/bin/activate
  1. If not already installed, install poetry. Install dependencies with:
poetry install
  1. Run the example
python sentiment_analysis_example.py

Release files for asyncflows-classify 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asyncflows-classify 0.1.2
File Size Uploaded
asyncflows_classify-0.1.2.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asyncflows-classify 0.1.2
File Interpreter ABI Platform
asyncflows_classify-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / asyncflows_classify-0.1.2.tar.gz

Download URL asyncflows_classify-0.1.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a3f034c269f55cdcb4879ac384bc5ae2e36915c29924550e4e1c095d058860c2
BLAKE2b-256 checksum
How to use checksums
067241d624528c51dd004e726be6352a99f7ca7ed1a71b121312f863a2c5bc46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Darwin/23.2.0

Release files / asyncflows_classify-0.1.2-py3-none-any.whl

Download URL asyncflows_classify-0.1.2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80ea7abc894f24f5838712bf67b2ae6a11e7168de5853e9c2bf67f930fafedff
BLAKE2b-256 checksum
How to use checksums
1f1d1c6e0575bde0a11220085479ee36581be7ac8eab358b2e97addabfda9223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Darwin/23.2.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page