Skip to content

OpenAI pipeline library for the Flowpipe cloud scripting engine. Automation and workflows to connect OpenAI to the people, systems and data that matters.

License

Notifications You must be signed in to change notification settings

turbot/flowpipe-mod-openai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

OpenAI Mod for Flowpipe

OpenAI pipeline library for Flowpipe, enabling seamless integration of OpenAI services into your workflows.

Documentation

Getting Started

Installation

Download and install Flowpipe (https://flowpipe.io/downloads). Or use Brew:

brew tap turbot/tap
brew install flowpipe

Connections

By default, the following environment variables will be used for authentication:

  • OPENAI_API_KEY

You can also create connection resources in configuration files:

vi ~/.flowpipe/config/openai.fpc
connection "openai" "default" {
  api_key = "sk-..."
}

For more information on connections in Flowpipe, please see Managing Connections.

Usage

Initialize a mod:

mkdir my_mod
cd my_mod
flowpipe mod init

Install the OpenAI mod as a dependency:

flowpipe mod install github.com/turbot/flowpipe-mod-openai

Use the dependency in a pipeline step:

vi my_pipeline.fp
pipeline "my_pipeline" {

  step "pipeline" "create_chat_completion" {
    pipeline = openai.pipeline.create_chat_completion
    args = {
      system_content = "You are a helpful assistant."
      user_content   = "Hello."
    }
  }
}

Run the pipeline:

flowpipe pipeline run my_pipeline

Developing

Clone:

git clone https://github.com/turbot/flowpipe-mod-openai.git
cd flowpipe-mod-openai

List pipelines:

flowpipe pipeline list

Run a pipeline:

flowpipe pipeline run create_chat_completion  --arg 'system_content=You are a helpful assistant.' --arg 'user_content=Hello!' --arg 'model=gpt-3.5-turbo' --arg 'max_tokens=50' --arg 'temperature=1'

To use a specific connection, specify the conn pipeline argument:

flowpipe pipeline run create_chat_completion  --arg 'system_content=You are a helpful assistant.' --arg 'user_content=Hello!' --arg 'model=gpt-3.5-turbo' --arg 'max_tokens=50' --arg 'temperature=1' --arg 'conn=connection.openai.my_conn'

Open Source & Contributing

This repository is published under the Apache 2.0 license. Please see our code of conduct. We look forward to collaborating with you!

Flowpipe is a product produced from this open source software, exclusively by Turbot HQ, Inc. It is distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our Open Source FAQ.

Get Involved

Join #flowpipe on Slack →

Want to help but not sure where to start? Pick up one of the help wanted issues: