eino icon indicating copy to clipboard operation
eino copied to clipboard

function name在编排的graph中可以传到下游吗?

Open dahaogewsh opened this issue 8 months ago • 2 comments

_ = graph.AddToolsNode( nodeKeyTools, toolsNode, compose.WithStatePreHandler(func(ctx context.Context, in *schema.Message, state *state) (*schema.Message, error) { state.messages = append(state.messages, in) return in, nil }), ) 我想要把tools的func name记载到某一个变量中传递到下游,这个有什么办法操作吗

dahaogewsh avatar May 04 '25 03:05 dahaogewsh

PostBranchCondition这个函数可以使用state这个变量吗?

dahaogewsh avatar May 04 '25 03:05 dahaogewsh

可以的,用 compose.GetState(ctx) 就可以取到对应的 state

kuhahalong avatar May 08 '25 08:05 kuhahalong