Pular para o conteúdo

Adding a Feature Flag-Controlled Tool

Este conteúdo não está disponível em sua língua ainda.

How to let server admins turn a built-in tool on and off. Build the tool first with Adding a Built-In Tool.

  1. Map the config field to a flag in configToFeatureFlags (src/utils/tools/featureFlagMapper.ts):

    my_config_field: [FeatureFlag.MY_TOOL],
  2. Set the flag on the tool class:

    override requiresFeatureFlag = FeatureFlag.MY_TOOL;
  3. Make sure a config command can change the field.

Run bun run check and bun run lint. With the setting off, the tool must be missing from the model’s tool list; with it on, the tool must appear and run.