openai

package
v0.0.0-...-b6dede2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelGPT4 = "gpt-4"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAI

type OpenAI struct {
	common.GenerativeAiIntegrationCommon
	APIKey  string `json:"api_key" validate:"required" required:"true"`
	ModelID string `json:"model_id" validate:"required,oneof=gpt-4" required:"true" enum:"gpt-4"`
}

func NewFromDBEntry

func NewFromDBEntry(ctx context.Context, config json.RawMessage) (*OpenAI, error)

func (*OpenAI) DecryptSecret

func (o *OpenAI) DecryptSecret(aes encryption.AES) error

func (*OpenAI) EncryptSecret

func (o *OpenAI) EncryptSecret(aes encryption.AES) error

func (*OpenAI) Message

func (o *OpenAI) Message(ctx context.Context, message string, dataChan chan string) error

func (*OpenAI) ValidateConfig

func (o *OpenAI) ValidateConfig(validate *validator.Validate) error

func (*OpenAI) VerifyAuth

func (o *OpenAI) VerifyAuth(ctx context.Context) error

Jump to

Keyboard shortcuts

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