Skip to main content

CrowAct

crowact is a lightweight ReAct agent framework with tool calling, streaming chunks, and pluggable providers.

Distribution name: crowact
Python import name: CrowAct

Requirements

  • Python 3.10+
  • requests
  • python-dotenv

Install

pip install crowact

For local development in this repository:

pip install -e .

Quick Start

from CrowAct import Agent, LLMProvider, load_prompt_from
from CrowAct.agent.tools import get_tools

TOOLS = get_tools("test_folder")


def main() -> None:
    provider = LLMProvider.from_anthropic_env("byte2.env")
    agent = Agent(
        provider=provider,
        model="deepseek-v3.2",
        system_prompt=load_prompt_from(["system.md", "rules.txt"]),
        tools=TOOLS,
    )

    question = (
        "Please use tools to calculate this step by step: "
        "first compute 1+19, then take the square root of the result, "
        "and finally add 100."
    )

    for chunk in agent.run(question, stream=True):
        print(chunk)

    print(agent.last_answer)


if __name__ == "__main__":
    main()

load_prompt_from(...) supports either a single file path or multiple file paths.

system_prompt = load_prompt_from("system.md")

system_prompt = load_prompt_from(["system.md", "rules.txt"])

Generated format:

system.md
----
file content

rules.txt
----
file content

Tool Files

get_tools(folder) loads every *.py file in the target folder and registers functions marked with the @tool(...) decorator.

Example folder:

test_folder/
  tool1.py
  tool2.py

Example tool:

from CrowAct.agent.tools import tool


@tool(
    description="Compute the square root of a number.",
    param_descriptions={"number": "The number to take the square root of"},
)
def sqrt_tool(number: float) -> float:
    return number ** 0.5

Agent Output

Agent.run(...) always returns an iterator of chunks.

Chunk types:

  • {"type": "text", "text": "..."}
  • {"type": "tool_use", "id": "...", "name": "...", "input": {...}}
  • {"type": "tool_result", "tool_use_id": "...", "content": "..."}

Behavior:

  • stream=True: text is yielded incrementally as streaming chunks.
  • stream=False: text is yielded as complete blocks, but the API remains iterator-based.

The final plain-text answer is stored in agent.last_answer.

History

history is optional. If omitted, the Agent starts with an empty history and keeps appending records across later run() calls. Stored history includes user messages, assistant messages, tool calls, and tool results. The history is available at agent.history and is truncated from the front with history_window (default: 20).

agent = Agent(
    provider=provider,
    model="deepseek-v3.2",
    system_prompt="You are helpful.",
    history_window=20,
)
agent.run("First question")
agent.run("Follow-up question")
print(len(agent.history))  # <= 20

Provider Setup

Anthropic-style

provider = LLMProvider.from_anthropic_env(".env")

Expected environment variables:

ANTHROPIC_BASE_URL=https://your-endpoint
ANTHROPIC_API_KEY=your-api-key

Endpoint pattern:

  • .../v1/messages

OpenAI-style

provider = LLMProvider.from_openai_env(".env")

Expected environment variables:

OPENAI_BASE_URL=https://your-endpoint
OPENAI_API_KEY=your-api-key

Endpoint pattern:

  • .../chat/completions

Current Limitation

LLMProvider supports both anthropic and openai endpoint styles, but the request body and tool-calling flow are currently implemented around the Anthropic-style message format. If you use an OpenAI-compatible endpoint, confirm that it accepts the same request shape before relying on it.

Local Example

This repository includes:

License

Add a license before publishing to PyPI.

Metadata

Release files for crowact 0.1.3

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

Source distribution (sdist)

Source distribution for crowact 0.1.3
File Size Uploaded Provenance Actions
crowact-0.1.3.tar.gz 7.9 kB Without provenance Details for crowact-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crowact 0.1.3
File Interpreter ABI Platform Actions
crowact-0.1.3-py3-none-any.whl Python 3 none any Details for crowact-0.1.3-py3-none-any.whl

Total release size: 17.5 kB

Release files / crowact-0.1.3.tar.gz

Download URL crowact-0.1.3.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
00324b84c5c111f55ed6dd95c991c85c703bf98c6036a9a630c8dc3e8b907cc7
BLAKE2b-256 checksum
How to use checksums
3894c169dece8209540e08333a22292f4a317826c727c373e305d5c67e1390f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / crowact-0.1.3-py3-none-any.whl

Download URL crowact-0.1.3-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d09b78e9d1c9345b46b84a23fc4c4d3e887bce1d0456b87ee4a4414212cc3bc8
BLAKE2b-256 checksum
How to use checksums
5d5a8b826c5906a92eba67d5b6e5cdb3fb09bb86fa88dc7628d85916d1ff21cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for crowact 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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