Add consent-gated media exchange library
This commit is contained in:
1 parent
b8e4a1bb88
commit
bf474dfe10
42 files changed
+2533
-9
No files matched your search
@@ -30,6 +30,18 @@ describe('OpenRouterClient', () => {
|
||||
client = new OpenRouterClient(config, logger, mockOpenAI);
|
||||
});
|
||||
|
||||
it('parses strict multi-tag media-library classifications', async () => {
|
||||
mockCreate.mockResolvedValueOnce({
|
||||
model: 'vision-model',
|
||||
choices: [{ message: { content: '```json\n{"tags":["selfie","topless"],"safety":"nsfw","description":"A self portrait","confidence":0.88}\n```' } }],
|
||||
usage: {},
|
||||
});
|
||||
|
||||
await expect(client.classifyLibraryImage('base64data', 'image/jpeg')).resolves.toEqual({
|
||||
tags: ['selfie', 'topless'], safety: 'nsfw', description: 'A self portrait', confidence: 0.88,
|
||||
});
|
||||
});
|
||||
|
||||
describe('isRefusal (internal)', () => {
|
||||
// We test refusal detection by checking the analyzeImage behavior
|
||||
// since isRefusal is private. We do this by mocking responses that
|
||||
|
||||
Reference in new issue
Block a user