Add varied messaging experiments
This commit is contained in:
1 parent
43f459a024
commit
23d4c3a320
12 files changed
+217
-72
No files matched your search
+35
-3
@@ -196,7 +196,8 @@ describe('ProcessorService', () => {
|
||||
['Example 1: Hey', 'Example 2: Nice'],
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
undefined,
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -218,7 +219,35 @@ describe('ProcessorService', () => {
|
||||
[],
|
||||
'Be teasing',
|
||||
undefined,
|
||||
undefined
|
||||
undefined,
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
it('passes recent image messages to generation for repetition avoidance', async () => {
|
||||
const recentMessages = ['Earlier opener one', 'Earlier opener two'];
|
||||
const config = getTestConfig({ reddit: { targetGenders: ['female'] } });
|
||||
processor = new ProcessorService(
|
||||
redditApi,
|
||||
aiClient,
|
||||
config,
|
||||
logger,
|
||||
fakeFetchImage,
|
||||
(sourceType) => sourceType === 'image' ? recentMessages : [],
|
||||
);
|
||||
|
||||
await processor.processPost(mockPost);
|
||||
|
||||
expect(aiClient.analyzeAndGenerateMessage).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'image/jpeg',
|
||||
'Test Post',
|
||||
'testuser',
|
||||
[],
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
recentMessages,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -260,7 +289,8 @@ describe('ProcessorService', () => {
|
||||
['Example A'],
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
undefined,
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -316,6 +346,7 @@ describe('ProcessorService', () => {
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -347,6 +378,7 @@ describe('ProcessorService', () => {
|
||||
'Be playful',
|
||||
undefined,
|
||||
undefined,
|
||||
[],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user