https://github.com/XpressAI/xai-openai
OpenAI components for Xircuits
https://github.com/XpressAI/xai-openai
Last synced: 7 months ago
JSON representation
OpenAI components for Xircuits
- Host: GitHub
- URL: https://github.com/XpressAI/xai-openai
- Owner: XpressAI
- License: mit
- Created: 2023-04-14T03:54:54.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-27T15:51:51.000Z (over 1 year ago)
- Last Synced: 2024-12-27T16:32:53.274Z (over 1 year ago)
- Language: Python
- Size: 50.8 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Component Libraries •
Project Templates
Docs •
Install •
Tutorials •
Developer Guides •
Contribute •
Blog •
Discord
Xircuits Library for OpenAI: Seamlessly integrate AI to build and deploy intelligent solutions effortlessly.
---
### Xircuits Component Library for OpenAI
This library connects OpenAI's models with Xircuits, making it easy to use features like text generation, image creation, and AI conversations.
## Table of Contents
- [Preview](#preview)
- [Prerequisites](#prerequisites)
- [Main Xircuits Components](#main-xircuits-components)
- [Try the Examples](#try-the-examples)
- [Installation](#installation)
## Preview
### The Example:

### The Result

## Prerequisites
Before you begin, you will need the following:
1. Python3.9+.
2. Xircuits.
## Main Xircuits Components
### OpenAIAuthorize Component:
Sets the API key and organization for OpenAI, enabling access to its models.

### OpenAIGenerate Component:
Creates text completions using an OpenAI model, with adjustable parameters.

### OpenAIChat Component:
Conducts conversations with OpenAI models, maintaining conversation history.

### OpenAIGetModels Component:
Fetches a list of available OpenAI models for use in workflows.
### OpenAIGetModel Component:
Retrieves detailed information about a specific OpenAI model.
### OpenAIEdit Component:
Edits input text based on specific instructions provided.
### OpenAIImageCreate Component:
Generates images from text prompts using OpenAI's image models. Supports both DALL-E 2 and DALL-E 3.
### OpenAIImageCreateVariation Component:
Creates alternate versions of an input image using OpenAI's variation tools.
### OpenAIImageEdit Component:
Modifies an input image based on a text prompt or a mask.
### OpenAIImageInference Component:
Analyzes images using OpenAI's vision capabilities, providing text descriptions or answers to questions about images.
### OpenAIAudioTranscription Component:
Transcribes audio files to text using OpenAI's Whisper models.
### OpenAIAudioTranslation Component:
Translates audio in any language to English text using OpenAI's Whisper models.
### OpenAISpeechGeneration Component:
Converts text to spoken audio using OpenAI's text-to-speech models.
## Try the Examples
We have provided an example workflow to help you get started with the OpenAI component library. Give it a try and see how you can create custom OpenAI components for your applications.
### OpenAI Sample
This example authorizes OpenAI access using an API key and retrieves the list of available models. The models are then printed to the console.
## Installation
To use this component library, ensure that you have an existing [Xircuits setup](https://xircuits.io/docs/main/Installation). You can then install the OpenAI library using the [component library interface](https://xircuits.io/docs/component-library/installation#installation-using-the-xircuits-library-interface), or through the CLI using:
```
xircuits install openai
```
You can also do it manually by cloning and installing it:
```
# base Xircuits directory
git clone https://github.com/XpressAI/xai-openai xai_components/xai_openai
pip install -r xai_components/xai_openai/requirements.txt
```