EnvironmentToolset

class EnvironmentToolset @JvmOverloads constructor(environment: Environment, maxOutputChars: Int = DEFAULT_MAX_OUTPUT_CHARS) : Toolset

Toolset that gives an agent Execute, ReadFile, EditFile and WriteFile tools over an Environment and appends tool-selection rules to the system instruction on each LLM call. Execute and ReadFile output is truncated to maxOutputChars characters, and each Execute command times out after 30 seconds.

Parameters

environment

The environment used to execute commands and perform file I/O.

maxOutputChars

Maximum characters of stdout, stderr or file content returned to the model, 30,000 by default; must not be negative.

Constructors

Link copied to clipboard
constructor(environment: Environment, maxOutputChars: Int = DEFAULT_MAX_OUTPUT_CHARS)

Functions

Link copied to clipboard
open override fun close()

Forwards to Environment.close on every call, relying on it being idempotent.

Link copied to clipboard
open suspend override fun getTools(readonlyContext: ReadonlyContext? = null): List<BaseTool>

Return all tools in the toolset based on the provided context.

Link copied to clipboard
open suspend override fun processLlmRequest(toolContext: ToolContext, llmRequest: LlmRequest): LlmRequest

Allows the toolset to process the LLM request.