Skip to content

Commit

Permalink
Consider an entire response as an answer
Browse files Browse the repository at this point in the history
Fixed: 351973653
Change-Id: Ia8621d9acc19972f4b15226c765f8fd8250b09d4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5687117
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Nikolay Vitkov <nvitkov@chromium.org>
  • Loading branch information
OrKoN authored and Devtools-frontend LUCI CQ committed Jul 9, 2024
1 parent 1ca47a3 commit 839c16e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions front_end/panels/freestyler/FreestylerAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ c`;
},
);
});

it('parses a response as an answer', async () => {
assert.deepStrictEqual(
FreestylerAgent.parseResponse(
'This is also an answer',
),
{
action: undefined,
thought: undefined,
answer: 'This is also an answer',
},
);
});
});

describe('buildRequest', () => {
Expand Down
5 changes: 5 additions & 0 deletions front_end/panels/freestyler/FreestylerAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ export class FreestylerAgent {
i++;
}
}
// If we could not parse the parts, consider the response to be an
// answer.
if (!answer && !thought && !action) {
answer = response;
}
return {thought, action, answer};
}

Expand Down

0 comments on commit 839c16e

Please sign in to comment.