Skip to main content

Alternative ReAct implementation for DSPy with full conversation history

Project description

DSPy-ReAct-Machina

Alternative ReAct implementation for DSPy with full conversation history in a unified context.

Installation

pip install dspy-react-machina

Quick Start

import dspy
from dspy_react_machina import ReActMachina

# Configure your LM
lm = dspy.LM(model="openai/gpt-4o-mini")
dspy.configure(lm=lm)

# Define tools
def get_weather(city: str) -> str:
    """Get current weather for a city"""
    return f"Weather in {city}: 72°F, sunny"

# Create agent
agent = ReActMachina(tools=[get_weather])

# Chat with the agent
result = agent("What's the weather in Paris?")
print(result.answer)

Documentation

Development

Setup

uv sync
uv run pre-commit install

Code Quality

uv run quality-check  # Run all checks: ruff + pyright

Testing

uv run tests                    # Run tests
uv run tests-coverage           # Run tests with coverage
uv run tests-coverage --web     # Run tests with coverage and open HTML report

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

dspy_react_machina-0.1.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

dspy_react_machina-0.1.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file dspy_react_machina-0.1.0.tar.gz.

File metadata

  • Download URL: dspy_react_machina-0.1.0.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for dspy_react_machina-0.1.0.tar.gz
Algorithm Hash digest
SHA256 688f2987b17a9d937e8222a549116bc9f154a8cc9b06fb3b710f5c503917e8b3
MD5 1f88d841ad2cd7f6378492974025291b
BLAKE2b-256 483a57cf9de05f105696b92bdf8f27b5f0491776282eca9ea94bcbb9dc69b8e3

See more details on using hashes here.

File details

Details for the file dspy_react_machina-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dspy_react_machina-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fba0d84f692bf52133d403af94da2eae128723a8a5389516df7470f631f1d97
MD5 13460f1d45ecc45d76be9f35f85a7a00
BLAKE2b-256 d0550928be90bb68c699e0716287d72b10ac67c1026af319cfcfe5b5430b20ee

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