Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c633f57fd | |||
| 17a69ed57b | |||
| 94c0dd13dc | |||
| 7a9f2b3da2 | |||
| cfd4790bf1 | |||
| eff11fc075 | |||
| 6f3a49575c | |||
| 07ed113291 | |||
| 0de772457e | |||
| c736f44604 | |||
| 3b8e73535b | |||
| e5e5d0928b | |||
| e5f260e7c3 | |||
|
|
b208d2ac73 | ||
| b1ac9ea3ff | |||
| d67f4d6db4 | |||
| 176489f9fd | |||
| b46da18c45 | |||
| ef7ef93887 | |||
| 6312a72895 | |||
| 57f8024bb2 | |||
|
|
220e436fa0 | ||
| b0ba36507b | |||
| d979105ad1 | |||
| e11bda0d96 | |||
| a94a0caee6 | |||
| 5aaaf7d3e5 | |||
| 5d1751b7f9 | |||
| 496a83ecc1 | |||
| 6ccb0992c3 | |||
| 63121d6702 | |||
| 3dac02b650 | |||
|
|
ad7c300a44 | ||
|
|
1d048023b1 | ||
| 815ce759cd | |||
| 23a912e1c0 | |||
| 8879c43fa8 | |||
|
|
b64b664621 | ||
| bff5c42a4e | |||
|
|
981c4bac6e | ||
| 2647691ae2 | |||
| d6bd5b955a | |||
| dd598a4ce3 | |||
| 9c9f551ca6 | |||
| 2f2f2964ba | |||
|
|
03c32138c6 | ||
|
|
251aa95f63 | ||
|
|
f9db6c4eec | ||
| 4d1522fac5 | |||
| 246f7cebe5 | |||
| 310bccbe6f | |||
| fa3c9fea16 | |||
| d327b226c9 | |||
| f332ee0147 | |||
| bbb61fab06 | |||
| b334fc82c7 | |||
| cfdfd61040 | |||
| e007c167e7 | |||
|
|
a3f1116608 | ||
|
|
bd1ea9a206 | ||
|
|
0129482b7c | ||
|
|
41d46cc148 | ||
|
|
f4ac580b83 | ||
| 2d926ecbcd | |||
| 9f4e288a02 | |||
| b29dac619c | |||
| d8e63f8abe | |||
| 035b4ff5d0 | |||
| 19718d5eed | |||
|
|
30af16708e | ||
|
|
ce3f8e23dd | ||
| e11d86db67 |
@ -1,2 +0,0 @@
|
||||
OPENAI_API_KEY=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
|
||||
ROOM_NAME=mediconnect-call-medico-99-1-1730838000000
|
||||
@ -1,81 +0,0 @@
|
||||
// bot-jitsi.js
|
||||
import puppeteer from "puppeteer";
|
||||
import fs from "fs";
|
||||
import dotenv from "dotenv";
|
||||
import OpenAI from "openai";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
// 🔑 Inicializa a API da OpenAI
|
||||
const openai = new OpenAI({
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
});
|
||||
|
||||
|
||||
const roomName = process.env.ROOM_NAME || process.argv[2];
|
||||
const jitsiUrl = `https://meet.jit.si/${roomName}`;
|
||||
|
||||
async function main() {
|
||||
console.log("🚀 Iniciando bot do MedConnect para Jitsi...");
|
||||
console.log("🔗 Sala:", jitsiUrl);
|
||||
|
||||
|
||||
const userDataPath = "C:/Users/SEU_USUARIO/AppData/Local/Google/Chrome/User Data"; // 🔸 Mude SEU_USUARIO
|
||||
const browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
userDataDir: userDataPath,
|
||||
args: [
|
||||
"--use-fake-ui-for-media-stream",
|
||||
"--no-sandbox",
|
||||
"--disable-setuid-sandbox",
|
||||
"--allow-file-access",
|
||||
],
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
await page.goto(jitsiUrl);
|
||||
|
||||
|
||||
await page.waitForSelector(".new-toolbox", { timeout: 60000 });
|
||||
console.log("✅ Conectado à sala Jitsi com sucesso!");
|
||||
|
||||
await page.keyboard.press("m");
|
||||
await page.keyboard.press("v");
|
||||
console.log("🎥 Câmera e microfone desativados.");
|
||||
|
||||
|
||||
const audioPath = `./recording-${Date.now()}.webm`;
|
||||
|
||||
if (fs.existsSync(audioPath)) {
|
||||
console.log("🔊 Processando áudio gravado...");
|
||||
|
||||
const transcription = await openai.audio.transcriptions.create({
|
||||
file: fs.createReadStream(audioPath),
|
||||
model: "whisper-1",
|
||||
language: "pt",
|
||||
});
|
||||
|
||||
console.log("📝 Transcrição:", transcription.text);
|
||||
|
||||
|
||||
const summary = await openai.chat.completions.create({
|
||||
model: "gpt-4o-mini",
|
||||
messages: [
|
||||
{ role: "system", content: "Você é um assistente médico que resume reuniões clínicas." },
|
||||
{ role: "user", content: `Resuma em formato de relatório: ${transcription.text}` },
|
||||
],
|
||||
});
|
||||
|
||||
const relatorio = summary.choices[0].message.content;
|
||||
fs.writeFileSync("./relatorio.txt", relatorio);
|
||||
console.log("📄 Relatório gerado com sucesso em relatorio.txt!");
|
||||
} else {
|
||||
console.log("⚠️ Nenhum áudio gravado");
|
||||
}
|
||||
|
||||
console.log("🤖 Bot ativo na reunião. Você pode ver a aba aberta no navegador.");
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error("❌ Erro ao executar o bot:", err);
|
||||
});
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
{
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
SQLCache
|
||||
Binary file not shown.
@ -1 +0,0 @@
|
||||
婁<M
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
MANIFEST-000001
|
||||
@ -1,2 +0,0 @@
|
||||
2025/11/05-16:47:36.396 51f0 Creating DB C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\Extension Rules since it was missing.
|
||||
2025/11/05-16:47:36.402 51f0 Reusing MANIFEST C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\Extension Rules/MANIFEST-000001
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
MANIFEST-000001
|
||||
@ -1,2 +0,0 @@
|
||||
2025/11/05-16:47:36.405 51f0 Creating DB C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\Extension Scripts since it was missing.
|
||||
2025/11/05-16:47:36.413 51f0 Reusing MANIFEST C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\Extension Scripts/MANIFEST-000001
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
MANIFEST-000001
|
||||
@ -1,2 +0,0 @@
|
||||
2025/11/05-16:47:36.544 13c0 Creating DB C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\Extension State since it was missing.
|
||||
2025/11/05-16:47:36.565 13c0 Reusing MANIFEST C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\Extension State/MANIFEST-000001
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
MANIFEST-000001
|
||||
@ -1,2 +0,0 @@
|
||||
2025/11/05-16:47:40.541 338c Creating DB C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\GCM Store since it was missing.
|
||||
2025/11/05-16:47:40.545 338c Reusing MANIFEST C:\Users\rafab\OneDrive\Documentos\Nova pasta (22)\riseup-squad23\medconnect-bot\chrome-bot-profile\Default\GCM Store/MANIFEST-000001
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user