Skip to main content

Tools for Meshagent

Project description

Meshagent

MeshAgent Tools

The meshagent.tools package bundles reusable tool and toolkit abstractions plus a set of out of the box MeshAgent toolkits.

ToolContext and BaseTool

The ToolContext tracks the caller and optional "on-behalf-of" participant. Tools that actually need a room should require a RoomToolContext or use a room-bound Toolkit. The BaseTool defines metadata used by all tools such as name and description.

Tool and Toolkit

A Tool encapsulates a single operation with an input JSON schema. Each tool implements an execute function where you define the logic for the tool. The Toolkit groups tools together and can enforce rules or descriptions.

Response Types

Response types specify the output that a tool should return. This helps the tool and agent know how to handle the response appropriately. Response types include: JsonChunk, TextChunk, and FileChunk.

from meshagent.tools import FunctionTool, Toolkit, ToolContext
from meshagent.api.messaging import TextChunk

class MyNewTool(FunctionTool):
    def __init__(self):
        super().__init__(
            name="my_new_tool",
            title="A sample tool", 
            description="The tool skeleton",
            input_schema={
                "type":"object",
                "additionalProperties": False,
                "required": [...],
                "properties": {...}
            }
        )
    async def execute(self, ctx:ToolContext, sample_parameter:str):
        # tool logic
        return TextChunk(text="Tool logic complete")
    
class MyNewToolkit(Toolkit):
    def __init__(self):
        super().__init__(
            name="my_new_toolkit", 
            title="An example toolkit", 
            description="The toolkit skeleton", 
            tools=[MyNewTool])

Built-in Toolkits

Some of the built-in MeshAgent toolkits include:

  • StorageToolkit: Provides file operations (read, write, list, etc.)
  • DocumentAuthoringToolkit: Defines tools for manipulating Mesh documents (create document, add element, remove element, etc.)

Learn more about MeshAgent on our website or check out the docs for additional examples!

Website: www.meshagent.com

Documentation: docs.meshagent.com


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

meshagent_tools-0.42.2.tar.gz (85.9 kB view details)

Uploaded Source

Built Distribution

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

meshagent_tools-0.42.2-py3-none-any.whl (83.0 kB view details)

Uploaded Python 3

File details

Details for the file meshagent_tools-0.42.2.tar.gz.

File metadata

  • Download URL: meshagent_tools-0.42.2.tar.gz
  • Upload date:
  • Size: 85.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meshagent_tools-0.42.2.tar.gz
Algorithm Hash digest
SHA256 a188cf44b5144ab8560b77691677af365f65447a01dcac9f322eab14c3f40d85
MD5 17b3895931c2a635ff377c368bd8019f
BLAKE2b-256 11a9b4b9fd5c35230339feaa3daf1b2a949bae88264b39c63a2f970bc3c9aea2

See more details on using hashes here.

File details

Details for the file meshagent_tools-0.42.2-py3-none-any.whl.

File metadata

File hashes

Hashes for meshagent_tools-0.42.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cdc53a523f2b61e9e069fa17a44994763e55f12b98a63b6a8cc2a88bdab49293
MD5 6f3e89ec62c2fe0572ddb82bf2a9494a
BLAKE2b-256 4d62a7b59f78e252354bc7b561f9e5ded220288f48008cdf6f2221faf5eda25f

See more details on using hashes here.

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