Interface IChainStep
- Namespace
- AiDotNet.Interfaces
- Assembly
- AiDotNet.dll
Defines a single step within a prompt chain.
public interface IChainStep
Remarks
Each step in a chain processes input and produces output. Steps can be simple prompt executions or complex operations like API calls or transformations.
For Beginners: A step is one operation in the chain.
Examples of steps:
- "Translate text" - sends to translation API
- "Summarize document" - sends to summarization prompt
- "Extract keywords" - parses text for keywords
- "Format as JSON" - transforms output to JSON
Each step has:
- A name (for identification)
- An execute function (what it does)
- Input/output handling
Properties
Name
Gets the name of this step.
string Name { get; }
Property Value
Methods
Execute(string)
Executes this step with the given input.
string Execute(string input)
Parameters
inputstringThe input to process.
Returns
- string
The output from this step.
ExecuteAsync(string, CancellationToken)
Executes this step asynchronously.
Task<string> ExecuteAsync(string input, CancellationToken cancellationToken = default)
Parameters
inputstringThe input to process.
cancellationTokenCancellationTokenToken to cancel the operation.