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.3.0.tar.gz (5.6 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.3.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for yuutools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bbde4aa4268e207f6bfd728422d4a8ba5feb9fdad1de144df5125f782bb0ad18
MD5 efc2c313785b7be5771785549cc16d43
BLAKE2b-256 56f9c3512a374df1b2b489eaa1ecec3e1f1d6225b05230316bc660650114b78b

See more details on using hashes here.

Provenance

The following attestation bundles were made for yuutools-0.3.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.3.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for yuutools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bfcc73eb43286105cc34d8a533ac8eee9aa5d42c272a6272ca52fd5507a5669
MD5 2882d418fc774b59ae756ecd394eb49d
BLAKE2b-256 6d4a5326f5287022020b320f8d0a0af443d184d364676e5c60d8c9aa1b96662d

See more details on using hashes here.

Provenance

The following attestation bundles were made for yuutools-0.3.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