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

https://github.com/usedatabrew/open_ai_benthos_processor

Open AI processor for Benthos
https://github.com/usedatabrew/open_ai_benthos_processor

benthos benthos-plugin data-engineering data-ops etl etl-pipeline event-sourcing golang-library openai stream-processor streaming-data

Last synced: 19 days ago
JSON representation

Open AI processor for Benthos

Awesome Lists containing this project

README

          

# Open AI Processor for Benthos

Benthos processors are functions applied to messages passing through a pipeline. The function signature allows a processor to mutate or drop messages depending on the content of the message

Welcome to the Open AI Processor for Benthos! This processor allows you to enrich the context of your messages with requests to Open AI.

## Getting Started

To get started you have to run benthos with custom processor. Since this processor is not adopted by benthos itself
you have to create a new benthos build with plugin registered

```go
package main

import (
"context"
"github.com/benthosdev/benthos/v4/public/service"

_ "github.com/benthosdev/benthos/v4/public/components/all"
// import open_ai processor
_ "github.com/usedatabrew/open_ai_benthos_processor"
)

func main() {
// here we initialize benthos
service.RunCLI(context.Background())
}
```

### Create benthos configuration with processor

```yaml
pipeline:
label: open_ai_processor
processors:
- open_ai:
source_field: "comment"
target_field: "ai_processed_comment"
prompt: "Check the field for hateful speech"
api_key: ""
api_endpoint: "" ## Optional for azure driver
driver: "azure" ## azure or openai
model: "gpt-3.5-turbo-instruct"
```