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

node-red-contrib-openai-wrapper

v1.1.2

Published

adds Node to call openai api via openai npm package

Downloads

20

Readme

Node-RED OpenAI API Wrapper

This Node-RED module extends the capabilities of Node-RED by adding nodes that facilitate interactions with the OpenAI API using the official OpenAI npm package. It allows you to seamlessly integrate OpenAI's GPT-3 models into your Node-RED flows.

Supported API Calls

1. chat.completions.create

This node allows you to create chat completions using OpenAI's chat models.

2. fineTuning.create

This node is used for fine-tuning tasks and expects the following optional parameters:

  • msg.payload.validationData: A string containing the content of the validation file.
  • msg.payload.model: Optional model configuration.
  • msg.payload.hyperparameters: Optional hyperparameter configuration.

3. fineTuning.list

This node lists fine-tuning jobs with no required parameters.

4. fineTuning.retrieve

This node retrieves fine-tuning job details based on the provided payload.id (fine-tuning job ID). You can also include an optional payload.query parameter to specify query details like after and limit.

5. fineTuning.cancel

This node cancels a fine-tuning job using the provided payload.id (fine-tuning job ID).

6. fineTuning.listEvents

This node lists events related to a fine-tuning job based on the provided payload.id (fine-tuning job ID). You can include an optional payload.query parameter to specify query details like after and limit.

7. files.validate

This node validates fine-tune data and attempts to predict the cost. It helps ensure your data is suitable for fine-tuning.

8. files.create

This node creates files for fine-tuning and expects the following input:

  • msg.payload.data: A string with training data in JSONL format or an array of JSON objects with a messages field containing training conversations.

For example:

[
  {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already."}]},
  {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?"}]},
  {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters."}]}
]

Additionally, you can set the following parameters:

  • msg.payload.name: File name.
  • msg.payload.purpose: File purpose.

9. files.list

This node lists files available for fine-tuning.

10. files.retrieve

This node retrieves file details based on the provided payload.id (file ID).

11. files.retrieveContents

This node retrieves the contents of a file based on the provided payload.id (file ID).

12. files.delete

This node deletes a file based on the provided payload.id (file ID).

Troubleshooting

If you encounter any issues or have questions, please visit the GitHub repository for support and reporting problems.

For more detailed information import the examples from the node


This README provides an overview of the Node-RED OpenAI API Wrapper and instructions for usage and troubleshooting. You can further customize it to include specific details or usage examples relevant to your project.