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.1.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.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yuutools-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 f348f45452af3aee9c39c2ce956aea9cdd0eead1b787ca8e9a75060c17e47280
MD5 2b9e751ebf6132c985f82eab366cdc3c
BLAKE2b-256 ed0cc2ac83461e03b222a2dd5571e38754abad85df04e3fccd244de5b65560eb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: yuutools-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 558f19d11f8572dbadf39b0ef1efb2d817d0180328dcba44006c2aa121d4d65c
MD5 be87aa0043a5a6383f2327d30a2b1cce
BLAKE2b-256 391555edec817435bd5569029bb0d58fbc7b48919799c36b5bc5b2fde876af97

See more details on using hashes here.

Provenance

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