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

@godspeedsystems/plugins-chatgpt-as-datasource

v1.0.1

Published

chatgpt as datasource plugin for Godspeed Framework

Readme

godspeed-custom-datasource-chatgpt

Welcome to the Godspeed ChatGPT Custom Data Source!

Easily integrate OpenAI's ChatGPT within your Godspeed project for dynamic, conversational AI responses.

This custom data source allows you to send prompts directly to ChatGPT and retrieve intelligent, human-like responses in your application, enhancing interactivity and user engagement.

Features

  • Quick Integration: Get ChatGPT up and running in your Godspeed project with minimal setup.
  • Configurable Responses: Customize responses by setting parameters like model type, temperature, and maximum tokens.
  • Reliable API Management: Enjoy dependable API interactions with built-in error handling.
  • Scalable Integration: Designed to seamlessly scale with your application as your need for AI-driven interactions grows.

Ideal for applications that need conversational support, content generation, or interactive user experiences powered by AI. Enhance your application’s intelligence today!

How to Use

  1. Set Up Your Godspeed Project:

    • Clone the Project: Clone your existing Godspeed project or repository where you want to add ChatGPT integration.
      git clone <your-repo-url>
      cd <project-directory>
    • Install Dependencies: Once inside the project directory, install the necessary dependencies.
      npm install
    • Set Up Environment Variables: Add your OpenAI API key to the environment variables by including the following in your .env file:
      OPENAI_API_KEY="Enter_Your_OpenAI_API_Key"
  2. Add ChatGPT Custom Data Source Configuration:

    • Inside the src/datasources/ directory, add a chatgpt.yaml file with the following configuration:
    type: chatgpt
    model: gpt-4o
    temperature: 1
    max_tokens: 200

Example Usage:

ChatGPT Event Schema (src/events/chatgpt_event.yaml)

http.post./chatgpt:
  summary: "Generate response from ChatGPT"
  description: "Endpoint to send a user prompt to ChatGPT and retrieve the AI-generated response."
  fn: prompt
  authn: false
  body:
    content:
      application/json:
        schema:
          type: object
          properties:
            prompt:
              type: string
              description: "The user's prompt or question for ChatGPT to respond to."
          required:
            - prompt
  responses:
    200:
      description: "Successful response from ChatGPT"
      content:
        application/json:
          schema:
            type: string

ChatGPT TypeScript Workflow (src/functions/prompt.ts)

import { GSContext, GSDataSource, GSStatus } from "@godspeedsystems/core";
export default async function (ctx: GSContext, args: any) {
    // Destructuring the `body` object from the context inputs
    const { inputs: {data: { body } }, }= ctx;
    const prompt = body.prompt;    
    // In Godspeed, the GSContext object ctx provides all the necessary data for the function, including inputs, datasources, and configurations.
    // ctx.datasources contains all the configured datasources.
    const ds: GSDataSource = ctx.datasources.chatgpt;
    
   // The code calls ds.execute, passing the ctx and an argument object.
   // The args object passed to execute has two parts:
   // prompt: The input text for the ChatGPT model, extracted from body.
   // meta: An object with a fnNameInWorkflow property set to 'datasource.chatgpt.chat'. 
   // This property likely tells the Godspeed framework which function within the chatgpt datasource to execute (chat in this case).
    const response = await ds.execute(ctx, {
        prompt,
        meta: {method: 'chat'}
    });
    return response;
}

ChatGPT YAML Workflow (src/functions/prompt.yaml)

summary: "Get AI-driven response from ChatGPT with configurations from YAML file"
tasks:
  - id: request_chatgpt
    fn: datasource.chatgpt.chat
    args:
      prompt: <% inputs.body.prompt %>

This ChatGPT custom data source is here to power your project with cutting-edge conversational AI. Enjoy the possibilities of OpenAI with the flexibility of Godspeed!