Skip to content

Conversation

@emil14
Copy link
Contributor

@emil14 emil14 commented Dec 3, 2023

This PR solves the problem that process step can't access results of previous steps, except the one previous step. For example, in a 3-step process it's not possible to get result of the first step inside third step.

It solves this by introducing 2 new abstractions - history and config func. History it's just a slice of intermediate results of steps, that Process maintains while executing steps. Config function is an "interceptor" API that allows to modify config of the operation (step) before executing it.

These 2 abstractions combined allow to preconfigure any step and inject data form history into its config. For example, in our case with 3-step process it allows to access result of the first step and e.g. inject it into the prompt for the third step.

}

func Logger(input, output agency.Message, cfg *agency.OperationConfig) {
func Logger(input, output agency.Message, cfg *agency.OperationConfig, _ uint) {
Copy link
Contributor Author

@emil14 emil14 Dec 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Pass history here?
  2. Combine all arguments into single structure?

P.S. - last parameter is step-index, interface of the interceptor was changed and interceptor was renamed to observer

@emil14 emil14 changed the title feat(process): config func, process history Process: History and Config-func Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants