steps property
Series of operation that needs to be performed for a command finish its task.
Supported Step Examples: MatchDocumentStep, WorkspaceQueryStep, PromptQueryStep, AppendToChatStep, ReplaceCodeStep, ContinueDecisionStep
While creating the series of steps, you may need to pass output of one or more
past steps to a new step. You can achieve this my simply passing the DashOutput
defined in the scope of Command
and used as a object that will store the
of the past steps.
This is better demonstrated by the below example:
// Outputs
final matchingDocuments = MatchDocumentObject();
final matchingCode = MultiCodeObject();
final queryOutput = QueryOutput();
List<Step> get steps => [
MatchingDocumentStep(
query: '$userQuery$codeAttachment',
dataSources: [],
output: matchingDocuments),
WorkspaceQueryStep(query: '$matchingDocuments', output: matchingCode),
PromptQueryStep(
prompt:
'''You are an X agent. Here is the $userQuery, here is the $matchingCode and the document references: $matchingDocuments. Answer the user's query.''',
postProcessKind: PostProcessKind.raw,
output: queryOutput),
AppendToChatStep(
value:
'This was your query: $userQuery and here is your output: $queryOutput'),
];
Implementation
List<Step> get steps;