tool_config_client


Description:

protected async Client tool_config_client (string model_type, string? opt_url = null, string? opt_api_key = null, string? cli_model_override = null) throws Error

Gets or creates a client from the codebase search tool config and verifies the model is available.

Uses the tool config system (not the usage map). Ensures tool config exists, applies CLI model override if provided, verifies the model is available on the server, but doesn't save config until after all checks are complete.

Note:

`opt_url` and `opt_api_key` only affect defaults if config is not already loaded. If config is loaded, they are ignored and existing defaults are used.

Parameters:

model_type

"embed" for embed model, "analysis" for analysis model

opt_url

Optional URL from command line (required if config not loaded; creates default connection if provided)

opt_api_key

Optional API key from command line (only used if config not loaded)

cli_model_override

Optional model name override from command line (overrides the model in tool config)

Returns:

Client instance for the model

Exceptions:

Error

if client cannot be created or model is not available