Inference Logoinference.sh

App Tools

Run inference.sh apps as agent tools.


Basic Usage

1from inferencesh import app_tool2 3image_gen = (4    app_tool("generate_image", "infsh/flux@latest")5    .describe("Generate images from text prompts")6    .build()7)

How It Works

When the agent calls an app tool:

  1. A task is created for the referenced app
  2. Tool arguments become task input
  3. Task output becomes tool result
  4. Agent continues with the result

Builder Methods

MethodDescription
appTool(name, ref)Create app tool with app reference
.describe(text)Set description for LLM
.display(name)Human-readable name
.requireApproval()Require user approval
.build()Build the tool

App Reference Formats

code
1# Latest version2namespace/app-name@latest3 4# Specific version5namespace/app-name@abc123

Examples

Image Generation

1image_gen = (2    app_tool("generate_image", "infsh/flux@latest")3    .describe("Generate an image from a text prompt")4    .build()5)6 7agent = client.agent({8    "core_app_ref": "infsh/claude-sonnet-4@latest",9    "tools": [image_gen]10})11 12response = agent.send_message("Generate a picture of a sunset")13# Agent calls generate_image, waits for result, then responds

Text-to-Speech & Code Execution

1tts = (2    app_tool("speak", "infsh/tts@latest")3    .describe("Convert text to speech audio")4    .build()5)6 7code_runner = (8    app_tool("run_code", "infsh/code-interpreter@latest")9    .describe("Execute Python code and return the result")10    .build()11)

With Approval

1expensive_model = (2    app_tool("analyze", "expensive/model@latest")3    .describe("Deep analysis using expensive model")4    .require_approval()  # User must approve before running5    .build()6)

Multiple App Tools

1agent = client.agent({2    "core_app_ref": "infsh/claude-sonnet-4@latest",3    "tools": [4        app_tool("generate_image", "infsh/flux@latest")5            .describe("Generate images").build(),6        app_tool("transcribe", "infsh/whisper@latest")7            .describe("Transcribe audio").build(),8        app_tool("run_code", "infsh/code-interpreter@latest")9            .describe("Run Python code").build(),10    ]11})

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.