Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt

Use this file to discover all available pages before exploring further.

After you create your Python tools, import them as a Python toolkit. A Python toolkit groups related tools so you can deploy and run them together in a single Python process. To meet this goal, design every tool in the toolkit to be thread-safe and reentrant. This approach gives you faster execution because the tools share the same process. When you run Python tools outside a toolkit, the system starts a lightweight process each time the tool runs. This design supports tools that use non-thread-safe operations, but it increases execution time compared to a toolkit. To create a Python toolkit, place all required Python tools in one folder. Each tool can include one or more Python files. In those files, define your functions and apply the @tool decorator so watsonx Orchestrate exposes each function as a usable tool. You can place tools that multiple agents use into a single toolkit. When you update tools inside a toolkit, redeploy all related agents to the live environment so you use the updated versions. Choose the number of tools in each toolkit based on the level of concurrent requests you expect. For more information, see CPU and memory allocation for Python toolkits.

CPU and memory allocation for Python toolkits

In the draft environment, all imported Python toolkits and Python tools run in a single Kubernetes deployment container per tenant. Due to this, process overheads per tool call always exist in draft. This container provides 2 vCPUs, 2 GB of memory, and 5 workers. The deployment supports two replicas. In live environments, in a premium plan, you can import up to five Python toolkits per tenant. If you use a different plan, contact support to request access. Each toolkit runs in its own Kubernetes deployment container with 2 vCPUs, 2 GB of memory, and 5 workers (no process overheads per tool call). Each deployment supports two replicas. If you use a different plan, contact support to request access.

Add Python toolkits using the ADK CLI

Use the orchestrate toolkits add command to add a Python toolkit.
BASH
orchestrate toolkits add \
  --kind python \
  --name <toolkit-name> \
  --description <toolkit-description> \
  --tier <deployment-tier> \
  --package_root <toolkit-path>

Import Python toolkits from a file

You can also import a Python toolkit from a YAML file. This file defines the same configuration options as the add command and fits well into import scripts and CI/CD pipelines. Use the orchestrate toolkits import command to import a toolkit from a file.
BASH
orchestrate toolkits import -f <path to spec> --app-id <connection>
For the YAML file, configure the following:
spec_version
string
required
The version of the YAML specification.
kind
string
required
The type of toolkit. For Python toolkits, use python.
name
string
required
The name of the toolkit.
description
string
The description of the toolkit.
environment
object
Key-value pairs for the toolkit.
Example:
toolkit_name.yaml
spec_version: v1
kind: python
name: toolkit_name
description: A toolkit sample
environment:
    key1: value1