Skip to content

Instantly share code, notes, and snippets.

@ricardocuellar
ricardocuellar / docker-compose.yml
Created June 17, 2026 18:38
Golang Backend - Section 2 - Docker compose
services:
postgres:
image: postgres:16-alpine
container_name: devboard_postgres
environment:
POSTGRES_USER: postgres <o tu USER>
POSTGRES_PASSWORD: password
POSTGRES_DB: devboard
ports:
- "5432:5432"
@ricardocuellar
ricardocuellar / .golangci.yml
Created June 17, 2026 18:37
Golang Backend - Section 2 - Golangci configuration
version: "2"
linters:
enable:
- errcheck
- staticcheck
- govet
- ineffassign
- unused
- gosec
@ricardocuellar
ricardocuellar / Makefile
Created June 17, 2026 18:36
Golang - Backend - Section 2- Makefile
# Variables
APP_NAME=devboard
MAIN_PATH=./cmd/api
MIGRATE_PATH=./migrations
DB_URL=postgresql://postgres:password@localhost:5432/devboard?sslmode=disable
.PHONY: run build test lint migrate-up migrate-down generate tidy help
## run: correr la aplicación
run:

Instalaciones recomendadas - Curso de Golang: Backend Profesional

Go Logo

Instalar Go

  1. Instalar Golang
  2. Verificar instalación de Golang
    • go version

Instalaciones recomendadas

@ricardocuellar
ricardocuellar / python_ia_section10_run_chat_function.py
Created May 30, 2026 16:29
Python IA Aplicada - Sección 10 - Run Chat - Function
def run_chat(
...
) -> None:
print(f"\n{'=' * 55}")
print("Asistente de Conocimiento Empresarial")
print(f"Sesión: {session_id}")
print(f"{'=' * 55}")
print("Comandos: 'sesion' | 'historial' | 'limpiar' | 'salir'")
@ricardocuellar
ricardocuellar / python_ia_section10_node_generate_prompt.py
Created May 30, 2026 13:45
Python IA Aplicada - Sección 10 - Node Generate - Prompt
prompt = f"""Eres un asistente de conocimiento empresarial experto.
{context_section}
HISTORIAL RECIENTE:
{history_text if history_text else 'Inicio de conversación'}
PREGUNTA: {state['question']}
INSTRUCCIONES:
@ricardocuellar
ricardocuellar / python_ia_section10_node_analyze_prompt.py
Created May 30, 2026 12:38
Python IA Aplicada - Sección 10 - Node Analyze - Prompt
prompt = f"""Analiza si esta pregunta necesita buscar en la base de conocimiento empresarial.
Contexto inmediato (últimos 2 mensajes):
{recent_context if recent_context else 'Sin contexto previo'}
Pregunta actual: {state['question']}
Responde ÚNICAMENTE con este JSON (sin markdown):
{{"needs_retrieval": true, "reason": "razón breve"}}
@ricardocuellar
ricardocuellar / demo_rag_show_welcome.py
Created May 27, 2026 17:45
Python IA Aplicada - Sección 9 - Funcion show welcome en demo rag
def show_welcome(num_chunks: int) -> None:
"""Muestra el mensaje de bienvenida con estado del sistema."""
print("\n" + "=" * 60)
print("🔍 RAG Interactivo — Chat con tus documentos")
print("=" * 60)
print(f" Carpeta de documentos: {DOCUMENTS_DIR}")
print(f" Chunks en el índice: {num_chunks}")
print()
print(" Comandos:")
print(" 'archivos' → ver archivos indexados")
@ricardocuellar
ricardocuellar / section9-prompt-rag-chain.py
Created May 27, 2026 12:43
Python IA Aplicada - Sección 9 - Prompt RAG Chain
prompt = ChatPromptTemplate.from_messages([
("system", """Eres un asistente que responde preguntas
basándote ÚNICAMENTE en el contexto proporcionado.
Contexto recuperado de los documentos:
{context}
Instrucciones:
- Si la respuesta está en el contexto, respóndela con precisión.
- Si no está, di: "No encontré esa información en los documentos."
@ricardocuellar
ricardocuellar / section6-chat-principal.py
Created May 15, 2026 20:08
section6-chat-principal.py metodo para iniciar loop del chat
def chat(self) -> None:
"""Loop principal de chat interactivo."""
console.print(Panel.fit(
"[bold cyan]Chat con tus PDFs[/bold cyan]\n"
"[dim]Comandos disponibles: 'estado' | 'reindexar' | 'salir'[/dim]",
border_style="cyan"
))
if self.rag.collection.count() == 0: