adds Node to call openai api via openai npm package
npm install node-red-contrib-openai-wrapperThis 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.
This node allows you to create chat completions using OpenAI's chat models.
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.
This node lists fine-tuning jobs with no required parameters.
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.
This node cancels a fine-tuning job using the provided payload.id (fine-tuning job ID).
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.
This node validates fine-tune data and attempts to predict the cost. It helps ensure your data is suitable for fine-tuning.
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:
``json`
[
{"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."}]}
]msg.payload.name: File name.
Additionally, you can set the following parameters:
- msg.payload.purpose: File purpose.
-
This node lists files available for fine-tuning.
This node retrieves file details based on the provided payload.id (file ID).
This node retrieves the contents of a file based on the provided payload.id (file ID).
This node deletes a file based on the provided payload.id` (file ID).
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.