Skip to main content

No project description provided

Project description

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

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

asyncflows_classify-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

asyncflows_classify-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file asyncflows_classify-0.1.2.tar.gz.

File metadata

  • Download URL: asyncflows_classify-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.2.0

File hashes

Hashes for asyncflows_classify-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a3f034c269f55cdcb4879ac384bc5ae2e36915c29924550e4e1c095d058860c2
MD5 075eebb4e5d5cfcb657318f018524424
BLAKE2b-256 067241d624528c51dd004e726be6352a99f7ca7ed1a71b121312f863a2c5bc46

See more details on using hashes here.

File details

Details for the file asyncflows_classify-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for asyncflows_classify-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 80ea7abc894f24f5838712bf67b2ae6a11e7168de5853e9c2bf67f930fafedff
MD5 6acc89df0340d51eb897fca876bf0205
BLAKE2b-256 1f1d1c6e0575bde0a11220085479ee36581be7ac8eab358b2e97addabfda9223

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page