mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-19 17:23:59 +00:00
16 lines
336 B
JavaScript
16 lines
336 B
JavaScript
import { serialize } from 'bson';
|
|
|
|
export default async function runAI(client, data, predict) {
|
|
const predictions = await predict(data.text);
|
|
const jsonData = {
|
|
event: 'ai_response',
|
|
id: data.id,
|
|
predictions
|
|
};
|
|
|
|
const bsonData = serialize(jsonData);
|
|
|
|
client.pipe(bsonData);
|
|
|
|
return;
|
|
} |