Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b87e2337f |
2
medconnect-bot/.env
Normal file
2
medconnect-bot/.env
Normal file
@ -0,0 +1,2 @@
|
||||
OPENAI_API_KEY=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
|
||||
ROOM_NAME=mediconnect-call-medico-99-1-1730838000000
|
||||
81
medconnect-bot/bot-jitsi.js
Normal file
81
medconnect-bot/bot-jitsi.js
Normal file
@ -0,0 +1,81 @@
|
||||
// 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);
|
||||
});
|
||||
BIN
medconnect-bot/chrome-bot-profile/Crashpad/settings.dat
Normal file
BIN
medconnect-bot/chrome-bot-profile/Crashpad/settings.dat
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/Account Web Data
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/Account Web Data
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/Affiliation Database
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/Affiliation Database
Normal file
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
SQLCache
|
||||
BIN
medconnect-bot/chrome-bot-profile/Default/Cache/Cache_Data/sqldb
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/Cache/Cache_Data/sqldb
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
婁<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.
BIN
medconnect-bot/chrome-bot-profile/Default/Code Cache/js/index
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/Code Cache/js/index
Normal file
Binary file not shown.
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/Code Cache/wasm/index
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/Code Cache/wasm/index
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/DIPS
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/DIPS
Normal file
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.
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_0
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_0
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_1
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_1
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_2
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_2
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_3
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/data_3
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/index
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/DawnWebGPUCache/index
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
MANIFEST-000001
|
||||
@ -0,0 +1,2 @@
|
||||
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.
@ -0,0 +1 @@
|
||||
MANIFEST-000001
|
||||
@ -0,0 +1,2 @@
|
||||
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.
@ -0,0 +1 @@
|
||||
MANIFEST-000001
|
||||
@ -0,0 +1,2 @@
|
||||
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.
BIN
medconnect-bot/chrome-bot-profile/Default/Favicons
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/Favicons
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/GCM Store/000003.log
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/GCM Store/000003.log
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
MANIFEST-000001
|
||||
2
medconnect-bot/chrome-bot-profile/Default/GCM Store/LOG
Normal file
2
medconnect-bot/chrome-bot-profile/Default/GCM Store/LOG
Normal file
@ -0,0 +1,2 @@
|
||||
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.
BIN
medconnect-bot/chrome-bot-profile/Default/GPUCache/data_0
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/GPUCache/data_0
Normal file
Binary file not shown.
BIN
medconnect-bot/chrome-bot-profile/Default/GPUCache/data_1
Normal file
BIN
medconnect-bot/chrome-bot-profile/Default/GPUCache/data_1
Normal file
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