ctxhelper

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuditID

func GetAuditID(ctx context.Context) (string, bool)

func GetClient

func GetClient(ctx context.Context) (*clientpb.Client, bool)

func GetClientToken

func GetClientToken(ctx context.Context) (*clienttokenpb.ClientToken, bool)

func GetConfig

func GetConfig(ctx context.Context) (*config.Config, bool)

func GetIsStream

func GetIsStream(ctx context.Context) bool

func GetLLMDirectorActualResponseBuffer

func GetLLMDirectorActualResponseBuffer(ctx context.Context) *bytes.Buffer

func GetLogger

func GetLogger(ctx context.Context) logs.Logger

func GetMessageGroup

func GetMessageGroup(ctx context.Context) (*message.Group, bool)

func GetModel

func GetModel(ctx context.Context) (*modelpb.Model, bool)

func GetModelProvider

func GetModelProvider(ctx context.Context) (*modelproviderpb.ModelProvider, bool)

func GetSession

func GetSession(ctx context.Context) (*sessionpb.Session, bool)

func GetUserPrompt

func GetUserPrompt(ctx context.Context) (string, bool)

func MustGetDBClient

func MustGetDBClient(ctx context.Context) dao.DAO

func MustGetModel

func MustGetModel(ctx context.Context) *modelpb.Model

func MustGetModelProvider

func MustGetModelProvider(ctx context.Context) *modelproviderpb.ModelProvider

func PutAudioInfo

func PutAudioInfo(ctx context.Context, info AudioInfo)

func PutAuditID

func PutAuditID(ctx context.Context, auditID string)

func PutImageInfo

func PutImageInfo(ctx context.Context, info ImageInfo)

func PutIsStream

func PutIsStream(ctx context.Context, isStream bool)

func PutMessageGroup

func PutMessageGroup(ctx context.Context, mg message.Group)

func PutUserPrompt

func PutUserPrompt(ctx context.Context, prompt string)

Types

type AudioInfo

type AudioInfo struct {
	FileName    string               `json:"fileName"`
	FileSize    bytesize.ByteSize    `json:"fileSize"`
	FileHeaders textproto.MIMEHeader `json:"fileHeaders"`
}

func GetAudioInfo

func GetAudioInfo(ctx context.Context) (*AudioInfo, bool)

type CtxKeyOfConfig

type CtxKeyOfConfig struct{ CtxKeyOfConfig any }

type ImageInfo

type ImageInfo struct {
	ImageQuality string `json:"imageQuality"`
	ImageSize    string `json:"imageSize"`
	ImageStyle   string `json:"imageStyle"`
}

func GetImageInfo

func GetImageInfo(ctx context.Context) (*ImageInfo, bool)

Jump to

Keyboard shortcuts

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