session

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

type DBClient struct {
	DB *gorm.DB
}

func (*DBClient) Archive

func (dbClient *DBClient) Archive(ctx context.Context, req *pb.SessionArchiveRequest) (*pb.Session, error)

func (*DBClient) Create

func (dbClient *DBClient) Create(ctx context.Context, req *pb.SessionCreateRequest) (*pb.Session, error)

func (*DBClient) Delete

func (dbClient *DBClient) Delete(ctx context.Context, req *pb.SessionDeleteRequest) (*commonpb.VoidResponse, error)

func (*DBClient) Get

func (dbClient *DBClient) Get(ctx context.Context, req *pb.SessionGetRequest) (*pb.Session, error)

func (*DBClient) GetChatLogs

func (*DBClient) Paging

func (dbClient *DBClient) Paging(ctx context.Context, req *pb.SessionPagingRequest) (*pb.SessionPagingResponse, error)

func (*DBClient) Reset

func (dbClient *DBClient) Reset(ctx context.Context, req *pb.SessionResetRequest) (*pb.Session, error)

func (*DBClient) UnArchive

func (dbClient *DBClient) UnArchive(ctx context.Context, req *pb.SessionUnArchiveRequest) (*pb.Session, error)

func (*DBClient) Update

func (dbClient *DBClient) Update(ctx context.Context, req *pb.SessionUpdateRequest) (*pb.Session, error)

type Session

type Session struct {
	common.BaseModel

	ClientID string `gorm:"column:client_id;type:char(36)" json:"clientID" yaml:"clientID"`
	PromptID string `gorm:"column:prompt_id;type:char(36)" json:"promptID" yaml:"promptID"`
	ModelID  string `gorm:"column:model_id;type:char(36)" json:"modelID" yaml:"modelID"`
	UserID   string `gorm:"column:user_id;type:varchar(191)" json:"userID" yaml:"userID"`
	Scene    string `gorm:"column:scene;type:varchar(191)" json:"scene" yaml:"scene"`

	Name        string           `gorm:"column:name;type:varchar(191)" json:"name" yaml:"name"`
	Topic       string           `gorm:"column:topic;type:text" json:"topic" yaml:"topic"`
	NumOfCtxMsg int64            `gorm:"column:num_of_ctx_msg;type:int(11)" json:"numOfCtxMsg" yaml:"numOfCtxMsg"`
	IsArchived  bool             `gorm:"column:is_archived;type:tinyint(1)" json:"isArchived" yaml:"isArchived"`
	ResetAt     fields.DeletedAt `gorm:"column:reset_at;type:datetime" json:"resetAt" yaml:"resetAt"`
	Temperature float64          `gorm:"column:temperature;type:decimal(11,0)" json:"temperature" yaml:"temperature"`

	Metadata metadata.Metadata `gorm:"column:metadata;type:mediumtext" json:"metadata" yaml:"metadata"`
}

func (*Session) TableName

func (*Session) TableName() string

func (*Session) ToProtobuf

func (s *Session) ToProtobuf() *pb.Session

type Sessions

type Sessions []Session

func (Sessions) ToProtobuf

func (sessions Sessions) ToProtobuf() []*pb.Session

Jump to

Keyboard shortcuts

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