audit

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audit

type Audit struct {
	common.BaseModel
	RequestAt  time.Time `gorm:"column:request_at;type:datetime" json:"requestAt" yaml:"requestAt"`
	ResponseAt time.Time `gorm:"column:response_at;type:datetime" json:"responseAt" yaml:"responseAt"`

	AuthKey            string `gorm:"column:auth_key;type:varchar(191)" json:"authKey" yaml:"authKey"`
	Status             int32  `gorm:"column:status;type:int(11)" json:"status" yaml:"status"`
	Prompt             string `gorm:"column:prompt;type:mediumtext" json:"prompt" yaml:"prompt"`
	Completion         string `gorm:"column:completion;type:longtext" json:"completion" yaml:"completion"`
	RequestBody        string `gorm:"column:request_body;type:longtext" json:"requestBody" yaml:"requestBody"`
	ResponseBody       string `gorm:"column:response_body;type:longtext" json:"responseBody" yaml:"responseBody"`
	ActualRequestBody  string `gorm:"column:actual_request_body;type:longtext" json:"actualRequestBody" yaml:"actualRequestBody"`
	ActualResponseBody string `gorm:"column:actual_response_body;type:longtext" json:"actualResponseBody" yaml:"actualResponseBody"`
	UserAgent          string `gorm:"column:user_agent;type:text" json:"userAgent" yaml:"userAgent"`
	XRequestID         string `gorm:"column:x_request_id;type:varchar(64)" json:"xRequestID" yaml:"xRequestID"`

	ClientID  string `gorm:"column:client_id;type:char(36)" json:"clientID" yaml:"clientID"`
	ModelID   string `gorm:"column:model_id;type:char(36)" json:"modelID" yaml:"modelID"`
	SessionID string `gorm:"column:session_id;type:char(36)" json:"sessionID" yaml:"sessionID"`

	Username string `gorm:"column:username;type:varchar(128)" json:"username" yaml:"username"`
	Email    string `gorm:"column:email;type:varchar(64)" json:"email" yaml:"email"`

	BizSource   string `gorm:"column:source;type:varchar(128)" json:"bizSource" yaml:"bizSource"`
	OperationID string `gorm:"column:operation_id;type:varchar(128)" json:"operationID" yaml:"operationID"`

	ResponseFunctionCallName string `gorm:"column:res_func_call_name;type:varchar(128)" json:"responseFunctionCallName" yaml:"responseFunctionCallName"`

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

func (*Audit) TableName

func (*Audit) TableName() string

func (*Audit) ToChatLogProtobuf

func (audit *Audit) ToChatLogProtobuf() *sessionpb.ChatLog

func (*Audit) ToProtobuf

func (audit *Audit) ToProtobuf() *auditpb.Audit

type Audits

type Audits []*Audit

func (*Audits) ToChatLogsProtobuf

func (audits *Audits) ToChatLogsProtobuf() []*sessionpb.ChatLog

func (Audits) ToProtobuf

func (audits Audits) ToProtobuf() []*auditpb.Audit

type DBClient

type DBClient struct {
	DB *gorm.DB
}

func (*DBClient) CreateWhenReceived

func (dbClient *DBClient) CreateWhenReceived(ctx context.Context, req *pb.AuditCreateRequestWhenReceived) (*pb.Audit, error)

func (*DBClient) Get

func (dbClient *DBClient) Get(ctx context.Context, req *pb.AuditGetRequest) (*pb.Audit, error)

func (*DBClient) Paging

func (dbClient *DBClient) Paging(ctx context.Context, req *pb.AuditPagingRequest) (*pb.AuditPagingResponse, error)

func (*DBClient) SetFilterErrorAudit

func (dbClient *DBClient) SetFilterErrorAudit(ctx context.Context, req *pb.AuditUpdateRequestWhenFilterError) (*pb.Audit, error)

func (*DBClient) UpdateAfterBasicContextParsed

func (dbClient *DBClient) UpdateAfterBasicContextParsed(ctx context.Context, req *pb.AuditUpdateRequestAfterBasicContextParsed) (*pb.Audit, error)

func (*DBClient) UpdateAfterLLMDirectorInvoke

func (dbClient *DBClient) UpdateAfterLLMDirectorInvoke(ctx context.Context, req *pb.AuditUpdateRequestAfterLLMDirectorInvoke) (*pb.Audit, error)

func (*DBClient) UpdateAfterLLMDirectorResponse

func (dbClient *DBClient) UpdateAfterLLMDirectorResponse(ctx context.Context, req *pb.AuditUpdateRequestAfterLLMDirectorResponse) (*pb.Audit, error)

func (*DBClient) UpdateAfterLLMResponse

func (dbClient *DBClient) UpdateAfterLLMResponse(ctx context.Context, req *pb.AuditUpdateRequestAfterLLMResponse) (*pb.Audit, error)

func (*DBClient) UpdateAfterSpecificContextParsed

func (dbClient *DBClient) UpdateAfterSpecificContextParsed(ctx context.Context, req *pb.AuditUpdateRequestAfterSpecificContextParsed) (*pb.Audit, error)

Jump to

Keyboard shortcuts

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