UNPKG

taskforce-aiagent

Version:

TaskForce is a modular, open-source, production-ready TypeScript agent framework for orchestrating AI agents, LLM-powered autonomous agents, task pipelines, dynamic toolchains, RAG workflows and memory/retrieval systems.

21 lines (20 loc) 788 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OpenAIEmbeddingProvider = void 0; const openai_1 = __importDefault(require("openai")); const dotenv_1 = __importDefault(require("dotenv")); dotenv_1.default.config(); const openai = new openai_1.default({ apiKey: process.env.OPENAI_API_KEY }); class OpenAIEmbeddingProvider { async getEmbedding(text) { const res = await openai.embeddings.create({ model: process.env.DEFAULT_OPENAI_EMBEDING_MODEL, input: text, }); return res.data[0].embedding; } } exports.OpenAIEmbeddingProvider = OpenAIEmbeddingProvider;