wrapper

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const OpenAiEndPoint = "https://api.openai.com/v1/chat/completions"

Variables

This section is empty.

Functions

This section is empty.

Types

type StatefulWrapper

type StatefulWrapper interface {
	GenerateId() uuid.UUID
	SecureCall(
		cxAuth string, metaData *message.MetaData, historyID uuid.UUID, newMessages []message.Message) ([]message.Message, error)
	SecureCallReturningFullResponse(
		cxAuth string, metaData *message.MetaData, historyID uuid.UUID, newMessages []message.Message) (*message.ChatResponse, error)
	Call(historyID uuid.UUID, newMessages []message.Message) ([]message.Message, error)
	SetupCall(setupMessages []message.Message)
	MaskSecrets(fileContent string) (*maskedSecret.MaskedEntry, error)
}

func NewStatefulWrapper

func NewStatefulWrapper(storageConnector connector.Connector, apiKey, model string, dropLen, limit int) StatefulWrapper

NewStatefulWrapper will be deprecated in the future

func NewStatefulWrapperNew

func NewStatefulWrapperNew(storageConnector connector.Connector, endpoint, apiKey, model string, dropLen, limit int) (StatefulWrapper, error)

type StatefulWrapperImpl

type StatefulWrapperImpl struct {
	StatelessWrapper
	// contains filtered or unexported fields
}

func (*StatefulWrapperImpl) Call

func (w *StatefulWrapperImpl) Call(historyID uuid.UUID, newMessages []message.Message) ([]message.Message, error)

func (*StatefulWrapperImpl) GenerateId

func (w *StatefulWrapperImpl) GenerateId() uuid.UUID

func (*StatefulWrapperImpl) MaskSecrets

func (w *StatefulWrapperImpl) MaskSecrets(fileContent string) (*maskedSecret.MaskedEntry, error)

func (*StatefulWrapperImpl) SecureCall

func (w *StatefulWrapperImpl) SecureCall(cxAuth string, metaData *message.MetaData, historyID uuid.UUID, newMessages []message.Message) ([]message.Message, error)

func (*StatefulWrapperImpl) SecureCallReturningFullResponse added in v1.0.3

func (w *StatefulWrapperImpl) SecureCallReturningFullResponse(
	cxAuth string, metaData *message.MetaData, historyID uuid.UUID, newMessages []message.Message) (*message.ChatResponse, error)

func (*StatefulWrapperImpl) SetupCall

func (w *StatefulWrapperImpl) SetupCall(setupMessages []message.Message)

type StatelessWrapper

type StatelessWrapper interface {
	SecureCall(
		cxAuth string, metaData *message.MetaData, history []message.Message, newMessages []message.Message) ([]message.Message, error)
	SecureCallReturningFullResponse(
		cxAuth string, metaData *message.MetaData, history []message.Message, newMessages []message.Message) (*message.ChatResponse, error)
	Call(history []message.Message, newMessages []message.Message) ([]message.Message, error)
	SetupCall(setupMessages []message.Message)
	MaskSecrets(fileContent string) (*maskedSecret.MaskedEntry, error)
}

func NewStatelessWrapper

func NewStatelessWrapper(endPoint, apiKey, model string, dropLen, limit int) (StatelessWrapper, error)

type StatelessWrapperImpl

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

func (*StatelessWrapperImpl) Call

func (w *StatelessWrapperImpl) Call(history []message.Message, newMessages []message.Message) ([]message.Message, error)

func (*StatelessWrapperImpl) MaskSecrets

func (w *StatelessWrapperImpl) MaskSecrets(fileContent string) (*maskedSecret.MaskedEntry, error)

func (*StatelessWrapperImpl) SecureCall

func (w *StatelessWrapperImpl) SecureCall(
	cxAuth string, metaData *message.MetaData, history []message.Message, newMessages []message.Message) ([]message.Message, error)

func (*StatelessWrapperImpl) SecureCallReturningFullResponse added in v1.0.3

func (w *StatelessWrapperImpl) SecureCallReturningFullResponse(
	cxAuth string, metaData *message.MetaData, history []message.Message, newMessages []message.Message) (*message.ChatResponse, error)

func (*StatelessWrapperImpl) SetupCall

func (w *StatelessWrapperImpl) SetupCall(setupMessages []message.Message)

Jump to

Keyboard shortcuts

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