All Products
Search
Document Center

API Gateway:AiToolSelectionConfig

Last Updated:Apr 09, 2026

Parameter

Type

Description

Example

object

Configuration for the AI tool selection feature.

enableConditions

object

Conditions for activating the tool selection feature.

toolCountThreshold

integer

The minimum number of tools required to activate tool selection.

toolReranking

object

Configuration for tool reranking, which controls how tools are scored and filtered.

modelService

object

Model service configuration for tool reranking.

serviceId

string

The ID of the model service used for reranking.

modelName

string

The name of the model used for reranking.

timeoutMillisecond

integer

The request timeout in milliseconds for the reranking model service.

filteringMethod

string

The method for filtering tools after reranking.

topKPercent

integer

The percentage of top-ranked tools to select. This parameter only applies when filteringMethod is set to a percentage-based method.

topNCount

integer

The number of top-ranked tools to select. This parameter only applies when filteringMethod is set to a count-based method.

scoreThreshold

number

The minimum score a tool must have to be selected. Tools with scores below this threshold are filtered out.

fallbackStrategy

string

The fallback strategy used if tool reranking fails or returns no results.

queryRewriting

object

Configuration for query rewriting, which optimizes user queries before tool selection.

enabled

boolean

Whether to enable query rewriting.

modelService

object

Model service configuration for query rewriting.

serviceId

string

The ID of the model service used for query rewriting.

modelName

string

The name of the model used for query rewriting.

timeoutMillisecond

integer

The request timeout in milliseconds for the query rewriting model service.

promptConfig

object

Prompt configuration for query rewriting.

type

string

The type of prompt, such as default or custom.

customPrompt

string

The custom prompt template for query rewriting. This parameter is required if type is set to custom.

maxOutputTokens

integer

The maximum number of tokens to generate for the rewritten query.

triggerConditions

object

Conditions for activating query rewriting.

messageCountThreshold

integer

The minimum number of messages in the conversation history required to activate query rewriting.

contextSelection

object

Method for selecting the conversation context for query rewriting.

type

string

The strategy for selecting the conversation context.

value

integer

The value associated with the context selection strategy, such as the number of messages to include.

fallbackStrategy

string

The fallback strategy used if query rewriting fails or returns no results.

pluginStatus AiPluginStatus
The status of the AI tool selection plugin.