entity

package
v0.0.0-...-8ac6ef6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DatasetErrorType_MismatchSchema int64 = 1
	DatasetErrorType_InternalError  int64 = 100
)

Variables

This section is empty.

Functions

func CommonContentTypeDO2DTO

func CommonContentTypeDO2DTO(contentType ContentType) *common.ContentType

Types

type AnnotationEvent

type AnnotationEvent struct {
	Annotation *loop_span.Annotation `json:"annotation"`
	StartAt    int64                 `json:"start_at"` // ms
	EndAt      int64                 `json:"end_at"`   // ms
	Caller     string                `json:"caller"`
	RetryTimes int64                 `json:"retry_times"`
}

type Content

type Content struct {
	ContentType ContentType
	Text        string
	Image       *Image
	MultiPart   []*Content
}

func GetContentInfo

func GetContentInfo(ctx context.Context, contentType ContentType, value string) (*Content, int64)

func (*Content) GetContentType

func (c *Content) GetContentType() ContentType

GetContentType returns the content type of the content

func (*Content) GetImage

func (c *Content) GetImage() *Image

GetImage returns the image content

func (*Content) GetMultiPart

func (c *Content) GetMultiPart() []*Content

GetMultiPart returns the multi-part content

func (*Content) GetText

func (c *Content) GetText() string

GetText returns the text content

type ContentType

type ContentType string
const (
	/* 基础类型 */
	ContentType_Text  ContentType = "Text"
	ContentType_Image ContentType = "Image"
	ContentType_Audio ContentType = "Audio"
	// 图文混排
	ContentType_MultiPart ContentType = "MultiPart"
)

type Dataset

type Dataset struct {
	// 主键&外键
	ID          int64
	WorkspaceID int64
	// 基础信息
	Name        string
	Description string
	// 业务分类
	DatasetCategory DatasetCategory
	// 版本信息
	DatasetVersion DatasetVersion
	// 评测集属性
	EvaluationBizCategory *EvaluationBizCategory
}

func NewDataset

func NewDataset(id, spaceID int64, name string, category DatasetCategory, schema DatasetSchema) *Dataset

func (*Dataset) GetFieldSchemaKeyByName

func (d *Dataset) GetFieldSchemaKeyByName(fieldSchemaName string) string

type DatasetCategory

type DatasetCategory string
const (
	DatasetCategory_General    DatasetCategory = "general"
	DatasetCategory_Evaluation DatasetCategory = "evaluation"
)

type DatasetItem

type DatasetItem struct {
	ID          int64
	WorkspaceID int64
	DatasetID   int64
	TraceID     string
	SpanID      string
	ItemKey     *string
	FieldData   []*FieldData
	Error       []*ItemError
	SpanType    string
	SpanName    string
}

func NewDatasetItem

func NewDatasetItem(workspaceID int64, datasetID int64, span *loop_span.Span) *DatasetItem

func (*DatasetItem) AddError

func (e *DatasetItem) AddError(message string, errorType int64, fieldNames []string)

func (*DatasetItem) AddFieldData

func (e *DatasetItem) AddFieldData(key string, name string, content *Content)

type DatasetSchema

type DatasetSchema struct {
	// 主键&外键
	ID          int64
	WorkspaceID int64
	DatasetID   int64
	// 数据集字段约束
	FieldSchemas []FieldSchema
}

type DatasetVersion

type DatasetVersion struct {
	// 主键&外键
	ID          int64
	WorkspaceID int64
	DatasetID   int64
	// 版本信息
	Version string
	// 版本描述
	Description string
	// schema
	DatasetSchema DatasetSchema
}

type EvaluationBizCategory

type EvaluationBizCategory string

type FieldData

type FieldData struct {
	Key     string // 评测集的唯一键
	Name    string // 用于展现的列名
	Content *Content
}

type FieldDisplayFormat

type FieldDisplayFormat int64
const (
	FieldDisplayFormat_PlainText FieldDisplayFormat = 1
	FieldDisplayFormat_Markdown  FieldDisplayFormat = 2
	FieldDisplayFormat_JSON      FieldDisplayFormat = 3
	FieldDisplayFormat_YAML      FieldDisplayFormat = 4
	FieldDisplayFormat_Code      FieldDisplayFormat = 5
)

type FieldMapping

type FieldMapping struct {
	// 数据集字段约束
	FieldSchema        FieldSchema
	TraceFieldKey      string
	TraceFieldJsonpath string
}

type FieldSchema

type FieldSchema struct {
	// 唯一键
	Key *string
	// 展示名称
	Name string
	// 描述
	Description string
	// 类型,如 文本,图片,etc.
	ContentType ContentType
	// [20,50) 内容格式限制相关
	TextSchema    string
	DisplayFormat FieldDisplayFormat
}

type Image

type Image struct {
	Name string
	Url  string
}

func (*Image) GetName

func (i *Image) GetName() string

GetName returns the name of the image

func (*Image) GetUrl

func (i *Image) GetUrl() string

GetUrl returns the URL of the image

type ItemError

type ItemError struct {
	Message    string
	Type       int64
	FieldNames []string
}

type ItemErrorDetail

type ItemErrorDetail struct {
	Message string
	// 单条错误数据在输入数据中的索引。从 0 开始,下同
	Index *int32
	// [startIndex, endIndex] 表示区间错误范围, 如 ExceedDatasetCapacity 错误时
	StartIndex *int32
	EndIndex   *int32
}

type ItemErrorGroup

type ItemErrorGroup struct {
	Type    int64
	Summary string
	// 错误条数
	ErrorCount int32
	// 批量写入时,每类错误至多提供 5 个错误详情;导入任务,至多提供 10 个错误详情
	Details []*ItemErrorDetail
}

type ObservabilityView

type ObservabilityView struct {
	ID           int64
	EnterpriseID string
	WorkspaceID  int64
	ViewName     string
	PlatformType string
	SpanListType string
	Filters      string
	CreatedAt    time.Time
	CreatedBy    string
	UpdatedAt    time.Time
	UpdatedBy    string
}

type TenantInfo

type TenantInfo struct {
	TTL              loop_span.TTL  `json:"ttl"`
	WorkspaceId      string         `json:"space_id"`
	CozeAccountID    string         `json:"coze_account_id"`
	WhichIsEnough    int            `json:"which_is_enough"`
	VolcanoAccountID int64          `json:"volcano_account_id"`
	Extra            map[string]any `json:"extra,omitempty"`
}

type TraceData

type TraceData struct {
	Tenant     string             `json:"tenant"`
	TenantInfo TenantInfo         `json:"tenant_info"`
	SpanList   loop_span.SpanList `json:"span_list"`
}

Directories

Path Synopsis
component/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
consumer/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
exporter/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
processor/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
receiver/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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