RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Model config: add tools (#16371)
Jin Hai65afaa1292a8
diff --git a/conf/all_models.json b/conf/all_models.jsonindex 48e4274e5f..965ae9e2e3 100644--- a/conf/all_models.json+++ b/conf/all_models.json@@ -6652,14 +6652,20 @@"max_tokens": 128000,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-flash-250414","max_tokens": 128000,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-long",@@ -6709,7 +6715,10 @@"max_tokens": 128000,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4.5-x",@@ -6731,6 +6740,9 @@"model_types": ["chat"],+ "tools": {+ "support": true+ },"thinking": {"default_value": true,"clear_thinking": true@@ -37357,6 +37369,9 @@"glm-5.2","glm-5-2"],+ "tools": {+ "support": true+ },"model_types": ["chat"]@@ -37371,6 +37386,9 @@"Z-AI/GLM 5.1","GLM 5.1 FP4"],+ "tools": {+ "support": true+ },"model_types": ["chat"],diff --git a/conf/models/zhipu-ai.json b/conf/models/zhipu-ai.jsonindex a79a51a443..872e555047 100644--- a/conf/models/zhipu-ai.json+++ b/conf/models/zhipu-ai.json@@ -26,6 +26,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -37,6 +40,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -48,6 +54,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -59,6 +68,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -70,6 +82,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -81,6 +96,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -93,6 +111,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -104,6 +125,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -115,6 +139,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -126,6 +153,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -137,6 +167,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -148,6 +181,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -159,6 +195,9 @@"thinking": {"default_value": true,"clear_thinking": true+ },+ "tools": {+ "support": true}},{@@ -166,56 +205,80 @@"max_tokens": 131072,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-0520","max_tokens": 131072,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4","max_tokens": 131072,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-airx","max_tokens": 8000,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-air","max_tokens": 131072,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-flash","max_tokens": 131072,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-flashx","max_tokens": 131072,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4-long","max_tokens": 1000000,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "glm-4v",@@ -229,7 +292,10 @@"max_tokens": 8192,"model_types": ["chat"- ]+ ],+ "tools": {+ "support": true+ }},{"name": "embedding-2",diff --git a/internal/entity/models/model.go b/internal/entity/models/model.goindex ed32cf0544..390a92e429 100644--- a/internal/entity/models/model.go+++ b/internal/entity/models/model.go@@ -153,12 +153,17 @@ type ModelThinking struct {ClearThinking bool `json:"clear_thinking"`}+type ModelTools struct {+ Support bool `json:"support"`+}+// Model represents a single LLM modeltype Model struct {Name string `json:"name"`MaxTokens *int `json:"max_tokens"`ModelTypes []string `json:"model_types"`Thinking *ModelThinking `json:"thinking"`+ Tools *ModelTools `json:"tools"`Class *string `json:"class"`MaxDimension *int `json:"max_dimension"` // used by embedding modelsDimensions []int `json:"dimensions"`@@ -406,6 +411,12 @@ func (pm *ProviderManager) ListAllModels() ([]map[string]interface{}, error) {if len(model.Dimensions) > 0 {modelData["dimensions"] = model.Dimensions}+ if model.Thinking != nil {+ modelData["thinking"] = "supported"+ }+ if model.Tools != nil {+ modelData["tools"] = "supported"+ }modelList = append(modelList, modelData)}@@ -473,6 +484,12 @@ func (pm *ProviderManager) ListModels(providerName string) ([]map[string]interfa"max_dimension": model.MaxDimension,"dimensions": model.Dimensions,}+ if model.Thinking != nil {+ modelData["thinking"] = "supported"+ }+ if model.Tools != nil {+ modelData["tools"] = "supported"+ }modelList = append(modelList, modelData)}