Skip to content

XpressAI/xai-openai

Repository files navigation

Component LibrariesProject Templates
DocsInstallTutorialsDeveloper GuidesContributeBlogDiscord

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

The Example:

openai_sample

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.

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.

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. You can then install the OpenAI library using the component 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  

About

OpenAI components for Xircuits

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages