Got looping rewritten as a proc agent. I had to convert the (for each step) into a (while step_index < max_index) loop to make looping work as a class. To make them work as a proc I had to put the step_index into the results dict. Now any step can change the step_index. I had to allow steps to output multiple results to make this work. I discovered that I can return multiple results from the inside of a proc. And all this was implemented with just a few lines because this is the right way to make it work. In order to emit the correct names for the output variables from inside the proc function that is running I had to map the outputs from the step into the step parameters, which meant I had to update all the functions that are embedded in the agents in the config file.
I got scatter and emit to work for lines. This was interesting. I read a file and split the lines and stored them in results and the count of the lines using scatter by separator, then I loop_start using the count of the lines set by the scatter operation. Then the next step is to emit a line then we process the line, we hit loop end and increment the loop index, then jump back up to emit and keep doing that until we run out of lines. Along the way I fixed a few little bugs.
At this point I am thinking about returning a status message with each step in addition to the results and have a workflow policy in how to handle that status. I think I can also have a conditional jump to jump over the part that builds an error report or takes other steps on error in a step and jump to the report building part of the steps.
What I am currently doing is getting json output from a new ai workflow. Trying to get it formatted and cleaned up so it can feed into the next step of the workflow. Trying to get an ai to generate the same json format call after call is tough.
Have a plan to implement status results and error handling. It should be done tomorrow.
No comments:
Post a Comment