This file contains 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
#include <jo/jo.h> | |
#include <jo/math.h> /* Para jo_sinf() e jo_cosf() */ | |
/*-------------------------------- | |
Planos | |
--------------------------------*/ | |
jo_vertice plane_vertices[] = JO_3D_PLANE_VERTICES(104); | |
jo_vertice plane_vertices2[] = JO_3D_PLANE_VERTICES(104); | |
jo_3d_quad plane; | |
jo_3d_quad plane2; |
This file contains 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 convertTextToHTML(text) { | |
// Primeira etapa: detectar e converter tabelas | |
let lines = text.split('\n'); | |
let htmlParts = []; | |
let i = 0; | |
while (i < lines.length) { | |
// Verifica se a linha atual parece ser um cabeçalho de tabela | |
if (isTableHeader(lines[i]) && i + 1 < lines.length && isTableDivider(lines[i + 1])) { | |
// Encontramos um possível bloco de tabela |
This file contains 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
Com o intuito de gerar um dataset para fine tuning, crie 20 perguntas e respostas no formato json sobre esta lei. Sempre incluir a lei/ano no texto da pergunta: | |
quais sao as tecnicas de data augumentation? Use elas para criar perguntas e respostas em json sobre a lei do texto a seguir. Sempre incluir a lei/ano no texto da pergunta: | |
"Crie tarefas em forma de prompts baseados na lei fornecida. Essas tarefas devem desafiar uma LLM a interpretar, explicar, ou aplicar os artigos e seções da lei. Cada prompt deve ser claro e direto, incluindo: | |
- Uma instrução ou pergunta que exija a análise ou aplicação da lei. | |
- O artigo ou seção específico relacionado ao prompt. | |
- Um exemplo de resposta esperada (opcional). |
This file contains 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
import operator, asyncio, requests | |
from typing import List, TypedDict, Literal, Annotated, Optional, Any | |
from langchain.chains.combine_documents.reduce import ( | |
acollapse_docs, | |
split_list_of_docs, | |
) | |
from langchain_core.documents import Document | |
from langgraph.constants import Send | |
from langgraph.graph import END, START, StateGraph |
This file contains 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
from langchain_community.document_loaders import PyPDFLoader # pip install -qU langchain_community pypdf | |
from langchain_core.language_models.llms import LLM | |
from langchain.chains.summarize import load_summarize_chain | |
from typing import List, Optional, Dict, Any | |
import requests, sys | |
# Classe personalizada para o LLM local | |
class LocalLLM(LLM): | |
def _call(self, prompt: str, stop: Optional[List[str]] = None, **kwargs: Any) -> str: |
This file contains 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
from playwright.sync_api import sync_playwright | |
import json, re | |
from bs4 import BeautifulSoup | |
def scrape_leis_ordinarias_anos(start_year, end_year): | |
base_url = "https://www4.planalto.gov.br/legislacao/portal-legis/legislacao-1/leis-ordinarias/{year}-leis-ordinarias" | |
leis_gerais = [] # Lista para armazenar todas as leis de todos os anos | |
with sync_playwright() as p: | |
# Inicia o navegador |
This file contains 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 | |
abstract class Operator { | |
const eq = '='; | |
const ne = '<>'; | |
const gt = '>'; | |
const lt = '<'; | |
const gte = '>='; | |
const lte = '<='; | |
const in = 'IN'; |
This file contains 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
#include <genesis.h> | |
// Função para desenhar uma linha entre dois pontos | |
void drawLine(u16 x0, u16 y0, u16 x1, u16 y1, u16 paletteIndex, u16 color, u8 tileSize) | |
{ | |
// Cria um tile de linha | |
u32 lineTile[8]; | |
for (int i = 0; i < 8; i++) | |
{ | |
lineTile[i] = 0xFFFFFFFF; |
This file contains 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
#include <genesis.h> | |
// Função genérica para desenhar uma linha entre dois pontos | |
void drawLine(u16 x0, u16 y0, u16 x1, u16 y1, u16 paletteIndex, u16 color, u8 tileSize) | |
{ | |
// Cria dinamicamente um tile com base no tamanho configurável | |
u32 lineTile[64]; // Máximo de 64 linhas (8x8 pixels no máximo) | |
for (int i = 0; i < tileSize; i++) | |
{ | |
// Cada linha do tile terá todos os bits preenchidos com '1' (para linhas sólidas) |
This file contains 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
from fastapi import FastAPI, HTTPException, Depends # pip install fastapi uvicorn | |
from pydantic import BaseModel | |
import mysql.connector # pip install mysql-connector-python | |
db_config = { | |
"host": "localhost", | |
"user": "root", | |
"password": "", | |
"database": "exemplo" | |
} |