Skip to main content

Explicit, async-first tool framework for LLM agents

Project description

yuutools

Explicit, async-first tool framework for LLM agents.

Install

uv add yuutools

Usage

import yuutools as yt

def get_z(ctx) -> int:
    return ctx.multiplier

@yt.tool(
    params={"x": "first operand", "y": "list of ints to sum"},
    name="goodtool",
    description="Add x + sum(y) + z",
)
async def goodtool(x: int, y: list[int], z: int = yt.depends(get_z)):
    return x + sum(y) + z

# Registry
manager = yt.ToolManager([goodtool])

tool = manager["goodtool"]
print(tool.spec.to("json_schema"))

# Bind context and run
result = await tool.bind(ctx).run(x=1, y=[2, 3])

@yt.tool

Decorator that turns a function into a Tool. Parameters:

  • params{name: description} mapping for the LLM schema
  • name — override tool name (default: __name__)
  • description — tool description (default: first docstring line)

yt.depends(resolver)

Marks a parameter as context-injected. The resolver is called with the bound context at execution time. Hidden from the generated spec.

ToolSpec.to(fmt)

Serialize to "json_schema" or "yaml" (requires yuutools[yaml]).

ToolManager

Name-keyed registry with [] lookup, iteration, and .specs() for bulk JSON schema export.

License

MIT

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

yuutools-0.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

yuutools-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file yuutools-0.2.0.tar.gz.

File metadata

  • Download URL: yuutools-0.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yuutools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 630a5196a4ff6887914bcd74eaacf534951e99afc326fdc04d06845a5f3cab02
MD5 d54021ac4548cd1e77b8636159cfc3be
BLAKE2b-256 f44e7759eec1b89c57cf4bf19f14054f5aedec85eaf4c36e068869cdafbe6bf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for yuutools-0.2.0.tar.gz:

Publisher: publish.yml on yuulabs/yuutools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yuutools-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yuutools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yuutools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c291368c2bcf926c89a2d879ba5f9466eef136a959069c7a69ab789eb10b6006
MD5 41b72eabc0a9da53ef5a3310a3a28087
BLAKE2b-256 e7f7a5ea59da469c51e9b6c24e8cd7e715f837b3367bbe76db39b56dd9c1ed4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for yuutools-0.2.0-py3-none-any.whl:

Publisher: publish.yml on yuulabs/yuutools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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