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

@renaiss-ai/renforce-js

v0.0.1-alpha.20

Published

## Installation

Downloads

1,292

Readme

Renforce JS

Installation

npm install @renaiss-ai/renforce-js

Example

Orchestator

import { AIOrchestrator, Model } from '@renaiss-ai/renforce-js'

async function run (): Promise<void> {
  const aiOrchestrator = new AIOrchestrator({
    credentials: {
      apiToken: process.env.RENFORCE_API_KEY!,
      spaceId: process.env.RENFORCE_SPACE_ID!
    }
    model: Model.GEMINI, // gemini-1.5-flash-002
    system_prompt: 'You are a helpful assistant.',
    output_prompt: 'Provide a concise response.',
    temperature: 0.3,
    max_output_tokens: 550,
    min_output_tokens: 1
  })

  const { status, result } = await aiOrchestrator.run({
    query: 'Hi, how are you?',
    /**
     * You can override the default parameters here
    model: Model.GEMINI, // gemini-1.5-flash-002
    system_prompt: 'You are a helpful assistant.',
    output_prompt: 'Provide a concise response.',
    temperature: 0.3,
    max_output_tokens: 550,
    min_output_tokens: 1
     */
  })

  console.log(`Status: ${status}, Model Answer: ${result.model_answer}`)
}

void run()

Pods

Simple

import { AIOrchestrator, Model } from '@renaiss-ai/renforce-js'

async function run (): Promise<void> {
  const pod = new Pod({ podId: process.env.POD_ID! })

  const { result, logEntry } = await pod.run({
    query: 'Hi, how are you?'
  })

  console.log(`Model Answer: ${result} Usage: ${JSON.stringify(logEntry)}`)
}

void run()

Transcribe this audio

import { AIOrchestrator, Model } from '@renaiss-ai/renforce-js'
import fs from 'fs'

const filePath = process.env.AUDIO_FILE_PATH

if (filePath == null) {
  console.error('Please set the AUDIO_FILE_PATH environment variable')
  process.exit(1)
}

const file = fs.readFileSync(filePath)
const blob = new Blob([file], { type: 'audio/mp3' })

async function run (): Promise<void> {
  const podId = process.env.POD_ID != null ? process.env.POD_ID : 'YOUR_POD_ID'
  const pod = new Pod({ podId })

  const { result, logEntry } = await pod.run({
    query: 'transcribe este audio',
    data: {
      index: false
    },
    attachments: [
      {
        data: blob,
        filename: 'sample.mp3'
      }
    ]
  })

  console.log(`Model Answer: ${result} Usage: ${JSON.stringify(logEntry)}`)
}

void run()

If the environment variable RENFORCE_API_KEY is not set, you must specify the API key in the apiToken field. If the environment variable RENFORCE_SPACE_ID is not set, you must specify the space ID in the spaceId field.