Refactor(harness): remove naive inline graph engine , unify graph execution under single pregel engine (#16608)

This commit is contained in:
Yingfeng
2026-07-03 17:50:30 +08:00
committed by GitHub
parent 3cba34d67f
commit 8db68e3eec
46 changed files with 894 additions and 1203 deletions

View File

@@ -11,6 +11,7 @@ import (
"time"
"github.com/google/uuid"
"ragflow/internal/harness/graph/checkpoint"
"ragflow/internal/harness/graph/graph"
"ragflow/internal/harness/graph/types"
)
@@ -238,8 +239,8 @@ type Entrypoint struct {
checkpointer interface{}
store interface{}
configurable map[string]interface{}
graph *graph.StateGraph
compiledGraph *graph.CompiledGraph
graph types.StateGraph
compiledGraph types.CompiledGraph
compileOnce sync.Once
compileErr error
}
@@ -285,7 +286,7 @@ func WithEntrypointConfigurable(configurable map[string]interface{}) EntrypointO
}
// WithEntrypointGraph sets the graph for the entrypoint.
func WithEntrypointGraph(g *graph.StateGraph) EntrypointOption {
func WithEntrypointGraph(g types.StateGraph) EntrypointOption {
return func(e *Entrypoint) {
e.graph = g
}
@@ -331,8 +332,8 @@ func (e *Entrypoint) Compile(ctx context.Context) error {
}
// Collect compile options from the checkpointer if set
var opts []graph.CompileOption
if cp, ok := e.checkpointer.(graph.Checkpointer); ok {
var opts []interface{}
if cp, ok := e.checkpointer.(checkpoint.BaseCheckpointer); ok {
opts = append(opts, graph.WithCheckpointer(cp))
}