entity

package
v0.0.0-...-02ecf0d Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnalysisTypeInsight    = "insight"
	AnalysisTypeTrajectory = "trajectory"
)
View Source
const (
	OrderByCreatedAt = "created_at"
	OrderByUpdatedAt = "updated_at"
)
View Source
const (
	TagContentTypeCategorical      = "categorical"
	TagContentTypeBoolean          = "boolean"
	TagContentTypeContinuousNumber = "continuous_number"
	TagContentTypeFreeText         = "free_text"

	TagContentTextMaxLength = 1024
)
View Source
const (
	TagStatusActive     = "active"
	TagStatusInactive   = "inactive"
	TagStatusDeprecated = "deprecated"
)
View Source
const (
	AggrResultFieldKey_TargetLatency      string = "_target_latency"
	AggrResultFieldKey_TargetInputTokens  string = "_target_input_tokens"
	AggrResultFieldKey_TargetOutputTokens string = "_target_output_tokens"
	AggrResultFieldKey_TargetTotalTokens  string = "_target_total_tokens"
)
View Source
const (
	RegionBOE  = "boe"
	RegionCN   = "cn"
	RegionI18N = "i18n"
)
View Source
const (
	AccessProtocolRPC         = "rpc"
	AccessProtocolRPCOld      = "rpc_old"
	AccessProtocolFaasHTTP    = "faas_http"
	AccessProtocolFaasHTTPOld = "faas_http_old"
)
View Source
const (
	HTTPMethodGet  = "get"
	HTTPMethodPost = "post"
)
View Source
const (
	VolcengineAgentProtocolMCP   = "mcp"
	VolcengineAgentProtocolA2A   = "a2a"
	VolcengineAgentProtocolOther = "other"
)
View Source
const (
	BizCategoryFromOnlineTrace = "from_online_trace"
)
View Source
const (
	EvaluatorAccessProtocolRPC = "rpc"
)
View Source
const (
	InsightAnalysisRunningTimeout = 2 * time.Hour
)

Variables

View Source
var EvaluatorTypeSet = map[EvaluatorType]struct{}{
	EvaluatorTypePrompt:    {},
	EvaluatorTypeCode:      {},
	EvaluatorTypeCustomRPC: {},
}
View Source
var LanguageTypeSet = map[LanguageType]struct{}{
	LanguageTypePython: {},
	LanguageTypeJS:     {},
}
View Source
var OrderBySet = map[string]struct{}{
	OrderByCreatedAt: {},
	OrderByUpdatedAt: {},
}

Functions

func IntersectInt64String

func IntersectInt64String(a []int64, b []string) []int64

IntersectInt64String 返回两个集合的交集(int64和string)

func IsExptFinished

func IsExptFinished(status ExptStatus) bool

func IsExptFinishing

func IsExptFinishing(status ExptStatus) bool

func IsItemRunFinished

func IsItemRunFinished(state ItemRunState) bool

func IsTurnRunFinished

func IsTurnRunFinished(state TurnRunState) bool

Types

type AccessProtocol

type AccessProtocol = string

type AgentTrajectoryAnalysisResult

type AgentTrajectoryAnalysisResult struct {
	StepID  string                     `json:"step_id,omitempty"`
	Status  InsightAnalysisStatus      `json:"status,omitempty"`
	Summary string                     `json:"summary,omitempty"`
	Issues  []*TrajectoryAnalysisIssue `json:"issues,omitempty"`
}

type AggrCalculateEvent

type AggrCalculateEvent struct {
	ExperimentID int64
	SpaceID      int64

	CalculateMode     CalculateMode
	SpecificFieldInfo *SpecificFieldInfo
}

func (*AggrCalculateEvent) GetFieldKey

func (e *AggrCalculateEvent) GetFieldKey() string

func (*AggrCalculateEvent) GetFieldType

func (e *AggrCalculateEvent) GetFieldType() FieldType

type AggrResultDataType

type AggrResultDataType int
const (
	Double              AggrResultDataType = 0 // 默认,有小数的浮点数值类型
	ScoreDistribution   AggrResultDataType = 1 // 得分分布
	OptionDistribution  AggrResultDataType = 2 // 选项分布
	BooleanDistribution AggrResultDataType = 3 // 布尔分布
)

type AggregateData

type AggregateData struct {
	DataType            AggrResultDataType
	Value               *float64
	ScoreDistribution   *ScoreDistributionData
	OptionDistribution  *OptionDistributionData
	BooleanDistribution *BooleanDistributionData
}

type AggregateResult

type AggregateResult struct {
	AggregatorResults []*AggregatorResult
}

expt_aggr_result 表 aggr_result 字段blob结构

type AggregatedEvaluatorTag

type AggregatedEvaluatorTag struct {
	TagKey   string
	TagValue string
}

AggregatedEvaluatorTag 聚合后的标签键值

type AggregatorResult

type AggregatorResult struct {
	AggregatorType AggregatorType
	Data           *AggregateData
}

AggregatorResult 一种聚合器类型的聚合结果

func (AggregatorResult) GetScore

func (a AggregatorResult) GetScore() float64

type AggregatorType

type AggregatorType int

AggregatorType 聚合器类型

const (
	Average      AggregatorType = 1
	Sum          AggregatorType = 2
	Max          AggregatorType = 3
	Min          AggregatorType = 4
	Distribution AggregatorType = 5 // 得分的分布情况
)

type AnalysisEvent

type AnalysisEvent struct {
	RecordID int64 `json:"record_id"`
}

type AnalysisRecord

type AnalysisRecord struct {
	ID          int64                 `json:"id"`
	WorkspaceID int64                 `json:"workspace_id"`
	Type        AnalysisType          `json:"type,omitempty"`
	Status      InsightAnalysisStatus `json:"status,omitempty"`

	// type=trajectory的metaInfo、result填充在此
	TrajectoryMetaInfo       *TrajectoryMetaInfo       `json:"trajectory_meta_info,omitempty"`
	TrajectoryAnalysisResult *TrajectoryAnalysisResult `json:"result,omitempty"`
	BaseInfo                 *common.BaseInfo          `json:"base_info,omitempty"`
}

type AnalysisRecordRef

type AnalysisRecordRef struct {
	ID                         int64            `json:"id"`
	WorkspaceID                int64            `json:"workspace_id"`
	UniqueKey                  string           `json:"unique_key"`
	TrajectoryAnalysisRecordID int64            `json:"trajectory_analysis_record_id"`
	BaseInfo                   *common.BaseInfo `json:"base_info,omitempty"`
}

type AnalysisType

type AnalysisType = string

type AnnotateData

type AnnotateData struct {
	Score          *float64
	TextValue      *string
	BoolValue      *string // 标签基座boolean标签以选项形式实现
	Option         *string
	TagContentType TagContentType
}

type AnnotateRecord

type AnnotateRecord struct {
	ID           int64
	SpaceID      int64
	TagKeyID     int64
	ExperimentID int64
	AnnotateData *AnnotateData
	BaseInfo     *BaseInfo
	TagValueID   int64
}

type AnnotationAggregateResult

type AnnotationAggregateResult struct {
	TagKeyID          int64
	AggregatorResults []*AggregatorResult
	Name              *string
}

人工标注项粒度聚合结果

type ArgsSchema

type ArgsSchema struct {
	Key                 *string       `json:"key,omitempty"`
	SupportContentTypes []ContentType `json:"support_content_types,omitempty"`
	JsonSchema          *string       `json:"json_schema,omitempty"`
	DefaultValue        *Content      `json:"default_value,omitempty"`
}

ArgsSchema 参数模式结构体

type Audio

type Audio struct {
	Format *string `json:"format,omitempty"`
	URL    *string `json:"url,omitempty"`
}

type BaseInfo

type BaseInfo struct {
	CreatedBy *UserInfo `json:"created_by,omitempty"`
	UpdatedBy *UserInfo `json:"updated_by,omitempty"`
	CreatedAt *int64    `json:"created_at,omitempty"`
	UpdatedAt *int64    `json:"updated_at,omitempty"`
	DeletedAt *int64    `json:"deleted_at,omitempty"`
}

BaseInfo 基础信息结构体

func (*BaseInfo) GetCreatedBy

func (do *BaseInfo) GetCreatedBy() *UserInfo

func (*BaseInfo) GetUpdatedBy

func (do *BaseInfo) GetUpdatedBy() *UserInfo

func (*BaseInfo) SetCreatedBy

func (do *BaseInfo) SetCreatedBy(createdBy *UserInfo)

func (*BaseInfo) SetUpdatedAt

func (do *BaseInfo) SetUpdatedAt(updatedAt *int64)

func (*BaseInfo) SetUpdatedBy

func (do *BaseInfo) SetUpdatedBy(updatedBy *UserInfo)

type BatchCreateEvaluationSetItemsParam

type BatchCreateEvaluationSetItemsParam struct {
	SpaceID         int64
	EvaluationSetID int64
	Items           []*EvaluationSetItem
	// items 中存在无效数据时,默认不会写入任何数据;设置 skipInvalidItems=true 会跳过无效数据,写入有效数据
	SkipInvalidItems *bool
	// 批量写入 items 如果超出数据集容量限制,默认不会写入任何数据;设置 partialAdd=true 会写入不超出容量限制的前 N 条
	AllowPartialAdd *bool
}

type BatchGetEvalTargetBySourceParam

type BatchGetEvalTargetBySourceParam struct {
	SpaceID        int64
	SourceTargetID []string
	TargetType     EvalTargetType
}

type BatchGetEvaluationSetItemsParam

type BatchGetEvaluationSetItemsParam struct {
	SpaceID         int64
	EvaluationSetID int64
	ItemIDs         []int64
	VersionID       *int64
	PageNumber      *int32
	PageSize        *int32
	PageToken       *string
	OrderBys        []*OrderBy
}

type BatchGetEvaluationSetVersionsResult

type BatchGetEvaluationSetVersionsResult struct {
	Version       *EvaluationSetVersion
	EvaluationSet *EvaluationSet
}

type BatchUpdateEvaluationSetItemsParam

type BatchUpdateEvaluationSetItemsParam struct {
	SpaceID         int64
	EvaluationSetID int64
	Items           []*EvaluationSetItem
	// items 中存在无效数据时,默认不会写入任何数据;设置 skipInvalidItems=true 会跳过无效数据,写入有效数据
	SkipInvalidItems *bool
}

type BizCategory

type BizCategory = string

type BmqProducerCfg

type BmqProducerCfg struct {
	Topic   string `json:"topic"`
	Cluster string `json:"cluster"`
}

type BooleanDistributionData

type BooleanDistributionData struct {
	TrueCount      int64
	FalseCount     int64
	TruePercentage float64
}

type CKDBConfig

type CKDBConfig struct {
	ExptTurnResultFilterDBName string `json:"expt_turn_result_filter_db_name" mapstructure:"expt_turn_result_filter_db_name"`
	DatasetItemsSnapshotDBName string `json:"dataset_items_snapshot_db_name" mapstructure:"dataset_items_snapshot_db_name"`
}

type CSVExportStatus

type CSVExportStatus int32
const (
	CSVExportStatus_Unknown CSVExportStatus = 0

	CSVExportStatus_Running CSVExportStatus = 1
	CSVExportStatus_Success CSVExportStatus = 2
	CSVExportStatus_Failed  CSVExportStatus = 3
)

type CalculateMode

type CalculateMode int
const (
	CreateAllFields        CalculateMode = 1
	UpdateSpecificField    CalculateMode = 2
	CreateAnnotationFields CalculateMode = 3
	UpdateAnnotationFields CalculateMode = 4
)

type CodeEvaluatorContent

type CodeEvaluatorContent struct {
	Lang2CodeContent map[LanguageType]string `json:"lang_2_code_content"`
}

type CodeEvaluatorVersion

type CodeEvaluatorVersion struct {
	ID            int64         `json:"id"`
	SpaceID       int64         `json:"space_id"`
	EvaluatorType EvaluatorType `json:"evaluator_type"`
	EvaluatorID   int64         `json:"evaluator_id"`
	Description   string        `json:"description"`
	Version       string        `json:"version"`
	BaseInfo      *BaseInfo     `json:"base_info"`

	// Code评估器特有字段
	CodeTemplateKey  *string      `json:"code_template_key"`
	CodeTemplateName *string      `json:"code_template_name"`
	CodeContent      string       `json:"code_content"`
	LanguageType     LanguageType `json:"language_type"`
}

CodeEvaluatorVersion Code评估器版本实体

func (*CodeEvaluatorVersion) GetBaseInfo

func (do *CodeEvaluatorVersion) GetBaseInfo() *BaseInfo

func (*CodeEvaluatorVersion) GetCodeContent

func (do *CodeEvaluatorVersion) GetCodeContent() string

func (*CodeEvaluatorVersion) GetCodeTemplateKey

func (do *CodeEvaluatorVersion) GetCodeTemplateKey() *string

func (*CodeEvaluatorVersion) GetCodeTemplateName

func (do *CodeEvaluatorVersion) GetCodeTemplateName() *string

func (*CodeEvaluatorVersion) GetDescription

func (do *CodeEvaluatorVersion) GetDescription() string

func (*CodeEvaluatorVersion) GetEvaluatorID

func (do *CodeEvaluatorVersion) GetEvaluatorID() int64

func (*CodeEvaluatorVersion) GetID

func (do *CodeEvaluatorVersion) GetID() int64

func (*CodeEvaluatorVersion) GetLanguageType

func (do *CodeEvaluatorVersion) GetLanguageType() LanguageType

func (*CodeEvaluatorVersion) GetSpaceID

func (do *CodeEvaluatorVersion) GetSpaceID() int64

func (*CodeEvaluatorVersion) GetVersion

func (do *CodeEvaluatorVersion) GetVersion() string

func (*CodeEvaluatorVersion) SetBaseInfo

func (do *CodeEvaluatorVersion) SetBaseInfo(baseInfo *BaseInfo)

func (*CodeEvaluatorVersion) SetCodeContent

func (do *CodeEvaluatorVersion) SetCodeContent(content string)

func (*CodeEvaluatorVersion) SetCodeTemplateKey

func (do *CodeEvaluatorVersion) SetCodeTemplateKey(key *string)

func (*CodeEvaluatorVersion) SetCodeTemplateName

func (do *CodeEvaluatorVersion) SetCodeTemplateName(name *string)

func (*CodeEvaluatorVersion) SetDescription

func (do *CodeEvaluatorVersion) SetDescription(description string)

func (*CodeEvaluatorVersion) SetEvaluatorID

func (do *CodeEvaluatorVersion) SetEvaluatorID(evaluatorID int64)

func (*CodeEvaluatorVersion) SetID

func (do *CodeEvaluatorVersion) SetID(id int64)

func (*CodeEvaluatorVersion) SetLanguageType

func (do *CodeEvaluatorVersion) SetLanguageType(languageType LanguageType)

func (*CodeEvaluatorVersion) SetSpaceID

func (do *CodeEvaluatorVersion) SetSpaceID(spaceID int64)

func (*CodeEvaluatorVersion) SetVersion

func (do *CodeEvaluatorVersion) SetVersion(version string)

func (*CodeEvaluatorVersion) ValidateBaseInfo

func (do *CodeEvaluatorVersion) ValidateBaseInfo() error

ValidateBaseInfo 校验评估器基本信息(支持大小写不敏感)

func (*CodeEvaluatorVersion) ValidateInput

func (do *CodeEvaluatorVersion) ValidateInput(input *EvaluatorInputData) error

ValidateInput 验证输入数据

type ColumnAnnotation

type ColumnAnnotation struct {
	TagKeyID       int64
	TagName        string
	Description    string
	TagValues      []*TagValue
	TagContentType TagContentType
	TagContentSpec *TagContentSpec
	TagStatus      TagStatus
}

type ColumnEvalSetField

type ColumnEvalSetField struct {
	Key         *string
	Name        *string
	Description *string
	ContentType ContentType
	TextSchema  *string
	SchemaKey   *SchemaKey
}

type ColumnEvalTarget

type ColumnEvalTarget struct {
	Name        string
	Desc        string
	Label       *string
	DisplayName string
}

type ColumnEvaluator

type ColumnEvaluator struct {
	EvaluatorVersionID int64
	EvaluatorID        int64
	EvaluatorType      EvaluatorType
	Name               *string
	Version            *string
	Description        *string
	Builtin            *bool
}

type CompleteExptOption

type CompleteExptOption struct {
	Status             ExptStatus
	StatusMessage      string
	CID                string
	CompleteInterval   time.Duration
	NoAggrCalculate    bool
	NoCompleteItemTurn bool
}

type CompleteExptOptionFn

type CompleteExptOptionFn func(*CompleteExptOption)

func NoAggrCalculate

func NoAggrCalculate() CompleteExptOptionFn

func NoCompleteItemTurn

func NoCompleteItemTurn() CompleteExptOptionFn

func WithCID

func WithCID(cid string) CompleteExptOptionFn

func WithCompleteInterval

func WithCompleteInterval(interval time.Duration) CompleteExptOptionFn

func WithStatus

func WithStatus(status ExptStatus) CompleteExptOptionFn

func WithStatusMessage

func WithStatusMessage(msg string) CompleteExptOptionFn

type ConflictField

type ConflictField struct {
	FieldName string
	Detail    map[string]*FieldSchema
}

type Connector

type Connector struct {
	TargetConf     *TargetConf
	EvaluatorsConf *EvaluatorsConf
}

type Content

type Content struct {
	ContentType      *ContentType        `json:"content_type,omitempty"`
	Format           *FieldDisplayFormat `json:"format,omitempty"` // 假设 datasetv2.FieldDisplayFormat 为 interface{}
	Text             *string             `json:"text,omitempty"`
	Image            *Image              `json:"image,omitempty"`
	MultiPart        []*Content          `json:"multi_part,omitempty"`
	Audio            *Audio              `json:"audio,omitempty"`
	ContentOmitted   *bool               `json:"content_omitted,omitempty"`
	FullContent      *ObjectStorage      `json:"full_content,omitempty"`       // 被省略数据的完整信息,批量返回时会签发相应的 url,用户可以点击下载. 同时支持通过该字段传入已经上传好的超长数据(dataOmitted 为 true 时生效)
	FullContentBytes *int32              `json:"full_content_bytes,omitempty"` // 超长数据完整内容的大小,单位 byte
}

Content 内容结构体

func (*Content) GetContentType

func (c *Content) GetContentType() ContentType

GetContentType 获取内容类型

func (*Content) GetText

func (c *Content) GetText() string

GetText 获取内容文本

func (*Content) IsContentOmitted

func (c *Content) IsContentOmitted() bool

func (*Content) SetContentType

func (c *Content) SetContentType(contentType ContentType)

SetContentType 设置内容类型

func (*Content) SetText

func (c *Content) SetText(text string)

SetText 设置内容文本

func (*Content) TextBytes

func (c *Content) TextBytes() int

type ContentType

type ContentType string

ContentType 定义内容类型

const (
	ContentTypeText  ContentType = "Text"
	ContentTypeImage ContentType = "Image"
	ContentTypeAudio ContentType = "Audio"

	ContentTypeMultipart         ContentType = "MultiPart"
	ContentTypeMultipartVariable ContentType = "multi_part_variable"
)

type ContinuousNumberSpec

type ContinuousNumberSpec struct {
	MinValue            *float64
	MinValueDescription *string
	MaxValue            *float64
	MaxValueDescription *string
}

type Correction

type Correction struct {
	Score     *float64 `json:"score,omitempty"`
	Explain   string   `json:"explain,omitempty"`
	UpdatedBy string   `json:"updated_by,omitempty"`
}

type CozeBot

type CozeBot struct {
	BotID          int64
	BotVersion     string
	BotInfoType    CozeBotInfoType
	PublishVersion *string

	BotName     string    `json:"-"`
	AvatarURL   string    `json:"-"`
	Description string    `json:"-"`
	BaseInfo    *BaseInfo `json:"-"`
}

type CozeBotInfoType

type CozeBotInfoType int64
const (
	// 草稿 bot
	CozeBotInfoTypeDraftBot CozeBotInfoType = 1
	// 商店 bot
	CozeBotInfoTypeProductBot CozeBotInfoType = 2
)

type CozeWorkflow

type CozeWorkflow struct {
	ID      string
	Version string
	EndType int32 // 结束节点的类型,1:返回文本

	Name        string    `json:"-"`
	AvatarURL   string    `json:"-"`
	Description string    `json:"-"`
	BaseInfo    *BaseInfo `json:"-"`
}

type CreateEvalTargetParam

type CreateEvalTargetParam struct {
	SourceTargetID      *string
	SourceTargetVersion *string
	EvalTargetType      *EvalTargetType
	BotInfoType         *CozeBotInfoType
	BotPublishVersion   *string
	CustomEvalTarget    *CustomEvalTarget // 搜索对象返回的信息
	Region              *Region
	Env                 *string
}

func (*CreateEvalTargetParam) IsNull

func (c *CreateEvalTargetParam) IsNull() bool

type CreateEvaluationSetParam

type CreateEvaluationSetParam struct {
	SpaceID             int64
	Name                string
	Description         *string
	EvaluationSetSchema *EvaluationSetSchema
	BizCategory         *BizCategory
	Session             *Session
}

type CreateEvaluationSetVersionParam

type CreateEvaluationSetVersionParam struct {
	SpaceID         int64
	EvaluationSetID int64
	Version         string
	Description     *string
}

type CreateEvaluationSetWithImportParam

type CreateEvaluationSetWithImportParam struct {
	SpaceID             int64
	Name                string
	Description         *string
	EvaluationSetSchema *EvaluationSetSchema
	BizCategory         *BizCategory
	SourceType          *SetSourceType
	Source              *DatasetIOEndpoint
	FieldMappings       []*FieldMapping
	Session             *Session
}

type CreateEvaluatorTemplateRequest

type CreateEvaluatorTemplateRequest struct {
	SpaceID            int64                                                 `json:"space_id" validate:"required,gt=0"`      // 空间ID
	Name               string                                                `json:"name" validate:"required,min=1,max=100"` // 模板名称
	Description        string                                                `json:"description" validate:"max=500"`         // 模板描述
	EvaluatorType      EvaluatorType                                         `json:"evaluator_type" validate:"required"`     // 评估器类型
	EvaluatorInfo      *EvaluatorInfo                                        `json:"evaluator_info,omitempty"`               // 评估器补充信息
	InputSchemas       []*ArgsSchema                                         `json:"input_schemas,omitempty"`                // 输入模式
	OutputSchemas      []*ArgsSchema                                         `json:"output_schemas,omitempty"`               // 输出模式
	ReceiveChatHistory *bool                                                 `json:"receive_chat_history,omitempty"`         // 是否接收聊天历史
	Tags               map[EvaluatorTagLangType]map[EvaluatorTagKey][]string `json:"tags,omitempty"`                         // 标签

	// 评估器内容
	PromptEvaluatorContent *PromptEvaluatorContent `json:"prompt_evaluator_content,omitempty"` // Prompt评估器内容
	CodeEvaluatorContent   *CodeEvaluatorContent   `json:"code_evaluator_content,omitempty"`   // Code评估器内容
}

CreateEvaluatorTemplateRequest 创建评估器模板请求

type CreateEvaluatorTemplateResponse

type CreateEvaluatorTemplateResponse struct {
	Template *EvaluatorTemplate `json:"template"` // 创建的模板
}

CreateEvaluatorTemplateResponse 创建评估器模板响应

type CreateExptParam

type CreateExptParam struct {
	WorkspaceID         int64   `thrift:"workspace_id,1,required" frugal:"1,required,i64" json:"workspace_id" form:"workspace_id,required" `
	EvalSetVersionID    int64   `thrift:"eval_set_version_id,2,optional" frugal:"2,optional,i64" json:"eval_set_version_id" form:"eval_set_version_id" `
	TargetVersionID     int64   `thrift:"target_version_id,3,optional" frugal:"3,optional,i64" json:"target_version_id" form:"target_version_id" `
	EvaluatorVersionIds []int64 `` /* 130-byte string literal not displayed */
	Name                string  `thrift:"name,5,optional" frugal:"5,optional,string" form:"name" json:"name,omitempty"`
	Desc                string  `thrift:"desc,6,optional" frugal:"6,optional,string" form:"desc" json:"desc,omitempty"`
	EvalSetID           int64   `thrift:"eval_set_id,7,optional" frugal:"7,optional,i64" json:"eval_set_id" form:"eval_set_id" `
	TargetID            *int64  `thrift:"target_id,8,optional" frugal:"8,optional,i64" json:"target_id" form:"target_id" `
	// TargetFieldMapping    *TargetFieldMapping                `thrift:"target_field_mapping,20,optional" frugal:"20,optional,TargetFieldMapping" form:"target_field_mapping" json:"target_field_mapping,omitempty"`
	// EvaluatorFieldMapping []*EvaluatorFieldMapping           `thrift:"evaluator_field_mapping,21,optional" frugal:"21,optional,list<EvaluatorFieldMapping>" form:"evaluator_field_mapping" json:"evaluator_field_mapping,omitempty"`
	// ItemConcurNum         int32                        `thrift:"item_concur_num,22,optional" frugal:"22,optional,i32" form:"item_concur_num" json:"item_concur_num,omitempty"`
	// EvaluatorsConcurNum   int32                        `thrift:"evaluators_concur_num,23,optional" frugal:"23,optional,i32" form:"evaluators_concur_num" json:"evaluators_concur_num,omitempty"`
	CreateEvalTargetParam *CreateEvalTargetParam `` /* 174-byte string literal not displayed */
	ExptType              ExptType               `thrift:"expt_type,30,optional" frugal:"30,optional,ExptType" form:"expt_type" json:"expt_type,omitempty"`
	MaxAliveTime          int64                  `thrift:"max_alive_time,31,optional" frugal:"31,optional,i64" form:"max_alive_time" json:"max_alive_time,omitempty"`
	SourceType            SourceType             `thrift:"source_type,32,optional" frugal:"32,optional,SourceType" form:"source_type" json:"source_type,omitempty"`
	SourceID              string                 `thrift:"source_id,33,optional" frugal:"33,optional,string" form:"source_id" json:"source_id,omitempty"`

	ExptConf *EvaluationConfiguration
}

type CreateSpecificFieldAggrResultParam

type CreateSpecificFieldAggrResultParam struct {
	SpaceID      int64
	ExperimentID int64
	FieldType    FieldType
	FieldKey     string
}

type CreditCost

type CreditCost int
const (
	CreditCostDefault CreditCost = 0
	CreditCostFree    CreditCost = 1
)

type CustomEvalTarget

type CustomEvalTarget struct {
	// 唯一键,平台不消费,仅做透传
	ID *string
	// 名称,平台用于展示在对象搜索下拉列表
	Name *string
	// 头像url,平台用于展示在对象搜索下拉列表
	AvatarURL *string
	// 扩展字段,目前主要存储旧版协议response中的额外字段:object_type(旧版ID)、object_meta、space_id
	Ext map[string]string
}

type CustomRPCEvaluatorVersion

type CustomRPCEvaluatorVersion struct {
	// standard EvaluatorVersion layer attributes
	ID            int64         `json:"id"`
	SpaceID       int64         `json:"space_id"`
	EvaluatorType EvaluatorType `json:"evaluator_type"`
	EvaluatorID   int64         `json:"evaluator_id"`
	Description   string        `json:"description"`
	Version       string        `json:"version"`
	BaseInfo      *BaseInfo     `json:"base_info"`

	// standard EvaluatorContent layer attributes
	InputSchemas  []*ArgsSchema `json:"input_schemas"`
	OutputSchemas []*ArgsSchema `json:"output_schemas"`

	// specific CustomRPCEvaluator layer attributes, refer to CustomRPCEvaluator DTO
	ProviderEvaluatorCode *string                 `json:"provider_evaluator_code"` // provider's evaluator identity code, e.g. provider A may name an evaluator as A001
	AccessProtocol        EvaluatorAccessProtocol `json:"access_protocol"`         // custom protocol
	ServiceName           *string                 `json:"service_name"`
	Cluster               *string                 `json:"cluster"`
	Timeout               *int64                  `json:"timeout"` // timeout duration in milliseconds(ms)
	RateLimit             *RateLimit              `json:"rate_limit,omitempty"`
}

func (*CustomRPCEvaluatorVersion) GetBaseInfo

func (do *CustomRPCEvaluatorVersion) GetBaseInfo() *BaseInfo

func (*CustomRPCEvaluatorVersion) GetDescription

func (do *CustomRPCEvaluatorVersion) GetDescription() string

func (*CustomRPCEvaluatorVersion) GetEvaluatorID

func (do *CustomRPCEvaluatorVersion) GetEvaluatorID() int64

func (*CustomRPCEvaluatorVersion) GetID

func (do *CustomRPCEvaluatorVersion) GetID() int64

func (*CustomRPCEvaluatorVersion) GetSpaceID

func (do *CustomRPCEvaluatorVersion) GetSpaceID() int64

func (*CustomRPCEvaluatorVersion) GetVersion

func (do *CustomRPCEvaluatorVersion) GetVersion() string

func (*CustomRPCEvaluatorVersion) SetBaseInfo

func (do *CustomRPCEvaluatorVersion) SetBaseInfo(baseInfo *BaseInfo)

func (*CustomRPCEvaluatorVersion) SetDescription

func (do *CustomRPCEvaluatorVersion) SetDescription(description string)

func (*CustomRPCEvaluatorVersion) SetEvaluatorID

func (do *CustomRPCEvaluatorVersion) SetEvaluatorID(evaluatorID int64)

func (*CustomRPCEvaluatorVersion) SetID

func (do *CustomRPCEvaluatorVersion) SetID(id int64)

func (*CustomRPCEvaluatorVersion) SetSpaceID

func (do *CustomRPCEvaluatorVersion) SetSpaceID(spaceID int64)

func (*CustomRPCEvaluatorVersion) SetVersion

func (do *CustomRPCEvaluatorVersion) SetVersion(version string)

func (*CustomRPCEvaluatorVersion) ValidateBaseInfo

func (do *CustomRPCEvaluatorVersion) ValidateBaseInfo() error

func (*CustomRPCEvaluatorVersion) ValidateInput

func (do *CustomRPCEvaluatorVersion) ValidateInput(input *EvaluatorInputData) error

type CustomRPCServer

type CustomRPCServer struct {
	// 应用ID
	ID int64
	// DTO使用,不存数据库
	Name string `json:"-"`
	// DTO使用,不存数据库
	Description string `json:"-"`
	// 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉
	ServerName string
	// 接入协议
	AccessProtocol AccessProtocol
	Regions        []Region
	Cluster        string
	// 执行http信息
	InvokeHTTPInfo *HTTPInfo
	// 异步执行http信息,如果用户选了异步就传入这个字段
	AsyncInvokeHTTPInfo *HTTPInfo
	// 是否需要搜索对象
	NeedSearchTarget *bool
	// 搜索对象http信息
	SearchHTTPInfo *HTTPInfo
	// 搜索对象返回的信息
	CustomEvalTarget *CustomEvalTarget
	// 是否异步
	IsAsync *bool
	// 额外信息
	Ext map[string]string

	ExecRegion   Region  // 执行区域
	ExecEnv      *string // 执行环境
	Timeout      *int64  // 执行超时,单位ms
	AsyncTimeout *int64  // 执行超时,单位ms
}

type DatasetFeatures

type DatasetFeatures struct {
	EditSchema   bool `json:"editSchema,omitempty"`
	RepeatedData bool `json:"repeatedData,omitempty"`
	MultiModal   bool `json:"multiModal,omitempty"`
}

type DatasetIODataset

type DatasetIODataset struct {
	SpaceID   *int64
	DatasetID int64
	VersionID *int64
}

type DatasetIOEndpoint

type DatasetIOEndpoint struct {
	File    *DatasetIOFile
	Dataset *DatasetIODataset
}

type DatasetIOFile

type DatasetIOFile struct {
	Provider StorageProvider
	Path     string
	// 数据文件的格式
	Format *FileFormat
	// 压缩包格式
	CompressFormat *FileFormat
	// path 为文件夹或压缩包时,数据文件列表, 服务端设置
	Files []string
	// 原始的文件名,创建文件时由前端写入。为空则与 path 保持一致
	OriginalFileName *string
	// 文件下载地址
	DownloadURL *string
	// 存储提供方ID,目前主要在 provider==imagex 时生效
	ProviderID *string
	// 存储提供方鉴权信息,目前主要在 provider==imagex 时生效
	ProviderAuth *ProviderAuth
}

type DatasetItemOutput

type DatasetItemOutput struct {
	// item 在 BatchCreateDatasetItemsReq.items 中的索引
	ItemIndex *int32
	ItemKey   *string
	ItemID    *int64
	// 是否是新的 Item。提供 itemKey 时,如果 itemKey 在数据集中已存在数据,则不算做「新 Item」,该字段为 false。
	IsNewItem *bool
}

type DatasetSpec

type DatasetSpec struct {
	MaxItemCount           int64           `json:"max_item_count,omitempty"`
	MaxFieldCount          int32           `json:"max_field_count,omitempty"`
	MaxItemSize            int64           `json:"max_item_size,omitempty"`
	MaxItemDataNestedDepth int32           `json:"max_item_data_nested_depth,omitempty"`
	MultiModalSpec         *MultiModalSpec `json:"multi_modal_spec,omitempty"`
}

type DatasetStatus

type DatasetStatus int64
const (
	DatasetStatus_Available DatasetStatus = 1
	DatasetStatus_Deleted   DatasetStatus = 2
	DatasetStatus_Expired   DatasetStatus = 3
	DatasetStatus_Importing DatasetStatus = 4
	DatasetStatus_Exporting DatasetStatus = 5
	DatasetStatus_Indexing  DatasetStatus = 6
)

func DatasetStatusFromString

func DatasetStatusFromString(s string) (DatasetStatus, error)

func DatasetStatusPtr

func DatasetStatusPtr(v DatasetStatus) *DatasetStatus

func (*DatasetStatus) Scan

func (p *DatasetStatus) Scan(value interface{}) (err error)

func (DatasetStatus) String

func (p DatasetStatus) String() string

func (*DatasetStatus) Value

func (p *DatasetStatus) Value() (driver.Value, error)

type DebugTargetParam

type DebugTargetParam struct {
	SpaceID      int64
	PatchyTarget *EvalTarget
	InputData    *EvalTargetInputData
}

type DeleteEvaluatorTemplateRequest

type DeleteEvaluatorTemplateRequest struct {
	ID int64 `json:"id" validate:"required,gt=0"` // 模板ID
}

DeleteEvaluatorTemplateRequest 删除评估器模板请求

type DeleteEvaluatorTemplateResponse

type DeleteEvaluatorTemplateResponse struct {
	Success bool `json:"success"` // 删除是否成功
}

DeleteEvaluatorTemplateResponse 删除评估器模板响应

type DummyRuntimeParam

type DummyRuntimeParam struct{}

func NewDummyRuntimeParam

func NewDummyRuntimeParam() *DummyRuntimeParam

func (*DummyRuntimeParam) GetJSONDemo

func (d *DummyRuntimeParam) GetJSONDemo() string

func (*DummyRuntimeParam) GetJSONValue

func (d *DummyRuntimeParam) GetJSONValue() string

func (*DummyRuntimeParam) ParseFromJSON

func (d *DummyRuntimeParam) ParseFromJSON(val string) (IRuntimeParam, error)

type ErrRetryCtrl

type ErrRetryCtrl struct {
	RetryConf    *RetryConf            `json:"retry_conf" mapstructure:"retry_conf"`
	ErrRetryConf map[string]*RetryConf `json:"err_retry_conf" mapstructure:"err_retry_conf"`
}

func (*ErrRetryCtrl) GetRetryConf

func (e *ErrRetryCtrl) GetRetryConf(err error) *RetryConf

type EvalAsyncCtx

type EvalAsyncCtx struct {
	Event       *ExptItemEvalEvent
	RecordID    int64
	AsyncUnixMS int64 // async call time with unix ms ts
	Session     *Session
	Callee      string
}

type EvalAudioInfo

type EvalAudioInfo struct {
	URL      string        `json:"url,omitempty"`
	Base64   string        `json:"base64,omitempty"`
	Duration time.Duration `json:"duration,omitempty"`
	Format   string        `json:"format,omitempty"`
}

EvalAudioInfo 音频信息

type EvalContent

type EvalContent struct {
	ContentType string         `json:"content_type"`
	Text        string         `json:"text,omitempty"`
	Image       *EvalImageInfo `json:"image,omitempty"`
	Audio       *EvalAudioInfo `json:"audio,omitempty"`
	MultiPart   []EvalContent  `json:"multi_part,omitempty"`
}

EvalContent 评估内容结构

type EvalImageInfo

type EvalImageInfo struct {
	URL    string `json:"url,omitempty"`
	Base64 string `json:"base64,omitempty"`
	Width  int    `json:"width,omitempty"`
	Height int    `json:"height,omitempty"`
}

EvalImageInfo 图片信息

type EvalInput

type EvalInput struct {
	Run     RunData   `json:"run"`
	History []RunData `json:"history,omitempty"`
}

EvalInput 优化后的评估输入结构

type EvalOutput

type EvalOutput struct {
	Score  float64 `json:"score"`
	Reason string  `json:"reason"`
}

EvalOutput 评估输出结构

type EvalTarget

type EvalTarget struct {
	ID                int64
	SpaceID           int64
	SourceTargetID    string
	EvalTargetType    EvalTargetType
	EvalTargetVersion *EvalTargetVersion
	BaseInfo          *BaseInfo
}

type EvalTargetInputData

type EvalTargetInputData struct {
	// 历史会话记录
	HistoryMessages []*Message
	// 变量
	InputFields map[string]*Content
	Ext         map[string]string
}

func (*EvalTargetInputData) ValidateInputSchema

func (e *EvalTargetInputData) ValidateInputSchema(inputSchema []*ArgsSchema) error

ValidateInputSchema common valiate input schema

type EvalTargetMtrAggrResult

type EvalTargetMtrAggrResult struct {
	TargetID                int64
	TargetVersionID         int64
	LatencyAggrResults      []*AggregatorResult
	InputTokensAggrResults  []*AggregatorResult
	OutputTokensAggrResults []*AggregatorResult
	TotalTokensAggrResults  []*AggregatorResult
}

type EvalTargetOutputData

type EvalTargetOutputData struct {
	// 变量
	OutputFields map[string]*Content
	// 运行消耗
	EvalTargetUsage *EvalTargetUsage
	// 运行报错
	EvalTargetRunError *EvalTargetRunError
	// 运行耗时
	TimeConsumingMS *int64
}

type EvalTargetRecord

type EvalTargetRecord struct {
	// 评估记录ID
	ID int64
	// 空间ID
	SpaceID         int64
	TargetID        int64
	TargetVersionID int64
	// 实验执行ID
	ExperimentRunID int64
	// 评测集数据项ID
	ItemID int64
	// 评测集数据项轮次ID
	TurnID int64
	// 链路ID
	TraceID string
	// 链路ID
	LogID string
	// 输入数据
	EvalTargetInputData *EvalTargetInputData
	// 输出数据
	EvalTargetOutputData *EvalTargetOutputData
	Status               *EvalTargetRunStatus

	BaseInfo *BaseInfo
}

type EvalTargetRunError

type EvalTargetRunError struct {
	Code    int32
	Message string
}

type EvalTargetRunStatus

type EvalTargetRunStatus int64
const (
	EvalTargetRunStatusUnknown       EvalTargetRunStatus = 0
	EvalTargetRunStatusSuccess       EvalTargetRunStatus = 1
	EvalTargetRunStatusFail          EvalTargetRunStatus = 2
	EvalTargetRunStatusAsyncInvoking EvalTargetRunStatus = 3
)

type EvalTargetType

type EvalTargetType int64
const (
	// CozeBot
	EvalTargetTypeCozeBot EvalTargetType = 1
	// Prompt
	EvalTargetTypeLoopPrompt EvalTargetType = 2
	// Trace
	EvalTargetTypeLoopTrace EvalTargetType = 3
	// CozeWorkflow
	EvalTargetTypeCozeWorkflow EvalTargetType = 4
	// 火山智能体
	EvalTargetTypeVolcengineAgent EvalTargetType = 5
	// 自定义服务 for内场
	EvalTargetTypeCustomRPCServer EvalTargetType = 6
)

func EvalTargetTypePtr

func EvalTargetTypePtr(v EvalTargetType) *EvalTargetType

func (*EvalTargetType) Scan

func (p *EvalTargetType) Scan(value interface{}) (err error)

func (EvalTargetType) String

func (p EvalTargetType) String() string

func (EvalTargetType) SupptTrajectory

func (p EvalTargetType) SupptTrajectory() bool

func (*EvalTargetType) Value

func (p *EvalTargetType) Value() (driver.Value, error)

type EvalTargetUsage

type EvalTargetUsage struct {
	InputTokens  int64
	OutputTokens int64
	TotalTokens  int64
}

func (*EvalTargetUsage) GetInputTokens

func (e *EvalTargetUsage) GetInputTokens() int64

func (*EvalTargetUsage) GetOutputTokens

func (e *EvalTargetUsage) GetOutputTokens() int64

func (*EvalTargetUsage) GetTotalTokens

func (e *EvalTargetUsage) GetTotalTokens() int64

type EvalTargetVersion

type EvalTargetVersion struct {
	ID                  int64
	SpaceID             int64
	TargetID            int64
	SourceTargetVersion string

	EvalTargetType EvalTargetType

	CozeBot         *CozeBot
	Prompt          *LoopPrompt
	CozeWorkflow    *CozeWorkflow
	VolcengineAgent *VolcengineAgent
	CustomRPCServer *CustomRPCServer

	InputSchema      []*ArgsSchema
	OutputSchema     []*ArgsSchema
	RuntimeParamDemo *string

	BaseInfo *BaseInfo
}

type EvaluationConfiguration

type EvaluationConfiguration struct {
	ConnectorConf Connector
	ItemConcurNum *int
}

type EvaluationSet

type EvaluationSet struct {
	ID                   int64                 `json:"id,omitempty"`
	AppID                int32                 `json:"app_id,omitempty"`
	SpaceID              int64                 `json:"space_id,omitempty"`
	Name                 string                `json:"name,omitempty"`
	Description          string                `json:"description,omitempty"`
	Status               DatasetStatus         `json:"status,omitempty"`
	Spec                 *DatasetSpec          `json:"spec,omitempty"`
	Features             *DatasetFeatures      `json:"features,omitempty"`
	ItemCount            int64                 `json:"item_count,omitempty"`
	ChangeUncommitted    bool                  `json:"change_uncommitted,omitempty"`
	EvaluationSetVersion *EvaluationSetVersion `json:"evaluation_set_version,omitempty"`
	LatestVersion        string                `json:"latest_version,omitempty"`
	NextVersionNum       int64                 `json:"next_version_num,omitempty"`
	BaseInfo             *BaseInfo             `json:"base_info,omitempty"`
	BizCategory          BizCategory           `json:"biz_category,omitempty"`
}

type EvaluationSetItem

type EvaluationSetItem struct {
	ID              int64     `json:"id,omitempty"`
	AppID           int32     `json:"app_id,omitempty"`
	SpaceID         int64     `json:"space_id,omitempty"`
	EvaluationSetID int64     `json:"evaluation_set_id,omitempty"`
	SchemaID        int64     `json:"schema_id,omitempty"`
	ItemID          int64     `json:"item_id,omitempty"`
	ItemKey         string    `json:"item_key,omitempty"`
	Turns           []*Turn   `json:"turns,omitempty"`
	BaseInfo        *BaseInfo `json:"base_info,omitempty"`
}

type EvaluationSetSchema

type EvaluationSetSchema struct {
	ID              int64          `json:"id,omitempty"`
	AppID           int32          `json:"app_id,omitempty"`
	SpaceID         int64          `json:"space_id,omitempty"`
	EvaluationSetID int64          `json:"evaluation_set_id,omitempty"`
	FieldSchemas    []*FieldSchema `json:"field_schemas,omitempty"`
	BaseInfo        *BaseInfo      `json:"base_info,omitempty"`
}

type EvaluationSetVersion

type EvaluationSetVersion struct {
	ID                  int64                `thrift:"id,1,optional" frugal:"1,optional,i64" json:"id,omitempty"`
	AppID               int32                `thrift:"app_id,2,optional" frugal:"2,optional,i32" json:"app_id,omitempty"`
	SpaceID             int64                `thrift:"space_id,3,optional" frugal:"3,optional,i64" json:"space_id,omitempty"`
	EvaluationSetID     int64                `thrift:"evaluation_set_id,4,optional" frugal:"4,optional,i64" json:"evaluation_set_id,omitempty"`
	Version             string               `thrift:"version,10,optional" frugal:"10,optional,string" json:"version,omitempty"`
	VersionNum          int64                `thrift:"version_num,11,optional" frugal:"11,optional,i64" json:"version_num,omitempty"`
	Description         string               `thrift:"description,12,optional" frugal:"12,optional,string" json:"description,omitempty"`
	EvaluationSetSchema *EvaluationSetSchema `thrift:"evaluation_set_schema,13,optional" frugal:"13,optional,EvaluationSetSchema" json:"evaluation_set_schema,omitempty"`
	ItemCount           int64                `thrift:"item_count,14,optional" frugal:"14,optional,i64" json:"item_count,omitempty"`
	BaseInfo            *BaseInfo            `thrift:"base_info,100,optional" frugal:"100,optional,common.BaseInfo" json:"base_info"`
}

type Evaluator

type Evaluator struct {
	ID             int64
	SpaceID        int64
	Name           string
	Description    string
	DraftSubmitted bool
	EvaluatorType  EvaluatorType
	LatestVersion  string
	BaseInfo       *BaseInfo

	Builtin               bool
	EvaluatorInfo         *EvaluatorInfo
	BuiltinVisibleVersion string
	BoxType               EvaluatorBoxType                                      `json:"box_type"`
	Tags                  map[EvaluatorTagLangType]map[EvaluatorTagKey][]string `json:"tags"`

	PromptEvaluatorVersion    *PromptEvaluatorVersion
	CodeEvaluatorVersion      *CodeEvaluatorVersion
	CustomRPCEvaluatorVersion *CustomRPCEvaluatorVersion
}

func (*Evaluator) GetBaseInfo

func (e *Evaluator) GetBaseInfo() *BaseInfo

GetBaseInfo 获取基础信息

func (*Evaluator) GetEvaluatorDescription

func (e *Evaluator) GetEvaluatorDescription() string

GetEvaluatorDescription 获取评估器描述

func (*Evaluator) GetEvaluatorID

func (e *Evaluator) GetEvaluatorID() int64

GetEvaluatorID 获取评估器ID

func (*Evaluator) GetEvaluatorVersionDescription

func (e *Evaluator) GetEvaluatorVersionDescription() string

GetEvaluatorVersionDescription 获取评估器版本描述

func (*Evaluator) GetEvaluatorVersionID

func (e *Evaluator) GetEvaluatorVersionID() int64

GetEvaluatorVersionID 获取评估器版本ID

func (*Evaluator) GetModelConfig

func (e *Evaluator) GetModelConfig() *ModelConfig

GetModelConfig 获取模型配置

func (*Evaluator) GetPromptTemplateKey

func (e *Evaluator) GetPromptTemplateKey() string

GetPromptTemplateKey 获取提示模板键

func (*Evaluator) GetRateLimit

func (e *Evaluator) GetRateLimit() *RateLimit

func (*Evaluator) GetSpaceID

func (e *Evaluator) GetSpaceID() int64

GetSpaceID 获取空间ID

func (*Evaluator) GetVersion

func (e *Evaluator) GetVersion() string

GetVersion 获取评估器版本号

func (*Evaluator) SetBaseInfo

func (e *Evaluator) SetBaseInfo(baseInfo *BaseInfo)

SetBaseInfo 设置基础信息

func (*Evaluator) SetEvaluatorDescription

func (e *Evaluator) SetEvaluatorDescription(description string)

SetEvaluatorDescription 设置评估器描述

func (*Evaluator) SetEvaluatorID

func (e *Evaluator) SetEvaluatorID(evaluatorID int64)

SetEvaluatorID 设置评估器ID

func (*Evaluator) SetEvaluatorVersion

func (e *Evaluator) SetEvaluatorVersion(version *Evaluator)

func (*Evaluator) SetEvaluatorVersionDescription

func (e *Evaluator) SetEvaluatorVersionDescription(description string)

SetEvaluatorVersionDescription 设置评估器版本描述

func (*Evaluator) SetEvaluatorVersionID

func (e *Evaluator) SetEvaluatorVersionID(id int64)

SetEvaluatorVersionID 设置评估器版本ID

func (*Evaluator) SetParseType

func (e *Evaluator) SetParseType(parseType ParseType)

SetParseType 设置解析类型

func (*Evaluator) SetPromptSuffix

func (e *Evaluator) SetPromptSuffix(promptSuffix string)

SetPromptSuffix 设置提示后缀

func (*Evaluator) SetSpaceID

func (e *Evaluator) SetSpaceID(spaceID int64)

SetSpaceID 设置空间ID

func (*Evaluator) SetTools

func (e *Evaluator) SetTools(tools []*Tool)

SetTools 设置工具

func (*Evaluator) SetVersion

func (e *Evaluator) SetVersion(version string)

SetVersion 设置版本号

func (*Evaluator) ValidateBaseInfo

func (e *Evaluator) ValidateBaseInfo() error

ValidateBaseInfo 校验评估器基本信息

func (*Evaluator) ValidateInput

func (e *Evaluator) ValidateInput(input *EvaluatorInputData) error

ValidateInput 验证输入数据

type EvaluatorAccessProtocol

type EvaluatorAccessProtocol = string

EvaluatorAccessProtocol 评估器接入协议类型

type EvaluatorAggregateResult

type EvaluatorAggregateResult struct {
	EvaluatorID        int64
	EvaluatorVersionID int64
	AggregatorResults  []*AggregatorResult
	Name               *string
	Version            *string
}

type EvaluatorAnalysisInfo

type EvaluatorAnalysisInfo struct {
	EvaluatorID     int64            `json:"evaluator_id,omitempty"`
	VersionID       int64            `json:"version_id,omitempty"`
	Name            string           `json:"name,omitempty"`
	Description     string           `json:"description,omitempty"`
	EvaluatorResult *EvaluatorResult `json:"evaluator_result,omitempty"`
}

type EvaluatorBoxType

type EvaluatorBoxType int64
const (
	EvaluatorBoxTypeWhite EvaluatorBoxType = 1
	EvaluatorBoxTypeBlack EvaluatorBoxType = 2
)

type EvaluatorConf

type EvaluatorConf struct {
	EvaluatorVersionID int64
	IngressConf        *EvaluatorIngressConf
}

func (*EvaluatorConf) Valid

func (e *EvaluatorConf) Valid(ctx context.Context) error

type EvaluatorFilterCondition

type EvaluatorFilterCondition struct {
	TagKey   EvaluatorTagKey             `json:"tag_key"`  // 筛选字段
	Operator EvaluatorFilterOperatorType `json:"operator"` // 操作符
	Value    string                      `json:"value"`    // 操作值
}

EvaluatorFilterCondition Evaluator筛选条件

func NewEvaluatorFilterCondition

func NewEvaluatorFilterCondition(tagKey EvaluatorTagKey, operator EvaluatorFilterOperatorType, value string) *EvaluatorFilterCondition

NewEvaluatorFilterCondition 创建新的筛选条件

type EvaluatorFilterOperatorType

type EvaluatorFilterOperatorType int32

EvaluatorFilterOperatorType Evaluator筛选操作符

const (
	EvaluatorFilterOperatorType_Unknown   EvaluatorFilterOperatorType = 0
	EvaluatorFilterOperatorType_Equal     EvaluatorFilterOperatorType = 1 // 等于
	EvaluatorFilterOperatorType_NotEqual  EvaluatorFilterOperatorType = 2 // 不等于
	EvaluatorFilterOperatorType_In        EvaluatorFilterOperatorType = 3 // 包含于
	EvaluatorFilterOperatorType_NotIn     EvaluatorFilterOperatorType = 4 // 不包含于
	EvaluatorFilterOperatorType_Like      EvaluatorFilterOperatorType = 5 // 模糊匹配
	EvaluatorFilterOperatorType_IsNull    EvaluatorFilterOperatorType = 6 // 为空
	EvaluatorFilterOperatorType_IsNotNull EvaluatorFilterOperatorType = 7 // 非空
)

func (EvaluatorFilterOperatorType) IsValid

func (e EvaluatorFilterOperatorType) IsValid() bool

IsValid 检查EvaluatorFilterOperatorType是否有效

func (EvaluatorFilterOperatorType) String

String 返回EvaluatorFilterOperatorType的字符串表示

type EvaluatorFilterOption

type EvaluatorFilterOption struct {
	SearchKeyword *string           `json:"search_keyword,omitempty"` // 模糊搜索关键词,在所有tag中搜索
	Filters       *EvaluatorFilters `json:"filters,omitempty"`        // 筛选条件
}

EvaluatorFilterOption Evaluator筛选器选项

func NewEvaluatorFilterOption

func NewEvaluatorFilterOption() *EvaluatorFilterOption

NewEvaluatorFilterOption 创建新的EvaluatorFilterOption

func (*EvaluatorFilterOption) WithFilters

WithFilters 设置筛选条件

func (*EvaluatorFilterOption) WithSearchKeyword

func (f *EvaluatorFilterOption) WithSearchKeyword(keyword string) *EvaluatorFilterOption

WithSearchKeyword 设置搜索关键词

type EvaluatorFilters

type EvaluatorFilters struct {
	FilterConditions []*EvaluatorFilterCondition `json:"filter_conditions,omitempty"` // 筛选条件列表
	LogicOp          *FilterLogicOp              `json:"logic_op,omitempty"`          // 逻辑操作符
	SubFilters       []*EvaluatorFilters         `json:"sub_filters,omitempty"`       // 子条件组(支持嵌套)
}

EvaluatorFilters Evaluator筛选条件

func NewEvaluatorFilters

func NewEvaluatorFilters() *EvaluatorFilters

NewEvaluatorFilters 创建新的EvaluatorFilters

func (*EvaluatorFilters) AddCondition

func (f *EvaluatorFilters) AddCondition(condition *EvaluatorFilterCondition) *EvaluatorFilters

AddCondition 添加筛选条件

func (*EvaluatorFilters) WithLogicOp

func (f *EvaluatorFilters) WithLogicOp(logicOp FilterLogicOp) *EvaluatorFilters

WithLogicOp 设置逻辑操作符

type EvaluatorInfo

type EvaluatorInfo struct {
	Benchmark     *string `json:"benchmark"`
	Vendor        *string `json:"vendor"`
	VendorURL     *string `json:"vendor_url"`
	UserManualURL *string `json:"user_manual_url"`
}

type EvaluatorIngressConf

type EvaluatorIngressConf struct {
	EvalSetAdapter *FieldAdapter
	TargetAdapter  *FieldAdapter
	CustomConf     *FieldAdapter
}

type EvaluatorInputData

type EvaluatorInputData struct {
	HistoryMessages            []*Message          `json:"history_messages,omitempty"`
	InputFields                map[string]*Content `json:"input_fields,omitempty"`
	EvaluateDatasetFields      map[string]*Content `json:"evaluate_dataset_fields,omitempty"`
	EvaluateTargetOutputFields map[string]*Content `json:"evaluate_target_output_fields,omitempty"`
	Ext                        map[string]string   `json:"ext,omitempty"`
}

type EvaluatorOutputData

type EvaluatorOutputData struct {
	EvaluatorResult   *EvaluatorResult   `json:"evaluator_result,omitempty"`
	EvaluatorUsage    *EvaluatorUsage    `json:"evaluator_usage,omitempty"`
	EvaluatorRunError *EvaluatorRunError `json:"evaluator_run_error,omitempty"`
	TimeConsumingMS   int64              `json:"time_consuming_ms,omitempty"`
	Stdout            string             `json:"stdout,omitempty"`
}

type EvaluatorRecord

type EvaluatorRecord struct {
	ID                  int64                `json:"id"`
	SpaceID             int64                `json:"space_id"`
	ExperimentID        int64                `json:"experiment_id"`
	ExperimentRunID     int64                `json:"experiment_run_id"`
	ItemID              int64                `json:"item_id"`
	TurnID              int64                `json:"turn_id"`
	EvaluatorVersionID  int64                `json:"evaluator_version_id"`
	TraceID             string               `json:"trace_id"`
	LogID               string               `json:"log_id"`
	EvaluatorInputData  *EvaluatorInputData  `json:"evaluator_input_data"`
	EvaluatorOutputData *EvaluatorOutputData `json:"evaluator_output_data"`
	Status              EvaluatorRunStatus   `json:"status"`
	BaseInfo            *BaseInfo            `json:"base_info"`

	Ext map[string]string `json:"ext,omitempty"`
}

func (*EvaluatorRecord) GetBaseInfo

func (e *EvaluatorRecord) GetBaseInfo() *BaseInfo

func (*EvaluatorRecord) GetCorrected

func (e *EvaluatorRecord) GetCorrected() bool

func (*EvaluatorRecord) GetReasoning

func (e *EvaluatorRecord) GetReasoning() string

func (*EvaluatorRecord) GetScore

func (e *EvaluatorRecord) GetScore() *float64

func (*EvaluatorRecord) SetBaseInfo

func (e *EvaluatorRecord) SetBaseInfo(info *BaseInfo)

type EvaluatorRecordCorrectionEvent

type EvaluatorRecordCorrectionEvent struct {
	EvaluatorResult    *EvaluatorResult  `json:"evaluator_result,omitempty"`
	EvaluatorRecordID  int64             `json:"evaluator_record_id"`
	EvaluatorVersionID int64             `json:"evaluator_version_id"`
	Ext                map[string]string `json:"ext,omitempty"`

	CreatedAt int64 `json:"created_at"`
	UpdatedAt int64 `json:"updated_at"`
}

type EvaluatorResult

type EvaluatorResult struct {
	Score      *float64    `json:"score,omitempty"`
	Correction *Correction `json:"correction,omitempty"`
	Reasoning  string      `json:"reasoning,omitempty"`
}

type EvaluatorResults

type EvaluatorResults struct {
	EvalVerIDToResID map[int64]int64
}

func (*EvaluatorResults) Serialize

func (e *EvaluatorResults) Serialize() ([]byte, error)

type EvaluatorRunError

type EvaluatorRunError struct {
	Code    int32  `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type EvaluatorRunStatus

type EvaluatorRunStatus int64
const (
	EvaluatorRunStatusUnknown EvaluatorRunStatus = 0
	EvaluatorRunStatusSuccess EvaluatorRunStatus = 1
	EvaluatorRunStatusFail    EvaluatorRunStatus = 2
)

type EvaluatorTagKey

type EvaluatorTagKey string

EvaluatorTagKey Evaluator筛选字段

const (
	EvaluatorTagKey_Category         EvaluatorTagKey = "Category"         // 类型筛选 (LLM/Code)
	EvaluatorTagKey_TargetType       EvaluatorTagKey = "TargetType"       // 评估对象 (文本/图片/视频等)
	EvaluatorTagKey_Objective        EvaluatorTagKey = "Objective"        // 评估目标 (任务完成/内容质量等)
	EvaluatorTagKey_BusinessScenario EvaluatorTagKey = "BusinessScenario" // 业务场景 (安全风控/AI Coding等)
	EvaluatorTagKey_BoxType          EvaluatorTagKey = "BoxType"          // 黑白盒类型
	EvaluatorTagKey_Name             EvaluatorTagKey = "Name"             // 评估器名称
)

type EvaluatorTagKeyType

type EvaluatorTagKeyType int32
const (
	EvaluatorTagKeyType_Evaluator EvaluatorTagKeyType = 1 // 评估器标签
	EvaluatorTagKeyType_Template  EvaluatorTagKeyType = 2 // 评估器模板标签
)

type EvaluatorTagLangType

type EvaluatorTagLangType string
const (
	EvaluatorTagLangType_Zh EvaluatorTagLangType = "zh-CN" // 中文
	EvaluatorTagLangType_En EvaluatorTagLangType = "en-US" // 英文
)

type EvaluatorTemplate

type EvaluatorTemplate struct {
	ID            int64
	SpaceID       int64
	Name          string
	Description   string
	EvaluatorType EvaluatorType

	EvaluatorInfo *EvaluatorInfo
	Popularity    int64

	InputSchemas       []*ArgsSchema                                         `json:"input_schemas"`
	OutputSchemas      []*ArgsSchema                                         `json:"output_schemas"`
	ReceiveChatHistory *bool                                                 `json:"receive_chat_history"`
	Tags               map[EvaluatorTagLangType]map[EvaluatorTagKey][]string `json:"tags"`

	PromptEvaluatorContent *PromptEvaluatorContent
	CodeEvaluatorContent   *CodeEvaluatorContent

	BaseInfo *BaseInfo `json:"base_info"`
}

func (*EvaluatorTemplate) GetBaseInfo

func (do *EvaluatorTemplate) GetBaseInfo() *BaseInfo

func (*EvaluatorTemplate) SetBaseInfo

func (do *EvaluatorTemplate) SetBaseInfo(baseInfo *BaseInfo)

type EvaluatorType

type EvaluatorType int64
const (
	EvaluatorTypePrompt    EvaluatorType = 1
	EvaluatorTypeCode      EvaluatorType = 2
	EvaluatorTypeCustomRPC EvaluatorType = 3
)

type EvaluatorUsage

type EvaluatorUsage struct {
	InputTokens  int64 `json:"input_tokens,omitempty"`
	OutputTokens int64 `json:"output_tokens,omitempty"`
}

type EvaluatorsConf

type EvaluatorsConf struct {
	EvaluatorConcurNum *int
	EvaluatorConf      []*EvaluatorConf
}

func (*EvaluatorsConf) GetEvaluatorConcurNum

func (e *EvaluatorsConf) GetEvaluatorConcurNum() int

func (*EvaluatorsConf) GetEvaluatorConf

func (e *EvaluatorsConf) GetEvaluatorConf(evalVerID int64) *EvaluatorConf

func (*EvaluatorsConf) Valid

func (e *EvaluatorsConf) Valid(ctx context.Context) error

type ExecuteEvalTargetParam

type ExecuteEvalTargetParam struct {
	TargetID            int64
	VersionID           int64
	SourceTargetID      string
	SourceTargetVersion string
	Input               *EvalTargetInputData
	TargetType          EvalTargetType
	EvalTarget          *EvalTarget // 透传,各个评测对象如需额外信息可以从这里消费
}

type ExecuteTargetCtx

type ExecuteTargetCtx struct {
	// 实验执行ID
	ExperimentRunID *int64
	// 评测集数据项ID
	ItemID int64
	// 评测集数据项轮次ID
	TurnID int64
}

type ExecutionLog

type ExecutionLog struct {
	ID          string    `json:"id"`
	Language    string    `json:"language"`
	CodeHash    string    `json:"code_hash"`
	Duration    int64     `json:"duration_ms"`
	MemoryUsage int64     `json:"memory_usage"`
	Success     bool      `json:"success"`
	Error       string    `json:"error,omitempty"`
	Timestamp   time.Time `json:"timestamp"`
}

ExecutionLog 执行日志

type ExecutionOutput

type ExecutionOutput struct {
	Stdout string `json:"stdout"`
	Stderr string `json:"stderr"`
	RetVal string `json:"ret_val"`
}

ExecutionOutput 执行输出信息

type ExecutionRequest

type ExecutionRequest struct {
	Code      string                 `json:"code"`
	Language  string                 `json:"language"`
	InputData map[string]interface{} `json:"input_data"`
	TimeoutMS int64                  `json:"timeout_ms"`
}

ExecutionRequest 代码执行请求

type ExecutionResult

type ExecutionResult struct {
	Output *ExecutionOutput `json:"output"`
}

ExecutionResult 代码执行结果 - 匹配远程沙箱服务的响应格式

type Experiment

type Experiment struct {
	ID          int64
	SpaceID     int64
	CreatedBy   string
	Name        string
	Description string

	EvalSetVersionID    int64
	EvalSetID           int64
	TargetType          EvalTargetType
	TargetVersionID     int64
	TargetID            int64
	EvaluatorVersionRef []*ExptEvaluatorVersionRef
	EvalConf            *EvaluationConfiguration

	Target     *EvalTarget
	EvalSet    *EvaluationSet
	Evaluators []*Evaluator

	Status        ExptStatus
	StatusMessage string
	LatestRunID   int64

	CreditCost CreditCost

	StartAt *time.Time
	EndAt   *time.Time

	ExptType     ExptType
	MaxAliveTime int64
	SourceType   SourceType
	SourceID     string

	Stats           *ExptStats
	AggregateResult *ExptAggregateResult
}

func (*Experiment) AsyncCallEvaluators

func (e *Experiment) AsyncCallEvaluators() bool

func (*Experiment) AsyncCallTarget

func (e *Experiment) AsyncCallTarget() bool

func (*Experiment) AsyncExec

func (e *Experiment) AsyncExec() bool

func (*Experiment) ContainsEvalTarget

func (e *Experiment) ContainsEvalTarget() bool

func (*Experiment) ToEvaluatorRefDO

func (e *Experiment) ToEvaluatorRefDO() []*ExptEvaluatorRef

type ExperimentResult

type ExperimentResult struct {
	ExperimentID int64
	Payload      *ExperimentTurnPayload
}

type ExperimentTurnPayload

type ExperimentTurnPayload struct {
	TurnID int64
	// 评测数据集数据
	EvalSet *TurnEvalSet
	// 评测对象结果
	TargetOutput *TurnTargetOutput
	// 评测规则执行结果
	EvaluatorOutput *TurnEvaluatorOutput
	// 评测系统相关数据日志、error
	SystemInfo *TurnSystemInfo
	// 标注结果
	AnnotateResult *TurnAnnotateResult
	// 分析结果
	AnalysisRecord *AnalysisRecord
}

type ExportCSVEvent

type ExportCSVEvent struct {
	ExportID     int64
	ExperimentID int64
	SpaceID      int64

	Session     *Session
	ExportScene ExportScene
	CreatedAt   int64
}

type ExportScene

type ExportScene int
const (
	ExportSceneDefault         ExportScene = 0
	ExportSceneInsightAnalysis ExportScene = 1
)

type ExptAggrResult

type ExptAggrResult struct {
	ID           int64
	SpaceID      int64
	ExperimentID int64
	FieldType    int32
	FieldKey     string
	Score        float64
	AggrResult   []byte
	Version      int64
	Status       int32
	UpdateAt     *time.Time
}

func (*ExptAggrResult) AggrResEqual

func (e *ExptAggrResult) AggrResEqual(other *ExptAggrResult) bool

type ExptAggregateResult

type ExptAggregateResult struct {
	ExperimentID      int64
	EvaluatorResults  map[int64]*EvaluatorAggregateResult
	Status            int64
	AnnotationResults map[int64]*AnnotationAggregateResult
	TargetResults     *EvalTargetMtrAggrResult
	UpdateTime        *time.Time
}

type ExptCalculateStats

type ExptCalculateStats struct {
	PendingItemCnt    int
	FailItemCnt       int
	SuccessItemCnt    int
	ProcessingItemCnt int
	TerminatedItemCnt int
}

type ExptColumnAnnotation

type ExptColumnAnnotation struct {
	ExptID            int64
	ColumnAnnotations []*ColumnAnnotation
}

type ExptColumnEvalTarget

type ExptColumnEvalTarget struct {
	ExptID  int64
	Columns []*ColumnEvalTarget
}

type ExptColumnEvaluator

type ExptColumnEvaluator struct {
	ExptID           int64
	ColumnEvaluators []*ColumnEvaluator
}

type ExptConsumerConf

type ExptConsumerConf struct {
	ExptExecWorkerNum     int `json:"expt_exec_worker_num" mapstructure:"expt_exec_worker_num"`
	ExptItemEvalWorkerNum int `json:"expt_item_eval_worker_num" mapstructure:"expt_item_eval_worker_num"`

	ExptExecConf      *ExptExecConf           `json:"expt_exec_conf" mapstructure:"expt_exec_conf"`
	SpaceExptExecConf map[int64]*ExptExecConf `json:"space_expt_exec_conf" mapstructure:"space_expt_exec_conf"`

	SchedulerAbortCtrl *SchedulerAbortCtrl `json:"scheduler_abort_ctrl" mapstructure:"scheduler_abort_ctrl"`
}

func DefaultExptConsumerConf

func DefaultExptConsumerConf() *ExptConsumerConf

func (*ExptConsumerConf) GetExptExecConf

func (e *ExptConsumerConf) GetExptExecConf(spaceID int64) *ExptExecConf

func (*ExptConsumerConf) GetSchedulerAbortCtrl

func (e *ExptConsumerConf) GetSchedulerAbortCtrl() *SchedulerAbortCtrl

type ExptErrCtrl

type ExptErrCtrl struct {
	ErrRetryCtrl      *ErrRetryCtrl           `json:"err_retry_ctrl" mapstructure:"err_retry_ctrl"`
	SpaceErrRetryCtrl map[int64]*ErrRetryCtrl `json:"space_err_retry_ctrl" mapstructure:"space_err_retry_ctrl"`
	ResultErrConverts []*ResultErrConvert     `json:"result_err_converts" mapstructure:"result_err_converts"`
}

func DefaultExptErrCtrl

func DefaultExptErrCtrl() *ExptErrCtrl

func (*ExptErrCtrl) ConvertErrMsg

func (e *ExptErrCtrl) ConvertErrMsg(msg string) string

func (*ExptErrCtrl) GetErrRetryCtrl

func (e *ExptErrCtrl) GetErrRetryCtrl(spaceID int64) *ErrRetryCtrl

type ExptEvalItem

type ExptEvalItem struct {
	ExptID           int64
	EvalSetVersionID int64
	ItemID           int64
	State            ItemRunState
	UpdatedAt        *time.Time
}

func (*ExptEvalItem) SetState

func (e *ExptEvalItem) SetState(state ItemRunState) *ExptEvalItem

type ExptEvalTurn

type ExptEvalTurn struct {
	ExptID    int64
	ExptRunID int64
	ItemID    int64
	TurnID    int64
}

type ExptEvaluatorRef

type ExptEvaluatorRef struct {
	ID                 int64
	SpaceID            int64
	ExptID             int64
	EvaluatorID        int64
	EvaluatorVersionID int64
}

type ExptEvaluatorVersionRef

type ExptEvaluatorVersionRef struct {
	EvaluatorID        int64
	EvaluatorVersionID int64
}

func (*ExptEvaluatorVersionRef) String

func (e *ExptEvaluatorVersionRef) String() string

type ExptExecConf

type ExptExecConf struct {
	DaemonIntervalSecond int `json:"daemon_interval_second" mapstructure:"daemon_interval_second"`
	ZombieIntervalSecond int `json:"expt_zombie_second" mapstructure:"expt_zombie_second"`
	SpaceExptConcurLimit int `json:"space_expt_concur_limit" mapstructure:"space_expt_concur_limit"`

	ExptItemEvalConf *ExptItemEvalConf `json:"expt_item_eval_conf" mapstructure:"expt_item_eval_conf"`
}

func (*ExptExecConf) GetDaemonInterval

func (e *ExptExecConf) GetDaemonInterval() time.Duration

func (*ExptExecConf) GetExptItemEvalConf

func (e *ExptExecConf) GetExptItemEvalConf() *ExptItemEvalConf

func (*ExptExecConf) GetSpaceExptConcurLimit

func (e *ExptExecConf) GetSpaceExptConcurLimit() int

func (*ExptExecConf) GetZombieIntervalSecond

func (e *ExptExecConf) GetZombieIntervalSecond() int

type ExptExportWhiteList

type ExptExportWhiteList struct {
	UserIDs  []int64 `json:"user_ids" mapstructure:"user_ids"`
	AllowAll bool    `json:"allow_all" mapstructure:"allow_all"`
}

func DefaultExptExportWhiteList

func DefaultExptExportWhiteList() *ExptExportWhiteList

func (*ExptExportWhiteList) IsUserIDInWhiteList

func (e *ExptExportWhiteList) IsUserIDInWhiteList(userID string) bool

type ExptFilterFields

type ExptFilterFields struct {
	CreatedBy    []string
	Status       []int64
	EvalSetIDs   []int64
	TargetIDs    []int64
	EvaluatorIDs []int64
	TargetType   []int64
	ExptType     []int64
	SourceType   []int64
	SourceID     []string
}

func (*ExptFilterFields) IsValid

func (e *ExptFilterFields) IsValid() bool

type ExptInsightAnalysisFeedback

type ExptInsightAnalysisFeedback struct {
	UpvoteCount         int64
	DownvoteCount       int64
	CurrentUserVoteType InsightAnalysisReportVoteType
}

type ExptInsightAnalysisFeedbackComment

type ExptInsightAnalysisFeedbackComment struct {
	ID               int64
	SpaceID          int64
	ExptID           int64
	AnalysisRecordID int64
	Comment          string
	CreatedBy        string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type ExptInsightAnalysisFeedbackParam

type ExptInsightAnalysisFeedbackParam struct {
	SpaceID            int64
	ExptID             int64
	AnalysisRecordID   int64
	FeedbackActionType FeedbackActionType
	Comment            *string
	CommentID          *int64
	Session            *Session
}

type ExptInsightAnalysisFeedbackVote

type ExptInsightAnalysisFeedbackVote struct {
	ID               int64
	SpaceID          int64
	ExptID           int64
	AnalysisRecordID int64
	VoteType         InsightAnalysisReportVoteType
	CreatedBy        string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type ExptInsightAnalysisRecord

type ExptInsightAnalysisRecord struct {
	ID                    int64
	SpaceID               int64
	ExptID                int64
	Status                InsightAnalysisStatus
	ExptResultFilePath    *string
	AnalysisReportID      *int64
	AnalysisReportContent string
	AnalysisReportIndex   []*InsightAnalysisReportIndex
	CreatedBy             string
	CreatedAt             time.Time
	UpdatedAt             time.Time

	ExptInsightAnalysisFeedback ExptInsightAnalysisFeedback
}

type ExptItemEvalConf

type ExptItemEvalConf struct {
	ConcurNum         int `json:"concur_num" mapstructure:"concur_num"`
	IntervalSecond    int `json:"interval_second" mapstructure:"interval_second"`
	ZombieSecond      int `json:"zombie_second" mapstructure:"zombie_second"`
	AsyncZombieSecond int `json:"async_zombie_second" mapstructure:"async_zombie_second"`
}

func (*ExptItemEvalConf) GetConcurNum

func (e *ExptItemEvalConf) GetConcurNum() int

func (*ExptItemEvalConf) GetInterval

func (e *ExptItemEvalConf) GetInterval() time.Duration

func (*ExptItemEvalConf) GetItemZombieSecond

func (e *ExptItemEvalConf) GetItemZombieSecond(isAsync bool) int

type ExptItemEvalCtx

type ExptItemEvalCtx struct {
	Event *ExptItemEvalEvent

	Expt *Experiment

	EvalSetItem *EvaluationSetItem

	ExistItemEvalResult *ExptItemEvalResult
}

func (*ExptItemEvalCtx) GetExistItemResultLog

func (e *ExptItemEvalCtx) GetExistItemResultLog() *ExptItemResultRunLog

func (*ExptItemEvalCtx) GetExistTurnResultLogs

func (e *ExptItemEvalCtx) GetExistTurnResultLogs() map[int64]*ExptTurnResultRunLog

func (*ExptItemEvalCtx) GetExistTurnResultRunLog

func (e *ExptItemEvalCtx) GetExistTurnResultRunLog(turnID int64) *ExptTurnResultRunLog

func (*ExptItemEvalCtx) GetRecordEvalLogID

func (e *ExptItemEvalCtx) GetRecordEvalLogID(ctx context.Context) (logID string)

func (*ExptItemEvalCtx) GetTurnEvalLogID

func (e *ExptItemEvalCtx) GetTurnEvalLogID(ctx context.Context, turnID int64) (logID string)

type ExptItemEvalEvent

type ExptItemEvalEvent struct {
	SpaceID     int64
	ExptID      int64
	ExptRunID   int64
	ExptRunMode ExptRunMode

	EvalSetItemID      int64
	AsyncReportTrigger bool

	CreateAt   int64
	RetryTimes int
	Ext        map[string]string
	Session    *Session
}

func (*ExptItemEvalEvent) GetEvalSetItemID

func (e *ExptItemEvalEvent) GetEvalSetItemID() int64

func (*ExptItemEvalEvent) GetExptID

func (e *ExptItemEvalEvent) GetExptID() int64

func (*ExptItemEvalEvent) GetExptRunID

func (e *ExptItemEvalEvent) GetExptRunID() int64

type ExptItemEvalResult

type ExptItemEvalResult struct {
	ItemResultRunLog  *ExptItemResultRunLog
	TurnResultRunLogs map[int64]*ExptTurnResultRunLog
}

type ExptItemResult

type ExptItemResult struct {
	ID        int64
	SpaceID   int64
	ExptID    int64
	ExptRunID int64
	ItemID    int64
	Status    ItemRunState
	ErrMsg    string
	ItemIdx   int32
	LogID     string
	Ext       map[string]string
}

item result

type ExptItemResultRunLog

type ExptItemResultRunLog struct {
	ID          int64
	SpaceID     int64
	ExptID      int64
	ExptRunID   int64
	ItemID      int64
	Status      int32
	ErrMsg      []byte
	LogID       string
	ResultState int32
	UpdatedAt   *time.Time
}

type ExptItemResultState

type ExptItemResultState int
const (
	ExptItemResultStateDefault  ExptItemResultState = 0
	ExptItemResultStateLogged   ExptItemResultState = 2
	ExptItemResultStateResulted ExptItemResultState = 1
)

type ExptItemRunLogFilter

type ExptItemRunLogFilter struct {
	Status      []ItemRunState
	ResultState *ExptItemResultState
}

func (*ExptItemRunLogFilter) GetResultState

func (e *ExptItemRunLogFilter) GetResultState() ExptItemResultState

func (*ExptItemRunLogFilter) GetStatus

func (e *ExptItemRunLogFilter) GetStatus() []int32

type ExptListFilter

type ExptListFilter struct {
	FuzzyName string
	Includes  *ExptFilterFields
	Excludes  *ExptFilterFields
}

filter

type ExptResultExportRecord

type ExptResultExportRecord struct {
	ID              int64
	SpaceID         int64
	ExptID          int64
	CsvExportStatus CSVExportStatus
	FilePath        string
	CreatedBy       string
	URL             *string
	Expired         bool
	ErrMsg          string

	StartAt *time.Time
	EndAt   *time.Time
}

type ExptRunCheckOption

type ExptRunCheckOption struct {
	CheckBenefit bool
}

type ExptRunCheckOptionFn

type ExptRunCheckOptionFn func(*ExptRunCheckOption)

func WithCheckBenefit

func WithCheckBenefit() ExptRunCheckOptionFn

type ExptRunLog

type ExptRunLog struct {
	ID            int64
	SpaceID       int64
	CreatedBy     string
	ExptID        int64
	ExptRunID     int64
	ItemIds       []byte
	Mode          int32
	Status        int64
	PendingCnt    int32
	SuccessCnt    int32
	FailCnt       int32
	CreditCost    float64
	TokenCost     int64
	StatusMessage []byte
	ProcessingCnt int32
	TerminatedCnt int32
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

TODO

type ExptRunMode

type ExptRunMode int32
const (
	// EvaluationModeSubmit 创建后提交
	EvaluationModeSubmit ExptRunMode = 1

	// EvaluationModeFailRetry 失败后全部重试
	EvaluationModeFailRetry ExptRunMode = 2

	// EvaluationModeAppend 追加模式
	EvaluationModeAppend ExptRunMode = 3
)

type ExptScheduleEvent

type ExptScheduleEvent struct {
	SpaceID     int64
	ExptID      int64
	ExptRunID   int64
	ExptRunMode ExptRunMode
	ExptType    ExptType

	CreatedAt int64
	Ext       map[string]string
	Session   *Session

	RetryTimes int
}

type ExptSchedulerMode

type ExptSchedulerMode interface {
	Mode() ExptRunMode
	ExptStart(ctx context.Context, event *ExptScheduleEvent, expt *Experiment) error
	ScanEvalItems(ctx context.Context, event *ExptScheduleEvent, expt *Experiment) (toSubmit, incomplete, complete []*ExptEvalItem, err error)
	ExptEnd(ctx context.Context, event *ExptScheduleEvent, expt *Experiment, toSubmit, incomplete int) (nextTick bool, err error)
	ScheduleStart(ctx context.Context, event *ExptScheduleEvent, expt *Experiment) error
	ScheduleEnd(ctx context.Context, event *ExptScheduleEvent, expt *Experiment, toSubmit, incomplete int) error
	NextTick(ctx context.Context, event *ExptScheduleEvent, nextTick bool) error
	PublishResult(ctx context.Context, turnEvaluatorRefs []*ExptTurnEvaluatorResultRef, event *ExptScheduleEvent) error
}

type ExptStats

type ExptStats struct {
	ID                int64
	SpaceID           int64
	ExptID            int64
	PendingItemCnt    int32
	SuccessItemCnt    int32
	FailItemCnt       int32
	ProcessingItemCnt int32
	TerminatedItemCnt int32
	CreditCost        float64
	InputTokenCost    int64
	OutputTokenCost   int64
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

type ExptStatus

type ExptStatus int64
const (
	ExptStatus_Unknown ExptStatus = 0
	// Awaiting execution
	ExptStatus_Pending ExptStatus = 2
	// In progress
	ExptStatus_Processing ExptStatus = 3
	// Execution succeeded
	ExptStatus_Success ExptStatus = 11
	// Execution failed
	ExptStatus_Failed ExptStatus = 12
	// User terminated
	ExptStatus_Terminated ExptStatus = 13
	// System terminated
	ExptStatus_SystemTerminated ExptStatus = 14
	ExptStatus_Terminating      ExptStatus = 15

	// 流式执行完成,不再接收新的请求
	ExptStatus_Draining ExptStatus = 21
)

type ExptTuple

type ExptTuple struct {
	Target     *EvalTarget
	EvalSet    *EvaluationSet
	Evaluators []*Evaluator
}

type ExptTupleID

type ExptTupleID struct {
	VersionedTargetID   *VersionedTargetID
	VersionedEvalSetID  *VersionedEvalSetID
	EvaluatorVersionIDs []int64
}

type ExptTurnAnnotateRecordRef

type ExptTurnAnnotateRecordRef struct {
	ID               int64
	SpaceID          int64
	ExptTurnResultID int64
	TagKeyID         int64
	AnnotateRecordID int64
	ExptID           int64
}

type ExptTurnEvalCtx

type ExptTurnEvalCtx struct {
	*ExptItemEvalCtx
	Turn              *Turn
	ExptTurnRunResult *ExptTurnRunResult
	History           []*Message
	Ext               map[string]string
}

type ExptTurnEvaluatorResultRef

type ExptTurnEvaluatorResultRef struct {
	ID                 int64
	SpaceID            int64
	ExptTurnResultID   int64
	EvaluatorVersionID int64
	EvaluatorResultID  int64
	ExptID             int64
}

type ExptTurnResult

type ExptTurnResult struct {
	ID               int64
	SpaceID          int64
	ExptID           int64
	ExptRunID        int64
	ItemID           int64
	TurnID           int64
	Status           int32
	TraceID          int64
	LogID            string
	TargetResultID   int64
	EvaluatorResults *EvaluatorResults
	ErrMsg           string
	TurnIdx          int32
}

func (*ExptTurnResult) ToRunLogDO

func (tr *ExptTurnResult) ToRunLogDO() *ExptTurnResultRunLog

type ExptTurnResultFilter

type ExptTurnResultFilter struct {
	TrunRunStateFilters []*TurnRunStateFilter
	ScoreFilters        []*ScoreFilter
}

type ExptTurnResultFilterAccelerator

type ExptTurnResultFilterAccelerator struct {
	// 必带字段
	SpaceID     int64     `json:"space_id"`
	ExptID      int64     `json:"expt_id"`
	CreatedDate time.Time `json:"created_date"`
	// 基础查询
	EvaluatorScoreCorrected *FieldFilter   `json:"evaluator_score_corrected"`
	ItemIDs                 []*FieldFilter `json:"item_id"`
	ItemRunStatus           []*FieldFilter `json:"item_status"`
	TurnRunStatus           []*FieldFilter `json:"turn_status"`
	// map类查询条件
	MapCond          *ExptTurnResultFilterMapCond `json:"map_cond,omitempty"`
	ItemSnapshotCond *ItemSnapshotFilter          `json:"item_snapshot_cond,omitempty"`
	// keyword search
	KeywordSearch     *KeywordFilter `json:"keyword_search"`
	Page              Page           `json:"page"`
	EvalSetSyncCkDate string
}

ExptTurnResultFilterAccelerator 用于业务层组合主表字段和map字段的多条件查询 其中map字段支持等值、范围、模糊等多种组合 例如:EvalTargetDataFilters、EvaluatorScoreFilters等 具体用法参考DAO层QueryItemIDs的参数

func (*ExptTurnResultFilterAccelerator) HasFilters

func (e *ExptTurnResultFilterAccelerator) HasFilters() bool

type ExptTurnResultFilterEntity

type ExptTurnResultFilterEntity struct {
	SpaceID                 int64              `json:"space_id"`
	ExptID                  int64              `json:"expt_id"`
	ItemID                  int64              `json:"item_id"`
	ItemIdx                 int32              `json:"item_idx"`
	TurnID                  int64              `json:"turn_id"`
	Status                  ItemRunState       `json:"status"`
	EvalTargetData          map[string]string  `json:"eval_target_data"`
	EvaluatorScore          map[string]float64 `json:"evaluator_score"`
	AnnotationFloat         map[string]float64 `json:"annotation_float"`
	AnnotationBool          map[string]bool    `json:"annotation_bool"`
	AnnotationString        map[string]string  `json:"annotation_string"`
	EvalTargetMetrics       map[string]int64   `json:"eval_target_metrics"`
	CreatedDate             time.Time          `json:"created_date"`
	EvaluatorScoreCorrected bool               `json:"evaluator_score_corrected"`
	EvalSetVersionID        int64              `json:"eval_set_version_id"`
	CreatedAt               time.Time          `json:"created_at"`
	UpdatedAt               time.Time          `json:"updated_at"`
}

type ExptTurnResultFilterEvent

type ExptTurnResultFilterEvent struct {
	ExperimentID int64
	SpaceID      int64
	ItemID       []int64

	RetryTimes *int32
	FilterType *UpsertExptTurnResultFilterType
}

type ExptTurnResultFilterKeyMapping

type ExptTurnResultFilterKeyMapping struct {
	SpaceID   int64            `json:"space_id"`   // 空间id
	ExptID    int64            `json:"expt_id"`    // 实验id
	FromField string           `json:"from_field"` // 筛选项唯一键,评估器: evaluator_version_id,人工标准:tag_key_id
	ToKey     string           `json:"to_key"`     // ck侧的map key,评估器:key1 ~ key10,人工标准:key1 ~ key100
	FieldType FieldTypeMapping `json:"field_type"` // 映射类型,Evaluator —— 1,人工标注—— 2
}

type ExptTurnResultFilterMapCond

type ExptTurnResultFilterMapCond struct {
	EvalTargetDataFilters    []*FieldFilter
	EvaluatorScoreFilters    []*FieldFilter
	AnnotationFloatFilters   []*FieldFilter
	AnnotationBoolFilters    []*FieldFilter
	AnnotationStringFilters  []*FieldFilter
	EvalTargetMetricsFilters []*FieldFilter
}

type ExptTurnResultRunLog

type ExptTurnResultRunLog struct {
	ID                 int64
	SpaceID            int64
	ExptID             int64
	ExptRunID          int64
	ItemID             int64
	TurnID             int64
	Status             TurnRunState
	TraceID            int64
	LogID              string
	TargetResultID     int64
	EvaluatorResultIds *EvaluatorResults
	ErrMsg             string
	UpdatedAt          time.Time
}

type ExptTurnResultTagRef

type ExptTurnResultTagRef struct {
	ID          int64
	SpaceID     int64
	ExptID      int64
	TagKeyID    int64
	TotalCnt    int32
	CompleteCnt int32
}

type ExptTurnRunResult

type ExptTurnRunResult struct {
	TargetResult     *EvalTargetRecord
	EvaluatorResults map[int64]*EvaluatorRecord
	EvalErr          error
	AsyncAbort       bool
}

func (*ExptTurnRunResult) AbortWithTargetResult

func (e *ExptTurnRunResult) AbortWithTargetResult(expt *Experiment) bool

func (*ExptTurnRunResult) GetEvalErr

func (e *ExptTurnRunResult) GetEvalErr() error

func (*ExptTurnRunResult) GetEvaluatorRecord

func (e *ExptTurnRunResult) GetEvaluatorRecord(evaluatorVersionID int64) *EvaluatorRecord

func (*ExptTurnRunResult) SetEvalErr

func (e *ExptTurnRunResult) SetEvalErr(err error) *ExptTurnRunResult

func (*ExptTurnRunResult) SetEvaluatorResults

func (e *ExptTurnRunResult) SetEvaluatorResults(er map[int64]*EvaluatorRecord) *ExptTurnRunResult

func (*ExptTurnRunResult) SetTargetResult

func (e *ExptTurnRunResult) SetTargetResult(er *EvalTargetRecord) *ExptTurnRunResult

type ExptType

type ExptType int64
const (
	ExptType_Offline ExptType = 1
	ExptType_Online  ExptType = 2
)

type ExptUpdateFields

type ExptUpdateFields struct {
	Name string `mapstructure:"name,omitempty"`
	Desc string `mapstructure:"description,omitempty"`
}

func (*ExptUpdateFields) ToFieldMap

func (e *ExptUpdateFields) ToFieldMap() (map[string]any, error)

type FeedbackActionType

type FeedbackActionType int
const (
	FeedbackActionType_Upvote         FeedbackActionType = 1
	FeedbackActionType_CancelUpvote   FeedbackActionType = 2
	FeedbackActionType_Downvote       FeedbackActionType = 3
	FeedbackActionType_CancelDownvote FeedbackActionType = 4
	FeedbackActionType_CreateComment  FeedbackActionType = 5
	FeedbackActionType_Update_Comment FeedbackActionType = 6
	FeedbackActionType_Delete_Comment FeedbackActionType = 7
)

type FieldAdapter

type FieldAdapter struct {
	FieldConfs []*FieldConf
}

type FieldConf

type FieldConf struct {
	FieldName string
	FromField string
	Value     string
}

type FieldData

type FieldData struct {
	Key     string   `json:"key,omitempty"`
	Name    string   `json:"name,omitempty"`
	Content *Content `json:"content,omitempty"`
}

type FieldDisplayFormat

type FieldDisplayFormat int64
const (
	// PlainText 表示纯文本格式
	PlainText FieldDisplayFormat = iota + 1
	// Markdown 表示 Markdown 格式
	Markdown
	// JSON 表示 JSON 格式
	JSON
	// YAML 表示 YAML 格式
	YAML
	// Code 表示代码格式
	Code
)
const (
	FieldDisplayFormat_PlainText FieldDisplayFormat = 1
	FieldDisplayFormat_Markdown  FieldDisplayFormat = 2
	FieldDisplayFormat_JSON      FieldDisplayFormat = 3
	FieldDisplayFormat_YAML      FieldDisplayFormat = 4
	FieldDisplayFormat_Code      FieldDisplayFormat = 5
)

func FieldDisplayFormatFromString

func FieldDisplayFormatFromString(s string) (FieldDisplayFormat, error)

func FieldDisplayFormatPtr

func FieldDisplayFormatPtr(v FieldDisplayFormat) *FieldDisplayFormat

func (*FieldDisplayFormat) Scan

func (p *FieldDisplayFormat) Scan(value interface{}) (err error)

func (FieldDisplayFormat) String

func (p FieldDisplayFormat) String() string

func (*FieldDisplayFormat) Value

func (p *FieldDisplayFormat) Value() (driver.Value, error)

type FieldFilter

type FieldFilter struct {
	Key    string
	Op     string // =, >, >=, <, <=, BETWEEN, LIKE
	Values []any
}

type FieldMapping

type FieldMapping struct {
	Source string
	Target string
}

type FieldSchema

type FieldSchema struct {
	Key                    string                               `json:"key,omitempty"`
	Name                   string                               `json:"name,omitempty"`
	Description            string                               `json:"description,omitempty"`
	ContentType            ContentType                          `json:"content_type,omitempty"`
	DefaultDisplayFormat   FieldDisplayFormat                   `json:"default_display_format,omitempty"`
	Status                 FieldStatus                          `json:"status,omitempty"`
	SchemaKey              *SchemaKey                           `json:"schema_key,omitempty"`
	TextSchema             string                               `json:"text_schema,omitempty"`
	MultiModelSpec         *MultiModalSpec                      `json:"multi_model_spec,omitempty"`
	Hidden                 bool                                 `json:"hidden,omitempty"`
	IsRequired             bool                                 `json:"is_required,omitempty"`
	DefaultTransformations []*dataset.FieldTransformationConfig `json:"default_transformations,omitempty"`
}

type FieldStatus

type FieldStatus int64
const (
	FieldStatus_Available FieldStatus = 1
	FieldStatus_Deleted   FieldStatus = 2
)

func FieldStatusFromString

func FieldStatusFromString(s string) (FieldStatus, error)

func FieldStatusPtr

func FieldStatusPtr(v FieldStatus) *FieldStatus

func (*FieldStatus) Scan

func (p *FieldStatus) Scan(value interface{}) (err error)

func (FieldStatus) String

func (p FieldStatus) String() string

func (*FieldStatus) Value

func (p *FieldStatus) Value() (driver.Value, error)

type FieldType

type FieldType int64
const (
	FieldType_Unknown FieldType = 0
	// 评估器得分, FieldKey为evaluatorVersionID,value为score
	FieldType_EvaluatorScore     FieldType = 1
	FieldType_CreatorBy          FieldType = 2
	FieldType_ExptStatus         FieldType = 3
	FieldType_TurnRunState       FieldType = 4
	FieldType_TargetID           FieldType = 5
	FieldType_EvalSetID          FieldType = 6
	FieldType_EvaluatorID        FieldType = 7
	FieldType_TargetType         FieldType = 8
	FieldType_SourceTarget       FieldType = 9
	FieldType_EvaluatorVersionID FieldType = 20
	FieldType_TargetVersionID    FieldType = 21
	FieldType_EvalSetVersionID   FieldType = 22

	// 标注项, FieldKey为TagKeyID
	FieldType_Annotation FieldType = 23

	FieldType_TargetLatency      FieldType = 50
	FieldType_TargetInputTokens  FieldType = 51
	FieldType_TargetOutputTokens FieldType = 52
	FieldType_TargetTotalTokens  FieldType = 53
)

type FieldTypeMapping

type FieldTypeMapping int32

FieldTypeMapping 定义 ExptTurnResultFilterKeyMapping 中 FieldType 的常量

const (
	// FieldTypeUnknown 未知类型
	FieldTypeUnknown FieldTypeMapping = 0
	// FieldTypeEvaluator 评估器类型
	FieldTypeEvaluator FieldTypeMapping = 1
	// FieldTypeManualAnnotation 人工标注类型
	FieldTypeManualAnnotation FieldTypeMapping = 2
)

type FileFormat

type FileFormat int64
const (
	FileFormat_JSONL   FileFormat = 1
	FileFormat_Parquet FileFormat = 2
	FileFormat_CSV     FileFormat = 3
	FileFormat_XLSX    FileFormat = 4
	/*[100, 200) 压缩格式*/
	FileFormat_ZIP FileFormat = 100
)

func (FileFormat) String

func (p FileFormat) String() string

type FilterLogicOp

type FilterLogicOp int32

FilterLogicOp 筛选逻辑操作符

const (
	FilterLogicOp_Unknown FilterLogicOp = 0
	FilterLogicOp_And     FilterLogicOp = 1 // 与操作
	FilterLogicOp_Or      FilterLogicOp = 2 // 或操作
)

func (FilterLogicOp) IsValid

func (f FilterLogicOp) IsValid() bool

IsValid 检查FilterLogicOp是否有效

func (FilterLogicOp) String

func (f FilterLogicOp) String() string

String 返回FilterLogicOp的字符串表示

type Function

type Function struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Parameters  string `json:"parameters"`
}

type FunctionCall

type FunctionCall struct {
	Name      string  `json:"name"`
	Arguments *string `json:"arguments,omitempty"`
}

type GetEvaluationSetItemFieldParam

type GetEvaluationSetItemFieldParam struct {
	SpaceID         int64
	EvaluationSetID int64
	// item 的主键ID,即 item.ID 这一字段
	ItemPK int64
	// 列名
	FieldName string
	// 当 item 为多轮时,必须提供
	TurnID *int64
}

type GetEvaluatorTemplateRequest

type GetEvaluatorTemplateRequest struct {
	ID             int64 `json:"id" validate:"required,gt=0"` // 模板ID
	IncludeDeleted bool  `json:"include_deleted,omitempty"`   // 是否包含已删除记录
}

GetEvaluatorTemplateRequest 获取评估器模板请求

type GetEvaluatorTemplateResponse

type GetEvaluatorTemplateResponse struct {
	Template *EvaluatorTemplate `json:"template"` // 模板详情
}

GetEvaluatorTemplateResponse 获取评估器模板响应

type GetExptTupleOption

type GetExptTupleOption struct {
	WithoutDeleted bool
}

type GetExptTupleOptionFn

type GetExptTupleOptionFn func(*GetExptTupleOption)

func WithoutTupleDeleted

func WithoutTupleDeleted() GetExptTupleOptionFn

type HTTPInfo

type HTTPInfo struct {
	Method HTTPMethod
	Path   string
}

type HTTPMethod

type HTTPMethod = string

type IRuntimeParam

type IRuntimeParam interface {
	GetJSONDemo() string
	GetJSONValue() string
	ParseFromJSON(val string) (IRuntimeParam, error)
}

func NewPromptRuntimeParam

func NewPromptRuntimeParam(modelConfig *ModelConfig) IRuntimeParam

type Image

type Image struct {
	Name            *string          `json:"name,omitempty"`
	URL             *string          `json:"url,omitempty"`
	URI             *string          `json:"uri,omitempty"`
	ThumbURL        *string          `json:"thumb_url,omitempty"`
	StorageProvider *StorageProvider `json:"storage_provider,omitempty"`
}

Image 图片结构体

type InsightAnalysisReportIndex

type InsightAnalysisReportIndex struct {
	ID    string
	Title string
}

type InsightAnalysisReportVoteType

type InsightAnalysisReportVoteType int

InsightAnalysisReportVoteType 洞察报告反馈类型

type InsightAnalysisStatus

type InsightAnalysisStatus int
const (
	InsightAnalysisStatus_Unknown InsightAnalysisStatus = 0
	InsightAnalysisStatus_Running InsightAnalysisStatus = 1
	InsightAnalysisStatus_Success InsightAnalysisStatus = 2
	InsightAnalysisStatus_Failed  InsightAnalysisStatus = 3
)

type InvokeExptReq

type InvokeExptReq struct {
	ExptID  int64
	RunID   int64
	SpaceID int64
	Session *Session

	Items []*EvaluationSetItem

	Ext map[string]string
}

type ItemErrorDetail

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

type ItemErrorGroup

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

type ItemErrorType

type ItemErrorType int64
const (
	// schema 不匹配
	ItemErrorType_MismatchSchema ItemErrorType = 1
	// 空数据
	ItemErrorType_EmptyData ItemErrorType = 2
	// 单条数据大小超限
	ItemErrorType_ExceedMaxItemSize ItemErrorType = 3
	// 数据集容量超限
	ItemErrorType_ExceedDatasetCapacity ItemErrorType = 4
	// 文件格式错误
	ItemErrorType_MalformedFile ItemErrorType = 5
	// 包含非法内容
	ItemErrorType_IllegalContent ItemErrorType = 6
	// 缺少必填字段
	ItemErrorType_MissingRequiredField ItemErrorType = 7
	// 数据嵌套层数超限
	ItemErrorType_ExceedMaxNestedDepth ItemErrorType = 8
	// 数据转换失败
	ItemErrorType_TransformItemFailed ItemErrorType = 9
	// 图片数量超限
	ItemErrorType_ExceedMaxImageCount ItemErrorType = 10
	// 图片大小超限
	ItemErrorType_ExceedMaxImageSize ItemErrorType = 11
	// 图片获取失败(例如图片不存在/访问不在白名单内的内网链接)
	ItemErrorType_GetImageFailed ItemErrorType = 12
	// 文件扩展名不合法
	ItemErrorType_IllegalExtension ItemErrorType = 13
	/* system error*/
	ItemErrorType_InternalError ItemErrorType = 100
	// 上传图片失败
	ItemErrorType_UploadImageFailed ItemErrorType = 103
)

func ItemErrorTypeFromString

func ItemErrorTypeFromString(s string) (ItemErrorType, error)

func (ItemErrorType) String

func (p ItemErrorType) String() string

type ItemResult

type ItemResult struct {
	ItemID int64
	// row粒度实验结果详情
	TurnResults []*TurnResult
	SystemInfo  *ItemSystemInfo
	ItemIndex   *int64
	Ext         map[string]string
}

type ItemRunState

type ItemRunState int64
const (
	ItemRunState_Unknown ItemRunState = -1
	// Queuing
	ItemRunState_Queueing ItemRunState = 0
	// Processing
	ItemRunState_Processing ItemRunState = 1
	// Success
	ItemRunState_Success ItemRunState = 2
	// Failure
	ItemRunState_Fail ItemRunState = 3
	// Terminated
	ItemRunState_Terminal ItemRunState = 5
)

type ItemSnapshotFieldMapping

type ItemSnapshotFieldMapping struct {
	FieldKey string `json:"field_key"`
	// float_map, int_map, string_map, tag_array
	MappingKey string `json:"mapping_key"`
	// tag_array时,无值
	MappingSubKey string `json:"mapping_subKey"`
}

type ItemSnapshotFilter

type ItemSnapshotFilter struct {
	BoolMapFilters   []*FieldFilter
	FloatMapFilters  []*FieldFilter
	IntMapFilters    []*FieldFilter
	StringMapFilters []*FieldFilter
}

type ItemSystemInfo

type ItemSystemInfo struct {
	RunState ItemRunState
	LogID    *string
	Error    *RunError
}

type ItemTurnID

type ItemTurnID struct {
	ItemID int64
	TurnID int64
}

type KeywordFilter

type KeywordFilter struct {
	ItemSnapshotFilter    *ItemSnapshotFilter
	EvalTargetDataFilters []*FieldFilter
	Keyword               *string
}

type LLMCallParam

type LLMCallParam struct {
	SpaceID     int64
	EvaluatorID string
	UserID      *string

	Scenario       Scenario
	Messages       []*Message
	Tools          []*Tool
	ToolCallConfig *ToolCallConfig
	ModelConfig    *ModelConfig
}

type LanguageType

type LanguageType string

LanguageType 编程语言类型

const (
	LanguageTypePython LanguageType = "Python"
	LanguageTypeJS     LanguageType = "JS"
)

type ListBuiltinEvaluatorRequest

type ListBuiltinEvaluatorRequest struct {
	FilterOption *EvaluatorFilterOption `json:"filter_option,omitempty"` // 标签筛选条件
	PageSize     int32                  `json:"page_size,omitempty"`
	PageNum      int32                  `json:"page_num,omitempty"`
	WithVersion  bool                   `json:"with_version,omitempty"`
}

type ListEvaluationSetItemsParam

type ListEvaluationSetItemsParam struct {
	SpaceID         int64
	EvaluationSetID int64
	VersionID       *int64
	PageNumber      *int32
	PageSize        *int32
	PageToken       *string
	OrderBys        []*OrderBy
	ItemIDsNotIn    []int64
}

type ListEvaluationSetVersionsParam

type ListEvaluationSetVersionsParam struct {
	SpaceID         int64
	EvaluationSetID int64
	PageToken       *string
	PageSize        *int32
	PageNumber      *int32
	VersionLike     *string
	Versions        []string // 精确查询
}

type ListEvaluationSetsParam

type ListEvaluationSetsParam struct {
	SpaceID          int64
	EvaluationSetIDs []int64
	Name             *string
	Creators         []string
	PageNumber       *int32
	PageSize         *int32
	PageToken        *string
	OrderBys         []*OrderBy
}

type ListEvaluatorRequest

type ListEvaluatorRequest struct {
	SpaceID       int64                  `json:"space_id"`
	SearchName    string                 `json:"search_name,omitempty"`
	CreatorIDs    []int64                `json:"creator_ids,omitempty"`
	EvaluatorType []EvaluatorType        `json:"evaluator_type,omitempty"`
	FilterOption  *EvaluatorFilterOption `json:"filter_option,omitempty"` // 标签筛选条件
	PageSize      int32                  `json:"page_size,omitempty"`
	PageNum       int32                  `json:"page_num,omitempty"`
	OrderBys      []*OrderBy             `json:"order_bys,omitempty"`
	WithVersion   bool                   `json:"with_version,omitempty"`
}

type ListEvaluatorTemplateRequest

type ListEvaluatorTemplateRequest struct {
	SpaceID        int64                  `json:"space_id" validate:"required,gt=0"`           // 空间ID
	FilterOption   *EvaluatorFilterOption `json:"filter_option,omitempty"`                     // 标签筛选条件
	PageSize       int32                  `json:"page_size" validate:"required,min=1,max=100"` // 分页大小
	PageNum        int32                  `json:"page_num" validate:"required,min=1"`          // 页码
	IncludeDeleted bool                   `json:"include_deleted,omitempty"`                   // 是否包含已删除记录
}

ListEvaluatorTemplateRequest 查询评估器模板列表请求

type ListEvaluatorTemplateResponse

type ListEvaluatorTemplateResponse struct {
	TotalCount int64                `json:"total_count"` // 总数量
	Templates  []*EvaluatorTemplate `json:"templates"`   // 模板列表
	PageSize   int32                `json:"page_size"`   // 分页大小
	PageNum    int32                `json:"page_num"`    // 页码
	TotalPages int32                `json:"total_pages"` // 总页数
}

ListEvaluatorTemplateResponse 查询评估器模板列表响应

type ListEvaluatorVersionRequest

type ListEvaluatorVersionRequest struct {
	SpaceID       int64      `json:"space_id"`
	EvaluatorID   int64      `json:"evaluator_id,omitempty"`
	QueryVersions []string   `json:"query_versions,omitempty"`
	PageSize      int32      `json:"page_size,omitempty"`
	PageNum       int32      `json:"page_num,omitempty"`
	OrderBys      []*OrderBy `json:"order_bys,omitempty"`
}

type ListEvaluatorVersionResponse

type ListEvaluatorVersionResponse struct {
	EvaluatorVersions []*Evaluator `json:"evaluator_versions,omitempty"`
	Total             int64        `json:"total,omitempty"`
}

type ListSourceParam

type ListSourceParam struct {
	TargetType EvalTargetType
	SpaceID    *int64
	PageSize   *int32
	Cursor     *string
	KeyWord    *string
}

type ListSourceVersionParam

type ListSourceVersionParam struct {
	TargetType     EvalTargetType
	SpaceID        *int64
	PageSize       *int32
	Cursor         *string
	SourceTargetID string
}

type LoopPrompt

type LoopPrompt struct {
	PromptID     int64
	Version      string
	PromptKey    string       `json:"-"`
	Name         string       `json:"-"`
	SubmitStatus SubmitStatus `json:"-"`
	Description  string       `json:"-"`
}

type MGetExperimentReportResult

type MGetExperimentReportResult struct {
	ColumnEvaluators      []*ColumnEvaluator
	ExptColumnEvaluators  []*ExptColumnEvaluator
	ColumnEvalSetFields   []*ColumnEvalSetField
	ExptColumnAnnotations []*ExptColumnAnnotation
	ItemResults           []*ItemResult
	ExptColumnsEvalTarget []*ExptColumnEvalTarget
	Total                 int64
}

type MGetExperimentResultParam

type MGetExperimentResultParam struct {
	SpaceID            int64
	ExptIDs            []int64
	BaseExptID         *int64
	Filters            map[int64]*ExptTurnResultFilter
	FilterAccelerators map[int64]*ExptTurnResultFilterAccelerator
	UseAccelerator     bool
	Page               Page
}

type Message

type Message struct {
	Role    Role              `json:"role,omitempty"`
	Content *Content          `json:"content,omitempty"`
	Ext     map[string]string `json:"ext,omitempty"`
}

Message 消息结构体

type ModelClass

type ModelClass int64

ModelClass 模型系列枚举

const (
	Undefined ModelClass = 0
	GPT       ModelClass = 1
	SEED      ModelClass = 2
	Gemini    ModelClass = 3
	Claude    ModelClass = 4
	Ernie     ModelClass = 5
	Baichuan  ModelClass = 6
	Qwen      ModelClass = 7
	GML       ModelClass = 8
	DeepSeek  ModelClass = 9
)

type ModelConfig

type ModelConfig struct {
	ModelID     int64          `json:"model_id"`
	ModelName   string         `json:"model_name"`
	MaxTokens   *int32         `json:"max_tokens,omitempty"`
	Temperature *float64       `json:"temperature,omitempty"`
	TopP        *float64       `json:"top_p,omitempty"`
	ToolChoice  ToolChoiceType `json:"tool_choice" jsonschema:"-"`

	ProviderModelID *string `json:"provider_model_id,omitempty" jsonschema:"-"`

	JSONExt *string `json:"json_ext,omitempty"`
}

type MultiModalSpec

type MultiModalSpec struct {
	MaxFileCount     int64    `json:"max_file_count,omitempty"`
	MaxFileSize      int64    `json:"max_file_size,omitempty"`
	SupportedFormats []string `json:"supported_formats,omitempty"`
	MaxPartCount     int32    `json:"max_part_count,omitempty"`
}

type ObjectStorage

type ObjectStorage struct {
	Provider *StorageProvider `json:"provider,omitempty"`
	Name     *string          `json:"name,omitempty"`
	URI      *string          `json:"uri,omitempty"`
	URL      *string          `json:"url,omitempty"`
	ThumbURL *string          `json:"thumb_url,omitempty"`
}

type OnlineExptEvalResultEvent

type OnlineExptEvalResultEvent struct {
	ExptId          int64                       `json:"expt_id,omitempty"`
	TurnEvalResults []*OnlineExptTurnEvalResult `json:"turn_eval_results,omitempty"`
}

OnlineExptEvalResultEvent 定义在线实验评估结果事件结构体

type OnlineExptTurnEvalResult

type OnlineExptTurnEvalResult struct {
	EvaluatorVersionId int64              `json:"evaluator_version_id"`
	EvaluatorRecordId  int64              `json:"evaluator_record_id"`
	Score              float64            `json:"score"`
	Reasoning          string             `json:"reasoning"`
	Status             int32              `json:"status"`
	EvaluatorRunError  *EvaluatorRunError `json:"evaluator_run_error"`
	Ext                map[string]string  `json:"ext"`

	BaseInfo *BaseInfo `json:"base_info"`
}

OnlineExptTurnEvalResult 定义在线实验轮次评估结果结构体

type Opt

type Opt struct {
	PublishVersion   *string
	BotInfoType      CozeBotInfoType
	CustomEvalTarget *CustomEvalTarget
	Region           *Region
	Env              *string
}

type Option

type Option func(option *Opt)

func WithCozeBotInfoType

func WithCozeBotInfoType(botInfoType CozeBotInfoType) Option

func WithCozeBotPublishVersion

func WithCozeBotPublishVersion(publishVersion *string) Option

func WithCustomEvalTarget

func WithCustomEvalTarget(customTarget *CustomEvalTarget) Option

func WithEnv

func WithEnv(env *string) Option

func WithRegion

func WithRegion(region *Region) Option

type OptionDistributionData

type OptionDistributionData struct {
	OptionDistributionItems []*OptionDistributionItem
}

type OptionDistributionItem

type OptionDistributionItem struct {
	Option     string // 选项ID,TOP5以外的聚合展示为“其他”
	Count      int64
	Percentage float64
}

type OrderBy

type OrderBy struct {
	Field *string `json:"field,omitempty"`
	IsAsc *bool   `json:"is_asc,omitempty"`
}

OrderBy 排序结构体

type Page

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

func NewPage

func NewPage(offset, limit int) Page

func (Page) Limit

func (p Page) Limit() int

func (Page) Offset

func (p Page) Offset() int

type ParseImportSourceFileParam

type ParseImportSourceFileParam struct {
	SpaceID int64
	File    *DatasetIOFile
}

type ParseImportSourceFileResult

type ParseImportSourceFileResult struct {
	Bytes                    int64
	FieldSchemas             []*FieldSchema
	Conflicts                []*ConflictField
	FilesWithAmbiguousColumn []string
}

type ParseType

type ParseType string
const (
	ParseTypeFunctionCall ParseType = "function_call"
	ParseTypeContent      ParseType = "content"
)

type PromptEvaluatorContent

type PromptEvaluatorContent struct {
	MessageList  []*Message   `json:"message_list"`
	ModelConfig  *ModelConfig `json:"model_config"`
	Tools        []*Tool      `json:"tools"`
	ParseType    ParseType    `json:"parse_type"`
	PromptSuffix string       `json:"prompt_suffix"`
}

type PromptEvaluatorVersion

type PromptEvaluatorVersion struct {
	ID                 int64            `json:"id"`
	SpaceID            int64            `json:"space_id"`
	EvaluatorType      EvaluatorType    `json:"evaluator_type"`
	EvaluatorID        int64            `json:"evaluator_id"`
	Description        string           `json:"description"`
	Version            string           `json:"version"`
	InputSchemas       []*ArgsSchema    `json:"input_schemas"`
	PromptSourceType   PromptSourceType `json:"prompt_source_type"`
	PromptTemplateKey  string           `json:"prompt_template_key"`
	MessageList        []*Message       `json:"message_list"`
	ModelConfig        *ModelConfig     `json:"model_config"`
	Tools              []*Tool          `json:"tools"`
	ReceiveChatHistory *bool            `json:"receive_chat_history"`
	BaseInfo           *BaseInfo        `json:"base_info"`
	ParseType          ParseType        `json:"parse_type"`
	PromptSuffix       string           `json:"prompt_suffix"`
}

func (*PromptEvaluatorVersion) GetBaseInfo

func (do *PromptEvaluatorVersion) GetBaseInfo() *BaseInfo

func (*PromptEvaluatorVersion) GetDescription

func (do *PromptEvaluatorVersion) GetDescription() string

func (*PromptEvaluatorVersion) GetEvaluatorID

func (do *PromptEvaluatorVersion) GetEvaluatorID() int64

func (*PromptEvaluatorVersion) GetID

func (do *PromptEvaluatorVersion) GetID() int64

func (*PromptEvaluatorVersion) GetModelConfig

func (do *PromptEvaluatorVersion) GetModelConfig() *ModelConfig

func (*PromptEvaluatorVersion) GetPromptTemplateKey

func (do *PromptEvaluatorVersion) GetPromptTemplateKey() string

func (*PromptEvaluatorVersion) GetSpaceID

func (do *PromptEvaluatorVersion) GetSpaceID() int64

func (*PromptEvaluatorVersion) GetVersion

func (do *PromptEvaluatorVersion) GetVersion() string

func (*PromptEvaluatorVersion) SetBaseInfo

func (do *PromptEvaluatorVersion) SetBaseInfo(baseInfo *BaseInfo)

func (*PromptEvaluatorVersion) SetDescription

func (do *PromptEvaluatorVersion) SetDescription(description string)

func (*PromptEvaluatorVersion) SetEvaluatorID

func (do *PromptEvaluatorVersion) SetEvaluatorID(evaluatorID int64)

func (*PromptEvaluatorVersion) SetID

func (do *PromptEvaluatorVersion) SetID(id int64)

func (*PromptEvaluatorVersion) SetParseType

func (do *PromptEvaluatorVersion) SetParseType(parseType ParseType)

func (*PromptEvaluatorVersion) SetPromptSuffix

func (do *PromptEvaluatorVersion) SetPromptSuffix(promptSuffix string)

func (*PromptEvaluatorVersion) SetSpaceID

func (do *PromptEvaluatorVersion) SetSpaceID(spaceID int64)

func (*PromptEvaluatorVersion) SetTools

func (do *PromptEvaluatorVersion) SetTools(tools []*Tool)

func (*PromptEvaluatorVersion) SetVersion

func (do *PromptEvaluatorVersion) SetVersion(version string)

func (*PromptEvaluatorVersion) ValidateBaseInfo

func (do *PromptEvaluatorVersion) ValidateBaseInfo() error

ValidateBaseInfo 校验评估器基本信息

func (*PromptEvaluatorVersion) ValidateInput

func (do *PromptEvaluatorVersion) ValidateInput(input *EvaluatorInputData) error

ValidateInput 验证输入数据

type PromptRuntimeParam

type PromptRuntimeParam struct {
	ModelConfig *ModelConfig `json:"model_config" jsonschema:"description:ModelConfig"`
}

func (*PromptRuntimeParam) GetJSONDemo

func (p *PromptRuntimeParam) GetJSONDemo() string

func (*PromptRuntimeParam) GetJSONValue

func (p *PromptRuntimeParam) GetJSONValue() string

func (*PromptRuntimeParam) ParseFromJSON

func (p *PromptRuntimeParam) ParseFromJSON(val string) (IRuntimeParam, error)

type PromptSourceType

type PromptSourceType int64
const (
	PromptSourceTypeBuiltinTemplate PromptSourceType = 1
	PromptSourceTypeLoopPrompt      PromptSourceType = 2
	PromptSourceTypeCustom          PromptSourceType = 3
)

type Provider

type Provider int64

Provider 模型提供方枚举

const (
	GPTOpenAPI Provider = 1
	Maas       Provider = 2
	BotEngine  Provider = 3
	Merlin     Provider = 4
	MerlinSeed Provider = 5
)

type ProviderAuth

type ProviderAuth struct {
	// provider == VETOS 时,此处存储的是用户在 fornax 上托管的方舟账号的ID
	ProviderAccountID *int64
}

type QuotaSpaceExpt

type QuotaSpaceExpt struct {
	ExptID2RunTime map[int64]int64 // id -> unix
}

func (*QuotaSpaceExpt) Serialize

func (q *QuotaSpaceExpt) Serialize() ([]byte, error)

type RateLimit

type RateLimit struct {
	Rate   *int32         `json:"rate,omitempty"`
	Burst  *int32         `json:"burst,omitempty"`
	Period *time.Duration `json:"period,omitempty"`
}

type Region

type Region = string

type Reply

type Reply struct {
	Item          *ReplyItem `json:"item,omitempty"`
	DebugID       int64      `json:"debug_id"`
	DebugStep     int32      `json:"debug_step"`
	DebugTraceKey string     `json:"debug_trace_key"`
}

type ReplyItem

type ReplyItem struct {
	Content          *string     `json:"content,omitempty"`
	ReasoningContent *string     `json:"reasoning_content,omitempty"`
	ToolCalls        []*ToolCall `json:"tool_calls,omitempty"`
	FinishReason     string      `json:"finish_reason"`
	TokenUsage       *TokenUsage `json:"token_usage,omitempty"`
}

type ReportStatus

type ReportStatus int64
const (
	// 未定义
	ReportStatus_Unknown ReportStatus = 0
	// 进行中
	ReportStatus_Running ReportStatus = 1
	// 生成成功
	ReportStatus_Success ReportStatus = 2
	// 生成失败
	ReportStatus_Failed ReportStatus = 3
)

type ReportTargetRecordParam

type ReportTargetRecordParam struct {
	SpaceID    int64
	RecordID   int64
	Status     EvalTargetRunStatus
	OutputData *EvalTargetOutputData

	Session *Session
}

type ResultErrConvert

type ResultErrConvert struct {
	MatchedText string `json:"matched_text" mapstructure:"matched_text"`
	ToErrCode   int32  `json:"to_err_code" mapstructure:"to_err_code"`
	ToErrMsg    string `json:"to_err_msg" mapstructure:"to_err_msg"`
	AsDefault   bool   `json:"as_default" mapstructure:"as_default"`
}

func (*ResultErrConvert) ConvertErrMsg

func (r *ResultErrConvert) ConvertErrMsg(msg string) (bool, string)

type RetryConf

type RetryConf struct {
	RetryTimes          int  `json:"retry_times" mapstructure:"retry_times"`
	RetryIntervalSecond int  `json:"retry_interval_second" mapstructure:"retry_interval_second"`
	IsInDebt            bool `json:"is_in_debt" mapstructure:"is_in_debt"`
}

func (*RetryConf) GetRetryInterval

func (e *RetryConf) GetRetryInterval() time.Duration

func (*RetryConf) GetRetryTimes

func (e *RetryConf) GetRetryTimes() int

type Role

type Role int64

Role 角色枚举

const (
	RoleUndefined Role = 0
	RoleSystem    Role = 1
	RoleUser      Role = 2
	RoleAssistant Role = 3
	RoleTool      Role = 4
)

type RootTrajectoryAnalysisResult

type RootTrajectoryAnalysisResult struct {
	StepID  string                     `json:"step_id,omitempty"`
	Status  InsightAnalysisStatus      `json:"status,omitempty"`
	Summary string                     `json:"summary,omitempty"`
	Issues  []*TrajectoryAnalysisIssue `json:"issues,omitempty"`
}

type RunData

type RunData struct {
	Input           EvalContent `json:"input"`
	Output          EvalContent `json:"output"`
	ReferenceOutput EvalContent `json:"reference_output"`
}

RunData 运行数据

type RunError

type RunError struct {
	Code    int64
	Message *string
	Detail  *string
}

type RunEvaluatorRequest

type RunEvaluatorRequest struct {
	SpaceID            int64               `json:"space_id"`
	Name               string              `json:"name"`
	EvaluatorVersionID int64               `json:"evaluator_version_id"`
	InputData          *EvaluatorInputData `json:"input_data"`
	ExperimentID       int64               `json:"experiment_id,omitempty"`
	ExperimentRunID    int64               `json:"experiment_run_id,omitempty"`
	ItemID             int64               `json:"item_id,omitempty"`
	TurnID             int64               `json:"turn_id,omitempty"`
	Ext                map[string]string   `json:"ext,omitempty"`
	DisableTracing     bool                `json:"disable_tracing,omitempty"`
}

type RuntimeCapabilities

type RuntimeCapabilities struct {
	SupportedLanguages []string `json:"supported_languages"`
	MaxMemoryMB        int64    `json:"max_memory_mb"`
	MaxExecutionTime   int64    `json:"max_execution_time_seconds"`
	NetworkAccess      bool     `json:"network_access"`
	FileSystemAccess   bool     `json:"file_system_access"`
}

RuntimeCapabilities 运行时能力

type SandboxConfig

type SandboxConfig struct {
	MemoryLimit    int64         `json:"memory_limit"`    // 内存限制 (MB)
	TimeoutLimit   time.Duration `json:"timeout_limit"`   // 执行超时时间
	MaxOutputSize  int64         `json:"max_output_size"` // 最大输出大小 (bytes)
	NetworkEnabled bool          `json:"network_enabled"` // 是否允许网络访问
}

SandboxConfig 沙箱配置

func DefaultSandboxConfig

func DefaultSandboxConfig() *SandboxConfig

DefaultSandboxConfig 默认沙箱配置

type SandboxExecutionRequest

type SandboxExecutionRequest struct {
	Code        string            `json:"code"`
	Language    string            `json:"language"`
	Input       *EvalInput        `json:"input,omitempty"`
	Config      *SandboxConfig    `json:"config,omitempty"`
	Environment map[string]string `json:"environment,omitempty"`
}

SandboxExecutionRequest 沙箱代码执行请求

type SandboxExecutionResult

type SandboxExecutionResult struct {
	Output      *EvalOutput   `json:"output"`
	Error       string        `json:"error,omitempty"`
	ExitCode    int           `json:"exit_code"`
	Duration    time.Duration `json:"duration"`
	MemoryUsage int64         `json:"memory_usage"`
	Success     bool          `json:"success"`
	Stdout      string        `json:"stdout,omitempty"`
	Stderr      string        `json:"stderr,omitempty"`
}

SandboxExecutionResult 沙箱代码执行结果

type Scenario

type Scenario string
const (
	ScenarioDefault    Scenario = "default"
	ScenarioEvalTarget Scenario = "eval_target"
	ScenarioEvaluator  Scenario = "evaluator"
)

type SchedulerAbortCtrl

type SchedulerAbortCtrl struct {
	UserExptTypeCtrl  map[string][]ExptType `json:"user_expt_type_ctrl" mapstructure:"user_expt_type_ctrl"`
	SpaceExptTypeCtrl map[int64][]ExptType  `json:"space_expt_type_ctrl" mapstructure:"space_expt_type_ctrl"`
	ExptIDCtrl        map[int64]bool        `json:"expt_id_ctrl" mapstructure:"expt_id_ctrl"`
}

func (*SchedulerAbortCtrl) Abort

func (s *SchedulerAbortCtrl) Abort(spaceID, exptID int64, userID string, exptType ExptType) bool

type SchemaKey

type SchemaKey int64
const (
	SchemaKey_String  SchemaKey = 1
	SchemaKey_Integer SchemaKey = 2
	SchemaKey_Float   SchemaKey = 3
	SchemaKey_Bool    SchemaKey = 4
	SchemaKey_Message SchemaKey = 5
	// 单选
	SchemaKey_SingleChoice SchemaKey = 6
	// 轨迹
	SchemaKey_Trajectory SchemaKey = 7
)

func (SchemaKey) String

func (p SchemaKey) String() string

type ScoreDistributionData

type ScoreDistributionData struct {
	ScoreDistributionItems []*ScoreDistributionItem
}

type ScoreDistributionItem

type ScoreDistributionItem struct {
	Score      string  // 得分,TOP5以外的聚合展示为“其他”
	Count      int64   // 此得分的数量
	Percentage float64 // 占总数的百分比
}

type ScoreFilter

type ScoreFilter struct {
	Score              float64
	Operator           string
	EvaluatorVersionID int64
}

type ScoreType

type ScoreType int64
const (
	ScoreTypeRange ScoreType = 1
	ScoreTypeEnum  ScoreType = 2
)

type SearchCustomEvalTargetParam

type SearchCustomEvalTargetParam struct {
	WorkspaceID     *int64
	Keyword         *string
	ApplicationID   *int64
	CustomRPCServer *CustomRPCServer
	Region          *Region
	Env             *string
	PageSize        *int32
	PageToken       *string
}

type Session

type Session struct {
	UserID string
	AppID  int32
}

func NewSession

func NewSession(ctx context.Context) *Session

type SetSourceType

type SetSourceType int64
const (
	SetSourceType_File    SetSourceType = 1
	SetSourceType_Dataset SetSourceType = 2
)

func SetSourceTypeFromString

func SetSourceTypeFromString(s string) (SetSourceType, error)

func (SetSourceType) String

func (p SetSourceType) String() string

type SourceInfo

type SourceInfo struct {
	StepId string `json:"step_id,omitempty"`
	Desc   string `json:"desc,omitempty"`
}

type SourceType

type SourceType = int64
const (
	SourceType_Evaluation SourceType = 1
	SourceType_Trace      SourceType = 2
)

type SpecificFieldInfo

type SpecificFieldInfo struct {
	FieldKey  string
	FieldType FieldType
}

type StatsCntArithOp

type StatsCntArithOp struct {
	OpStatusCnt map[ItemRunState]int
}

type StorageProvider

type StorageProvider int64
const (
	StorageProvider_TOS    StorageProvider = 1
	StorageProvider_VETOS  StorageProvider = 2
	StorageProvider_HDFS   StorageProvider = 3
	StorageProvider_ImageX StorageProvider = 4
	StorageProvider_S3     StorageProvider = 5
	/* 后端内部使用 */
	StorageProvider_Abase   StorageProvider = 100
	StorageProvider_RDS     StorageProvider = 101
	StorageProvider_LocalFS StorageProvider = 102
)

func StorageProviderFromString

func StorageProviderFromString(s string) (StorageProvider, error)

func StorageProviderPtr

func StorageProviderPtr(v StorageProvider) *StorageProvider

func (StorageProvider) String

func (p StorageProvider) String() string

type SubmitStatus

type SubmitStatus int64
const (
	SubmitStatus_Undefined SubmitStatus = 0
	// 未提交
	SubmitStatus_UnSubmit SubmitStatus = 1
	// 已提交
	SubmitStatus_Submitted SubmitStatus = 2
)

type SystemMaintainerConf

type SystemMaintainerConf struct {
	UserIDs []string `json:"user_ids" mapstructure:"user_ids"`
}

type TagContentSpec

type TagContentSpec struct {
	ContinuousNumberSpec *ContinuousNumberSpec
}

type TagContentType

type TagContentType string

type TagInfo

type TagInfo struct {
	TagKeyId       int64
	TagKeyName     string
	Description    string
	InActive       bool
	TagContentType TagContentType
	TagValues      []*TagValue
	TagContentSpec *TagContentSpec
	TagStatus      TagStatus
}

type TagStatus

type TagStatus = string

type TagValue

type TagValue struct {
	TagValueId   int64
	TagValueName string
	Status       TagStatus // 选项是否被禁用
}

type TargetConf

type TargetConf struct {
	TargetVersionID int64
	IngressConf     *TargetIngressConf
}

func (*TargetConf) Valid

func (t *TargetConf) Valid(ctx context.Context, targetType EvalTargetType) error

type TargetIngressConf

type TargetIngressConf struct {
	EvalSetAdapter *FieldAdapter
	CustomConf     *FieldAdapter
}

type TargetTrajectoryConf

type TargetTrajectoryConf struct {
	ExtractIntervalSecond      int64           `json:"extract_interval_second" mapstructure:"extract_interval_second"`
	SpaceExtractIntervalSecond map[int64]int64 `json:"space_extract_interval_second" mapstructure:"space_extract_interval_second"`
}

func (*TargetTrajectoryConf) GetExtractInterval

func (t *TargetTrajectoryConf) GetExtractInterval(spaceID int64) time.Duration

type TokenUsage

type TokenUsage struct {
	InputTokens  int64 `json:"input_tokens"`
	OutputTokens int64 `json:"output_tokens"`
}

type Tool

type Tool struct {
	Type     ToolType  `json:"type"`
	Function *Function `json:"function,omitempty"`
}

type ToolCall

type ToolCall struct {
	Index        int64         `json:"index"`
	ID           string        `json:"id"`
	Type         ToolType      `json:"type"`
	FunctionCall *FunctionCall `json:"function_call,omitempty"`
}

type ToolCallConfig

type ToolCallConfig struct {
	ToolChoice ToolChoiceType `json:"tool_choice"`
}

type ToolChoiceType

type ToolChoiceType string
const (
	ToolChoiceTypeNone     ToolChoiceType = "none"
	ToolChoiceTypeAuto     ToolChoiceType = "auto"
	ToolChoiceTypeRequired ToolChoiceType = "required"
)

type ToolType

type ToolType int64
const (
	ToolTypeFunction ToolType = 1
)

type Trajectory

type Trajectory trajectory.Trajectory

func (*Trajectory) IsValid

func (t *Trajectory) IsValid() bool

func (*Trajectory) ToContent

func (t *Trajectory) ToContent(ctx context.Context) *Content

type TrajectoryAnalysisIssue

type TrajectoryAnalysisIssue struct {
	Type       string        `json:"type,omitempty"`
	Desc       string        `json:"desc,omitempty"`
	SourceList []*SourceInfo `json:"source_list,omitempty"`
	Suggestion string        `json:"suggestion,omitempty"`
}

type TrajectoryAnalysisResult

type TrajectoryAnalysisResult struct {
	RootResult   *RootTrajectoryAnalysisResult    `json:"root_result,omitempty"`
	AgentResults []*AgentTrajectoryAnalysisResult `json:"agent_results,omitempty"`
}

type TrajectoryMetaInfo

type TrajectoryMetaInfo struct {
	ExptID                 int64                    `json:"expt_id,omitempty"`
	ItemID                 int64                    `json:"item_id,omitempty"`
	TurnID                 int64                    `json:"turn_id,omitempty"`
	Trajectory             *Trajectory              `json:"trajectory,omitempty"`
	EvaluatorAnalysisInfos []*EvaluatorAnalysisInfo `json:"evaluator_analysis_infos,omitempty"`
}

type TupleExpt

type TupleExpt struct {
	Expt *Experiment
	*ExptTuple
}

type Turn

type Turn struct {
	ID            int64        `json:"id,omitempty"`
	FieldDataList []*FieldData `json:"field_data_list,omitempty"`
	ItemID        int64        `json:"item_id,omitempty"`
	EvalSetID     int64        `json:"eval_set_id,omitempty"`
}

type TurnAnnotateResult

type TurnAnnotateResult struct {
	AnnotateRecords map[int64]*AnnotateRecord
}

type TurnEvalSet

type TurnEvalSet struct {
	Turn      *Turn
	ItemID    int64
	EvalSetID int64
}

type TurnEvaluatorOutput

type TurnEvaluatorOutput struct {
	EvaluatorRecords map[int64]*EvaluatorRecord
}

type TurnResult

type TurnResult struct {
	TurnID int64
	// 参与对比的实验序列,对于单报告序列长度为1
	ExperimentResults []*ExperimentResult
	TurnIndex         *int64
}

type TurnRunState

type TurnRunState int64
const (
	// Not started
	TurnRunState_Queueing TurnRunState = 0
	// Execution succeeded
	TurnRunState_Success TurnRunState = 1
	// Execution failed
	TurnRunState_Fail TurnRunState = 2
	// In progress
	TurnRunState_Processing TurnRunState = 3
	// Terminated
	TurnRunState_Terminal TurnRunState = 4
)

type TurnRunStateFilter

type TurnRunStateFilter struct {
	Status   []TurnRunState
	Operator string
}

type TurnSystemInfo

type TurnSystemInfo struct {
	TurnRunState TurnRunState
	LogID        *string
	Error        *RunError
}

type TurnTargetOutput

type TurnTargetOutput struct {
	EvalTargetRecord *EvalTargetRecord
}

type UpdateEvaluationSetParam

type UpdateEvaluationSetParam struct {
	SpaceID         int64
	EvaluationSetID int64
	Name            *string
	Description     *string
}

type UpdateEvaluatorMetaRequest

type UpdateEvaluatorMetaRequest struct {
	ID                    int64
	SpaceID               int64
	Name                  *string
	Description           *string
	Builtin               *bool
	EvaluatorInfo         *EvaluatorInfo
	BuiltinVisibleVersion *string
	BoxType               *EvaluatorBoxType
	UpdatedBy             string
}

UpdateEvaluatorMetaRequest 用于更新评估器元信息的参数

type UpdateEvaluatorTemplateRequest

type UpdateEvaluatorTemplateRequest struct {
	ID                 int64                                                 `json:"id" validate:"required,gt=0"`                        // 模板ID
	Name               *string                                               `json:"name,omitempty" validate:"omitempty,min=1,max=100"`  // 模板名称
	Description        *string                                               `json:"description,omitempty" validate:"omitempty,max=500"` // 模板描述
	EvaluatorInfo      *EvaluatorInfo                                        `json:"evaluator_info,omitempty"`                           // 评估器补充信息
	InputSchemas       []*ArgsSchema                                         `json:"input_schemas,omitempty"`                            // 输入模式
	OutputSchemas      []*ArgsSchema                                         `json:"output_schemas,omitempty"`                           // 输出模式
	ReceiveChatHistory *bool                                                 `json:"receive_chat_history,omitempty"`                     // 是否接收聊天历史
	Tags               map[EvaluatorTagLangType]map[EvaluatorTagKey][]string `json:"tags,omitempty"`                                     // 标签

	// 评估器内容
	PromptEvaluatorContent *PromptEvaluatorContent `json:"prompt_evaluator_content,omitempty"` // Prompt评估器内容
	CodeEvaluatorContent   *CodeEvaluatorContent   `json:"code_evaluator_content,omitempty"`   // Code评估器内容
}

UpdateEvaluatorTemplateRequest 更新评估器模板请求

type UpdateEvaluatorTemplateResponse

type UpdateEvaluatorTemplateResponse struct {
	Template *EvaluatorTemplate `json:"template"` // 更新后的模板
}

UpdateEvaluatorTemplateResponse 更新评估器模板响应

type UpdateExptAggrResultParam

type UpdateExptAggrResultParam struct {
	SpaceID      int64
	ExperimentID int64
	FieldType    FieldType
	FieldKey     string
}

aggregate result

type UpsertExptTurnResultFilterType

type UpsertExptTurnResultFilterType string
const (
	UpsertExptTurnResultFilterTypeAuto   UpsertExptTurnResultFilterType = "auto"
	UpsertExptTurnResultFilterTypeCheck  UpsertExptTurnResultFilterType = "check"
	UpsertExptTurnResultFilterTypeManual UpsertExptTurnResultFilterType = "manual"
)

type UserInfo

type UserInfo struct {
	Name        *string `json:"name,omitempty"`
	EnName      *string `json:"en_name,omitempty"`
	AvatarURL   *string `json:"avatar_url,omitempty"`
	AvatarThumb *string `json:"avatar_thumb,omitempty"`
	OpenID      *string `json:"open_id,omitempty"`
	UnionID     *string `json:"union_id,omitempty"`
	UserID      *string `json:"user_id,omitempty"`
	Email       *string `json:"email,omitempty"`
}

UserInfo 用户信息结构体

type VariableVal

type VariableVal struct {
	Key                 *string    `json:"key,omitempty"`
	Value               *string    `json:"value,omitempty"`
	PlaceholderMessages []*Message `json:"placeholderMessages,omitempty"`
	Content             *Content   `json:"content,omitempty"`
}

type VersionedEvalSetID

type VersionedEvalSetID struct {
	EvalSetID int64
	VersionID int64
}

type VersionedTargetID

type VersionedTargetID struct {
	TargetID  int64
	VersionID int64
}

type VolcengineAgent

type VolcengineAgent struct {
	ID int64

	Name                     string `json:"-"`
	Description              string `json:"-"`
	VolcengineAgentEndpoints []*VolcengineAgentEndpoint
	BaseInfo                 *BaseInfo `json:"-"` // 基础信息
	Protocol                 *VolcengineAgentProtocol
}

type VolcengineAgentEndpoint

type VolcengineAgentEndpoint struct {
	EndpointID string
	APIKey     string
}

type VolcengineAgentProtocol

type VolcengineAgentProtocol = string

Directories

Path Synopsis
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