This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tenho 100 dolares de créditos dentro do claude console para gastos com agentes no mês. preciso criar uma função, dentro do besser home crm, que vai levantar detalhes do operacional/financeiro/corte e enviar a algumas pessoas. como podemos fazer isso da melhor forma? e qual seria o custo? | |
| Dá para fazer com custo quase irrelevante perto dos seus US$ 100. A razão é que o levantamento dos números não precisa de agente. | |
| Como eu faria | |
| Os números saem de SQL, não da IA. Uma função no Supabase (RPC ou views) calcula operacional, financeiro e corte de forma determinística. Assim o valor nunca é inventado nem arredondado errado, e o resultado é sempre igual para a mesma consulta. | |
| A IA entra só no texto. Uma edge function pega o JSON dos números e faz uma única chamada à API do Claude para escrever o resumo, destacar o que mudou e apontar anomalias. Isso evita o loop de agente consultando o banco, que é mais caro, mais lento e menos previsível. | |
| Agendamento com pg_cron, ou botão “enviar agora” no CRM chamando a mesma |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function array_subtract(array $source, array $subtractor) | |
| { | |
| foreach ($subtractor as $subtractorItem) { | |
| $subtractorKey = array_search($subtractorItem, $source, true); | |
| if ($subtractorKey !== false) { | |
| unset($source[$subtractorKey]); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types = 1); | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\SoftDeletes; | |
| class Example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ | |
| RewriteCond %{REQUEST_URI} !^/public/ | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule ^(.*)$ /public/$1 | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] | |
| RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /scripts/rebuildhttpdconf | |
| service httpd restart | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| header('HTTP/1.1 301 Moved Permanently'); | |
| header('Location: http://site.dominio.com/'); | |