Package ai.mindconnect.agent.tool
Interface ToolEnvironment
- All Known Implementing Classes:
MapToolEnvironment
public interface ToolEnvironment
Typed registry of runtime-level dependencies that
ToolFactory
instances may request at bind time. The runtime populates it with whatever
services and configuration the host application wants to expose to tools
(repositories, HTTP clients, API keys, base directories, ...).
A factory should only pull the values it actually needs — there is no
shared god-context. Missing values return Optional.empty() or
null, and it is the factory's responsibility to decide whether that
makes the tool unavailable.
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> Look up a service by type.Look up a named string value (e.g. an API key or base directory).default <T> TRequired-type accessor; throws if no service of the given type is registered.default StringrequireString(String key) Required-string accessor; throws if no value is bound for the key.
-
Method Details
-
get
Look up a service by type. Returns empty if no such service is registered. -
getString
Look up a named string value (e.g. an API key or base directory). -
require
Required-type accessor; throws if no service of the given type is registered. -
requireString
Required-string accessor; throws if no value is bound for the key.
-