Socket
Book a DemoInstallSign in
Socket

embed-text-chunk

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embed-text-chunk

A simple example showing how to embed a chunk using Mastra and OpenAI.

alpha
latest
npmnpm
Version
0.0.1-alpha.0
Version published
Maintainers
0
Created
Source

Embed text chunk

A simple example showing how to embed a chunk using Mastra and OpenAI.

Prerequisites

  • Node.js v20.0+
  • pnpm (recommended) or npm
  • OpenAI API key

Getting Started

  • Clone the repository and navigate to the project directory:

    git clone https://github.com/mastra-ai/mastra
    cd examples/basics/rag/embed-text-chunk
    
  • Copy the environment variables file and add your OpenAI API key:

    cp .env.example .env
    

    Then edit .env and add your OpenAI API key:

    OPENAI_API_KEY=sk-your-api-key-here
    
  • Install dependencies:

    pnpm install
    
  • Run the example:

    pnpm start
    

FAQs

Package last updated on 03 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts