### Start Local Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/tech-guide-writer/README.md Run this command in your terminal to launch the application in development mode. This will typically start a local server, allowing you to access and test the project in your web browser. ```bash npm run dev ``` -------------------------------- ### Install Dependencies and Start Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/js-tutor/README.md These commands are used to initialize and run the project. `npm install` fetches all necessary project dependencies, while `npm run dev` starts the local development server, enabling live preview and development of the Next.js application. ```Shell # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Download and Setup Project Files Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-python/readme.md This shell command sequence downloads the example project folder, renames it, changes the current directory to the new project folder, and copies the environment variable example file to a live .env file. ```sh npx degit LangbaseInc/langbase-examples/examples/email-agent-python example-composable-email-agent-python && cd example-composable-email-agent-python && cp .env.example .env ``` -------------------------------- ### Install Dependencies and Run Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/career-prep-coach/README.md These shell commands are used to prepare and launch the Next.js project. `npm install` fetches all necessary project dependencies, while `npm run dev` starts the development server, making the application accessible for local testing and development. ```sh npm install ``` ```sh npm run dev ``` -------------------------------- ### Install Node.js Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ask-docs-rag/README.md This command installs all necessary Node.js packages and dependencies defined in the project's `package.json` file. It's a standard step for setting up any Node.js or Next.js project locally, ensuring all required libraries are available. ```sh npm install ``` -------------------------------- ### Download and Setup Langbase Email Agent Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-node/readme.md This command downloads the example project folder from the LangbaseInc/langbase-examples repository, renames it to `example-composable-email-agent-node`, changes the current directory to the new project folder, and copies the `.env.example` file to `.env` for environment variable configuration. ```sh npx degit LangbaseInc/langbase-examples/examples/email-agent-node example-composable-email-agent-node && cd example-composable-email-agent-node && cp .env.example .env ``` -------------------------------- ### Install Project Dependencies and Run Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ascii-software-architect/README.md These shell commands are used to set up and run the Next.js project. `npm install` fetches all required Node.js packages based on the `package.json` file, and `npm run dev` starts the local development server, typically accessible at `localhost:3000`. ```sh # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Install Dependencies and Run Next.js Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/dev-screener/README.md These shell commands are used to initialize and run the DevScreener Chatbot project. First, `npm install` fetches all necessary project dependencies. Subsequently, `npm run dev` starts the development server, making the application accessible locally, typically at `localhost:3000`. ```sh # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Install Node.js Dependencies and Run Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/cefr-level-assessment-bot/README.md These command-line instructions are used to prepare and launch the Next.js project. The `npm install` command downloads and installs all necessary Node.js packages defined in the project's `package.json`. Subsequently, `npm run dev` starts the local development server, making the application accessible, typically at `localhost:3000`. ```sh # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Download and Setup Langbase AI Email Agent Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-email-agent/README.md This command sequence downloads the AI Email Agent example project from GitHub, renames the directory to 'example-composable-email-agent', changes the current directory into the new project folder, and then copies the '.env.example' file to '.env.local' for local environment configuration. ```sh npx degit LangbaseInc/langbase-examples/examples/ai-email-agent example-composable-email-agent && cd example-composable-email-agent && cp .env.example .env.local ``` -------------------------------- ### Install Dependencies and Run Langbase AI Email Agent Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-email-agent/README.md These commands guide the user through installing the project's dependencies using either pnpm or npm, and then starting the development server. The application will typically run on localhost:3000. ```sh # Install the dependencies using the following command: pnpm install # OR npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Install Dependencies and Run Langbase Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/pseudocode-generator/README.md These shell commands are used to initialize and run the Langbase project. `npm install` downloads all required project dependencies, while `npm run dev` starts the development server, making the application accessible locally, typically at `localhost:3000`. ```sh # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Start Langbase Discord Bot Server Locally Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md This command initiates the local server for the Langbase Discord Bot, making it ready to receive and process Discord interactions. It should be executed after all necessary dependencies are installed and Discord commands have been successfully registered, either globally or per guild. ```sh npm start ``` -------------------------------- ### Configure Environment Variables and Run Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/rag-chatbot/README.md This snippet outlines the steps to configure the necessary environment variable for the Langbase API key and then install project dependencies and start the development server. It's a crucial step for setting up and running the RAG Chatbot example locally. ```sh # Replace `PIPE_API_KEY` with the copied API key. NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/code-alchemist/README.md This command installs all necessary project dependencies. Users can choose to use either `pnpm install` or `npm install` based on their preferred package manager. It's crucial to run this command before starting the development server. ```sh pnpm install # OR npm install ``` -------------------------------- ### Install Project Dependencies and Run Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/excel-master/README.md Commands to install the necessary Node.js dependencies for the project using npm and then start the Next.js development server. This allows the application to be accessed locally, typically at `localhost:3000`. ```sh npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Install Dependencies and Run Next.js Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/expert-proofreader/README.md These commands are used to set up and run the Next.js project. `npm install` fetches all required project dependencies, while `npm run dev` starts the development server, making the application accessible locally. This is a standard procedure for Node.js-based web projects. ```Shell # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/video-wisdom/README.md Installs all required project dependencies using either `pnpm` or `npm`. `pnpm` is recommended for its efficiency, while `npm` is a common alternative for Node.js projects. ```pnpm pnpm install ``` ```npm npm install ``` -------------------------------- ### Configure Environment Variables and Run Langbase RAG Application Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/documents-qna-rag/README.md This code block provides the essential shell commands to configure the required environment variable (`LANGBASE_PIPE_API_KEY`), install project dependencies using npm, and start the development server for the Langbase-powered RAG application. Users must replace the placeholder API key with their actual key obtained from Langbase. ```sh # Replace `LANGBASE_PIPE_API_KEY` with the copied API key. LANGBASE_PIPE_API_KEY="LANGBASE_PIPE_API_KEY" # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Langbase Project Setup and Execution Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-chatbot/README.md This snippet provides the necessary environment variable configuration for the Langbase API key and the commands to install project dependencies and run the Next.js development server. ```sh # Replace `USER/ORG-API-KEY` with the generated API key. LANGBASE_API_KEY="USER/ORG-API-KEY" # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Configure Environment and Install Dependencies for Langbase RAG App Source: https://github.com/langbaseinc/langbase-examples/blob/main/starters/documents-qna-rag/README.md This snippet provides the necessary shell commands to set up the environment variables, specifically the `LANGBASE_PIPE_API_KEY`, and to install the required Node.js dependencies using `npm install`, followed by the command to run the development server. ```sh # Replace `LANGBASE_PIPE_API_KEY` with the copied API key. LANGBASE_PIPE_API_KEY="LANGBASE_PIPE_API_KEY" # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Configure Langbase AI Translator Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-translator/readme.md This snippet provides the necessary shell commands to set up the Langbase AI Translator project locally. It covers configuring the API key, installing Node.js dependencies, and starting the development server. ```sh # Replace `PIPE_API_KEY` with the copied API key. LANGBASE_AI_PIPE_API_KEY="PIPE_API_KEY" # Install the dependencies using the following command: npm install # Run the project using the following command: npm run dev ``` -------------------------------- ### Clone Langbase Examples Repository Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/video-wisdom/README.md This command clones the entire `langbase-examples` repository from GitHub to your local machine, providing access to all example projects, including VideoWisdom. ```sh git clone https://github.com/LangbaseInc/langbase-examples ``` -------------------------------- ### Install Node.js Dependencies for Langbase Discord Bot Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md This command navigates into the project directory and installs all required Node.js packages using npm. It is a crucial prerequisite for running the bot locally and requires Node.js v18 or higher to ensure compatibility with project dependencies. ```sh cd ai-discord-bot npm install ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ask-docs-rag/README.md This command starts the Next.js development server, making the application accessible locally, typically at `localhost:3000`. It enables hot-reloading and other development features for efficient coding and testing during development. ```sh npm run dev ``` -------------------------------- ### Navigate to VideoWisdom Project Directory Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/video-wisdom/README.md This command changes the current working directory to the specific `video-wisdom` project folder within the cloned `langbase-examples` repository, preparing for further setup. ```sh cd langbase-examples/examples/video-wisdom ``` -------------------------------- ### Run VideoWisdom Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/video-wisdom/README.md This command starts the Next.js development server for the VideoWisdom application. It allows developers to run and test the application locally, typically accessible via `localhost:3000`. ```sh npm run dev ``` -------------------------------- ### Install Node.js Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-drug-assistant/README.md This command installs all necessary project dependencies listed in the `package.json` file. It is a standard step for setting up any Node.js or Next.js project after cloning the repository. ```bash npm install ``` -------------------------------- ### Start ngrok for local Discord bot development Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md This command initiates ngrok, creating an HTTP tunnel that forwards external Discord requests to your local machine, essential for testing slash commands during development. ```sh npm run ngrok ``` -------------------------------- ### Download and Initialize Code Alchemist Project Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/code-alchemist/README.md This shell command sequence downloads the Code Alchemist example project from the LangbaseInc GitHub repository, renames the directory to 'code-alchemist', changes the current directory into the newly created project folder, and then copies the '.env.example' file to '.env' to set up environment variables. ```sh npx degit LangbaseInc/langbase-examples/examples/code-alchemist code-alchemist && cd code-alchemist && cp .env.example .env ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/github-docs-sync-script/README.md Installs the necessary Node.js packages required for the GitHub documentation synchronization script. This command should be executed in the project's root directory after cloning the repository. ```bash npm install ``` -------------------------------- ### Install Node.js Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/api-sec-consultant/README.md This command installs all necessary Node.js packages and dependencies for the project, as defined in the `package.json` file. It's a standard and essential step for setting up any JavaScript/TypeScript project before it can be run. ```bash # Install the dependencies using the following command: npm install ``` -------------------------------- ### Run Local Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/text-summarizer/README.md Execute this command in your terminal to start the development server. This will typically launch the application on a local port, allowing you to test and develop the text summarizer in your browser. ```bash npm run dev ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/nextjs-basic/README.md Executes the command to start the Next.js development server. This allows you to run and test your application locally during development. ```bash npm run dev ``` -------------------------------- ### Install Node.js Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-master-chef/README.md Executes `npm install` to download and set up all required Node.js packages and libraries defined in the project's `package.json` file. This is a prerequisite for running the application. ```shell npm install ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/product-review-generator/README.md Installs all necessary project dependencies using npm, as defined in the `package.json` file. This command must be executed from the project's root directory to ensure all required packages are available. ```sh npm install ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/product-review-generator/README.md Starts the Next.js development server, making the application accessible locally, typically at `localhost:3000`. This command enables hot-reloading and other development features for efficient coding. ```sh npm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-node/readme.md These commands install the necessary Node.js project dependencies using either `pnpm` or `npm` package managers. It is crucial to run one of these commands after setting up the project to ensure all required libraries are available. ```sh pnpm install ``` ```sh npm install ``` -------------------------------- ### Install Required Python Packages Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-python/readme.md This command uses pip3 to install the necessary Python libraries: 'python-dotenv' for environment variable management and 'aiohttp' for asynchronous HTTP client/server operations. ```sh pip3 install python-dotenv aiohttp ``` -------------------------------- ### Clone Langbase RAG Memory Agent Example Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/rag-memory-agent/readme.md Downloads the `rag-memory-agent` example project from the LangbaseInc repository using `npx degit`. ```bash npx degit LangbaseInc/langbase-examples/examples/rag-memory-agent rag-memory-agent ``` -------------------------------- ### Install Project Dependencies with pnpm Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/rag-memory-agent/readme.md Installs all required Node.js packages for the project using the pnpm package manager. ```bash pnpm install ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/tech-guide-writer/README.md This environment variable is essential for authenticating your application with the Langbase Pipe API. Replace 'YOUR_PIPE_API_KEY' with the actual API key obtained from your forked Langbase Pipe. ```env NEXT_LB_PIPE_API_KEY=YOUR_PIPE_API_KEY ``` -------------------------------- ### Run the Composable Email Agent Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-node/readme.md These commands initiate the email agent application. Users can choose to run the agent using either `pnpm` or `npm`. Ensure all dependencies are installed and environment variables are properly configured before executing this command. ```sh pnpm run agent ``` ```sh npm run agent ``` -------------------------------- ### Run the Composable Email Agent Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-python/readme.md This command executes the main Python script 'agent.py', which starts the AI-powered composable email agent. ```sh python3 agent.py ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-drug-assistant/README.md This command initiates the development server for the Next.js project. It allows developers to run the application locally, typically accessible at `localhost:3000`, for testing and development purposes. ```bash npm run dev ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/api-sec-consultant/README.md This command starts the Next.js development server, making the application accessible locally, typically at `localhost:3000`. It enables hot-reloading, error reporting, and other development features for efficient coding. ```bash # Run the project using the following command: npm run dev ``` -------------------------------- ### Copy Environment Variable Example File Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/rag-memory-agent/readme.md Creates a `.env` file from the `.env.example` template, which will be used to store the Langbase API key. ```bash cp .env.example .env ``` -------------------------------- ### Run Code Alchemist Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/code-alchemist/README.md This command starts the development server for the Code Alchemist project. The application will typically be accessible on `localhost:3000` after execution. Users can choose between `pnpm run dev` or `npm run dev` to launch the server. ```sh pnpm run dev # OR npm run dev ``` -------------------------------- ### Define Website Crawling Rules with Robots.txt Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/geosimcities/public/robots.txt This snippet provides a standard robots.txt configuration. It instructs web crawlers to disallow access to all paths (`/`) except for the root (`/$`) and the `index.html` file (`/index.html$`). This helps manage which parts of a website are indexed by search engines. ```Robots.txt User-agent: * Disallow: / Allow: /$ Allow: /index.html$ ``` -------------------------------- ### Start Local Development Server Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-master-chef/README.md Runs the `npm run dev` command to launch the Next.js development server. This makes the AI Master Chef application accessible in a web browser, typically at `http://localhost:3000`, enabling live development and testing. ```shell npm run dev ``` -------------------------------- ### Langbase AI Discord Bot Project Structure Overview Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md This section outlines the directory and file organization of the Langbase AI Discord Bot project. It details the purpose of key files and directories, including GitHub Actions workflows, source code for commands, API interactions, Discord functions, and server logic, along with configuration files for Cloudflare Workers and Node.js. ```APIDOC ├── .github/workflows/ci.yaml -> Github Action configuration ├── src │ ├── commands.js -> JSON payloads for commands │ ├── langbase.ts -> Interactions with the Langbase API │ ├── discord.ts -> Discord fns and types │ ├── register.js -> Sets up commands with the Discord API │ ├── unregister.js -> Deletes commands with the Discord API │ ├── server.ts -> Discord bot logic and routing ├── wrangler.toml -> Configuration for Cloudflare workers ├── package.json ├── README.md ├── .eslintrc.json ├── .prettierignore ├── .prettierrc.json └── .gitignore ``` -------------------------------- ### Set secrets for Cloudflare Worker deployment Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md These commands use the `wrangler secret put` utility to securely store sensitive credentials as environment variables for a deployed Cloudflare Worker, ensuring they are not hardcoded. ```sh wrangler secret put DISCORD_TOKEN wrangler secret put DISCORD_PUBLIC_KEY wrangler secret put DISCORD_APPLICATION_ID wrangler secret put DISCORD_GUILD_ID wrangler secret put LANGBASE_PIPE_KEY ``` -------------------------------- ### Set Langbase Pipe API Key Environment Variable Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ask-docs-rag/README.md This snippet shows how to set the `LANGBASE_PIPE_API_KEY` environment variable. This key is essential for authenticating with the Langbase Pipe service and should be replaced with your actual API key. It's typically stored in a `.env.local` file for local development. ```sh LANGBASE_PIPE_API_KEY="YOUR_PIPE_API_KEY" ``` -------------------------------- ### Register Discord Bot Commands Globally Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md This command registers Discord application commands globally, making them available across all Discord servers. It requires the Discord bot token and application ID as environment variables. Global registration can take up to an hour to propagate and is generally not recommended for development purposes due to the propagation delay. ```sh DISCORD_TOKEN=**** DISCORD_APPLICATION_ID=**** node src/register.js global ``` -------------------------------- ### Register Discord Bot Commands for a Specific Guild Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-discord-bot/README.md This command registers Discord application commands for a specific guild (server), making them instantly available only within that server. It requires the Discord bot token, application ID, and the guild ID as environment variables. This method is highly recommended for development and for bots intended for a single server, as it provides immediate feedback. ```sh DISCORD_TOKEN=**** DISCORD_APPLICATION_ID=**** DISCORD_GUILD_ID=**** node src/register.js guild ``` -------------------------------- ### Run Documentation Sync Script Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/github-docs-sync-script/README.md Executes the `script.js` file using Node.js. This command initiates the process of syncing GitHub documentation files to Langbase memory, based on the `processAllFiles` configuration and other environment variables. ```bash node script.js ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/excel-master/README.md Instructions to set up the `NEXT_LB_PIPE_API_KEY` environment variable in a `.env.local` file. This key is essential for the application to connect to the Langbase AI Pipe and should be replaced with the actual API key copied from the Langbase API tab. ```plaintext # Replace `PIPE_API_KEY` with the copied API key. NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Composable Email Agent Project Directory Structure Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-node/readme.md This snippet outlines the typical directory structure of the `email-agent-node` project. It highlights key files such as `.env.example` for environment variables, `index.ts` as the main implementation file, and `package.json` for Node.js package configuration and dependencies. ```text email-agent-node/ ├── .env.example # Environment variables example ├── .gitignore # Git ignore ├── index.ts # Email agent implementation ├── package.json # Node.js package configuration and dependencies └── README.md # Project documentation ``` -------------------------------- ### Configure Langbase Pipe API Key Environment Variable Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-drug-assistant/README.md This snippet shows how to set up the `NEXT_LB_PIPE_API_KEY` environment variable in a `.env.local` file. This key is essential for authenticating with the Langbase Pipe API and should be replaced with the actual API key copied from the Langbase API tab. ```shell NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Environment Variable Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/pseudocode-generator/README.md This snippet demonstrates how to set the `NEXT_LB_PIPE_API_KEY` environment variable in a `.env.local` file. This key is essential for authenticating with the Langbase Pipe API and must be replaced with the actual API key obtained from the Langbase platform. ```text NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/career-prep-coach/README.md This snippet demonstrates how to set the Langbase Pipe API key within the `.env.local` file. This environment variable is essential for authenticating your application's requests to the Langbase AI Pipe, ensuring secure communication. ```plaintext NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ascii-software-architect/README.md This snippet demonstrates how to set the `NEXT_LB_PIPE_API_KEY` environment variable in a `.env.local` file for a Next.js project. This key is essential for authenticating requests to the Langbase Pipe API and should be replaced with the actual API key copied from the Langbase API tab. ```sh NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Keys Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/video-wisdom/README.md This configuration block defines environment variables for various Langbase Pipe API keys. These keys are essential for the VideoWisdom application to authenticate and interact with different AI functionalities provided by Langbase, such as summarization, Q&A, and fact extraction. Each variable corresponds to a specific forked Langbase Pipe. ```sh # Fork https://langbase.com/examples/youtube-video-summarizer # Replace `LB_SUMMARIZE_PIPE_KEY` with your API from the forked Pipe LB_SUMMARIZE_PIPE_KEY="" # Fork https://langbase.com/examples/you-tube-videos-qn-a # Replace `LB_GENERATE_PIPE_KEY` with your API from the forked Pipe LB_GENERATE_PIPE_KEY="" # Fork https://langbase.com/examples/youtube-video-main-ideas-extractor # Replace `LB_MAIN_IDEAS_PIPE_KEY` with your API from the forked Pipe LB_MAIN_IDEAS_PIPE_KEY="" # Fork https://langbase.com/examples/youtube-video-interesting-facts-extractor # Replace `LB_FACTS_PIPE_KEY` with your API from the forked Pipe LB_FACTS_PIPE_KEY="" # Fork https://langbase.com/examples/youtube-video-wow-moments # Replace `LB_WOW_PIPE_KEY` with your API from the forked Pipe LB_WOW_PIPE_KEY="" # Fork https://langbase.com/examples/youtube-video-tweets-extractor # Replace `LB_TWEETS_PIPE_KEY` with your API from the forked Pipe LB_TWEETS_PIPE_KEY="" # Fork https://langbase.com/examples/youtube-video-recommendations-extractor # Replace `LB_RECOMMENDATION_PIPE_KEY` with your API from the forked Pipe LB_RECOMMENDATION_PIPE_KEY="" # Fork https://langbase.com/examples/youtube-video-quotes-extractor # Replace `LB_QUOTES_PIPE_KEY` with your API from the forked Pipe LB_QUOTES_PIPE_KEY="" ``` -------------------------------- ### Configure Langbase Pipe API Key for Next.js Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/product-review-generator/README.md Sets up the Langbase Pipe API key as an environment variable in a Next.js project's `.env.local` file. This key is essential for authenticating requests to the Langbase AI Pipe and should be kept confidential, used only on the server-side. ```shell NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/api-sec-consultant/README.md This snippet shows how to set the `NEXT_LB_PIPE_API_KEY` environment variable, which is crucial for authenticating with the Langbase Pipe API. Ensure you replace `PIPE_API_KEY` with the actual key obtained from the Langbase API tab before running the application. ```bash # Replace `PIPE_API_KEY` with the copied API key. NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key in Next.js Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/dev-screener/README.md This snippet demonstrates how to set the `NEXT_LB_PIPE_API_KEY` environment variable within a `.env.local` file for a Next.js project. This key is essential for authenticating requests to the Langbase Pipe API and should be replaced with your actual API key obtained from the Langbase platform. ```shell NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-master-chef/README.md Sets the `NEXT_LB_PIPE_API_KEY` environment variable, which is crucial for the application to authenticate and interact with the Langbase AI Pipe. Users must replace the placeholder with their actual API key obtained from Langbase. ```dotenv NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase API Key Environment Variable Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/code-alchemist/README.md This snippet demonstrates how to set the `LANGBASE_API_KEY` environment variable. This key is essential for authenticating and accessing the Langbase API. Users must replace `USER_OR_ORG_API_KEY` with their actual API key obtained from their Langbase account. ```sh LANGBASE_API_KEY="USER_OR_ORG_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key in .env.local Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/cefr-level-assessment-bot/README.md This snippet demonstrates how to set the `NEXT_LB_PIPE_API_KEY` environment variable within the `.env.local` file. This variable is crucial for authenticating your application with the Langbase Pipe API. Users must replace the placeholder `PIPE_API_KEY` with their actual API key obtained from the Langbase platform. ```env # Replace `PIPE_API_KEY` with the copied API key. NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/js-tutor/README.md This snippet demonstrates how to set the Langbase Pipe API key as an environment variable. This key is essential for authenticating requests to the Langbase AI Pipe and should be stored securely, typically in a .env.local file for local development. ```Shell # Replace `PIPE_API_KEY` with the copied API key. NEXT_LB_PIPE_API_KEY="PIPE_API_KEY" ``` -------------------------------- ### Configure Langbase Pipe API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/text-summarizer/README.md Set the `NEXT_LB_PIPE_API_KEY` environment variable with your unique Langbase Pipe's API key. This key is essential for the application to authenticate and interact with the Langbase service. ```plaintext NEXT_LB_PIPE_API_KEY=YOUR_PIPE_API_KEY ``` -------------------------------- ### Create and Activate Python Virtual Environment Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-python/readme.md These commands create a new Python virtual environment named 'venv' in the current directory and then activate it, isolating project dependencies. ```sh python3 -m venv ./venv source ./venv/bin/activate ``` -------------------------------- ### Configure Script to Process All Files Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/github-docs-sync-script/README.md Sets the `processAllFiles` variable to `true` within the `script.js` file. This configuration instructs the script to upload all documentation files present in the GitHub repository to Langbase memory, rather than only files changed between specific commits. ```javascript const processAllFiles = true; ``` -------------------------------- ### Configure Langbase API Key Environment Variable Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-node/readme.md This snippet shows how to set the `LANGBASE_API_KEY` environment variable in the `.env` file. This key is essential for accessing Langbase services. Users should replace `USER_OR_ORG_API_KEY` with their actual API key obtained from Langbase. ```sh # Get your org or user API key that can be used to access everything with Langbase. # https://langbase.com/docs/api-reference/api-keys LANGBASE_API_KEY="USER_OR_ORG_API_KEY" ``` -------------------------------- ### Configure Langbase API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/email-agent-python/readme.md This snippet illustrates how to add your Langbase API key to the '.env' file. This key is essential for the agent to authenticate and interact with Langbase services. ```sh LANGBASE_API_KEY="USER_OR_ORG_API_KEY" ``` -------------------------------- ### Configure Langbase API Key Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/ai-email-agent/README.md This snippet shows how to set the LANGBASE_API_KEY environment variable within the '.env.local' file. This API key is essential for authenticating requests to Langbase services and accessing various functionalities. ```sh # Get your org or user API key that can be used to access everything with Langbase. # https://langbase.com/docs/api-reference/api-keys LANGBASE_API_KEY="USER_OR_ORG_API_KEY" ``` -------------------------------- ### Run Script to Update Langbase Memory with Changed Files Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/github-docs-sync-script/README.md After configuring the `script.js` file with the appropriate commit SHAs and setting `processAllFiles` to `false`, execute the script using Node.js. This command initiates the process of downloading and updating only the files that have changed between the specified commits in your Langbase memory. ```bash node script.js ``` -------------------------------- ### Configure JavaScript for Incremental Documentation Updates Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/github-docs-sync-script/README.md To enable the processing of only changed documentation files, set the `processAllFiles` variable to `false` in the `script.js` file. This ensures that the script compares commits and updates only the necessary files, optimizing the update process. ```javascript const processAllFiles = false; ``` -------------------------------- ### Execute Full RAG Workflow Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/rag-memory-agent/readme.md Triggers the complete Retrieval-Augmented Generation pipeline, processing a user query, retrieving context, and generating a response via the agent. ```bash npx tsx agent/rag.ts ``` -------------------------------- ### Configure Pipe API Key Environment Variable in Next.js Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/nextjs-basic/README.md Sets the `NEXT_LB_PIPE_API_KEY` environment variable, which is crucial for authenticating your Next.js application with the Pipe service. This variable should be stored in a `.env.local` file for local development. ```bash NEXT_LB_PIPE_API_KEY=YOUR_PIPE_API_KEY ``` -------------------------------- ### GeoCities Browser URL Handling and Navigation Logic Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/geosimcities/public/index.html JavaScript code responsible for the interactive functionality of the GeoCities browser. It initializes the address bar with a URL from query parameters or a default, loads content into an iframe, handles user input for navigation, and updates the browser's history and title based on the loaded iframe content. ```JavaScript const addressInput = document.getElementById('address-input'); const content = document.getElementById('content'); const url = new URL(window.location.href).searchParams.get('url'); addressInput.value = url ? decodeURIComponent(url) : 'https://mathias-biilmann.geocities.com'; if (url) { content.src = `/geocities?url=${url}`; } addressInput.addEventListener('keypress', function(e) { if (e.key === 'Enter') { const url = encodeURIComponent(this.value); content.src = `/geocities?url=${url}`; } }); content.addEventListener('load', function() { console.log("Hello") const iframeUrl = new URL(this.contentWindow.location.href); const originalUrl = decodeURIComponent(iframeUrl.searchParams.get('url')); document.title = this.contentDocument.title; addressInput.value = originalUrl; history.pushState({}, document.title, `/?url=${encodeURIComponent(originalUrl)}`); }); ``` -------------------------------- ### Create Langbase Memory Instance Source: https://github.com/langbaseinc/langbase-examples/blob/main/examples/rag-memory-agent/readme.md Executes a TypeScript script to initialize a new memory instance named "rag-knowledge-base" for storing documents. ```bash npx tsx agent/memory-create.ts ```