Giter VIP home page Giter VIP logo

allanbunch / node-red-openai-api Goto Github PK

View Code? Open in Web Editor NEW
26.0 5.0 4.0 341 KB

Build low-code, advanced AI applications and workflows using **any** OpenAI API-compatible framework.

Home Page: https://www.npmjs.com/package/@inductiv/node-red-openai-api

License: MIT License

JavaScript 13.00% HTML 87.00%
ai artificial-intelligence javascript llm low-code node-red node-red-contrib nodejs ollama open-source openai openai-api slm

node-red-openai-api's Introduction

@inductiv/node-red-openai-api

NPM Version GitHub Release Date GitHub Issues or Pull Requests GitHub Repo stars

This library provides convenient access to the OpenAI Node API Library from Node-RED.

node-red-openai-api-node

Node-RED OpenAI API is a versatile and configurable Node-RED node designed for seamless integration with any OpenAI API compatible platform. This node empowers innovators and developers to effortlessly connect and orchestrate complex AI and IoT workflows, leveraging Node-RED's sophisticated ecosystem. Ideal for enhancing IoT operations with advanced AI capabilities, this node serves as your gateway to applying the latest AI technology in an IoT context, facilitating innovative applications across diverse environments.

Installation

Via Node-RED Palette Manager

@inductiv/node-red-openai-api

Via NPM

cd $HOME/.node-red # or the location of your Node-RED configuration directory.
npm i @inductiv/node-red-openai-api

Usage

After installation, find your node in the AI palette category labeled "OpenAI API". Here's how you can start integrating AI into your IoT projects:

  1. Configure the node with your AI platform's API key (if required).
  2. Send OpenAI documented API service configuration paramaters to the node using the default msg.payload property, or confiure your desired incoming object property reference on the node itself.
  3. Explore the examples directory for sample implementations.

Core Features

  • Seamless Integration: Connect directly with OpenAI API compatible services without the hassle of complex coding or setup. Ideal for rapid prototyping and deployment in IoT contexts.
  • Configurable and Flexible: Adapt to a wide range of project requirements, making it easy to integrate AI into your IoT solutions.
  • Powerful Combinations: Utilize Node-RED's diverse nodes to build complex, AI-driven IoT workflows with ease.

Release Notes (v1.4.0)

  • Upgraded to OpenAI Node API Library package dependency v4.47.1
    • Supporting OpenAI's new gpt-4o model capabilities
  • Updated the node's documentation panel
  • Code stability & formatting updates

What's New in Version 1.x

Version 1.0 of the node-red-openai-api node brings significant enhancements and new possibilities, including:

  • API Upgrade to OpenAI Assistants v2: Transition to the new Assistants v2 API version with extended features. This upgrade leverages the updated OpenAI NodeJS package, which supports newer models and capabilities, enhancing AIoT applications.
  • Response Object Parity: Updated response objects to closely align with the OpenAI documented response object structures, ensuring that your integration can seamlessly handle newer data formats.
  • New Functionalities: Addition of new capabilities such as Batch requests and Vector Store features to enhance your projects.
  • Updated Examples: Updated examples showcasing new API features and functionality.
  • Bug Fixes: Closed out a series of bugs improving overall usability and stability.

Important Notice Regarding Compatibility

  • Backward Incompatible Changes: Please be aware that v1.0 includes breaking changes that may affect existing implementations (v0.x.x instllations) due to the updated OpenAI NodeJS package:
    • The API call structure and parameters have been refined to align with the latest OpenAI specifications.
    • Some functions and settings from previous versions may no longer be compatible with this update.
    • List responses now exist at the top level of the msg.payload object; previously msg.payload.data.

I recommend reviewing current setups and testing them with this new version in a development environment before updating to ensure a smooth transition. This will help you take full advantage of the enhanced features while managing any necessary adjustments in your existing applications.

Contribute

I value community contributions that help enhance this Node-RED node and expand its capabilities in AIoT applications. Whether you're fixing bugs, adding new features, or improving documentation, your help is welcome!

How to Contribute

  1. Fork the Repository: Start by forking the repository to your GitHub account.
  2. Clone Your Fork: Clone your fork to your local machine for development.
  3. Create a Feature Branch: Create a branch in your forked repository where you can make your changes.
  4. Commit Your Changes: Make your changes in your feature branch and commit them with clear, descriptive messages.
  5. Push to Your Fork: Push your changes to your fork on GitHub.
  6. Submit a Pull Request: Go to the original repository and submit a pull request from your feature branch. Please provide a clear description of the changes and reference any related issues.

Guidelines

  • Ensure your code adheres to or enhances the project's style and quality standards.
  • Include unit tests for new features to confirm they work as expected.
  • Update documentation to reflect any changes or additions made.

Community and Support

Engage with the Node-RED OpenAI API community to share your experiences, get support, and discuss your ideas. Whether you're using the node or contributing to its development, we're here to help and look forward to your feedback and contributions.

  • Community Discussions: For any questions, help with setting up, or to connect with other users and contributors, please visit our Community Discussions.
  • Feedback and Issues: If you encounter any issues or have suggestions, please raise an issue directly on GitHub.
  • Contributing: Your contributions are invaluable to us. See the How to Contribute section for more details on how to get involved.

Thank you for being part of our innovative community!

License

This project is licensed under the MIT License.

Thank you for being part of the Node-RED community!

node-red-openai-api's People

Contributors

allanbunch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-red-openai-api's Issues

Custom Api Url?

Hi!

Would it be possible to provide custom API url when setting up the node?
This could potentially play along when running local llm models, such as text-generation-webui-docker or LM Studio.

Then tokens don't really matter.

Thanks :)

500 error when processing a specific jpeg file

I am having a weird error. Any ideas why? Both appear to be valid jpeg files renderable in the browser

I am using the Microsoft/Florence-2-large model with OpenedAI-vision

when I use this 1200px file I get a 500 error from the node

[{"role":"user","content":[{"type":"text","text":"<DETAILED_CAPTION>"},{"type":"image_url","image_url":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/ChrisLitherlandBourbonSt.jpg/1200px-ChrisLitherlandBourbonSt.jpg"}}]}]

7/1/2024, 4:10:54 PMnode: chat completion
msg : string[25]
"500 status code (no body)"

and when i use the 1280px file it works

[{"role":"user","content":[{"type":"text","text":"<DETAILED_CAPTION>"},{"type":"image_url","image_url":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/ChrisLitherlandBourbonSt.jpg/1280px-ChrisLitherlandBourbonSt.jpg"}}]}]

"In this image we can see buildings, street poles, street lights, name boards, motor vehicles on the road, persons standing on the floor and sky."

createSpeech returning erroneous content type

Discussed in #12

Originally posted by knuppe February 1, 2024
How does the createSpeech component work? I couldn't make it save an MP3 file; from what I've noticed, the output of the node is a string. When I try to save it as an MP3, the file becomes corrupted.

Custom property paths not honored.

The only property path being honored by the node is the base msg.payload property. Custom property paths, e.g. msg.assistant; msg.custom.props; flow.payload cause errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.