mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-09 19:27:54 +02:00
rewrite-state-graph
This commit is contained in:
@@ -29,6 +29,9 @@ func NewAdvancedStateGraph[StateT any]() *AdvancedStateGraph[StateT] {
|
||||
}
|
||||
}
|
||||
|
||||
// AddNode keeps `fn` as `any` because advanced graph nodes can have different
|
||||
// input argument types per node, while only `StateT` is globally constrained.
|
||||
// We validate and adapt node signatures at runtime in compileNodeExecutor.
|
||||
func (g *AdvancedStateGraph[StateT]) AddNode(fn any) string {
|
||||
name := NodeName(fn)
|
||||
return g.AddNodeAs(name, fn)
|
||||
|
||||
Reference in New Issue
Block a user