Skip to main content

No project description provided

Project description

dowse

dowse logo

A powerful library for building natural language agents that can interpret and execute commands.

Overview

Dowse is a Python library that enables you to build intelligent agents capable of:

  • Parsing natural language commands and questions
  • Classifying inputs into different types (e.g. commands vs questions)
  • Executing structured commands based on natural language requests
  • Responding to user queries with relevant information
  • Building complex pipelines for command processing

Key Features

  • Natural Language Processing: Convert human language into structured commands
  • Flexible Pipeline Architecture: Build custom processing flows with branching logic
  • Built-in Command Handlers: Ready-to-use handlers for common operations
  • Extensible Design: Easy to add new command types and handlers
  • Async Support: Built for high-performance async/await operations

Installation

# COMING SOON
pip install dowse

Quickstart

import asyncio
import os
import logging
from typing import Literal

from eth_rpc import set_alchemy_key

from dowse import Pipeline
from dowse.impls.basic.llms import BasicTweetClassifier, BasicTwitterCommands, BasicTwitterQuestion
from dowse.impls.basic.effects import Printer
from dowse.impls.basic.source import TwitterMock
from dowse.interfaces import Tweet

logging.getLogger("dowse").setLevel(logging.DEBUG)
set_alchemy_key(os.environ["ALCHEMY_KEY"])


async def amain():
    # create a pipeline that classifiers commands as either a command or a question.
    pipeline = Pipeline[Literal["commands", "question"]](
        classifier=BasicTweetClassifier,
        # create a handler for each classification
        handlers={
            # commands are consumed by the BasicTwitterCommands operator
            "commands": BasicTwitterCommands >> Printer(prefix="COMMANDS"),
            # questions are consumed by the BasicTwitterQuestion operator
            "question": BasicTwitterQuestion >> Printer(prefix="QUESTION"),
        },
        source=TwitterMock(),
    )

    result = await pipeline.process(
        # the input is a tweet, which then gets handled by the Pipeline
        Tweet(
            id=1684298214198108160,
            content="swap $300 for $UNI and then send half of it to @vitalikbuterin",
            creator_id=12,
            creator_name="@jack",
        ),
    )

    print(result)

    # run the pipeline for 3 executions, with a minimum of 120 seconds between each execution
    # this pulls data from the source and processes it
    await pipeline.run(max_executions=3, iteration_min_time=120)


if __name__ == "__main__":
    asyncio.run(amain())

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

dowse-0.1.0.post1.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dowse-0.1.0.post1-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file dowse-0.1.0.post1.tar.gz.

File metadata

  • Download URL: dowse-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dowse-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 224c11bf8331f8c703ea85a510e79a63704a686ffcd5b63469ae90f57c7da88a
MD5 6bc72467d71fd611920c5c3d86eee552
BLAKE2b-256 519c82894cd66b026fad73012c6ac201366dc8f883a3b4b46ed2e59f1d875088

See more details on using hashes here.

File details

Details for the file dowse-0.1.0.post1-py3-none-any.whl.

File metadata

  • Download URL: dowse-0.1.0.post1-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dowse-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 417cf95ebf1eb3506eb0d0aa7c493a6c5f34136e44cf1d7aa2417281c1e326c6
MD5 750def5d403586f26ddd86433c8f22a2
BLAKE2b-256 d6552bcc493abd21e10860614fdebd60a7ebd3c860bcdf8f48a12d6ffbf45b6b

See more details on using hashes here.

Supported by

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