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
- Examples - Working examples including async and instrumentation
- Testing Conventions - Testing guidelines
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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
688f2987b17a9d937e8222a549116bc9f154a8cc9b06fb3b710f5c503917e8b3
|
|
| MD5 |
1f88d841ad2cd7f6378492974025291b
|
|
| BLAKE2b-256 |
483a57cf9de05f105696b92bdf8f27b5f0491776282eca9ea94bcbb9dc69b8e3
|
File details
Details for the file dspy_react_machina-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dspy_react_machina-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fba0d84f692bf52133d403af94da2eae128723a8a5389516df7470f631f1d97
|
|
| MD5 |
13460f1d45ecc45d76be9f35f85a7a00
|
|
| BLAKE2b-256 |
d0550928be90bb68c699e0716287d72b10ac67c1026af319cfcfe5b5430b20ee
|