Skip to content

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

Support jev model interface, part1 (#21087)

Jin Haif7c281515975
diff --git a/internal/entity/models/302ai.go b/internal/entity/models/302ai.go
index 87ee8c2015..b94292b0ea 100644
--- a/internal/entity/models/302ai.go
+++ b/internal/entity/models/302ai.go
@@ -785,3 +785,7 @@ func (a *AI302Model) ShowTask(ctx context.Context, taskID string, apiConfig *API
},
}, nil
}
+
+func (a *AI302Model) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s no such method", a.Name())
+}
diff --git a/internal/entity/models/aliyun.go b/internal/entity/models/aliyun.go
index 84b5b17aa1..8aa3ff4b4c 100644
--- a/internal/entity/models/aliyun.go
+++ b/internal/entity/models/aliyun.go
@@ -1026,3 +1026,7 @@ func (a *AliyunModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (a *AliyunModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", a.Name())
}
+
+func (a *AliyunModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", a.Name())
+}
diff --git a/internal/entity/models/anthropic.go b/internal/entity/models/anthropic.go
index d823e3a932..c1c6f3ba48 100644
--- a/internal/entity/models/anthropic.go
+++ b/internal/entity/models/anthropic.go
@@ -620,3 +620,7 @@ func (a *AnthropicModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([
func (a *AnthropicModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", a.Name())
}
+
+func (a *AnthropicModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", a.Name())
+}
diff --git a/internal/entity/models/astraflow.go b/internal/entity/models/astraflow.go
index 6bed002eb7..8b06c4d807 100644
--- a/internal/entity/models/astraflow.go
+++ b/internal/entity/models/astraflow.go
@@ -419,3 +419,7 @@ func (a *AstraflowModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([
func (a *AstraflowModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", a.Name())
}
+
+func (a *AstraflowModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", a.Name())
+}
diff --git a/internal/entity/models/avian.go b/internal/entity/models/avian.go
index 24a70a96bb..c6a4f14928 100644
--- a/internal/entity/models/avian.go
+++ b/internal/entity/models/avian.go
@@ -224,3 +224,7 @@ func (a *AvianModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Lis
func (a *AvianModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", a.Name())
}
+
+func (a *AvianModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", a.Name())
+}
diff --git a/internal/entity/models/azure_openai.go b/internal/entity/models/azure_openai.go
index 3eb490f12e..5dc801b82c 100644
--- a/internal/entity/models/azure_openai.go
+++ b/internal/entity/models/azure_openai.go
@@ -304,3 +304,7 @@ func (a *AzureOpenAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig)
func (a *AzureOpenAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", a.Name())
}
+
+func (a *AzureOpenAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", a.Name())
+}
diff --git a/internal/entity/models/baichuan.go b/internal/entity/models/baichuan.go
index a0742282a6..7b304c5344 100644
--- a/internal/entity/models/baichuan.go
+++ b/internal/entity/models/baichuan.go
@@ -229,3 +229,7 @@ func (b *BaichuanModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (b *BaichuanModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", b.Name())
}
+
+func (b *BaichuanModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", b.Name())
+}
diff --git a/internal/entity/models/baidu.go b/internal/entity/models/baidu.go
index 071286344e..0fd5e11173 100644
--- a/internal/entity/models/baidu.go
+++ b/internal/entity/models/baidu.go
@@ -571,3 +571,7 @@ func (b *BaiduModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Lis
func (b *BaiduModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", b.Name())
}
+
+func (b *BaiduModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", b.Name())
+}
diff --git a/internal/entity/models/bedrock.go b/internal/entity/models/bedrock.go
index f04c070675..7858f85cc9 100644
--- a/internal/entity/models/bedrock.go
+++ b/internal/entity/models/bedrock.go
@@ -1217,3 +1217,7 @@ func (b *BedrockModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (b *BedrockModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", b.Name())
}
+
+func (b *BedrockModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", b.Name())
+}
diff --git a/internal/entity/models/builtin.go b/internal/entity/models/builtin.go
index e424a1fdd9..2de9a4b1d7 100644
--- a/internal/entity/models/builtin.go
+++ b/internal/entity/models/builtin.go
@@ -168,6 +168,10 @@ func (b *BuiltinModel) ShowTask(ctx context.Context, taskID string, apiConfig *A
return nil, fmt.Errorf("builtin model does not support tasks")
}
+func (b *BuiltinModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("builtin model does not support decide")
+}
+
// GetBuiltinEmbeddingModel returns a Builtin model driver for the given model name
func GetBuiltinEmbeddingModel(modelName string) ModelDriver {
return NewBuiltinModel("", modelName)
diff --git a/internal/entity/models/cohere.go b/internal/entity/models/cohere.go
index 3290cd92d8..25b9789c99 100644
--- a/internal/entity/models/cohere.go
+++ b/internal/entity/models/cohere.go
@@ -752,3 +752,7 @@ func (c *CoHereModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (c *CoHereModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", c.Name())
}
+
+func (c *CoHereModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", c.Name())
+}
diff --git a/internal/entity/models/cometapi.go b/internal/entity/models/cometapi.go
index c002b1489c..9bfeae6ef6 100644
--- a/internal/entity/models/cometapi.go
+++ b/internal/entity/models/cometapi.go
@@ -546,3 +546,7 @@ func (c *CometAPIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (c *CometAPIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", c.Name())
}
+
+func (c *CometAPIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", c.Name())
+}
diff --git a/internal/entity/models/deepinfra.go b/internal/entity/models/deepinfra.go
index 078dbec7f2..6f72cd6ed2 100644
--- a/internal/entity/models/deepinfra.go
+++ b/internal/entity/models/deepinfra.go
@@ -728,3 +728,7 @@ func (d *DeepInfraModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([
func (d *DeepInfraModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s no such method", d.Name())
}
+
+func (d *DeepInfraModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", d.Name())
+}
diff --git a/internal/entity/models/deepseek.go b/internal/entity/models/deepseek.go
index e6934355d1..58e326af2b 100644
--- a/internal/entity/models/deepseek.go
+++ b/internal/entity/models/deepseek.go
@@ -379,3 +379,7 @@ func (d *DeepSeekModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (d *DeepSeekModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", d.Name())
}
+
+func (d *DeepSeekModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", d.Name())
+}
diff --git a/internal/entity/models/dummy.go b/internal/entity/models/dummy.go
index ef88bf4018..047ce2fb0e 100644
--- a/internal/entity/models/dummy.go
+++ b/internal/entity/models/dummy.go
@@ -116,3 +116,7 @@ func (d *DummyModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Lis
func (d *DummyModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", d.Name())
}
+
+func (d *DummyModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", d.Name())
+}
diff --git a/internal/entity/models/fishaudio.go b/internal/entity/models/fishaudio.go
index 18f774de40..b11f5dbad9 100644
--- a/internal/entity/models/fishaudio.go
+++ b/internal/entity/models/fishaudio.go
@@ -451,3 +451,7 @@ func (f *FishAudioModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([
func (f *FishAudioModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", f.Name())
}
+
+func (f *FishAudioModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", f.Name())
+}
diff --git a/internal/entity/models/funasr.go b/internal/entity/models/funasr.go
index 7cec0feaa7..7471f8e383 100644
--- a/internal/entity/models/funasr.go
+++ b/internal/entity/models/funasr.go
@@ -279,3 +279,7 @@ func (f *FunASR) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]ListTas
func (f *FunASR) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s no such method", f.Name())
}
+
+func (f *FunASR) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", f.Name())
+}
diff --git a/internal/entity/models/futurmix.go b/internal/entity/models/futurmix.go
index 678d65ab96..d3f537d12c 100644
--- a/internal/entity/models/futurmix.go
+++ b/internal/entity/models/futurmix.go
@@ -189,3 +189,7 @@ func (f *FuturMixModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (f *FuturMixModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", f.Name())
}
+
+func (f *FuturMixModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", f.Name())
+}
diff --git a/internal/entity/models/gitee.go b/internal/entity/models/gitee.go
index 15cfa6ac8c..f8fa1d88c3 100644
--- a/internal/entity/models/gitee.go
+++ b/internal/entity/models/gitee.go
@@ -918,3 +918,7 @@ func (g *GiteeModel) ShowTask(ctx context.Context, taskID string, apiConfig *API
return taskResp, nil
}
+
+func (g *GiteeModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", g.Name())
+}
diff --git a/internal/entity/models/google.go b/internal/entity/models/google.go
index cbd2b928c9..66f486ab4f 100644
--- a/internal/entity/models/google.go
+++ b/internal/entity/models/google.go
@@ -727,3 +727,7 @@ func (g *GoogleModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (g *GoogleModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", g.Name())
}
+
+func (g *GoogleModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", g.Name())
+}
diff --git a/internal/entity/models/gpustack.go b/internal/entity/models/gpustack.go
index c417aacc2d..179c4efe6f 100644
--- a/internal/entity/models/gpustack.go
+++ b/internal/entity/models/gpustack.go
@@ -319,3 +319,7 @@ func (g *GPUStackModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (g *GPUStackModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", g.Name())
}
+
+func (g *GPUStackModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", g.Name())
+}
diff --git a/internal/entity/models/greenpt.go b/internal/entity/models/greenpt.go
index bd974f979f..2570202d60 100644
--- a/internal/entity/models/greenpt.go
+++ b/internal/entity/models/greenpt.go
@@ -222,3 +222,7 @@ func (m *GreenPTModel) TranscribeAudio(ctx context.Context, modelName *string, f
}
return &ASRResponse{Text: result.Results.Channels[0].Alternatives[0].Transcript}, nil
}
+
+func (g *GreenPTModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", g.Name())
+}
diff --git a/internal/entity/models/groq.go b/internal/entity/models/groq.go
index 1bac1c7dee..aac79123ac 100644
--- a/internal/entity/models/groq.go
+++ b/internal/entity/models/groq.go
@@ -430,3 +430,7 @@ func (g *GroqModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]List
func (g *GroqModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", g.Name())
}
+
+func (g *GroqModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", g.Name())
+}
diff --git a/internal/entity/models/huaweicloud.go b/internal/entity/models/huaweicloud.go
index 35ba1d96c5..9515ca3e8f 100644
--- a/internal/entity/models/huaweicloud.go
+++ b/internal/entity/models/huaweicloud.go
@@ -548,3 +548,7 @@ func (h *HuaweiCloudModel) ListTasks(ctx context.Context, apiConfig *APIConfig)
func (h *HuaweiCloudModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", h.Name())
}
+
+func (h *HuaweiCloudModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", h.Name())
+}
diff --git a/internal/entity/models/huggingface.go b/internal/entity/models/huggingface.go
index 69f2915137..e1576051b3 100644
--- a/internal/entity/models/huggingface.go
+++ b/internal/entity/models/huggingface.go
@@ -295,3 +295,7 @@ func (h *HuggingFaceModel) ListTasks(ctx context.Context, apiConfig *APIConfig)
func (h *HuggingFaceModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", h.Name())
}
+
+func (h *HuggingFaceModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", h.Name())
+}
diff --git a/internal/entity/models/hunyuan.go b/internal/entity/models/hunyuan.go
index 759932f526..5e0f23c431 100644
--- a/internal/entity/models/hunyuan.go
+++ b/internal/entity/models/hunyuan.go
@@ -289,3 +289,7 @@ func (h *HunyuanModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (h *HunyuanModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", h.Name())
}
+
+func (h *HunyuanModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", h.Name())
+}
diff --git a/internal/entity/models/jiekouai.go b/internal/entity/models/jiekouai.go
index 3919f7f533..3dae389236 100644
--- a/internal/entity/models/jiekouai.go
+++ b/internal/entity/models/jiekouai.go
@@ -428,3 +428,7 @@ func (j *JieKouAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (j *JieKouAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s no such method", j.Name())
}
+
+func (j *JieKouAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", j.Name())
+}
diff --git a/internal/entity/models/jina.go b/internal/entity/models/jina.go
index 6c429cd81b..3e7c984be3 100644
--- a/internal/entity/models/jina.go
+++ b/internal/entity/models/jina.go
@@ -710,3 +710,7 @@ func (j *JinaModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]List
func (j *JinaModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", j.Name())
}
+
+func (j *JinaModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", j.Name())
+}
diff --git a/internal/entity/models/llm_test.go b/internal/entity/models/llm_test.go
index 9d8e41f6dc..cb4a8b2a6a 100644
--- a/internal/entity/models/llm_test.go
+++ b/internal/entity/models/llm_test.go
@@ -593,6 +593,9 @@ func (d *captureToolDriver) ListTasks(ctx context.Context, _ *APIConfig) ([]List
func (d *captureToolDriver) ShowTask(ctx context.Context, _ string, _ *APIConfig) (*TaskResponse, error) {
return nil, nil
}
+func (u *captureToolDriver) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, nil
+}
// TestToInternalMessagesConvertsMultiModalContent guards the eino→driver
// boundary: UserInputMultiContent must become OpenAI-style content blocks
diff --git a/internal/entity/models/lmstudio.go b/internal/entity/models/lmstudio.go
index 1a1f5bc157..3d7b89921f 100644
--- a/internal/entity/models/lmstudio.go
+++ b/internal/entity/models/lmstudio.go
@@ -340,3 +340,7 @@ func (l *LmStudioModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (l *LmStudioModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", l.Name())
}
+
+func (l *LmStudioModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", l.Name())
+}
diff --git a/internal/entity/models/localai.go b/internal/entity/models/localai.go
index 57b9ee7604..c708efe4f4 100644
--- a/internal/entity/models/localai.go
+++ b/internal/entity/models/localai.go
@@ -415,3 +415,7 @@ func (l *LocalAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (l *LocalAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", l.Name())
}
+
+func (l *LocalAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", l.Name())
+}
diff --git a/internal/entity/models/longcat.go b/internal/entity/models/longcat.go
index d6ab3d8b9a..638ce4c8cf 100644
--- a/internal/entity/models/longcat.go
+++ b/internal/entity/models/longcat.go
@@ -252,3 +252,7 @@ func (l *LongCatModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (l *LongCatModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", l.Name())
}
+
+func (l *LongCatModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", l.Name())
+}
diff --git a/internal/entity/models/mineru.go b/internal/entity/models/mineru.go
index a4bd547423..471cc5121f 100644
--- a/internal/entity/models/mineru.go
+++ b/internal/entity/models/mineru.go
@@ -313,3 +313,7 @@ func (m *MinerUModel) ShowTask(ctx context.Context, taskID string, apiConfig *AP
},
}, nil
}
+
+func (m *MinerUModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/mineru_local.go b/internal/entity/models/mineru_local.go
index 91389b4ea7..47a99e717b 100644
--- a/internal/entity/models/mineru_local.go
+++ b/internal/entity/models/mineru_local.go
@@ -363,3 +363,7 @@ func (m *MinerULocalModel) ShowTask(ctx context.Context, taskID string, apiConfi
},
}, nil
}
+
+func (m *MinerULocalModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/minimax.go b/internal/entity/models/minimax.go
index 5dc346dc3c..f21ca6b834 100644
--- a/internal/entity/models/minimax.go
+++ b/internal/entity/models/minimax.go
@@ -532,3 +532,7 @@ func (m *MinimaxModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (m *MinimaxModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", m.Name())
}
+
+func (m *MinimaxModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/mistral.go b/internal/entity/models/mistral.go
index 7a2724f06c..0f36a5ae27 100644
--- a/internal/entity/models/mistral.go
+++ b/internal/entity/models/mistral.go
@@ -582,3 +582,7 @@ func (m *MistralModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (m *MistralModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", m.Name())
}
+
+func (m *MistralModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/modelscope.go b/internal/entity/models/modelscope.go
index 347a5af989..2b50702294 100644
--- a/internal/entity/models/modelscope.go
+++ b/internal/entity/models/modelscope.go
@@ -203,3 +203,7 @@ func (m *ModelScopeModel) ListTasks(ctx context.Context, apiConfig *APIConfig) (
func (m *ModelScopeModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", m.Name())
}
+
+func (m *ModelScopeModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/monkeyocrv2.go b/internal/entity/models/monkeyocrv2.go
index 35c5178a8b..7c1a05e035 100644
--- a/internal/entity/models/monkeyocrv2.go
+++ b/internal/entity/models/monkeyocrv2.go
@@ -93,3 +93,7 @@ func monkeyOCRv2BaseURLFromAPIKey(apiConfig *APIConfig) string {
}
return ""
}
+
+func (m *MonkeyOCRv2Model) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/moonshot.go b/internal/entity/models/moonshot.go
index 7a50667a55..891512a28b 100644
--- a/internal/entity/models/moonshot.go
+++ b/internal/entity/models/moonshot.go
@@ -324,3 +324,7 @@ func (m *MoonshotModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (m *MoonshotModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", m.Name())
}
+
+func (m *MoonshotModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/mws.go b/internal/entity/models/mws.go
index 5ef18ed3d2..0d1cf2bea8 100644
--- a/internal/entity/models/mws.go
+++ b/internal/entity/models/mws.go
@@ -316,3 +316,7 @@ func (m *MWSModel) CheckConnection(ctx context.Context, apiConfig *APIConfig) er
_, err := m.ListModels(ctx, apiConfig)
return err
}
+
+func (m *MWSModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/n1n.go b/internal/entity/models/n1n.go
index 4f44520b1f..d8196befe5 100644
--- a/internal/entity/models/n1n.go
+++ b/internal/entity/models/n1n.go
@@ -440,3 +440,7 @@ func (n *N1NModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]ListT
func (n *N1NModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", n.Name())
}
+
+func (n *N1NModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", n.Name())
+}
diff --git a/internal/entity/models/novita.go b/internal/entity/models/novita.go
index 7409f8f2e3..507231e7e7 100644
--- a/internal/entity/models/novita.go
+++ b/internal/entity/models/novita.go
@@ -679,3 +679,7 @@ func (n *NovitaModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (n *NovitaModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", n.Name())
}
+
+func (n *NovitaModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", n.Name())
+}
diff --git a/internal/entity/models/nvidia.go b/internal/entity/models/nvidia.go
index ee0ce27bd2..9bd978f5cd 100644
--- a/internal/entity/models/nvidia.go
+++ b/internal/entity/models/nvidia.go
@@ -755,3 +755,7 @@ func (n *NvidiaModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (n *NvidiaModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", n.Name())
}
+
+func (n *NvidiaModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", n.Name())
+}
diff --git a/internal/entity/models/ollama.go b/internal/entity/models/ollama.go
index 2cff523213..491d259f67 100644
--- a/internal/entity/models/ollama.go
+++ b/internal/entity/models/ollama.go
@@ -529,3 +529,7 @@ func (o *OllamaModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (o *OllamaModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", o.Name())
}
+
+func (o *OllamaModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", o.Name())
+}
diff --git a/internal/entity/models/openai.go b/internal/entity/models/openai.go
index 93ce151c10..8e14fd803d 100644
--- a/internal/entity/models/openai.go
+++ b/internal/entity/models/openai.go
@@ -749,3 +749,7 @@ func (o *OpenAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (o *OpenAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", o.Name())
}
+
+func (o *OpenAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", o.Name())
+}
diff --git a/internal/entity/models/openai_api_compatible.go b/internal/entity/models/openai_api_compatible.go
index 480dd3f692..f16d30c89d 100644
--- a/internal/entity/models/openai_api_compatible.go
+++ b/internal/entity/models/openai_api_compatible.go
@@ -341,3 +341,7 @@ func (m *OpenAIAPICompatibleModel) TranscribeAudio(ctx context.Context, modelNam
func (m *OpenAIAPICompatibleModel) TranscribeAudioWithSender(ctx context.Context, modelName *string, file *string, apiConfig *APIConfig, asrConfig *ASRConfig, modelUsage *common.ModelUsage, sender func(*string, *string) error) error {
return fmt.Errorf("%s ASR streaming not implemented", m.Name())
}
+
+func (m *OpenAIAPICompatibleModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", m.Name())
+}
diff --git a/internal/entity/models/openrouter.go b/internal/entity/models/openrouter.go
index df3fc85c7b..2bad603068 100644
--- a/internal/entity/models/openrouter.go
+++ b/internal/entity/models/openrouter.go
@@ -638,3 +638,7 @@ func (o *OpenRouterModel) ListTasks(ctx context.Context, apiConfig *APIConfig) (
func (o *OpenRouterModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", o.Name())
}
+
+func (o *OpenRouterModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", o.Name())
+}
diff --git a/internal/entity/models/orcarouter.go b/internal/entity/models/orcarouter.go
index 83e365ac43..06dd4e8728 100644
--- a/internal/entity/models/orcarouter.go
+++ b/internal/entity/models/orcarouter.go
@@ -266,3 +266,7 @@ func (o *OrcaRouterModel) ListTasks(ctx context.Context, apiConfig *APIConfig) (
func (o *OrcaRouterModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s no such method", o.Name())
}
+
+func (o *OrcaRouterModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", o.Name())
+}
diff --git a/internal/entity/models/paddleocr.go b/internal/entity/models/paddleocr.go
index 0663a2b244..5f0c66b008 100644
--- a/internal/entity/models/paddleocr.go
+++ b/internal/entity/models/paddleocr.go
@@ -644,3 +644,7 @@ func paddleOCRAlgorithm(ocrConfig *OCRConfig, apiConfig *APIConfig) string {
}
return "PaddleOCR-VL"
}
+
+func (p *PaddleOCRModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", p.Name())
+}
diff --git a/internal/entity/models/paddleocr_local.go b/internal/entity/models/paddleocr_local.go
index d1ed10779f..477c2cae18 100644
--- a/internal/entity/models/paddleocr_local.go
+++ b/internal/entity/models/paddleocr_local.go
@@ -269,3 +269,7 @@ func (p *PaddleOCRLocalModel) ListTasks(ctx context.Context, apiConfig *APIConfi
func (p *PaddleOCRLocalModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s no such method", p.Name())
}
+
+func (p *PaddleOCRLocalModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", p.Name())
+}
diff --git a/internal/entity/models/perplexity.go b/internal/entity/models/perplexity.go
index 3fe77f6be9..520296a583 100644
--- a/internal/entity/models/perplexity.go
+++ b/internal/entity/models/perplexity.go
@@ -307,3 +307,7 @@ func (p *PerplexityModel) ListTasks(ctx context.Context, apiConfig *APIConfig) (
func (p *PerplexityModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", p.Name())
}
+
+func (p *PerplexityModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", p.Name())
+}
diff --git a/internal/entity/models/ppio.go b/internal/entity/models/ppio.go
index 847a235bce..1f357442ca 100644
--- a/internal/entity/models/ppio.go
+++ b/internal/entity/models/ppio.go
@@ -411,3 +411,7 @@ func (p *PPIOModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]List
func (p *PPIOModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", p.Name())
}
+
+func (p *PPIOModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", p.Name())
+}
diff --git a/internal/entity/models/qiniu.go b/internal/entity/models/qiniu.go
index 3e5ae1de97..4e0e416482 100644
--- a/internal/entity/models/qiniu.go
+++ b/internal/entity/models/qiniu.go
@@ -291,3 +291,7 @@ func (q *QiniuModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Lis
func (q *QiniuModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", q.Name())
}
+
+func (q *QiniuModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", q.Name())
+}
diff --git a/internal/entity/models/ragcon.go b/internal/entity/models/ragcon.go
index aec23acceb..c7f8a107f0 100644
--- a/internal/entity/models/ragcon.go
+++ b/internal/entity/models/ragcon.go
@@ -637,3 +637,7 @@ func (r *RAGconModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (r *RAGconModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", r.Name())
}
+
+func (r *RAGconModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", r.Name())
+}
diff --git a/internal/entity/models/replicate.go b/internal/entity/models/replicate.go
index fdb0c6bd15..7cc6e7a7a4 100644
--- a/internal/entity/models/replicate.go
+++ b/internal/entity/models/replicate.go
@@ -861,3 +861,7 @@ func (r *ReplicateModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([
func (r *ReplicateModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", r.Name())
}
+
+func (r *ReplicateModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", r.Name())
+}
diff --git a/internal/entity/models/siliconflow.go b/internal/entity/models/siliconflow.go
index 3daea3a13c..6c4f0febcb 100644
--- a/internal/entity/models/siliconflow.go
+++ b/internal/entity/models/siliconflow.go
@@ -782,3 +782,7 @@ func (s *SiliconflowModel) ListTasks(ctx context.Context, apiConfig *APIConfig)
func (s *SiliconflowModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", s.Name())
}
+
+func (s *SiliconflowModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", s.Name())
+}
diff --git a/internal/entity/models/stepfun.go b/internal/entity/models/stepfun.go
index 846007a914..d35e89ff45 100644
--- a/internal/entity/models/stepfun.go
+++ b/internal/entity/models/stepfun.go
@@ -344,3 +344,7 @@ func (s *StepFunModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (s *StepFunModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", s.Name())
}
+
+func (s *StepFunModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", s.Name())
+}
diff --git a/internal/entity/models/togetherai.go b/internal/entity/models/togetherai.go
index 5f6ffe09e2..43de0c9a91 100644
--- a/internal/entity/models/togetherai.go
+++ b/internal/entity/models/togetherai.go
@@ -632,3 +632,7 @@ func (t *TogetherAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) (
func (t *TogetherAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", t.Name())
}
+
+func (t *TogetherAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", t.Name())
+}
diff --git a/internal/entity/models/tokenhub.go b/internal/entity/models/tokenhub.go
index 02f5168fd1..60a0961313 100644
--- a/internal/entity/models/tokenhub.go
+++ b/internal/entity/models/tokenhub.go
@@ -297,3 +297,7 @@ func (t *TokenHubModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]
func (t *TokenHubModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s no such method", t.Name())
}
+
+func (t *TokenHubModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", t.Name())
+}
diff --git a/internal/entity/models/tokenpony.go b/internal/entity/models/tokenpony.go
index c434540b94..2b0f11151c 100644
--- a/internal/entity/models/tokenpony.go
+++ b/internal/entity/models/tokenpony.go
@@ -194,3 +194,7 @@ func (t *TokenPonyModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([
func (t *TokenPonyModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", t.Name())
}
+
+func (t *TokenPonyModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", t.Name())
+}
diff --git a/internal/entity/models/types.go b/internal/entity/models/types.go
index add68abc8d..f6a1bc2e5d 100644
--- a/internal/entity/models/types.go
+++ b/internal/entity/models/types.go
@@ -73,6 +73,8 @@ type ModelDriver interface {
ListTasks(ctx context.Context, apiConfig *APIConfig) ([]ListTaskStatus, error)
ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error)
+
+ Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error)
}
type ChatResponse struct {
@@ -155,6 +157,50 @@ type TaskResponse struct {
Segments []TaskSegment `json:"segments"`
}
+type Question interface {
+ isQuestion()
+}
+
+type Noul struct {
+ Instructions any
+ Criteria *NoulCriteria
+}
+
+func (Noul) isQuestion() {}
+
+type NoulCriteria struct {
+ True any `json:"true,omitzero"`
+ False any `json:"false,omitzero"`
+}
+
+type Choice struct {
+ Instructions any
+ Criteria any
+}
+
+func (Choice) isQuestion() {}
+
+type Score struct {
+ Instructions any
+ Criteria any
+}
+
+func (Score) isQuestion() {}
+
+type Box struct {
+ Instructions any
+}
+
+func (Box) isQuestion() {}
+
+type DecideRequest struct {
+ State any `json:"state"`
+ Questions map[string]Question `json:"question"`
+}
+
+type DecideResponse struct {
+}
+
type ModelListItem struct {
ID string `json:"id"`
ContextLength *int `json:"context_length"`
diff --git a/internal/entity/models/upstage.go b/internal/entity/models/upstage.go
index fc9ee773fc..6ec5c1df55 100644
--- a/internal/entity/models/upstage.go
+++ b/internal/entity/models/upstage.go
@@ -317,3 +317,7 @@ func (u *UpstageModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (u *UpstageModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", u.Name())
}
+
+func (u *UpstageModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", u.Name())
+}
diff --git a/internal/entity/models/vllm.go b/internal/entity/models/vllm.go
index 93f6343568..d1c69b70fd 100644
--- a/internal/entity/models/vllm.go
+++ b/internal/entity/models/vllm.go
@@ -505,3 +505,7 @@ func (v *VllmModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]List
func (v *VllmModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", v.Name())
}
+
+func (v *VllmModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", v.Name())
+}
diff --git a/internal/entity/models/volcengine.go b/internal/entity/models/volcengine.go
index 4481cf2a4b..2d1c29dfc8 100644
--- a/internal/entity/models/volcengine.go
+++ b/internal/entity/models/volcengine.go
@@ -594,3 +594,7 @@ func (v *VolcEngine) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Lis
func (v *VolcEngine) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", v.Name())
}
+
+func (v *VolcEngine) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", v.Name())
+}
diff --git a/internal/entity/models/voyage.go b/internal/entity/models/voyage.go
index 3cefbe5768..40a18d6cac 100644
--- a/internal/entity/models/voyage.go
+++ b/internal/entity/models/voyage.go
@@ -314,3 +314,7 @@ func (v *VoyageModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (v *VoyageModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", v.Name())
}
+
+func (v *VoyageModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", v.Name())
+}
diff --git a/internal/entity/models/xai.go b/internal/entity/models/xai.go
index bfc038c976..1ae8515fa9 100644
--- a/internal/entity/models/xai.go
+++ b/internal/entity/models/xai.go
@@ -383,3 +383,7 @@ func (x *XAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]ListT
func (x *XAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", x.Name())
}
+
+func (x *XAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", x.Name())
+}
diff --git a/internal/entity/models/xiaomi.go b/internal/entity/models/xiaomi.go
index 8c0d43fd1c..a9cea6775f 100644
--- a/internal/entity/models/xiaomi.go
+++ b/internal/entity/models/xiaomi.go
@@ -649,3 +649,7 @@ func (x *XiaomiModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (x *XiaomiModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("no such method %s", x.Name())
}
+
+func (x *XiaomiModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", x.Name())
+}
diff --git a/internal/entity/models/xinference.go b/internal/entity/models/xinference.go
index ad6e72b0bf..ab0a8c145c 100644
--- a/internal/entity/models/xinference.go
+++ b/internal/entity/models/xinference.go
@@ -568,3 +568,7 @@ func (x *XinferenceModel) ListTasks(ctx context.Context, apiConfig *APIConfig) (
func (x *XinferenceModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", x.Name())
}
+
+func (x *XinferenceModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", x.Name())
+}
diff --git a/internal/entity/models/xunfei.go b/internal/entity/models/xunfei.go
index c8eac1a2b7..4323a43935 100644
--- a/internal/entity/models/xunfei.go
+++ b/internal/entity/models/xunfei.go
@@ -210,3 +210,7 @@ func (x *XunFeiModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]Li
func (x *XunFeiModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", x.Name())
}
+
+func (x *XunFeiModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", x.Name())
+}
diff --git a/internal/entity/models/zhipu-ai.go b/internal/entity/models/zhipu-ai.go
index 79bd655e2c..d862b2f250 100644
--- a/internal/entity/models/zhipu-ai.go
+++ b/internal/entity/models/zhipu-ai.go
@@ -792,3 +792,7 @@ func (z *ZhipuAIModel) ListTasks(ctx context.Context, apiConfig *APIConfig) ([]L
func (z *ZhipuAIModel) ShowTask(ctx context.Context, taskID string, apiConfig *APIConfig) (*TaskResponse, error) {
return nil, fmt.Errorf("%s, no such method", z.Name())
}
+
+func (z *ZhipuAIModel) Decide(ctx context.Context, modelName *string, request *DecideRequest, apiConfig *APIConfig, modelUsage *common.ModelUsage) (*DecideResponse, error) {
+ return nil, fmt.Errorf("%s, no such method", z.Name())
+}
diff --git a/internal/ingestion/component/parser_dispatch_test.go b/internal/ingestion/component/parser_dispatch_test.go
index 9b7adc63d4..bbad965b46 100644
--- a/internal/ingestion/component/parser_dispatch_test.go
+++ b/internal/ingestion/component/parser_dispatch_test.go
@@ -1267,6 +1267,9 @@ func (d *mineruTestDriver) ListTasks(ctx context.Context, apiConfig *models.APIC
func (d *mineruTestDriver) ShowTask(ctx context.Context, taskID string, apiConfig *models.APIConfig) (*models.TaskResponse, error) {
return nil, fmt.Errorf("not implemented")
}
+func (u *mineruTestDriver) Decide(ctx context.Context, modelName *string, request *models.DecideRequest, apiConfig *models.APIConfig, modelUsage *common.ModelUsage) (*models.DecideResponse, error) {
+ return nil, nil
+}
func TestDispatch_PDFPaddleOCRMarkdown_UsesTenantModel(t *testing.T) {
withSSRFBypass(t)
diff --git a/internal/ingestion/task/embedder_test.go b/internal/ingestion/task/embedder_test.go
index ce288d27c4..16252cf92f 100644
--- a/internal/ingestion/task/embedder_test.go
+++ b/internal/ingestion/task/embedder_test.go
@@ -139,6 +139,9 @@ func (d *stubDriver) ListTasks(ctx context.Context, apiConfig *models.APIConfig)
func (d *stubDriver) ShowTask(ctx context.Context, taskID string, apiConfig *models.APIConfig) (*models.TaskResponse, error) {
return nil, nil
}
+func (d *stubDriver) Decide(ctx context.Context, modelName *string, request *models.DecideRequest, apiConfig *models.APIConfig, modelUsage *common.ModelUsage) (*models.DecideResponse, error) {
+ return nil, nil
+}
func (d *stubDriver) ToolCall(ctx context.Context, name string, arguments map[string]interface{}) (string, error) {
return "", nil
}
diff --git a/internal/service/chunk/chunk_test.go b/internal/service/chunk/chunk_test.go
index aef63eb980..525ddbed32 100644
--- a/internal/service/chunk/chunk_test.go
+++ b/internal/service/chunk/chunk_test.go
@@ -2439,6 +2439,9 @@ func (d *stubEmbeddingDriver) ListTasks(context.Context, *models.APIConfig) ([]m
func (d *stubEmbeddingDriver) ShowTask(context.Context, string, *models.APIConfig) (*models.TaskResponse, error) {
return nil, nil
}
+func (d *stubEmbeddingDriver) Decide(ctx context.Context, modelName *string, request *models.DecideRequest, apiConfig *models.APIConfig, modelUsage *common.ModelUsage) (*models.DecideResponse, error) {
+ return nil, nil
+}
func strPtr(v string) *string {
return &v