### Install Playwright Dependencies (Bash) Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Installs Playwright dependencies for development environments. This can be done automatically with 'npm run dev:setup', manually with 'npm install' and 'npm run playwright:install', or via a full setup script './scripts/setup-dev.sh'. ```bash npm run dev:setup ``` ```bash npm install npm run playwright:install ``` ```bash ./scripts/setup-dev.sh ``` -------------------------------- ### Bash - Contributing to FormMy Agent Framework Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/formmy-agent-framework/README.md Provides the command-line instructions to clone the FormMy repository, navigate to the agent framework package, install dependencies, and start the development server, facilitating contributions to the project. ```bash git clone https://github.com/formmy/formmy cd packages/formmy-agent-framework npm install npm run dev ``` -------------------------------- ### Setup Initial Dependencies and Environment Variables - Bash Source: https://github.com/blissito/formmy_rrv7/blob/main/PORTABILIDAD-AGENTENGINE-V0.md Installs necessary dependencies for LlamaIndex and configures essential API keys as environment variables. This is the first step in setting up the project environment. ```bash # Instalar dependencias npm install llamaindex @llamaindex/openai @llamaindex/anthropic @llamaindex/workflow # Configurar variables de entorno OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... CHATGPT_API_KEY=sk-... # OpenAI Direct API ``` -------------------------------- ### Setup and Publish CelebrationFlip Component to NPM Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/celebration_flip/PUBLISH.md This snippet details the bash commands required to initialize a Git repository, create a GitHub repository, build the package, and publish it to NPM. It includes steps for navigating to the package directory, committing initial changes, adding a remote origin, pushing to GitHub, installing dependencies, building distribution files, creating a local .tgz package for testing, logging into NPM, and finally publishing the package to NPM. ```bash # Navigate to the package directory cd packages/celebration_flip # Initialize git (if not already done) git init git add . git commit -m "Initial commit: CelebrationFlip component" # Create GitHub repository # Go to https://github.com/new # Repository name: celebration-flip # Description: Beautiful animated flip text component for celebrating milestones # Add remote and push git remote add origin https://github.com/formmy/celebration-flip.git git branch -M main git push -u origin main # Install build dependencies npm install # Build the distribution files npm run build # Test the build npm pack # This creates a .tgz file you can test locally: # npm install ./formmy-celebration-flip-1.0.0.tgz # Login to NPM (if not already logged in) npm login # Publish the package npm publish --access public # For scoped packages (@formmy/celebration-flip) npm publish --access public # Tag the release git tag v1.0.0 git push origin v1.0.0 ``` -------------------------------- ### Untitled No description -------------------------------- ### Playwright Development Success Log Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Indicates a successful Playwright setup and initialization in a development environment, confirming the use of bundled Chromium. ```log 💻 Using Playwright bundled Chromium in development ✅ Playwright web search service initialized successfully ``` -------------------------------- ### System Prompt RAG Example: Price Inquiry Source: https://github.com/blissito/formmy_rrv7/blob/main/CLAUDE_OLD.md An example of an improved system prompt for a user asking about cheaper plans, demonstrating the agent's expected execution flow using `search_context`. ```text User: "¿Tienen planes más baratos que $5,000?" → EJECUTAR: search_context("precios planes baratos económicos") → LEER resultados y RESPONDER con datos encontrados ``` -------------------------------- ### Configure Basic Registry (JavaScript) Source: https://github.com/blissito/formmy_rrv7/blob/main/app/content/blog/formmy-agent-express-tutorial.md Sets up a basic tool registry using a Map in JavaScript. It defines an example 'get_weather' tool with its name, description, parameters, and handler. It exports functions to get available tools and execute tool calls. ```javascript // server/tools/registry.js const tools = new Map(); // Herramienta de ejemplo tools.set('get_weather', { name: 'get_weather', description: 'Obtiene el clima de una ciudad', parameters: { type: 'object', properties: { city: { type: 'string', description: 'Nombre de la ciudad' } } }, handler: async (args) => { // Lógica para obtener clima return `El clima en ${args.city} es soleado, 25°C`; } }); function getAvailableTools() { return Array.from(tools.values()); } function executeToolCall(toolName, args) { const tool = tools.get(toolName); if (!tool) throw new Error(`Herramienta ${toolName} no encontrada`); return tool.handler(args); } module.exports = { getAvailableTools, executeToolCall }; ``` -------------------------------- ### Install Formmy Agent Framework using npm Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/formmy-agent-framework/README.md This command installs the Formmy Agent Framework package from npm, making it available for use in your project. ```bash npm install @formmy/agent-framework ``` -------------------------------- ### Ghosty Prompt Approach Example Source: https://github.com/blissito/formmy_rrv7/blob/main/docs/PROMPT_ENGINEERING.md The project's prompt approach for Ghosty. It is significantly more detailed than basic examples and includes absolute prohibitions, an obligatory protocol with specific steps (knowledge base, web fallback, final resort), and examples with reasoning. This detailed structure is necessary for complex agentic behavior. ```plaintext ⛔ PROHIBICIONES ABSOLUTAS: 1. NUNCA respondas sin buscar PRIMERO 2. NUNCA digas "no sé" sin AGOTAR herramientas ✅ PROTOCOLO OBLIGATORIO: PASO 1 - Base de conocimiento (search_context) PASO 2 - Fallback a web (web_search_google) PASO 3 - Último recurso: decir "busqué pero no encontré" 📊 EJEMPLOS CON RAZONAMIENTO: ... ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Install Playwright Chromium (Bash) Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Installs the Chromium browser for Playwright in development environments when facing the 'Executable doesn't exist' error. This command uses npx to run the playwright CLI. ```bash npx playwright install chromium ``` -------------------------------- ### Untitled No description -------------------------------- ### Initialize FormmyParser with API Key Source: https://github.com/blissito/formmy_rrv7/blob/main/sdk/formmy-parser/README.md A basic example of how to instantiate the `FormmyParser` class using only the required API key. This is the simplest way to get started with the SDK. ```typescript const parser = new FormmyParser('sk_live_xxxxx'); ``` -------------------------------- ### Untitled No description -------------------------------- ### Configure Playwright for Docker (Dockerfile) Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Ensures Playwright functions correctly in a Docker production environment by installing the system Chromium browser. This is typically done using a package manager like apk. ```dockerfile RUN apk add chromium ``` -------------------------------- ### API Endpoint Examples for Referral System Source: https://github.com/blissito/formmy_rrv7/blob/main/requirements.txt Examples demonstrating how to interact with the referral API endpoint for different intents, such as getting stats, generating a referral code, or processing a new referral. These examples use a form-data POST request. ```bash POST /api/referral intent=get_stats ``` ```bash POST /api/referral intent=generate_code ``` ```bash POST /api/referral intent=process_referral code=ABC123 referredUserId=60d5ec9f8b3f8b3f8b3f8b3f ``` -------------------------------- ### Untitled No description -------------------------------- ### Install and Import CelebrationFlip Component in React Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/celebration_flip/PUBLISH.md This snippet shows how to install the 'celebration_flip' package using npm and then import the CelebrationFlip component and its styles into a React application. It demonstrates the standard import statements for both the component and its associated CSS. ```javascript npm install @formmy/celebration-flip ``` ```jsx import { CelebrationFlip } from "@formmy/celebration-flip"; import "@formmy/celebration-flip/styles"; ``` -------------------------------- ### Untitled No description -------------------------------- ### Playwright Production Success Log Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Confirms successful Playwright initialization in a production Docker environment, noting the use of system Chromium. ```log 🐳 Using system Chromium in production: /usr/bin/chromium-browser ✅ Playwright web search service initialized successfully ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Setup Agenda.js for Background Jobs Source: https://github.com/blissito/formmy_rrv7/blob/main/README.md This snippet shows the setup for Agenda.js, a job scheduler. It initializes an Agenda instance with MongoDB connection details, specifies the processing interval and maximum concurrency, and starts the scheduler. This is crucial for handling background tasks asynchronously. ```typescript import Agenda from "agenda"; const agenda = new Agenda({ db: { address: process.env.MONGO_ATLAS!, collection: "agendaJobs" }, processEvery: "10 seconds", maxConcurrency: 5 }); agenda.start(); ``` -------------------------------- ### LLM Prompt for Tool Prioritization in TypeScript Source: https://github.com/blissito/formmy_rrv7/blob/main/docs/REACT_PATTERN.md This TypeScript snippet shows an example of how tool priorities can be communicated to a Large Language Model (LLM) within a system prompt. It suggests a preferred order for data retrieval (cache, then database, then web), guiding the LLM's decision-making process. ```typescript // In system prompt "When multiple data sources are needed, prefer this order: 1. Check local cache first 2. Query database 3. Search web as last resort" ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Playwright Fallback Log Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Logs a warning indicating that the Playwright browser was not initialized, which means web search functionalities will gracefully fail and the system will rely on its base knowledge. ```log ⚠️ Browser not initialized - search will fail gracefully ``` -------------------------------- ### Untitled No description -------------------------------- ### Production Environment Variables for Playwright Source: https://github.com/blissito/formmy_rrv7/blob/main/PLAYWRIGHT_SETUP.md Sets environment variables for Playwright in a production Docker environment. PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 prevents downloading bundled browsers, and PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH points to the system-installed Chromium. ```bash PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium-browser ``` -------------------------------- ### Untitled No description -------------------------------- ### TypeScript - Testing Utilities for Agents Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/formmy-agent-framework/README.md Provides code examples for testing agents using `createTestAgent` and mock providers. This setup allows for isolated testing of agent logic without external dependencies. ```typescript import { createTestAgent } from '@formmy/agent-framework'; // Agente configurado para testing (menos iteraciones, contexto reducido) const testAgent = createTestAgent('gpt-4'); // Mock de proveedor para tests const mockProvider = { chatCompletion: async (req) => ({ content: 'Test response' }) }; const agent = createAgent({ model: 'test-model', aiProvider: mockProvider }); ``` -------------------------------- ### Backend Coexistence Detection API Call Source: https://github.com/blissito/formmy_rrv7/blob/main/WHATSAPP_COEXISTENCE_READY.md A JavaScript example demonstrating how the backend can make a GET request to the Meta Graph API to detect coexistence indicators for a given phone number ID. ```javascript // Detecta indicadores de coexistencia GET https://graph.facebook.com/v17.0/{phone_number_id}?fields=account_mode,platform_type,verified_name // Si account_mode o platform_type están presentes = COEXISTENCE ACTIVO ``` -------------------------------- ### Clonar Formmy Agent Framework Source: https://github.com/blissito/formmy_rrv7/blob/main/content/blog/tutorial-express-formmy-agent-framework.md Instala el Formmy Agent Framework clonando el repositorio público o copiando manualmente los archivos. Este script muestra cómo clonar desde un repositorio y copiar los archivos necesarios al directorio del framework. ```bash # Crear directorio del framework mkdir -p src/server/formmy-agent # Opción A: Clone del repo público git clone https://github.com/formmy/agent-examples.git temp cp -r temp/framework/* src/server/formmy-agent/ rm -rf temp # Opción B: Copiar manualmente los archivos desde documentación ``` -------------------------------- ### Untitled No description -------------------------------- ### Dockerfile for Bridge Service Source: https://github.com/blissito/formmy_rrv7/blob/main/docs/whatsapp-flowise-integration.md This Dockerfile sets up the environment for the bridge service. It uses a Node.js 18 slim image, installs production dependencies, copies the application code, exposes port 3001, and defines the command to start the server. ```dockerfile # Dockerfile FROM node:18-slim WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . EXPOSE 3001 CMD ["node", "server.js"] ``` -------------------------------- ### Untitled No description -------------------------------- ### Debugging Logs for Agent Iterations in TypeScript Source: https://github.com/blissito/formmy_rrv7/blob/main/docs/REACT_PATTERN.md This TypeScript code provides examples of logging crucial information during each iteration of an agent's execution. It logs the current iteration number, tools used, and token count, which is invaluable for monitoring and debugging agent behavior. ```typescript // Log each iteration for debugging console.log(`[ReAct] Iteration ${state.iterations}/${this.maxIterations}`); console.log(`[ReAct] Tools used: ${state.toolsUsed.join(', ')}`); console.log(`[ReAct] Tokens: ${state.totalTokens}`); ``` -------------------------------- ### OAuth Flow Example - API Request Source: https://github.com/blissito/formmy_rrv7/blob/main/COMPOSIO_CALENDAR_STATUS.md This snippet demonstrates the sequence of events for connecting a Google Calendar via OAuth, starting from the user click to the final API call. It highlights the POST request to the Composio API and the subsequent redirect and token exchange. ```http POST /api/v1/composio/google-calendar?intent=connect&chatbotId=abc123 HTTP/1.1 Host: example.com Content-Type: application/json ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Execute TypeScript Test Script (Bash) Source: https://github.com/blissito/formmy_rrv7/blob/main/content/blog/tutorial-express-formmy-agent-framework.md This command uses `ts-node` to directly execute the TypeScript test framework script. Ensure `ts-node` is installed (`npm install -g ts-node` or `npm install --save-dev ts-node`) and the script path is correct. ```bash # Ejecutar test npx ts-node src/test-framework.ts ``` -------------------------------- ### Basic Formmy Agent Configuration and Usage in TypeScript Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/formmy-agent-framework/README.md Demonstrates how to configure a simple AI provider and create a Formmy agent. It outlines the steps for setting up the AI provider (e.g., OpenAI), initializing the agent with model and configuration, and performing a basic chat interaction. The agent uses a placeholder `aiProvider` for demonstration purposes. ```typescript import { FormmyAgent, createAgent } from '@formmy/agent-framework'; // 1. Configurar proveedor de AI const aiProvider = { async chatCompletion(request) { // Tu lógica de integración con OpenAI, Anthropic, etc. const response = await openai.chat.completions.create({ model: request.model, messages: request.messages, temperature: request.temperature, max_tokens: request.maxTokens }); return { content: response.choices[0].message.content, usage: { inputTokens: response.usage.prompt_tokens, outputTokens: response.usage.completion_tokens, totalTokens: response.usage.total_tokens } }; } }; // 2. Crear agente const agent = createAgent({ model: 'gpt-4', aiProvider: aiProvider, maxIterations: 5, contextLimit: 4000 }); // 3. Chat const response = await agent.chat('¿Cómo puedo optimizar mi aplicación React?'); console.log(response.content); ``` -------------------------------- ### Untitled No description -------------------------------- ### Start Local Development Server Source: https://github.com/blissito/formmy_rrv7/blob/main/GHOSTY-PLAN-PAYMENT-AUDIT.md Command to start the local development server for testing the application. After running this, the application can be accessed at http://localhost:3000/dashboard/ghosty. ```bash npm run dev ``` -------------------------------- ### Untitled No description -------------------------------- ### Install Project Dependencies (Bash) Source: https://github.com/blissito/formmy_rrv7/blob/main/README.md Installs all necessary project dependencies using npm. This is a prerequisite for running the development server or building the project. ```bash npm install ``` -------------------------------- ### Untitled No description -------------------------------- ### Install @formmy/parser using npm, yarn, or pnpm Source: https://github.com/blissito/formmy_rrv7/blob/main/sdk/formmy-parser/README.md Instructions for installing the @formmy/parser package using common Node.js package managers. This is the initial step before using the SDK. ```bash npm install @formmy/parser # or yarn add @formmy/parser # or pnpm add @formmy/parser ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Install CelebrationFlip Package Source: https://github.com/blissito/formmy_rrv7/blob/main/packages/celebration_flip/README.md Demonstrates how to install the CelebrationFlip package using various package managers like npm, yarn, pnpm, and bun. This step is necessary for using the component in your project. ```bash # npm npm install celebration-flip # yarn yarn add celebration-flip # pnpm pnpm add celebration-flip # bun bun add celebration-flip ``` -------------------------------- ### Instalar Dependencias de Proyecto Express Source: https://github.com/blissito/formmy_rrv7/blob/main/content/blog/tutorial-express-formmy-agent-framework.md Instala las dependencias necesarias para un proyecto Express con soporte de TypeScript, incluyendo Express, dotenv, cors, helmet, y herramientas de desarrollo como ts-node y nodemon, además de SDKs para interacciones con IA como OpenAI y Anthropic. ```bash # Crear directorio del proyecto mkdir mi-app-agentes-ia cd mi-app-agentes-ia npm init -y # Dependencias principales (mínimas y controladas) npm install express dotenv cors helmet npm install -D typescript @types/node @types/express ts-node nodemon # SDKs directos (sin wrappers) npm install openai @anthropic-ai/sdk axios ``` -------------------------------- ### Timer Functionality in JavaScript Source: https://github.com/blissito/formmy_rrv7/blob/main/presentacion-claude-code-sesion1.html This snippet implements a timer that updates the displayed time and elapsed time since a start time. It includes a function to format time and an event listener to reset the start time on click. ```javascript let p = new Date(); const v = () => { const e = new Date(), t = (e) => `${Math.floor(e)}`.padStart(2, "0"), n = e.getTime() - p.getTime(), o = t((n / 1e3) % 60), a = t((n / 1e3 / 60) % 60), i = t((n / 36e5) % 24); ((r(J.infoTime).textContent = e.toLocaleTimeString()), (r(J.infoTimer).textContent = `${i}:${a}:${o}`)); }; (v(), setInterval(v, 250), r(J.infoTimer).addEventListener("click", () => { p = new Date(); })); ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### LlamaIndex Blog-Writer Prompt Example Source: https://github.com/blissito/formmy_rrv7/blob/main/docs/PROMPT_ENGINEERING.md A concise prompt example from LlamaIndex's blog-writer.ts. It defines the role of the agent as a research agent and outlines its workflow of gathering information from the internet using provided tools and transferring it to a report agent. ```plaintext You are a research agent. Your role is to gather information from the internet using the provided tools and then transfer this information to the report agent for content creation. ```