Skip to content

Commit

Permalink
feat: rename getOrderedNarratives to getNarratives
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Replace 'getOrderedNarratives' method with 'getNarratives'

This method retrieves an ordered array of narratives from the nodes property.
  • Loading branch information
tabkram committed Dec 15, 2023
1 parent c38efe9 commit ec8aea9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/trace/traceableExecution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe('TraceableExecution', () => {
]);

// Get the ordered narratives and verify their content
const orderedNarratives = traceableExecution.getOrderedNarratives();
const orderedNarratives = traceableExecution.getNarratives();
expect(orderedNarratives).toEqual([
'Narrative 0',
'Narrative 0 with Result: InputParam',
Expand Down
7 changes: 4 additions & 3 deletions src/trace/traceableExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ export class TraceableExecution {
}

/**
* Gets an ordered array of narratives.
* @returns An array containing ordered narratives.
* Retrieves an ordered array of narratives.
*
* @returns {Array<string>} An array that contains the ordered narratives. If no narratives are found, an empty array is returned.
*/
getOrderedNarratives(): Array<string> {
getNarratives(): Array<string> {
return this.nodes?.flatMap?.((n) => n.data?.narratives)?.filter((n) => !!n);
}

Expand Down

0 comments on commit ec8aea9

Please sign in to comment.