openai

package
v1.16.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiKey         string `json:"api_key" yaml:"api_key"`
	SourceField    string `json:"source_field" yaml:"source_field"`
	TargetField    string `json:"target_field" yaml:"target_field"`
	Model          string `json:"model" yaml:"model"`
	Prompt         string `json:"prompt" yaml:"prompt"`
	StreamName     string `json:"stream_name" yaml:"stream_name"`
	LimitPerMinute int64  `json:"limit_per_minute" yaml:"limit_per_minute"`
}

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func NewOpenAIPlugin

func NewOpenAIPlugin(appctx *stream_context.Context, config Config) (*Plugin, error)

func (*Plugin) EvolveSchema

func (p *Plugin) EvolveSchema(streamSchema *schema.StreamSchemaObj) error

EvolveSchema will add a string column to the schema in order to store OpenAI response

func (*Plugin) Process

func (p *Plugin) Process(context context.Context, msg *message.Message) (*message.Message, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL