PageSourceSearch

https://radreport.com.br/assets/WhisperConfigPage-D-2RwV7a.js

js radreport.com.br collected 2026-10-02 01:20:32 UTC 30,231 bytes, 8 lines download raw bytes

1import{a as Ts,u as Vs,j as e}from"./vendor-query-CmFN4-M1.js";import{r}from"./vendor-react-7PyNDetJ.js";import{aK as Cs,at as Ps,ab as y,p as S,av as l,aD as d,aE as c,aF as m,aG as x,aA as t,r as j,v as g,x as v,y as f,z as i,ai as u,I as o,aB as N,aM as n,c as C,aN as Fs,aO as Is,aP as J,aQ as X,b as ws,X as Os}from"./index-BZSaBQD0.js";import{T as P}from"./textarea-Bw8y9bs3.js";import{M as Ls,as as q,aR as ks,bq as Gs,Z as Bs,$ as Ks,bt as Us,S as Qs,bu as Hs,a4 as Ms,aF as Ws,bv as $s}from"./vendor-ui-DjI1iuvA.js";import"./vendor-supabase-BfoV2C50.js";const p=[{value:"groq",label:"Groq Whisper",icon:"groq",model:"whisper-large-v3-turbo",cost:"$0.00015/min"},{value:"openai_mini",label:"OpenAI Mini",icon:"openai_mini",model:"gpt-4o-mini-transcribe",cost:"$0.003/min"},{value:"openai",label:"OpenAI Pro",icon:"openai",model:"gpt-4o-transcribe",cost:"$0.006/min"}];function aa(){var _s,bs,ys,Ss;const Y=Ts(),[ee,se]=r.useState(!1),[Ds,qs]=r.useState(""),[ae,re]=r.useState("groq"),[D,te]=r.useState(""),[Es,Rs]=r.useState("pt"),[E,ne]=r.useState(0),[R,ie]=r.useState(.5),[z,oe]=r.useState(-.5),[le,de]=r.useState(1),[ce,me]=r.useState(5),[xe,ue]=r.useState(2),[pe,he]=r.useState(!0),[je,ge]=r.useState(!0),[A,ve]=r.useState("groq"),[T,fe]=r.useState("openai_mini"),[V,Ne]=r.useState("openai"),[F,_e]=r.useState("openai"),[be,ye]=r.useState(!0),[I,Se]=r.useState(!0),[O,Ce]=r.useState(200),[Pe,we]=r.useState(!1),[L,ke]=r.useState(""),[G,Me]=r.useState(""),[B,De]=r.useState(""),[qe,K]=r.useState(!1),[Ee,Re]=r.useState(!1),[ze,Ae]=r.useState("nova-3"),[Te,Ve]=r.useState("multi"),[U,Fe]=r.useState(600),[_,Ie]=r.useState(40),[Oe,Le]=r.useState(!0),[Ge,Be]=r.useState(!0),[Q,Ke]=r.useState(""),[Ue,Qe]=r.useState(4),[He,We]=r.useState(60),[$e,Ze]=r.useState(!0),[Je,Xe]=r.useState(!0),[Ye,es]=r.useState(!0),[ss,as]=r.useState(1500),[rs,ts]=r.useState(!1),[ns,is]=r.useState(!1),[os,ls]=r.useState(!1),[ds,cs]=r.useState(!1),[ms,xs]=r.useState("stt-rt-v5"),[H,w]=r.useState(0),[W,k]=r.useState(.15),[us,M]=r.useState(3500),[$,b]=r.useState(!0),[Z,ps]=r.useState(""),[hs,js]=r.useState(8e3),[gs,vs]=r.useState(3),[fs,Ns]=r.useState(60),{data:a,isLoading:zs}=Vs({queryKey:["whisper-config"],queryFn:async()=>{const{data:s,error:h}=await ws.from("whisper_config").select("*").eq("config_name","default").single();if(h)throw h;return s},staleTime:6e4,refetchOnWindowFocus:!1});r.useEffect(()=>{a&&!qe&&(qs(a.display_name),re(a.provider),te(a.system_prompt),Rs(a.language||"pt"),ne(Number(a.temperature)||0),ie(Number(a.no_speech_prob_threshold)||.5),oe(Number(a.avg_logprob_threshold)||-.5),de(a.credit_cost_per_minute||1),me(a.max_credits_per_audio||5),ue(a.min_audio_seconds||2),he(a.remove_fillers??!0),ge(a.normalize_measurements??!0),ve(a.provider_gratuito||"groq"),fe(a.provider_basico||"openai_mini"),Ne(a.provider_profissional||"openai"),_e(a.provider_premium||"openai"),ye(a.is_active??!0),Se(a.use_previous_context??!0),Ce(a.previous_context_chars||200),we(a.enable_streaming??!1),ke(a.prompt_groq||""),Me(a.prompt_openai||""),De(a.prompt_openai_mini||""),Re(!!a.deepgram_enabled),Ae(a.deepgram_model||"nova-3"),Ve(a.deepgram_language||"pt-BR"),Fe(Number(a.deepgram_endpointing_ms??600)),Le(a.deepgram_smart_format??!0),Be(a.deepgram_interim??!0),Ke((a.deepgram_keyterms??[]).join(`
2`)),Qe(Number(a.deepgram_radc_per_minute??4)),We(Number(a.deepgram_max_radc_per_session??60)),Ze(a.deepgram_plan_premium??!0),Xe(a.deepgram_punctuate??!0),es(a.deepgram_vad_events??!0),as(Number(a.deepgram_utterance_end_ms??1500)),ts(a.deepgram_numerals??!1),is(a.deepgram_diarize??!1),ls(a.deepgram_profanity_filter??!1),Ie(Number(a.deepgram_user_keyterms_max??40)),cs(!!a.soniox_realtime_enabled),xs(a.soniox_model||"stt-rt-v5"),w(Number(a.soniox_endpoint_latency_level??0)),k(Number(a.soniox_endpoint_sensitivity??.15)),M(Number(a.soniox_max_endpoint_delay_ms??3500)),b(a.soniox_enable_endpoint_detection??!0),ps(a.soniox_glossary??""),js(Number(a.soniox_context_max_chars??8e3)),vs(Number(a.soniox_radc_per_minute??3)),Ns(Number(a.soniox_max_radc_per_session??60)),K(!0))},[a,qe]);const As=async()=>
2{if(!a)return;se(!0);const{error:s}=await ws.from("whisper_config").update({display_name:Ds,provider:ae,system_prompt:D,language:Es,temperature:E,no_speech_prob_threshold:R,avg_logprob_threshold:z,credit_cost_per_minute:le,max_credits_per_audio:ce,min_audio_seconds:xe,remove_fillers:pe,normalize_measurements:je,provider_gratuito:A,provider_basico:T,provider_profissional:V,provider_premium:F,is_active:be,use_previous_context:I,previous_context_chars:O,enable_streaming:Pe,prompt_groq:L||null,prompt_openai:G||null,prompt_openai_mini:B||null,deepgram_enabled:Ee,deepgram_model:ze,deepgram_language:Te,deepgram_endpointing_ms:U,deepgram_smart_format:Oe,deepgram_interim:Ge,deepgram_keyterms:Q.split(`
3`).map(h=>h.trim()).filter(h=>h.length>0&&h.length<=40&&!/^\d+$/.test(h)).slice(0,100),deepgram_radc_per_minute:Ue,deepgram_max_radc_per_session:He,deepgram_plan_premium:$e,deepgram_punctuate:Je,deepgram_vad_events:Ye,deepgram_utterance_end_ms:ss,deepgram_numerals:rs,deepgram_diarize:ns,deepgram_profanity_filter:os,deepgram_user_keyterms_max:_,soniox_realtime_enabled:ds,soniox_model:ms,soniox_endpoint_latency_level:H,soniox_endpoint_sensitivity:W,soniox_max_endpoint_delay_ms:us,soniox_enable_endpoint_detection:$,soniox_glossary:Z,soniox_context_max_chars:hs,soniox_radc_per_minute:gs,soniox_max_radc_per_session:fs}).eq("id",a.id);s?(Os.error("Error saving config:",s),C.error("Erro ao salvar configuração")):(C.success("Configuração salva com sucesso!"),K(!1),Y.invalidateQueries({queryKey:["whisper-config"]})),se(!1)};return zs?e.jsx(Cs,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsx(Ps,{className:"h-8 w-64"}),e.jsx(Ps,{className:"h-96 w-full"})]})}):e.jsx(Cs,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(Ls,{className:"h-6 w-6 text-teal-500"}),"Configuração Whisper"]}),e.jsx("p",{className:"text-muted-foreground",children:"Sistema de transcrição multi-provider dinâmico"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsxs(y,{variant:"outline",className:"gap-1",children:[e.jsx(q,{className:"h-3 w-3"}),"v",a.version]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>{K(!1),Y.invalidateQueries({queryKey:["whisper-config"]})},children:[e.jsx(ks,{className:"h-4 w-4 mr-1"}),"Atualizar"]}),e.jsxs(S,{onClick:As,disabled:ee,children:[e.jsx(Gs,{className:"h-4 w-4 mr-1"}),ee?"Salvando...":"Salvar"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(Bs,{className:"h-5 w-5 text-yellow-500"}),"Seleção de Provider por Plano"]}),e.jsx(m,{children:"Define qual provider de transcrição será usado para cada plano de assinatura"})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Plano Gratuito"}),e.jsxs(j,{value:A,onValueChange:ve,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:p.map(s=>e.jsx(i,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:s.icon}),e.jsx("span",{children:s.label})]})},s.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:(_s=p.find(s=>s.value===A))==null?void 0:_s.cost})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Plano Essencial"}),e.jsxs(j,{value:T,onValueChange:fe,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:p.map(s=>e.jsx(i,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:s.icon}),e.jsx("span",{children:s.label})]})},s.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:(bs=p.find(s=>s.value===T))==null?void 0:bs.cost})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Plano Profissional"}),e.jsxs(j,{value:V,onValueChange:Ne,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:p.map(s=>e.jsx(i,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:s.icon}),e.jsx("span",{children:s.label})]})},s.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:(ys=p.find(s=>s.value===V))==null?void 0:ys.cost})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Plano Premium"}),e.jsxs(j,{value:F,onValueChange:_e,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:p.map(s=>e.jsx(i,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:s.icon}),e.jsx("span",{children:s.label})]})},s.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:(Ss=
3p.find(s=>s.value===F))==null?void 0:Ss.cost})]})]}),e.jsx(u,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Provider Padrão (Fallback)"}),e.jsxs(j,{value:ae,onValueChange:re,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:p.map(s=>e.jsx(i,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:s.icon}),e.jsx("span",{children:s.label}),e.jsxs("span",{className:"text-muted-foreground",children:["(",s.model,")"]})]})},s.value))})]})]})]})]}),e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(Ks,{className:"h-5 w-5 text-green-500"}),"Configurações de Créditos"]}),e.jsx(m,{children:"Define custos e limites de créditos por transcrição"})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Custo por Minuto"}),e.jsx(o,{type:"number",min:1,max:10,value:le,onChange:s=>de(Number(s.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"créditos/min"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Máximo por Áudio"}),e.jsx(o,{type:"number",min:1,max:20,value:ce,onChange:s=>me(Number(s.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"créditos máx"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Mínimo de Áudio"}),e.jsx(o,{type:"number",min:1,max:10,value:xe,onChange:s=>ue(Number(s.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"segundos"})]})]}),e.jsx(u,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(t,{children:"Temperatura (Variabilidade)"}),e.jsx(N,{value:[E],onValueChange:([s])=>ne(s),min:0,max:1,step:.1}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Valor: ",E," (0 = determinístico, 1 = criativo)"]})]})]})]}),e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(Us,{className:"h-5 w-5 text-blue-500"}),"Filtragem de Qualidade"]}),e.jsx(m,{children:"Thresholds para filtrar segmentos de baixa qualidade"})]}),e.jsx(x,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{children:"No Speech Probability Threshold"}),e.jsx(N,{value:[R],onValueChange:([s])=>ie(s),min:0,max:1,step:.05}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Valor: ",R," (segmentos com no_speech_prob maior são filtrados)"]})]}),e.jsxs("div",{children:[e.jsx(t,{children:"Average Log Probability Threshold"}),e.jsx(N,{value:[z],onValueChange:([s])=>oe(s),min:-2,max:0,step:.1}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Valor: ",z," (segmentos com avg_logprob menor são filtrados)"]})]})]})})]}),e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(Qs,{className:"h-5 w-5 text-slate-500"}),"Pós-processamento"]}),e.jsx(m,{children:"Tratamento automático do texto transcrito"})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Remover Vícios de Fala"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Remove "ééé", "hã", "né", "tipo", "hmm"'})]}),e.jsx(n,{checked:pe,onCheckedChange:he})]}),e.jsx(u,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Normalizar Medidas"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Formato brasileiro: 3.2 → 3,2 cm, "por" → "x"'})]}),e.jsx(n,{checked:je,onCheckedChange:ge})]})]})]}),e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-orange-500"}),"Contexto & Streaming"]}),e.jsx(m,{children:"Configurações avançadas para continuidade e latência"})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Usar Contexto Anterior"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Envia últimos caracteres da transcrição anterior para melhor continuidade"})]}),e.jsx(n,{checked:I,onCheckedChange:Se})]}),I&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs(t,{children:["Tamanho do Contexto: ",O," caracteres"]}),e.jsx(N,{value:[O],onValueChange:([s])=>Ce(s),min:100,max:500,step:50}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Groq: contexto será truncado junto com prompt (~850 chars total)"})]}),e.jsx(u,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Habilitar Streaming (Experimental)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"SSE para OpenAI gpt-4o-transcribe. Reduz latência percebida."})]}),e.jsx(n,{checked:Pe,onCheckedChange:we})]}),e.jsx(u,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Configuração Ativa"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Desativar para usar fallback hardcoded"})]}),e.jsx(n,{checked:be,onCheckedChange:ye})]})]})]})]}),e.jsxs(l,{className:"border-primary/40",children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-primary"}),"Premium Live (Deepgram Nova-3)"]}),e.jsx(m,{children:"Streaming WebSocket com ghost text (interim_results), endpointing e keyterm boost. Latência < 300 ms. Disponível apenas no plano Premium."})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Habilitar Premium Live"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Quando desligado, o botão "Premium Live" no editor é ocultado.'})]}),e.jsx(n,{checked:Ee,onCheckedChange:Re})]}),e.jsx(u,{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Modelo"}),e.jsxs(j,{value:ze,onValueChange:Ae,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:e.jsx(i,{value:"nova-3",children:"nova-3 (multilingual, ~$0.0077/min)"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Idioma"}),e.jsxs(j,{value:Te,onValueChange:Ve,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsxs(f,{children:[e.jsx(i,{value:"pt-BR",children:"pt-BR (recomendado para radiologia local)"}),e.jsx(i,{value:"multi",children:"multi (PT-BR + termos EN)"}),e.jsx(i,{value:"en",children:"en (somente inglês)"}),e.jsx(i,{value:"es",children:"es (espanhol)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"pt-BR puro melhora a precisão; use multi se ditar termos em inglês frequentemente."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(t,{children:["Endpointing: ",U," ms"]}),e.jsx(N,{value:[U],onValueChange:([s])=>Fe(s),min:100,max:1e3,step:50}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Silêncio para fechar utterance. Recomendado PT-BR radiologia: 600 ms."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"RADC / minuto"}),e.jsx(o,{type:"number",min:1,max:20,value:Ue,onChange:s=>Qe(Number(s.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Máx RADC / sessão"}
3),e.jsx(o,{type:"number",min:1,max:500,value:He,onChange:s=>We(Number(s.target.value))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Smart Format"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Números, unidades, pontuação."})]}),e.jsx(n,{checked:Oe,onCheckedChange:Le})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Interim Results"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Ghost text palavra-por-palavra."})]}),e.jsx(n,{checked:Ge,onCheckedChange:Be})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Habilitado em Premium"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Gating final por plano."})]}),e.jsx(n,{checked:$e,onCheckedChange:Ze})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Punctuate"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Pontuação automática (manter ON)."})]}),e.jsx(n,{checked:Je,onCheckedChange:Xe})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"VAD Events"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Eventos de início de fala."})]}),e.jsx(n,{checked:Ye,onCheckedChange:es})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Utterance End (ms)"}),e.jsx(o,{type:"number",min:0,max:5e3,step:100,value:ss,onChange:s=>as(Number(s.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"1000–5000 ms. 0 desativa. Recomendado PT-BR radiologia: 1500."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Numerals"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Já coberto por Smart Format. Manter OFF."})]}),e.jsx(n,{checked:rs,onCheckedChange:ts})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Diarize"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Multi-falante (não usar em ditado)."})]}),e.jsx(n,{checked:ns,onCheckedChange:is}
3)]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Profanity Filter"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove palavrões (off para clínica)."})]}),e.jsx(n,{checked:os,onCheckedChange:ls})]})]}),e.jsx(u,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(t,{children:["Slots de keyterms personalizados (por usuário): ",_," / 80"]}),e.jsx(N,{value:[_],onValueChange:([s])=>Ie(s),min:0,max:80,step:5}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Quantos dos 100 slots Deepgram são reservados para keyterms personalizados do usuário (dicionário pessoal + frases ativas mais recentes). O restante (",100-_,") fica para o catálogo global abaixo. Recomendado: 40."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(t,{children:"Keyterms globais (vocabulário radiológico base)"}),e.jsxs(y,{variant:"outline",children:[Q.split(`
4`).filter(s=>s.trim()).length," / ",100-_]})]}),e.jsx(P,{value:Q,onChange:s=>Ke(s.target.value),rows:10,className:"font-mono text-sm",placeholder:`BI-RADS
5hipoecogênico
6ateromatose`}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Um termo por linha. Use `keyterm` (Nova-3 NÃO aceita `keywords`). Capitalize como deseja na saída. Evite números puros e palavras genéricas. Os primeiros ",100-_," termos serão usados (resto é cortado para dar lugar aos keyterms personalizados do usuário)."]})]})]})]}),e.jsxs(l,{className:"border-violet-500/40",children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-violet-500"}),"Ditado ao Vivo (Soniox stt-rt-v5)"]}),e.jsxs(m,{children:["WebSocket realtime com endpointing calibrável, pontuação/capitalização automáticas e context bias (glossário + dicionário pessoal). Gating por plano é 100% dinâmico via ",e.jsx("code",{children:"feature_whisper"})," em Assinaturas."]})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Habilitar Ditado ao Vivo (Soniox)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Kill-switch global. Quando desligado, o card na sidebar do editor mostra "Manutenção" para todos os planos.'})]}),e.jsx(n,{checked:ds,onCheckedChange:cs})]}),e.jsx(u,{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Modelo"}),e.jsxs(j,{value:ms,onValueChange:xs,children:[e.jsx(g,{children:e.jsx(v,{})}),e.jsx(f,{children:e.jsx(i,{value:"stt-rt-v5",children:"stt-rt-v5 (multilíngue, pt+en, endpointing nativo)"})})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[e.jsxs("div",{className:"flex-1 pr-3",children:[e.jsx(t,{children:"Endpointing (Ditado Contínuo)"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[e.jsx("strong",{children:"Desligado"})," = a frase nunca é cortada em pausa; o texto é consolidado quando o usuário para o ditado (finalize manual). Recomendado para laudo. ",e.jsx("strong",{children:"Ligado"})," = modo conversação, o Soniox decide onde termina a frase (pode inserir ponto+Maiúscula em pausas de raciocínio)."]})]}),e.jsx(n,{checked:$,onCheckedChange:b})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{variant:"default",size:"sm",onClick:()=>{b(!0),k(-.3),w(2),M(3500),C.success("Preset Ditado Contínuo (recomendado) aplicado. Salve para persistir.")},children:"Ditado Contínuo (recomendado)"}),e.jsx(S,{variant:"secondary",size:"sm",onClick:()=>{b(!0),k(-.5),w(2),M(4e3),C.success("Preset Ditado Contínuo Estrito aplicado. Salve para persistir.")},children:"Ditado Contínuo Estrito"}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>{b(!1),C.success("Kill-switch aplicado — endpoint OFF, finalize manual. Salve para persistir.")},children:"Kill-switch (finalize manual)"})]}),e.jsxs("div",{className:$?"":"opacity-50 pointer-events-none",children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Parâmetros abaixo só têm efeito com endpointing ",e.jsx("strong",{children:"ligado"}),". Ficam persistidos para rollback via preset."]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(t,{children:["Latency level: ",H," ",e.jsx("span",{className:"text-muted-foreground",children:"(0=ditado ↔ 3=conversa)"})]}),e.jsx(N,{value:[H],onValueChange:([s])=>w(s),min:0,max:3,step:1}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Menor = aguarda mais antes de finalizar segmento."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(t,{children:["Endpoint sensitivity: ",W.toFixed(2)]}),e.jsx(N,{value:[W],onValueChange:([s])=>
6k(s),min:-1,max:1,step:.05}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Menor = tolera pausas mais longas antes de cortar."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Max endpoint delay (ms)"}),e.jsx(o,{type:"number",min:500,max:6e3,step:100,value:us,onChange:s=>M(Number(s.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Teto absoluto para finalização."})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Context máx (chars)"}),e.jsx(o,{type:"number",min:500,max:1e4,step:500,value:hs,onChange:s=>js(Number(s.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Soniox aceita até 10k chars de `context.text`."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"RADC / minuto"}),e.jsx(o,{type:"number",min:1,max:20,value:gs,onChange:s=>vs(Number(s.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t,{children:"Máx RADC / sessão"}),e.jsx(o,{type:"number",min:1,max:500,value:fs,onChange:s=>Ns(Number(s.target.value))})]})]}),e.jsx(u,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(t,{children:"Glossário Soniox (context.terms)"}),e.jsxs(y,{variant:"outline",children:[Z.split(/[\n;,]+/).filter(s=>s.trim().length>=2).length," termos"]})]}),e.jsx(P,{value:Z,onChange:s=>ps(s.target.value),rows:10,className:"font-mono text-sm",placeholder:`BI-RADS 4a
7espessamento parietal
8hipoecogênico`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Separe por linha, vírgula ou ponto e vírgula. O contexto do Soniox é montado em camadas de prioridade — keyterms curados → dicionário pessoal do usuário → unidades e termos em inglês → frases de alta prioridade → nomes anatômicos → glossário — e limitado pelo orçamento de caracteres de soniox_context_max_chars. O glossário é a camada de PREENCHIMENTO: entra com o que sobrar do orçamento. Escreva na grafia canônica que deseja obter."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>{b(!0),w(2),k(-.3),M(3500),C.success("Padrões recomendados restaurados (endpoint ON, sensitivity -0.30). Não esqueça de salvar.")},children:[e.jsx(ks,{className:"h-3 w-3 mr-1"})," Restaurar padrões de ditado"]})})]})]}),e.jsxs(l,{children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"h-5 w-5 text-blue-500"}),"Prompts por Provider"]}),e.jsx(m,{children:"Cada provider tem limite e otimização diferente. Groq: ~850 chars (hints apenas). OpenAI: ilimitado (instruções completas)."})]}),e.jsx(x,{children:e.jsxs(Fs,{defaultValue:"groq",className:"w-full",children:[e.jsxs(Is,{className:"grid w-full grid-cols-3",children:[e.jsxs(J,{value:"groq",className:"gap-1",children:[e.jsx(Ms,{className:"h-2.5 w-2.5 fill-red-500 text-red-500"})," Groq"]}),e.jsxs(J,{value:"openai",className:"gap-1",children:[e.jsx(Ws,{className:"h-3 w-3 text-amber-500"})," OpenAI Pro"]}),e.jsxs(J,{value:"openai_mini",className:"gap-1",children:[e.jsx(Ms,{className:"h-2.5 w-2.5 fill-green-500 text-green-500"})," OpenAI Mini"]})]}),e.jsxs(X,{value:"groq",className:"space-y-3 mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(t,{children:"Prompt Groq (whisper-large-v3-turbo)"}),e.jsxs(y,{variant:"outline",className:"text-yellow-600",children:[L.length,"/850 chars"]})]}),e.jsx(P,{value:L,onChange:s=>ke(s.target.value),rows:8,className:"font-mono text-sm",placeholder:"Terminologia apenas como hints..."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"⚠️ Groq limita prompt a ~224 tokens (~850 chars). Use apenas terminologia como hints, sem instruções detalhadas."})]}),e.jsxs(X,{value:"openai",className:"space-y-3 mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(t,{children:"Prompt OpenAI Pro (gpt-4o-transcribe)"}),e.jsxs(y,{variant:"outline",className:"text-green-600",children:[G.length," chars"]})]}),e.jsx(P,{value:G,onChange:s=>Me(s.target.value),rows:12,className:"font-mono text-sm",placeholder:"Instruções detalhadas para transcrição médica..."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"✅ Sem limite de caracteres. Pode incluir instruções detalhadas de formatação, regras e terminologia completa."})]}),e.jsxs(X,{value:"openai_mini",className:"space-y-3 mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(t,{children:"Prompt OpenAI Mini (gpt-4o-mini-transcribe)"}),e.jsxs(y,{variant:"outline",className:"text-blue-600",children:[B.length," chars"]})]}),e.jsx(P,{value:B,onChange:s=>De(s.target.value),rows:10,className:"font-mono text-sm",placeholder:"Instruções moderadas para transcrição..."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Instruções intermediárias. Mais completo que Groq, mais conciso que Pro para melhor performance."})]})]})})]}),e.jsxs(l,{className:"opacity-75",children:[e.jsxs(d,{children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx($s,{className:"h-5 w-5 text-muted-foreground"}),"Prompt Fallback (Legado)"]}
8),e.jsx(m,{children:"Usado apenas se prompt específico do provider estiver vazio. Mantido para compatibilidade."})]}),e.jsxs(x,{children:[e.jsx(P,{value:D,onChange:s=>te(s.target.value),rows:8,className:"font-mono text-sm",placeholder:"Instruções para transcrição médica..."}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[D.length," caracteres",D.length>850&&e.jsx("span",{className:"text-yellow-500 ml-2",children:"(Groq irá truncar para ~850 caracteres)"})]})]})]})]})})}export{aa as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.