Skip to content

Commit

Permalink
[JS] fix: SequenceAugmentation + Citations (#1650)
Browse files Browse the repository at this point in the history
## Linked issues

#minor

ensure response message is copied and mapped properly with citations
during sequence augmentation.
  • Loading branch information
aacebo authored May 15, 2024
1 parent c976453 commit 58fdeab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,19 @@ describe('SequenceAugmentation', () => {
// Create plan from response
const plan = await augmentation.createPlanFromResponse(context, state, {
status: 'success',
message: { role: 'assistant', content: validation.value }
message: {
role: 'assistant',
content: validation.value,
context: {
intent: 'to test citations',
citations: [{
url: '',
title: '',
filepath: '',
content: 'my citation content...'
}]
}
}
});
assert.notEqual(plan, undefined);
assert.deepEqual(plan, {
Expand All @@ -255,7 +267,16 @@ describe('SequenceAugmentation', () => {
type: 'SAY',
response: {
role: 'assistant',
content: 'hello world'
content: 'hello world',
context: {
intent: 'to test citations',
citations: [{
url: '',
title: '',
filepath: '',
content: 'my citation content...'
}]
}
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export class SequenceAugmentation implements Augmentation<Plan | undefined> {
return {
...c,
response: {
...response.message,
role: 'assistant',
content: (c as PredictedSayCommand).response as unknown as string
}
Expand Down

0 comments on commit 58fdeab

Please sign in to comment.