npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@e-llm-studio/data-engine

v1.3.0

Published

data operations library for e-llm-studio

Downloads

319

Readme

eLLM Studio Data Operations Package

Welcome to the eLLM Studio Data Operations package! 🎉 This package enables streaming chat functionality with your AI assistant in eLLM Studio via WebSocket and GraphQL. It's designed for both frontend and backend implementations.

🚀 Features

  • Data Ingestion: Ingest text data.

📦 Installation

npm i @e-llm-studio/data-engine

🛠️ Data Ingestion

Here’s how you can use the startChatStream function to set up the AI chat stream:

import { ContentManager } from "@e-llm-studio/data-engine";

// Example usage:

const baseUrl = "https://dev-egpt.techo.camp";
const chatbotId = "3e94587c-733d-4e92-8d98-d5150c63b8cd";
const chatbotName = "Assistant1";
const organizationName = "techolution";
const username = "your-username";
const password = "your-password";
const contentManager = new ContentManager(
  baseUrl,
  chatbotId,
  chatbotName,
  organizationName,
  username,
  password
);

// Save text content example
contentManager
  .saveTextContent("Title1", "Text Content")
  .then((saveResponse) => {
    console.log("Save Response:", saveResponse);
  })
  .catch((error) => {
    console.error("Save Error:", error);
  });

// Delete text content example
contentManager
  .deleteTextContent(["671a391fbcce6ddc80e86099"])
  .then((deleteResponse) => {
    console.log("Delete Response:", deleteResponse);
  })
  .catch((error) => {
    console.error("Delete Error:", error);
  });
  // Get Context Id
contentManager
  .getContextId("6d25ddb4-e375-4adf-a98d-4d14114c2840")
  .then((contextResponse) => {
    console.log("Context Response:", contextResponse);
  })
  .catch((error) => {
    console.error("Context Error:", error);
  });

  // Seamantic Search api
  contentManager
  .getSemanticSearch(
    "model-name",      // AI Model to use for semantic search
    "search query",    // The query string for searching
    "request123",      // Unique request ID for tracking
    "user456",         // User ID performing the search
    0,                 // Offset for pagination
    10                 // Limit for pagination
  )
  .then((searchResponse) => {
    console.log("Search Response:", searchResponse);
  })
  .catch((error) => {
    console.error("Search Error:", error);
  });

📝 API Documentation saveTextContent(title: string, textContent: string): Promise Saves the provided text content under the specified title.

Parameters: title (string): The title of the text content. textContent (string): The content text to be saved.

deleteTextContent(contextInfoIds: string[]): Promise Deletes the specified content using the provided array of contextInfoIds.

Parameters: contextInfoIds (string[]): An array of IDs representing the content items to delete. deleteContextId(fileId: string): Promise Deletes a specific content item by its fileId.

Parameters: fileId (string): The ID of the content item to delete from the chatbot’s context. 🔐 Authentication The package requires user authentication. The ContentManager class will automatically log in using the provided credentials and manage access tokens internally.

Semantic Search The getSemanticSearch method performs a semantic search based on a provided query and model, returning results from the chatbot’s knowledge base.

Parameters:

aiModel (string): The name of the AI model to use for the search. searchQuery (string): The search query string. requestId (string): A unique identifier for tracking the search request. userId (string): The ID of the user initiating the search. offset (number): The number of results to skip (for pagination). limit (number): The maximum number of results to return. Returns: A promise that resolves with search results matching the query or an error message if the search fails.

👥 Community & Support

For any questions or issues, feel free to reach out via our GitHub repository or join our community chat! We’re here to help. 😊