mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-22 18:13:27 +00:00
test(api): type multi-phase payload captures
This commit is contained in:
parent
c8080a09f7
commit
3da5f8d35a
1 changed files with 7 additions and 3 deletions
|
|
@ -135,7 +135,11 @@ describe('createActivityPhaseWiring', () => {
|
|||
it('creates multiple phases around substantial root text in one run', async () => {
|
||||
const parts: LooseContentPart[] = [];
|
||||
const stepIndexes = new Map<string, number>();
|
||||
const generatePhase = jest.fn(async () => ({ label: 'Completed the activity phase' }));
|
||||
const generatedPayloads: GenerateActivityPhasePayload[] = [];
|
||||
const generatePhase = jest.fn(async (payload: GenerateActivityPhasePayload) => {
|
||||
generatedPayloads.push(payload);
|
||||
return { label: 'Completed the activity phase' };
|
||||
});
|
||||
const wiring = createActivityPhaseWiring({
|
||||
getContentParts: () => parts,
|
||||
getStepIndex: (stepId) => stepIndexes.get(stepId),
|
||||
|
|
@ -199,11 +203,11 @@ describe('createActivityPhaseWiring', () => {
|
|||
await flushDetached();
|
||||
|
||||
expect(generatePhase).toHaveBeenCalledTimes(2);
|
||||
expect(generatePhase.mock.calls[0][0]).toMatchObject({
|
||||
expect(generatedPayloads[0]).toMatchObject({
|
||||
assistantContext: ['I pulled the repository history and will analyze it now.'],
|
||||
totalActivityCount: 2,
|
||||
});
|
||||
expect(generatePhase.mock.calls[1][0]).toMatchObject({
|
||||
expect(generatedPayloads[1]).toMatchObject({
|
||||
assistantContext: ['I found another angle worth checking.'],
|
||||
closingTextPhase: 'final_answer',
|
||||
totalActivityCount: 2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue