An open API service indexing awesome lists of open source software.

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

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:

![openai_sample](https://github.com/user-attachments/assets/1b557501-47e7-40fe-8152-65ea5e74694d)

### The Result

openai_sample_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.

OpenAIAuthorize

### OpenAIGenerate Component:

Creates text completions using an OpenAI model, with adjustable parameters.

OpenAIGenerate

### OpenAIChat Component:

Conducts conversations with OpenAI models, maintaining conversation history.

OpenAIChat

### 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
```