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-azure-openai

v1.0.1

Published

utilize Azure OpenAI

Downloads

35

Readme

Node-RED Azure OpenAI Node

This Node-RED node allows you to interact with Azure OpenAI to generate completions based on provided prompts and system prompts. It sends a prompt to the Azure OpenAI service and forwards the completions to the flow. This README provides instructions on how to install, configure, and use this node in your Node-RED project.

Table of Contents


Installation

Before using this node, ensure you have Node-RED installed. If you haven't already, you can download and install Node-RED by following the instructions on the official website.

To install this node in your Node-RED environment, you can use the following methods:

Option 1: Node-RED Palette Manager

  1. Open your Node-RED dashboard.
  2. Click the menu icon in the top-right corner.
  3. Select "Manage palette."
  4. Go to the "Install" tab.
  5. Search for "node-red-contrib-azure-openai" and click "Install."

Option 2: Command Line

You can also install this node using the Node-RED command-line tool:

npm install node-red-contrib-azure-openai

After installation, restart Node-RED to make the node available in your palette.


Configuration

Before you can use the Azure OpenAI node, you need to configure it with your Azure OpenAI service credentials. Follow these steps to set up the configuration:

  1. Drag and drop the "Azure OpenAI" node onto your Node-RED flow.

  2. Double-click the node to open its configuration dialog.

  3. Click the "Edit" button next to the "Azure OpenAI Config" field to configure your Azure OpenAI service credentials. You will need the following information:

    • Endpoint: The URL endpoint of your Azure OpenAI service.

    • API Key: Your Azure OpenAI API key.

    • Model: Select the model you want to use for generating completions. You can choose from:

      • GPT-3.5-Turbo
      • Text-DaVinci-003
  4. Once you've entered your credentials and selected a model, click the "Add" button to save them.

  5. Click "Done" to close the configuration dialog.


Usage

Now that you have configured the Azure OpenAI node, you can use it in your Node-RED flows to generate completions based on prompts and system prompts. Here's how to use the node:

  1. Add the "Azure OpenAI" node to your flow as mentioned in the Configuration section.

  2. Connect the input of the "Azure OpenAI" node to a source of data that provides the prompts and system prompts. You can use other nodes or inject messages into this input.

  3. Configure the "Azure OpenAI" node by setting the following properties in the configuration dialog:

    • Prompt: A static prompt that will be used unless overridden by the incoming msg.payload.prompt.

    • System Prompt: A static system prompt that will be used unless overridden by the incoming msg.payload.systemprompt.

  4. Deploy your flow.

  5. When a message containing msg.payload.prompt and/or msg.payload.systemprompt is sent to the "Azure OpenAI" node, it will generate completions and forward them in the output message.

  6. Use the output of the "Azure OpenAI" node in your flow as needed, or pass it to other nodes for further processing.

  7. Ensure that you handle the responses from Azure OpenAI appropriately based on your use case.


Node Properties

The "Azure OpenAI" node has the following properties that you can configure:

  • Name: The name of the node (optional).
  • Azure OpenAI Config: The configuration for your Azure OpenAI service, including the endpoint, API key, and selected model.
  • Prompt: A static prompt that will be used unless overridden by msg.payload.prompt.
  • System Prompt: A static system prompt that will be used unless overridden by msg.payload.systemprompt.

Contributing

Contributions to this project are welcome! If you encounter any issues, have suggestions for improvements, or would like to contribute code, please visit the GitHub repository for this project and open an issue or pull request.


License

This project is licensed under the MIT License. Feel free to use and modify this code as needed in your projects.