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 🙏

© 2026 – Pkg Stats / Ryan Hefner

godly-ai

v1.1.15

Published

Personlize your OpenAI completions with custom context.

Readme

GodlyAI

Extend your OpenAI GPT3 completions with custom context to personalize youre responses. Godly.ai

Installation

$ npm install godly-ai

Usage

You need an OpenAI api key which you can generate on the OpenAI Website.

You also need a Godly API key which you can generate on the Godly Dashboard

Create a Project to get started via the Godly Website

Adding Context To a Project

ContextItems are snippets of text with relevant information that may be useful to prompts related to a query.

You can add contextItems via the website, or using the SDK. To use the SDK just call the createContextItem function and pass through the PROJECT_ID you want to add context to. You can find the PROJECT_ID via the Godly Dashboard.

const configuration = new Configuration({
  accessToken: process.env.GODLY_API_KEY,
});
const godlyApi = new GodlyApi(configuration);

// Add some information as conext to the project
await godlyApi.createContextItem(PROJECT_ID, {
  value: 'Some information',
});

Congratulations, you've just uploaded your first piece of context. You're ready to start getting personalized completions.

Using Context with OpenAI Completions

When you send a prompt to OpenAI via Godly it will append the most relevant pieces of Context to your query allowing GPT-3 to better understand the intent of your query and give you more accurate completions.

const { Configuration, GodlyApi } = require('godly-ai');

const configuration = new Configuration({
  accessToken: process.env.GODLY_API_KEY,
});
const godlyApi = new GodlyApi(configuration);

const completion = await godlyApi.completionWithContext(PROJECT_ID, {
  model: 'text-davinci-003',
  prompt: 'Hello world',
});
console.log(completion.data.choices[0].text);

You can manage projects and context items via the Godly API or sdk. Check out the full API documentation for examples of all the available actions.

Error handling

API requests can potentially return errors due to invalid inputs or other issues. These errors can be handled with a try...catch statement, and the error details can be found in either error.response or error.message:

try {
  const completion = await godlyApi.createCompletionWithContext(CONTEXT_ID, {
    model: 'text-davinci-003',
    prompt: 'Hello world',
  });
  console.log(completion.data.choices[0].text);
} catch (error) {
  if (error.response) {
    console.log(error.response.status);
    console.log(error.response.data);
  } else {
    console.log(error.message);
  }
}