Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

feat(setting): default tool calling on for new provider instances (#20195)

chanx8786900e6755
diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index ddb65d41e8..a636024aa7 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -2424,7 +2424,7 @@ Example: Virtual Hosted Style`,
editCustomModelTitle: 'Edit model',
modelMaxTokens: 'Max context length',
modelFeatures: 'Model features',
- modelFeatureToolCall: 'Tool call',
+ modelFeatureToolCall: 'Tool calling',
modelFeatureFunctionCall: 'Function call',
modelNameRequired: 'Model name is required',
modelNameDuplicate: 'Model name already exists',
diff --git a/web/src/pages/user-setting/setting-model/instance-card/models-section/hooks.ts b/web/src/pages/user-setting/setting-model/instance-card/models-section/hooks.ts
index db98c5b366..5edc87335e 100644
--- a/web/src/pages/user-setting/setting-model/instance-card/models-section/hooks.ts
+++ b/web/src/pages/user-setting/setting-model/instance-card/models-section/hooks.ts
@@ -79,12 +79,20 @@ export const normalizeModelTypes = (raw: unknown): string[] =>
* provider model items. `features` is forwarded via `extra` so the backend
* can persist per-model flags such as `is_tools`.
*/
-export const buildModelInfo = (items: IProviderModelItem[]): IModelInfo[] =>
+export const buildModelInfo = (
+ items: IProviderModelItem[],
+ // New (draft) instances default every model to tool-calling enabled;
+ // an explicit per-model `extra.is_tools` below still overrides it.
+ defaultToolsEnabled = false,
+): IModelInfo[] =>
items.map((m) => ({
model_name: m.name,
model_type: m.model_types ?? [],
max_tokens: m.max_tokens ?? 0,
- extra: { is_tools: hasToolFeature(m.features), ...(m.extra ?? {}) },
+ extra: {
+ is_tools: defaultToolsEnabled || hasToolFeature(m.features),
+ ...(m.extra ?? {}),
+ },
}));
/** Resolved credentials for catalog / verify / batch calls.
@@ -462,7 +470,7 @@ export function useModelsDerived({
// Push the latest per-instance model list up to the host so its
// save payload can include `model_info`.
useEffect(() => {
- onChangeRef.current?.(buildModelInfo(instanceItems));
+ onChangeRef.current?.(buildModelInfo(instanceItems, isDraftInstance));
}, [instanceItems]);
// Saved instance models come from the backend, both after the initial
@@ -855,7 +863,7 @@ export function useModelMutations({
api_key: apiKey,
base_url: baseUrl,
region: instance?.region ?? 'default',
- model_info: buildModelInfo(nextModels),
+ model_info: buildModelInfo(nextModels, isDraftInstance),
});
filteredModels.forEach((m) => {
if (!isModelAdded(m.name)) {