fabricatio_tool.config

Module containing configuration classes for fabricatio-tool.

Attributes

tool_config

Classes

CheckConfigModel

Configuration for check modules, imports, and calls.

ServiceConfig

Configuration for a single MCP service instance.

ToolConfig

Configuration for fabricatio-tool.

Module Contents

class fabricatio_tool.config.CheckConfigModel(/, **data: Any)

Bases: pydantic.BaseModel

Configuration for check modules, imports, and calls.

targets: Set[str] = None

A set of strings representing the targets to check.

Type:

targets

mode: Literal['whitelist', 'blacklist'] = 'whitelist'

The mode to use for checking. Can be either “whitelist” or “blacklist”.

Type:

mode

is_blacklist() bool

Check if the mode is blacklist.

is_whitelist() bool

Check if the mode is whitelist.

class fabricatio_tool.config.ServiceConfig

Bases: TypedDict

Configuration for a single MCP service instance.

type: Literal['stdio', 'sse', 'stream', 'worker']

The transport protocol type (stdio, sse, stream, worker), default is stdio.

command: str | None

The execution command for stdio-type services

url: str | None

The endpoint URL for SSE/stream/worker-type services

args: List[str]

Command-line arguments for stdio services

env: Dict[str, pydantic.JsonValue]

Environment variables to set for service process

class fabricatio_tool.config.ToolConfig(/, **data: Any)

Bases: pydantic.BaseModel

Configuration for fabricatio-tool.

draft_tool_usage_code_template: str = 'built-in/draft_tool_usage_code'

The name of the draft tool usage code template which will be used to draft tool usage code.

check_modules: CheckConfigModel = None

Modules that are forbidden/allowed to be imported.

check_imports: CheckConfigModel = None

Imports that are forbidden/allowed to be used.

check_calls: CheckConfigModel = None

Calls that are forbidden/allowed to be used.

mcp_servers: Dict[str, ServiceConfig] = None

MCP servers that are allowed to be used.

confirm_on_ops: bool = True

Whether to confirm operations before executing them.

logging_on_ops: bool = True

Whether to log operations before executing them.

error_key: str = '__error__'

The key to use for error reporting.

fabricatio_tool.config.tool_config