跳转至

配置

Bumblehive 提供两种常用配置方式:

  • 简单项目使用 RuntimeArguments
  • 需要保存或分层管理时使用 BumblehiveConfig

单次 run() 可以通过 config 覆盖部分设置,但不能在单次运行中更换 mcp_servers

配置对象 负责内容
ProviderConfig 模型、API Key 和 Base URL
AgentConfig 指令、动态上下文、Skills 和工具选择
RuntimeConfig 工作区、时区、上下文和迭代限制
GenerationConfig 温度、输出长度和模型扩展参数

公开接口

Public configuration models and loading helpers.

AgentConfig dataclass

Agent defaults applied to each runtime turn.

BumblehiveConfig dataclass

Top-level runtime configuration.

from_dict classmethod

from_dict(data: Mapping[str, Any] | None) -> BumblehiveConfig

Build a config object from JSON-like dictionary data.

from_json_file classmethod

from_json_file(path: str | Path) -> BumblehiveConfig

Load a config object from a JSON file.

from_mapping classmethod

from_mapping(data: Mapping[str, Any] | None) -> BumblehiveConfig

Build a config object from JSON-like mapping data.

to_dict

to_dict() -> dict[str, Any]

Return this config as JSON-like dictionary data.

to_json_file

to_json_file(path: str | Path) -> None

Write this config to a JSON file.

ProviderConfig dataclass

Provider settings used to build the default runtime provider.

RuntimeArguments dataclass

Convenient flat arguments for constructing a Bumblehive runtime.

to_config

to_config() -> BumblehiveConfig

Convert flat runtime arguments into structured config.

RuntimeConfig dataclass

Per-runtime defaults applied to each turn.

load_config

load_config(config: ConfigInput = None) -> BumblehiveConfig

Normalize supported config inputs into a BumblehiveConfig.

load_json_config

load_json_config(path: str | Path) -> BumblehiveConfig

Load a BumblehiveConfig from a JSON file.