shared

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	// Unique identifier for the acl
	ID string `json:"id,required" format:"uuid"`
	// The organization the ACL's referred object belongs to
	ObjectOrgID string `json:"_object_org_id,required" format:"uuid"`
	// The id of the object the ACL applies to
	ObjectID string `json:"object_id,required" format:"uuid"`
	// The object type that the ACL applies to
	ObjectType ACLObjectType `json:"object_type,required"`
	// Date of acl creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will
	// be provided
	GroupID string `json:"group_id,nullable" format:"uuid"`
	// Each permission permits a certain type of operation on an object in the system
	//
	// Permissions can be assigned to to objects on an individual basis, or grouped
	// into roles
	Permission ACLPermission `json:"permission,nullable"`
	// The object type that the ACL applies to
	RestrictObjectType ACLRestrictObjectType `json:"restrict_object_type,nullable"`
	// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be
	// provided
	RoleID string `json:"role_id,nullable" format:"uuid"`
	// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will
	// be provided
	UserID string  `json:"user_id,nullable" format:"uuid"`
	JSON   aclJSON `json:"-"`
}

An ACL grants a certain permission or role to a certain user or group on an object.

ACLs are inherited across the object hierarchy. So for example, if a user has read permissions on a project, they will also have read permissions on any experiment, dataset, etc. created within that project.

To restrict a grant to a particular sub-object, you may specify `restrict_object_type` in the ACL, as part of a direct permission grant or as part of a role.

func (*ACL) UnmarshalJSON

func (r *ACL) UnmarshalJSON(data []byte) (err error)

type ACLBatchUpdateResponse added in v0.4.0

type ACLBatchUpdateResponse struct {
	// An ACL grants a certain permission or role to a certain user or group on an
	// object.
	//
	// ACLs are inherited across the object hierarchy. So for example, if a user has
	// read permissions on a project, they will also have read permissions on any
	// experiment, dataset, etc. created within that project.
	//
	// To restrict a grant to a particular sub-object, you may specify
	// `restrict_object_type` in the ACL, as part of a direct permission grant or as
	// part of a role.
	AddedACLs []ACL `json:"added_acls,required"`
	// An ACL grants a certain permission or role to a certain user or group on an
	// object.
	//
	// ACLs are inherited across the object hierarchy. So for example, if a user has
	// read permissions on a project, they will also have read permissions on any
	// experiment, dataset, etc. created within that project.
	//
	// To restrict a grant to a particular sub-object, you may specify
	// `restrict_object_type` in the ACL, as part of a direct permission grant or as
	// part of a role.
	RemovedACLs []ACL                      `json:"removed_acls,required"`
	JSON        aclBatchUpdateResponseJSON `json:"-"`
}

func (*ACLBatchUpdateResponse) UnmarshalJSON added in v0.4.0

func (r *ACLBatchUpdateResponse) UnmarshalJSON(data []byte) (err error)

type ACLObjectType

type ACLObjectType string

The object type that the ACL applies to

const (
	ACLObjectTypeOrganization  ACLObjectType = "organization"
	ACLObjectTypeProject       ACLObjectType = "project"
	ACLObjectTypeExperiment    ACLObjectType = "experiment"
	ACLObjectTypeDataset       ACLObjectType = "dataset"
	ACLObjectTypePrompt        ACLObjectType = "prompt"
	ACLObjectTypePromptSession ACLObjectType = "prompt_session"
	ACLObjectTypeGroup         ACLObjectType = "group"
	ACLObjectTypeRole          ACLObjectType = "role"
	ACLObjectTypeOrgMember     ACLObjectType = "org_member"
	ACLObjectTypeProjectLog    ACLObjectType = "project_log"
	ACLObjectTypeOrgProject    ACLObjectType = "org_project"
)

func (ACLObjectType) IsKnown

func (r ACLObjectType) IsKnown() bool

type ACLPermission

type ACLPermission string

Each permission permits a certain type of operation on an object in the system

Permissions can be assigned to to objects on an individual basis, or grouped into roles

const (
	ACLPermissionCreate     ACLPermission = "create"
	ACLPermissionRead       ACLPermission = "read"
	ACLPermissionUpdate     ACLPermission = "update"
	ACLPermissionDelete     ACLPermission = "delete"
	ACLPermissionCreateACLs ACLPermission = "create_acls"
	ACLPermissionReadACLs   ACLPermission = "read_acls"
	ACLPermissionUpdateACLs ACLPermission = "update_acls"
	ACLPermissionDeleteACLs ACLPermission = "delete_acls"
)

func (ACLPermission) IsKnown

func (r ACLPermission) IsKnown() bool

type ACLRestrictObjectType

type ACLRestrictObjectType string

The object type that the ACL applies to

const (
	ACLRestrictObjectTypeOrganization  ACLRestrictObjectType = "organization"
	ACLRestrictObjectTypeProject       ACLRestrictObjectType = "project"
	ACLRestrictObjectTypeExperiment    ACLRestrictObjectType = "experiment"
	ACLRestrictObjectTypeDataset       ACLRestrictObjectType = "dataset"
	ACLRestrictObjectTypePrompt        ACLRestrictObjectType = "prompt"
	ACLRestrictObjectTypePromptSession ACLRestrictObjectType = "prompt_session"
	ACLRestrictObjectTypeGroup         ACLRestrictObjectType = "group"
	ACLRestrictObjectTypeRole          ACLRestrictObjectType = "role"
	ACLRestrictObjectTypeOrgMember     ACLRestrictObjectType = "org_member"
	ACLRestrictObjectTypeProjectLog    ACLRestrictObjectType = "project_log"
	ACLRestrictObjectTypeOrgProject    ACLRestrictObjectType = "org_project"
)

func (ACLRestrictObjectType) IsKnown

func (r ACLRestrictObjectType) IsKnown() bool

type AISecret added in v0.4.0

type AISecret struct {
	// Unique identifier for the AI secret
	ID string `json:"id,required" format:"uuid"`
	// Name of the AI secret
	Name string `json:"name,required"`
	// Unique identifier for the organization
	OrgID string `json:"org_id,required" format:"uuid"`
	// Date of AI secret creation
	Created       time.Time              `json:"created,nullable" format:"date-time"`
	Metadata      map[string]interface{} `json:"metadata,nullable"`
	PreviewSecret string                 `json:"preview_secret,nullable"`
	Type          string                 `json:"type,nullable"`
	JSON          aiSecretJSON           `json:"-"`
}

func (*AISecret) UnmarshalJSON added in v0.4.0

func (r *AISecret) UnmarshalJSON(data []byte) (err error)

type APIKey

type APIKey struct {
	// Unique identifier for the api key
	ID string `json:"id,required" format:"uuid"`
	// Name of the api key
	Name        string `json:"name,required"`
	PreviewName string `json:"preview_name,required"`
	// Date of api key creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Unique identifier for the organization
	OrgID string `json:"org_id,nullable" format:"uuid"`
	// Unique identifier for the user
	UserID string     `json:"user_id,nullable" format:"uuid"`
	JSON   apiKeyJSON `json:"-"`
}

func (*APIKey) UnmarshalJSON

func (r *APIKey) UnmarshalJSON(data []byte) (err error)

type ChatCompletionContentPart added in v0.4.0

type ChatCompletionContentPart struct {
	Text string                        `json:"text"`
	Type ChatCompletionContentPartType `json:"type,required"`
	// This field can have the runtime type of
	// [ChatCompletionContentPartImageImageURL].
	ImageURL interface{}                   `json:"image_url,required"`
	JSON     chatCompletionContentPartJSON `json:"-"`
	// contains filtered or unexported fields
}

func (ChatCompletionContentPart) AsUnion added in v0.4.0

AsUnion returns a ChatCompletionContentPartUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.ChatCompletionContentPartText, shared.ChatCompletionContentPartImage.

func (*ChatCompletionContentPart) UnmarshalJSON added in v0.4.0

func (r *ChatCompletionContentPart) UnmarshalJSON(data []byte) (err error)

type ChatCompletionContentPartImage added in v0.4.0

type ChatCompletionContentPartImage struct {
	ImageURL ChatCompletionContentPartImageImageURL `json:"image_url,required"`
	Type     ChatCompletionContentPartImageType     `json:"type,required"`
	JSON     chatCompletionContentPartImageJSON     `json:"-"`
}

func (ChatCompletionContentPartImage) ImplementsSharedChatCompletionContentPart added in v0.4.0

func (r ChatCompletionContentPartImage) ImplementsSharedChatCompletionContentPart()

func (*ChatCompletionContentPartImage) UnmarshalJSON added in v0.4.0

func (r *ChatCompletionContentPartImage) UnmarshalJSON(data []byte) (err error)

type ChatCompletionContentPartImageImageURL added in v0.4.0

type ChatCompletionContentPartImageImageURL struct {
	URL    string                                       `json:"url,required"`
	Detail ChatCompletionContentPartImageImageURLDetail `json:"detail"`
	JSON   chatCompletionContentPartImageImageURLJSON   `json:"-"`
}

func (*ChatCompletionContentPartImageImageURL) UnmarshalJSON added in v0.4.0

func (r *ChatCompletionContentPartImageImageURL) UnmarshalJSON(data []byte) (err error)

type ChatCompletionContentPartImageImageURLDetail added in v0.4.0

type ChatCompletionContentPartImageImageURLDetail string
const (
	ChatCompletionContentPartImageImageURLDetailAuto ChatCompletionContentPartImageImageURLDetail = "auto"
	ChatCompletionContentPartImageImageURLDetailLow  ChatCompletionContentPartImageImageURLDetail = "low"
	ChatCompletionContentPartImageImageURLDetailHigh ChatCompletionContentPartImageImageURLDetail = "high"
)

func (ChatCompletionContentPartImageImageURLDetail) IsKnown added in v0.4.0

type ChatCompletionContentPartImageImageURLParam added in v0.4.0

type ChatCompletionContentPartImageImageURLParam struct {
	URL    param.Field[string]                                       `json:"url,required"`
	Detail param.Field[ChatCompletionContentPartImageImageURLDetail] `json:"detail"`
}

func (ChatCompletionContentPartImageImageURLParam) MarshalJSON added in v0.4.0

func (r ChatCompletionContentPartImageImageURLParam) MarshalJSON() (data []byte, err error)

type ChatCompletionContentPartImageParam added in v0.4.0

type ChatCompletionContentPartImageParam struct {
	ImageURL param.Field[ChatCompletionContentPartImageImageURLParam] `json:"image_url,required"`
	Type     param.Field[ChatCompletionContentPartImageType]          `json:"type,required"`
}

func (ChatCompletionContentPartImageParam) ImplementsSharedChatCompletionContentPartUnionParam added in v0.4.0

func (r ChatCompletionContentPartImageParam) ImplementsSharedChatCompletionContentPartUnionParam()

func (ChatCompletionContentPartImageParam) MarshalJSON added in v0.4.0

func (r ChatCompletionContentPartImageParam) MarshalJSON() (data []byte, err error)

type ChatCompletionContentPartImageType added in v0.4.0

type ChatCompletionContentPartImageType string
const (
	ChatCompletionContentPartImageTypeImageURL ChatCompletionContentPartImageType = "image_url"
)

func (ChatCompletionContentPartImageType) IsKnown added in v0.4.0

type ChatCompletionContentPartParam added in v0.4.0

type ChatCompletionContentPartParam struct {
	Text     param.Field[string]                        `json:"text"`
	Type     param.Field[ChatCompletionContentPartType] `json:"type,required"`
	ImageURL param.Field[interface{}]                   `json:"image_url,required"`
}

func (ChatCompletionContentPartParam) ImplementsSharedChatCompletionContentPartUnionParam added in v0.4.0

func (r ChatCompletionContentPartParam) ImplementsSharedChatCompletionContentPartUnionParam()

func (ChatCompletionContentPartParam) MarshalJSON added in v0.4.0

func (r ChatCompletionContentPartParam) MarshalJSON() (data []byte, err error)

type ChatCompletionContentPartText added in v0.4.0

type ChatCompletionContentPartText struct {
	Type ChatCompletionContentPartTextType `json:"type,required"`
	Text string                            `json:"text"`
	JSON chatCompletionContentPartTextJSON `json:"-"`
}

func (ChatCompletionContentPartText) ImplementsSharedChatCompletionContentPart added in v0.4.0

func (r ChatCompletionContentPartText) ImplementsSharedChatCompletionContentPart()

func (*ChatCompletionContentPartText) UnmarshalJSON added in v0.4.0

func (r *ChatCompletionContentPartText) UnmarshalJSON(data []byte) (err error)

type ChatCompletionContentPartTextParam added in v0.4.0

type ChatCompletionContentPartTextParam struct {
	Type param.Field[ChatCompletionContentPartTextType] `json:"type,required"`
	Text param.Field[string]                            `json:"text"`
}

func (ChatCompletionContentPartTextParam) ImplementsSharedChatCompletionContentPartUnionParam added in v0.4.0

func (r ChatCompletionContentPartTextParam) ImplementsSharedChatCompletionContentPartUnionParam()

func (ChatCompletionContentPartTextParam) MarshalJSON added in v0.4.0

func (r ChatCompletionContentPartTextParam) MarshalJSON() (data []byte, err error)

type ChatCompletionContentPartTextType added in v0.4.0

type ChatCompletionContentPartTextType string
const (
	ChatCompletionContentPartTextTypeText ChatCompletionContentPartTextType = "text"
)

func (ChatCompletionContentPartTextType) IsKnown added in v0.4.0

type ChatCompletionContentPartType added in v0.4.0

type ChatCompletionContentPartType string
const (
	ChatCompletionContentPartTypeText     ChatCompletionContentPartType = "text"
	ChatCompletionContentPartTypeImageURL ChatCompletionContentPartType = "image_url"
)

func (ChatCompletionContentPartType) IsKnown added in v0.4.0

func (r ChatCompletionContentPartType) IsKnown() bool

type ChatCompletionContentPartUnion added in v0.4.0

type ChatCompletionContentPartUnion interface {
	ImplementsSharedChatCompletionContentPart()
}

Union satisfied by shared.ChatCompletionContentPartText or shared.ChatCompletionContentPartImage.

type ChatCompletionContentPartUnionParam added in v0.4.0

type ChatCompletionContentPartUnionParam interface {
	ImplementsSharedChatCompletionContentPartUnionParam()
}

Satisfied by shared.ChatCompletionContentPartTextParam, shared.ChatCompletionContentPartImageParam, ChatCompletionContentPartParam.

type ChatCompletionMessageToolCall added in v0.4.0

type ChatCompletionMessageToolCall struct {
	ID       string                                `json:"id,required"`
	Function ChatCompletionMessageToolCallFunction `json:"function,required"`
	Type     ChatCompletionMessageToolCallType     `json:"type,required"`
	JSON     chatCompletionMessageToolCallJSON     `json:"-"`
}

func (*ChatCompletionMessageToolCall) UnmarshalJSON added in v0.4.0

func (r *ChatCompletionMessageToolCall) UnmarshalJSON(data []byte) (err error)

type ChatCompletionMessageToolCallFunction added in v0.4.0

type ChatCompletionMessageToolCallFunction struct {
	Arguments string                                    `json:"arguments,required"`
	Name      string                                    `json:"name,required"`
	JSON      chatCompletionMessageToolCallFunctionJSON `json:"-"`
}

func (*ChatCompletionMessageToolCallFunction) UnmarshalJSON added in v0.4.0

func (r *ChatCompletionMessageToolCallFunction) UnmarshalJSON(data []byte) (err error)

type ChatCompletionMessageToolCallFunctionParam added in v0.4.0

type ChatCompletionMessageToolCallFunctionParam struct {
	Arguments param.Field[string] `json:"arguments,required"`
	Name      param.Field[string] `json:"name,required"`
}

func (ChatCompletionMessageToolCallFunctionParam) MarshalJSON added in v0.4.0

func (r ChatCompletionMessageToolCallFunctionParam) MarshalJSON() (data []byte, err error)

type ChatCompletionMessageToolCallParam added in v0.4.0

type ChatCompletionMessageToolCallParam struct {
	ID       param.Field[string]                                     `json:"id,required"`
	Function param.Field[ChatCompletionMessageToolCallFunctionParam] `json:"function,required"`
	Type     param.Field[ChatCompletionMessageToolCallType]          `json:"type,required"`
}

func (ChatCompletionMessageToolCallParam) MarshalJSON added in v0.4.0

func (r ChatCompletionMessageToolCallParam) MarshalJSON() (data []byte, err error)

type ChatCompletionMessageToolCallType added in v0.4.0

type ChatCompletionMessageToolCallType string
const (
	ChatCompletionMessageToolCallTypeFunction ChatCompletionMessageToolCallType = "function"
)

func (ChatCompletionMessageToolCallType) IsKnown added in v0.4.0

type CodeBundle added in v0.4.0

type CodeBundle struct {
	BundleID       string                   `json:"bundle_id,required"`
	Location       CodeBundleLocation       `json:"location,required"`
	RuntimeContext CodeBundleRuntimeContext `json:"runtime_context,required"`
	// A preview of the code
	Preview string         `json:"preview,nullable"`
	JSON    codeBundleJSON `json:"-"`
}

func (*CodeBundle) UnmarshalJSON added in v0.4.0

func (r *CodeBundle) UnmarshalJSON(data []byte) (err error)

type CodeBundleLocation added in v0.4.0

type CodeBundleLocation struct {
	Type     CodeBundleLocationType `json:"type,required"`
	EvalName string                 `json:"eval_name"`
	// This field can have the runtime type of [CodeBundleLocationExperimentPosition].
	Position interface{}            `json:"position,required"`
	Index    int64                  `json:"index"`
	JSON     codeBundleLocationJSON `json:"-"`
	// contains filtered or unexported fields
}

func (CodeBundleLocation) AsUnion added in v0.4.0

AsUnion returns a CodeBundleLocationUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.CodeBundleLocationExperiment, shared.CodeBundleLocationFunction.

func (*CodeBundleLocation) UnmarshalJSON added in v0.4.0

func (r *CodeBundleLocation) UnmarshalJSON(data []byte) (err error)

type CodeBundleLocationExperiment added in v0.4.0

type CodeBundleLocationExperiment struct {
	EvalName string                               `json:"eval_name,required"`
	Position CodeBundleLocationExperimentPosition `json:"position,required"`
	Type     CodeBundleLocationExperimentType     `json:"type,required"`
	JSON     codeBundleLocationExperimentJSON     `json:"-"`
}

func (*CodeBundleLocationExperiment) UnmarshalJSON added in v0.4.0

func (r *CodeBundleLocationExperiment) UnmarshalJSON(data []byte) (err error)

type CodeBundleLocationExperimentParam added in v0.4.0

type CodeBundleLocationExperimentParam struct {
	EvalName param.Field[string]                                         `json:"eval_name,required"`
	Position param.Field[CodeBundleLocationExperimentPositionUnionParam] `json:"position,required"`
	Type     param.Field[CodeBundleLocationExperimentType]               `json:"type,required"`
}

func (CodeBundleLocationExperimentParam) MarshalJSON added in v0.4.0

func (r CodeBundleLocationExperimentParam) MarshalJSON() (data []byte, err error)

type CodeBundleLocationExperimentPosition added in v0.4.0

type CodeBundleLocationExperimentPosition struct {
	Type  CodeBundleLocationExperimentPositionType `json:"type,required"`
	Index int64                                    `json:"index"`
	JSON  codeBundleLocationExperimentPositionJSON `json:"-"`
	// contains filtered or unexported fields
}

func (CodeBundleLocationExperimentPosition) AsUnion added in v0.4.0

AsUnion returns a CodeBundleLocationExperimentPositionUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.Task, shared.Scorer.

func (*CodeBundleLocationExperimentPosition) UnmarshalJSON added in v0.4.0

func (r *CodeBundleLocationExperimentPosition) UnmarshalJSON(data []byte) (err error)

type CodeBundleLocationExperimentPositionParam added in v0.4.0

type CodeBundleLocationExperimentPositionParam struct {
	Type  param.Field[CodeBundleLocationExperimentPositionType] `json:"type,required"`
	Index param.Field[int64]                                    `json:"index"`
}

func (CodeBundleLocationExperimentPositionParam) ImplementsSharedCodeBundleLocationExperimentPositionUnionParam added in v0.4.0

func (r CodeBundleLocationExperimentPositionParam) ImplementsSharedCodeBundleLocationExperimentPositionUnionParam()

func (CodeBundleLocationExperimentPositionParam) MarshalJSON added in v0.4.0

func (r CodeBundleLocationExperimentPositionParam) MarshalJSON() (data []byte, err error)

type CodeBundleLocationExperimentPositionType added in v0.4.0

type CodeBundleLocationExperimentPositionType string
const (
	CodeBundleLocationExperimentPositionTypeTask   CodeBundleLocationExperimentPositionType = "task"
	CodeBundleLocationExperimentPositionTypeScorer CodeBundleLocationExperimentPositionType = "scorer"
)

func (CodeBundleLocationExperimentPositionType) IsKnown added in v0.4.0

type CodeBundleLocationExperimentPositionUnion added in v0.4.0

type CodeBundleLocationExperimentPositionUnion interface {
	ImplementsSharedCodeBundleLocationExperimentPosition()
}

Union satisfied by shared.Task or shared.Scorer.

type CodeBundleLocationExperimentPositionUnionParam added in v0.4.0

type CodeBundleLocationExperimentPositionUnionParam interface {
	ImplementsSharedCodeBundleLocationExperimentPositionUnionParam()
}

Satisfied by shared.TaskParam, shared.ScorerParam, CodeBundleLocationExperimentPositionParam.

type CodeBundleLocationExperimentType added in v0.4.0

type CodeBundleLocationExperimentType string
const (
	CodeBundleLocationExperimentTypeExperiment CodeBundleLocationExperimentType = "experiment"
)

func (CodeBundleLocationExperimentType) IsKnown added in v0.4.0

type CodeBundleLocationFunction added in v0.4.0

type CodeBundleLocationFunction struct {
	Index int64                          `json:"index,required"`
	Type  CodeBundleLocationFunctionType `json:"type,required"`
	JSON  codeBundleLocationFunctionJSON `json:"-"`
}

func (*CodeBundleLocationFunction) UnmarshalJSON added in v0.4.0

func (r *CodeBundleLocationFunction) UnmarshalJSON(data []byte) (err error)

type CodeBundleLocationFunctionParam added in v0.4.0

type CodeBundleLocationFunctionParam struct {
	Index param.Field[int64]                          `json:"index,required"`
	Type  param.Field[CodeBundleLocationFunctionType] `json:"type,required"`
}

func (CodeBundleLocationFunctionParam) MarshalJSON added in v0.4.0

func (r CodeBundleLocationFunctionParam) MarshalJSON() (data []byte, err error)

type CodeBundleLocationFunctionType added in v0.4.0

type CodeBundleLocationFunctionType string
const (
	CodeBundleLocationFunctionTypeFunction CodeBundleLocationFunctionType = "function"
)

func (CodeBundleLocationFunctionType) IsKnown added in v0.4.0

type CodeBundleLocationParam added in v0.4.0

type CodeBundleLocationParam struct {
	Type     param.Field[CodeBundleLocationType] `json:"type,required"`
	EvalName param.Field[string]                 `json:"eval_name"`
	Position param.Field[interface{}]            `json:"position,required"`
	Index    param.Field[int64]                  `json:"index"`
}

func (CodeBundleLocationParam) MarshalJSON added in v0.4.0

func (r CodeBundleLocationParam) MarshalJSON() (data []byte, err error)

type CodeBundleLocationType added in v0.4.0

type CodeBundleLocationType string
const (
	CodeBundleLocationTypeExperiment CodeBundleLocationType = "experiment"
	CodeBundleLocationTypeFunction   CodeBundleLocationType = "function"
)

func (CodeBundleLocationType) IsKnown added in v0.4.0

func (r CodeBundleLocationType) IsKnown() bool

type CodeBundleLocationUnion added in v0.4.0

type CodeBundleLocationUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.CodeBundleLocationExperiment or shared.CodeBundleLocationFunction.

type CodeBundleLocationUnionParam added in v0.4.0

type CodeBundleLocationUnionParam interface {
	// contains filtered or unexported methods
}

Satisfied by shared.CodeBundleLocationExperimentParam, shared.CodeBundleLocationFunctionParam, CodeBundleLocationParam.

type CodeBundleParam added in v0.4.0

type CodeBundleParam struct {
	BundleID       param.Field[string]                        `json:"bundle_id,required"`
	Location       param.Field[CodeBundleLocationUnionParam]  `json:"location,required"`
	RuntimeContext param.Field[CodeBundleRuntimeContextParam] `json:"runtime_context,required"`
	// A preview of the code
	Preview param.Field[string] `json:"preview"`
}

func (CodeBundleParam) MarshalJSON added in v0.4.0

func (r CodeBundleParam) MarshalJSON() (data []byte, err error)

type CodeBundleRuntimeContext added in v0.4.0

type CodeBundleRuntimeContext struct {
	Runtime CodeBundleRuntimeContextRuntime `json:"runtime,required"`
	Version string                          `json:"version,required"`
	JSON    codeBundleRuntimeContextJSON    `json:"-"`
}

func (*CodeBundleRuntimeContext) UnmarshalJSON added in v0.4.0

func (r *CodeBundleRuntimeContext) UnmarshalJSON(data []byte) (err error)

type CodeBundleRuntimeContextParam added in v0.4.0

type CodeBundleRuntimeContextParam struct {
	Runtime param.Field[CodeBundleRuntimeContextRuntime] `json:"runtime,required"`
	Version param.Field[string]                          `json:"version,required"`
}

func (CodeBundleRuntimeContextParam) MarshalJSON added in v0.4.0

func (r CodeBundleRuntimeContextParam) MarshalJSON() (data []byte, err error)

type CodeBundleRuntimeContextRuntime added in v0.4.0

type CodeBundleRuntimeContextRuntime string
const (
	CodeBundleRuntimeContextRuntimeNode   CodeBundleRuntimeContextRuntime = "node"
	CodeBundleRuntimeContextRuntimePython CodeBundleRuntimeContextRuntime = "python"
)

func (CodeBundleRuntimeContextRuntime) IsKnown added in v0.4.0

type CreateAPIKeyOutput

type CreateAPIKeyOutput struct {
	// Unique identifier for the api key
	ID string `json:"id,required" format:"uuid"`
	// The raw API key. It will only be exposed this one time
	Key string `json:"key,required"`
	// Name of the api key
	Name        string `json:"name,required"`
	PreviewName string `json:"preview_name,required"`
	// Date of api key creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Unique identifier for the organization
	OrgID string `json:"org_id,nullable" format:"uuid"`
	// Unique identifier for the user
	UserID string                 `json:"user_id,nullable" format:"uuid"`
	JSON   createAPIKeyOutputJSON `json:"-"`
}

func (*CreateAPIKeyOutput) UnmarshalJSON

func (r *CreateAPIKeyOutput) UnmarshalJSON(data []byte) (err error)

type DataSummary

type DataSummary struct {
	// Total number of records in the dataset
	TotalRecords int64           `json:"total_records,required"`
	JSON         dataSummaryJSON `json:"-"`
}

Summary of a dataset's data

func (*DataSummary) UnmarshalJSON

func (r *DataSummary) UnmarshalJSON(data []byte) (err error)

type Dataset

type Dataset struct {
	// Unique identifier for the dataset
	ID string `json:"id,required" format:"uuid"`
	// Name of the dataset. Within a project, dataset names are unique
	Name string `json:"name,required"`
	// Unique identifier for the project that the dataset belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// Date of dataset creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Date of dataset deletion, or null if the dataset is still active
	DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
	// Textual description of the dataset
	Description string `json:"description,nullable"`
	// User-controlled metadata about the dataset
	Metadata map[string]interface{} `json:"metadata,nullable"`
	// Identifies the user who created the dataset
	UserID string      `json:"user_id,nullable" format:"uuid"`
	JSON   datasetJSON `json:"-"`
}

func (*Dataset) UnmarshalJSON

func (r *Dataset) UnmarshalJSON(data []byte) (err error)

type DatasetEvent

type DatasetEvent struct {
	// A unique identifier for the dataset event. If you don't provide one, BrainTrust
	// will generate one for you
	ID string `json:"id,required"`
	// The transaction id of an event is unique to the network operation that processed
	// the event insertion. Transaction ids are monotonically increasing over time and
	// can be used to retrieve a versioned snapshot of the dataset (see the `version`
	// parameter)
	XactID string `json:"_xact_id,required"`
	// The timestamp the dataset event was created
	Created time.Time `json:"created,required" format:"date-time"`
	// Unique identifier for the dataset
	DatasetID string `json:"dataset_id,required" format:"uuid"`
	// Unique identifier for the project that the dataset belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// The `span_id` of the root of the trace this dataset event belongs to
	RootSpanID string `json:"root_span_id,required"`
	// A unique identifier used to link different dataset events together as part of a
	// full trace. See the
	// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
	// on tracing
	SpanID string `json:"span_id,required"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object)
	Expected interface{} `json:"expected,nullable"`
	// The argument that uniquely define an input case (an arbitrary, JSON serializable
	// object)
	Input interface{} `json:"input,nullable"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata map[string]interface{} `json:"metadata,nullable"`
	// A list of tags to log
	Tags []string         `json:"tags,nullable"`
	JSON datasetEventJSON `json:"-"`
}

func (*DatasetEvent) UnmarshalJSON

func (r *DatasetEvent) UnmarshalJSON(data []byte) (err error)

type EnvVar added in v0.4.0

type EnvVar struct {
	// Unique identifier for the environment variable
	ID string `json:"id,required" format:"uuid"`
	// The name of the environment variable
	Name string `json:"name,required"`
	// The id of the object the environment variable is scoped for
	ObjectID string `json:"object_id,required" format:"uuid"`
	// The type of the object the environment variable is scoped for
	ObjectType EnvVarObjectType `json:"object_type,required"`
	// Date of environment variable creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Date the environment variable was last used
	Used time.Time  `json:"used,nullable" format:"date-time"`
	JSON envVarJSON `json:"-"`
}

func (*EnvVar) UnmarshalJSON added in v0.4.0

func (r *EnvVar) UnmarshalJSON(data []byte) (err error)

type EnvVarObjectType added in v0.4.0

type EnvVarObjectType string

The type of the object the environment variable is scoped for

const (
	EnvVarObjectTypeOrganization EnvVarObjectType = "organization"
	EnvVarObjectTypeProject      EnvVarObjectType = "project"
	EnvVarObjectTypeFunction     EnvVarObjectType = "function"
)

func (EnvVarObjectType) IsKnown added in v0.4.0

func (r EnvVarObjectType) IsKnown() bool

type Experiment

type Experiment struct {
	// Unique identifier for the experiment
	ID string `json:"id,required" format:"uuid"`
	// Name of the experiment. Within a project, experiment names are unique
	Name string `json:"name,required"`
	// Unique identifier for the project that the experiment belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// Whether or not the experiment is public. Public experiments can be viewed by
	// anybody inside or outside the organization
	Public bool `json:"public,required"`
	// Id of default base experiment to compare against when viewing this experiment
	BaseExpID string `json:"base_exp_id,nullable" format:"uuid"`
	// Commit, taken directly from `repo_info.commit`
	Commit string `json:"commit,nullable"`
	// Date of experiment creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Identifier of the linked dataset, or null if the experiment is not linked to a
	// dataset
	DatasetID string `json:"dataset_id,nullable" format:"uuid"`
	// Version number of the linked dataset the experiment was run against. This can be
	// used to reproduce the experiment after the dataset has been modified.
	DatasetVersion string `json:"dataset_version,nullable"`
	// Date of experiment deletion, or null if the experiment is still active
	DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
	// Textual description of the experiment
	Description string `json:"description,nullable"`
	// User-controlled metadata about the experiment
	Metadata map[string]interface{} `json:"metadata,nullable"`
	// Metadata about the state of the repo when the experiment was created
	RepoInfo RepoInfo `json:"repo_info,nullable"`
	// Identifies the user who created the experiment
	UserID string         `json:"user_id,nullable" format:"uuid"`
	JSON   experimentJSON `json:"-"`
}

func (*Experiment) UnmarshalJSON

func (r *Experiment) UnmarshalJSON(data []byte) (err error)

type ExperimentEvent

type ExperimentEvent struct {
	// A unique identifier for the experiment event. If you don't provide one,
	// BrainTrust will generate one for you
	ID string `json:"id,required"`
	// The transaction id of an event is unique to the network operation that processed
	// the event insertion. Transaction ids are monotonically increasing over time and
	// can be used to retrieve a versioned snapshot of the experiment (see the
	// `version` parameter)
	XactID string `json:"_xact_id,required"`
	// The timestamp the experiment event was created
	Created time.Time `json:"created,required" format:"date-time"`
	// Unique identifier for the experiment
	ExperimentID string `json:"experiment_id,required" format:"uuid"`
	// Unique identifier for the project that the experiment belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// The `span_id` of the root of the trace this experiment event belongs to
	RootSpanID string `json:"root_span_id,required"`
	// A unique identifier used to link different experiment events together as part of
	// a full trace. See the
	// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
	// on tracing
	SpanID string `json:"span_id,required"`
	// Context is additional information about the code that produced the experiment
	// event. It is essentially the textual counterpart to `metrics`. Use the
	// `caller_*` attributes to track the location in code which produced the
	// experiment event
	Context ExperimentEventContext `json:"context,nullable"`
	// If the experiment is associated to a dataset, this is the event-level dataset id
	// this experiment event is tied to
	DatasetRecordID string `json:"dataset_record_id,nullable"`
	// The error that occurred, if any.
	Error interface{} `json:"error,nullable"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not.
	// Braintrust currently does not compare `output` to `expected` for you, since
	// there are so many different ways to do that correctly. Instead, these values are
	// just used to help you navigate your experiments while digging into analyses.
	// However, we may later use these values to re-score outputs or fine-tune your
	// models
	Expected interface{} `json:"expected,nullable"`
	// The arguments that uniquely define a test case (an arbitrary, JSON serializable
	// object). Later on, Braintrust will use the `input` to know whether two test
	// cases are the same between experiments, so they should not contain
	// experiment-specific state. A simple rule of thumb is that if you run the same
	// experiment twice, the `input` should be identical
	Input interface{} `json:"input,nullable"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata map[string]interface{} `json:"metadata,nullable"`
	// Metrics are numerical measurements tracking the execution of the code that
	// produced the experiment event. Use "start" and "end" to track the time span over
	// which the experiment event was produced
	Metrics ExperimentEventMetrics `json:"metrics,nullable"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object), that allows you to determine whether the result is correct
	// or not. For example, in an app that generates SQL queries, the `output` should
	// be the _result_ of the SQL query generated by the model, not the query itself,
	// because there may be multiple valid queries that answer a single question
	Output interface{} `json:"output,nullable"`
	// A dictionary of numeric values (between 0 and 1) to log. The scores should give
	// you a variety of signals that help you determine how accurate the outputs are
	// compared to what you expect and diagnose failures. For example, a summarization
	// app might have one score that tells you how accurate the summary is, and another
	// that measures the word similarity between the generated and grouth truth
	// summary. The word similarity score could help you determine whether the
	// summarization was covering similar concepts or not. You can use these scores to
	// help you sort, filter, and compare experiments
	Scores map[string]float64 `json:"scores,nullable"`
	// Human-identifying attributes of the span, such as name, type, etc.
	SpanAttributes ExperimentEventSpanAttributes `json:"span_attributes,nullable"`
	// An array of the parent `span_ids` of this experiment event. This should be empty
	// for the root span of a trace, and should most often contain just one parent
	// element for subspans
	SpanParents []string `json:"span_parents,nullable"`
	// A list of tags to log
	Tags []string            `json:"tags,nullable"`
	JSON experimentEventJSON `json:"-"`
}

func (*ExperimentEvent) UnmarshalJSON

func (r *ExperimentEvent) UnmarshalJSON(data []byte) (err error)

type ExperimentEventContext

type ExperimentEventContext struct {
	// Name of the file in code where the experiment event was created
	CallerFilename string `json:"caller_filename,nullable"`
	// The function in code which created the experiment event
	CallerFunctionname string `json:"caller_functionname,nullable"`
	// Line of code where the experiment event was created
	CallerLineno int64                      `json:"caller_lineno,nullable"`
	ExtraFields  map[string]interface{}     `json:"-,extras"`
	JSON         experimentEventContextJSON `json:"-"`
}

Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event

func (*ExperimentEventContext) UnmarshalJSON

func (r *ExperimentEventContext) UnmarshalJSON(data []byte) (err error)

type ExperimentEventMetrics

type ExperimentEventMetrics struct {
	// The number of tokens in the completion generated by the model (only set if this
	// is an LLM span)
	CompletionTokens int64 `json:"completion_tokens,nullable"`
	// A unix timestamp recording when the section of code which produced the
	// experiment event finished
	End float64 `json:"end,nullable"`
	// The number of tokens in the prompt used to generate the experiment event (only
	// set if this is an LLM span)
	PromptTokens int64 `json:"prompt_tokens,nullable"`
	// A unix timestamp recording when the section of code which produced the
	// experiment event started
	Start float64 `json:"start,nullable"`
	// The total number of tokens in the input and output of the experiment event.
	Tokens      int64                      `json:"tokens,nullable"`
	ExtraFields map[string]interface{}     `json:"-,extras"`
	JSON        experimentEventMetricsJSON `json:"-"`
}

Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced

func (*ExperimentEventMetrics) UnmarshalJSON

func (r *ExperimentEventMetrics) UnmarshalJSON(data []byte) (err error)

type ExperimentEventSpanAttributes

type ExperimentEventSpanAttributes struct {
	// Name of the span, for display purposes only
	Name string `json:"name,nullable"`
	// Type of the span, for display purposes only
	Type        ExperimentEventSpanAttributesType `json:"type,nullable"`
	ExtraFields map[string]interface{}            `json:"-,extras"`
	JSON        experimentEventSpanAttributesJSON `json:"-"`
}

Human-identifying attributes of the span, such as name, type, etc.

func (*ExperimentEventSpanAttributes) UnmarshalJSON

func (r *ExperimentEventSpanAttributes) UnmarshalJSON(data []byte) (err error)

type ExperimentEventSpanAttributesType

type ExperimentEventSpanAttributesType string

Type of the span, for display purposes only

const (
	ExperimentEventSpanAttributesTypeLlm      ExperimentEventSpanAttributesType = "llm"
	ExperimentEventSpanAttributesTypeScore    ExperimentEventSpanAttributesType = "score"
	ExperimentEventSpanAttributesTypeFunction ExperimentEventSpanAttributesType = "function"
	ExperimentEventSpanAttributesTypeEval     ExperimentEventSpanAttributesType = "eval"
	ExperimentEventSpanAttributesTypeTask     ExperimentEventSpanAttributesType = "task"
	ExperimentEventSpanAttributesTypeTool     ExperimentEventSpanAttributesType = "tool"
)

func (ExperimentEventSpanAttributesType) IsKnown

type FeedbackDatasetItemParam

type FeedbackDatasetItemParam struct {
	// The id of the dataset event to log feedback for. This is the row `id` returned
	// by `POST /v1/dataset/{dataset_id}/insert`
	ID param.Field[string] `json:"id,required"`
	// An optional comment string to log about the dataset event
	Comment param.Field[string] `json:"comment"`
	// A dictionary with additional data about the feedback. If you have a `user_id`,
	// you can log it here and access it in the Braintrust UI.
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// The source of the feedback. Must be one of "external" (default), "app", or "api"
	Source param.Field[FeedbackDatasetItemSource] `json:"source"`
}

func (FeedbackDatasetItemParam) MarshalJSON

func (r FeedbackDatasetItemParam) MarshalJSON() (data []byte, err error)

type FeedbackDatasetItemSource

type FeedbackDatasetItemSource string

The source of the feedback. Must be one of "external" (default), "app", or "api"

const (
	FeedbackDatasetItemSourceApp      FeedbackDatasetItemSource = "app"
	FeedbackDatasetItemSourceAPI      FeedbackDatasetItemSource = "api"
	FeedbackDatasetItemSourceExternal FeedbackDatasetItemSource = "external"
)

func (FeedbackDatasetItemSource) IsKnown

func (r FeedbackDatasetItemSource) IsKnown() bool

type FeedbackExperimentItemParam

type FeedbackExperimentItemParam struct {
	// The id of the experiment event to log feedback for. This is the row `id`
	// returned by `POST /v1/experiment/{experiment_id}/insert`
	ID param.Field[string] `json:"id,required"`
	// An optional comment string to log about the experiment event
	Comment param.Field[string] `json:"comment"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not
	Expected param.Field[interface{}] `json:"expected"`
	// A dictionary with additional data about the feedback. If you have a `user_id`,
	// you can log it here and access it in the Braintrust UI.
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// A dictionary of numeric values (between 0 and 1) to log. These scores will be
	// merged into the existing scores for the experiment event
	Scores param.Field[map[string]float64] `json:"scores"`
	// The source of the feedback. Must be one of "external" (default), "app", or "api"
	Source param.Field[FeedbackExperimentItemSource] `json:"source"`
}

func (FeedbackExperimentItemParam) MarshalJSON

func (r FeedbackExperimentItemParam) MarshalJSON() (data []byte, err error)

type FeedbackExperimentItemSource

type FeedbackExperimentItemSource string

The source of the feedback. Must be one of "external" (default), "app", or "api"

const (
	FeedbackExperimentItemSourceApp      FeedbackExperimentItemSource = "app"
	FeedbackExperimentItemSourceAPI      FeedbackExperimentItemSource = "api"
	FeedbackExperimentItemSourceExternal FeedbackExperimentItemSource = "external"
)

func (FeedbackExperimentItemSource) IsKnown

func (r FeedbackExperimentItemSource) IsKnown() bool

type FeedbackProjectLogsItemParam

type FeedbackProjectLogsItemParam struct {
	// The id of the project logs event to log feedback for. This is the row `id`
	// returned by `POST /v1/project_logs/{project_id}/insert`
	ID param.Field[string] `json:"id,required"`
	// An optional comment string to log about the project logs event
	Comment param.Field[string] `json:"comment"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not
	Expected param.Field[interface{}] `json:"expected"`
	// A dictionary with additional data about the feedback. If you have a `user_id`,
	// you can log it here and access it in the Braintrust UI.
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// A dictionary of numeric values (between 0 and 1) to log. These scores will be
	// merged into the existing scores for the project logs event
	Scores param.Field[map[string]float64] `json:"scores"`
	// The source of the feedback. Must be one of "external" (default), "app", or "api"
	Source param.Field[FeedbackProjectLogsItemSource] `json:"source"`
}

func (FeedbackProjectLogsItemParam) MarshalJSON

func (r FeedbackProjectLogsItemParam) MarshalJSON() (data []byte, err error)

type FeedbackProjectLogsItemSource

type FeedbackProjectLogsItemSource string

The source of the feedback. Must be one of "external" (default), "app", or "api"

const (
	FeedbackProjectLogsItemSourceApp      FeedbackProjectLogsItemSource = "app"
	FeedbackProjectLogsItemSourceAPI      FeedbackProjectLogsItemSource = "api"
	FeedbackProjectLogsItemSourceExternal FeedbackProjectLogsItemSource = "external"
)

func (FeedbackProjectLogsItemSource) IsKnown

func (r FeedbackProjectLogsItemSource) IsKnown() bool

type FeedbackResponseSchema added in v0.4.0

type FeedbackResponseSchema struct {
	Status FeedbackResponseSchemaStatus `json:"status,required"`
	JSON   feedbackResponseSchemaJSON   `json:"-"`
}

func (*FeedbackResponseSchema) UnmarshalJSON added in v0.4.0

func (r *FeedbackResponseSchema) UnmarshalJSON(data []byte) (err error)

type FeedbackResponseSchemaStatus added in v0.4.0

type FeedbackResponseSchemaStatus string
const (
	FeedbackResponseSchemaStatusSuccess FeedbackResponseSchemaStatus = "success"
)

func (FeedbackResponseSchemaStatus) IsKnown added in v0.4.0

func (r FeedbackResponseSchemaStatus) IsKnown() bool

type FetchDatasetEventsResponse

type FetchDatasetEventsResponse struct {
	// A list of fetched events
	Events []DatasetEvent `json:"events,required"`
	// Pagination cursor
	//
	// Pass this string directly as the `cursor` param to your next fetch request to
	// get the next page of results. Not provided if the returned result set is empty.
	Cursor string                         `json:"cursor,nullable"`
	JSON   fetchDatasetEventsResponseJSON `json:"-"`
}

func (*FetchDatasetEventsResponse) UnmarshalJSON

func (r *FetchDatasetEventsResponse) UnmarshalJSON(data []byte) (err error)

type FetchExperimentEventsResponse

type FetchExperimentEventsResponse struct {
	// A list of fetched events
	Events []ExperimentEvent `json:"events,required"`
	// Pagination cursor
	//
	// Pass this string directly as the `cursor` param to your next fetch request to
	// get the next page of results. Not provided if the returned result set is empty.
	Cursor string                            `json:"cursor,nullable"`
	JSON   fetchExperimentEventsResponseJSON `json:"-"`
}

func (*FetchExperimentEventsResponse) UnmarshalJSON

func (r *FetchExperimentEventsResponse) UnmarshalJSON(data []byte) (err error)

type FetchProjectLogsEventsResponse

type FetchProjectLogsEventsResponse struct {
	// A list of fetched events
	Events []ProjectLogsEvent `json:"events,required"`
	// Pagination cursor
	//
	// Pass this string directly as the `cursor` param to your next fetch request to
	// get the next page of results. Not provided if the returned result set is empty.
	Cursor string                             `json:"cursor,nullable"`
	JSON   fetchProjectLogsEventsResponseJSON `json:"-"`
}

func (*FetchProjectLogsEventsResponse) UnmarshalJSON

func (r *FetchProjectLogsEventsResponse) UnmarshalJSON(data []byte) (err error)

type Function

type Function struct {
	// Unique identifier for the prompt
	ID string `json:"id,required" format:"uuid"`
	// The transaction id of an event is unique to the network operation that processed
	// the event insertion. Transaction ids are monotonically increasing over time and
	// can be used to retrieve a versioned snapshot of the prompt (see the `version`
	// parameter)
	XactID       string               `json:"_xact_id,required"`
	FunctionData FunctionFunctionData `json:"function_data,required"`
	// A literal 'p' which identifies the object as a project prompt
	LogID FunctionLogID `json:"log_id,required"`
	// Name of the prompt
	Name string `json:"name,required"`
	// Unique identifier for the organization
	OrgID string `json:"org_id,required" format:"uuid"`
	// Unique identifier for the project that the prompt belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// Unique identifier for the prompt
	Slug string `json:"slug,required"`
	// Date of prompt creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Textual description of the prompt
	Description string `json:"description,nullable"`
	// JSON schema for the function's parameters and return type
	FunctionSchema FunctionFunctionSchema `json:"function_schema,nullable"`
	FunctionType   FunctionFunctionType   `json:"function_type,nullable"`
	// User-controlled metadata about the prompt
	Metadata map[string]interface{} `json:"metadata,nullable"`
	Origin   FunctionOrigin         `json:"origin,nullable"`
	// The prompt, model, and its parameters
	PromptData PromptData `json:"prompt_data,nullable"`
	// A list of tags for the prompt
	Tags []string     `json:"tags,nullable"`
	JSON functionJSON `json:"-"`
}

func (*Function) UnmarshalJSON

func (r *Function) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionData

type FunctionFunctionData struct {
	Type FunctionFunctionDataType `json:"type,required"`
	// This field can have the runtime type of [FunctionFunctionDataCodeData].
	Data interface{}              `json:"data,required"`
	Name string                   `json:"name"`
	JSON functionFunctionDataJSON `json:"-"`
	// contains filtered or unexported fields
}

func (FunctionFunctionData) AsUnion

AsUnion returns a FunctionFunctionDataUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.FunctionFunctionDataPrompt, shared.FunctionFunctionDataCode, shared.FunctionFunctionDataGlobal.

func (*FunctionFunctionData) UnmarshalJSON

func (r *FunctionFunctionData) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataCode

type FunctionFunctionDataCode struct {
	Data FunctionFunctionDataCodeData `json:"data,required"`
	Type FunctionFunctionDataCodeType `json:"type,required"`
	JSON functionFunctionDataCodeJSON `json:"-"`
}

func (*FunctionFunctionDataCode) UnmarshalJSON

func (r *FunctionFunctionDataCode) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataCodeData

type FunctionFunctionDataCodeData struct {
	// This field can have the runtime type of [CodeBundleRuntimeContext],
	// [FunctionFunctionDataCodeDataInlineRuntimeContext].
	RuntimeContext interface{} `json:"runtime_context,required"`
	// This field can have the runtime type of [CodeBundleLocation].
	Location interface{} `json:"location,required"`
	BundleID string      `json:"bundle_id"`
	// A preview of the code
	Preview string                           `json:"preview,nullable"`
	Type    FunctionFunctionDataCodeDataType `json:"type"`
	Code    string                           `json:"code"`
	JSON    functionFunctionDataCodeDataJSON `json:"-"`
	// contains filtered or unexported fields
}

func (FunctionFunctionDataCodeData) AsUnion added in v0.4.0

AsUnion returns a FunctionFunctionDataCodeDataUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.FunctionFunctionDataCodeDataBundle, shared.FunctionFunctionDataCodeDataInline.

func (*FunctionFunctionDataCodeData) UnmarshalJSON

func (r *FunctionFunctionDataCodeData) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataCodeDataBundle added in v0.4.0

type FunctionFunctionDataCodeDataBundle struct {
	Type FunctionFunctionDataCodeDataBundleType `json:"type,required"`
	JSON functionFunctionDataCodeDataBundleJSON `json:"-"`
	CodeBundle
}

func (*FunctionFunctionDataCodeDataBundle) UnmarshalJSON added in v0.4.0

func (r *FunctionFunctionDataCodeDataBundle) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataCodeDataBundleType added in v0.4.0

type FunctionFunctionDataCodeDataBundleType string
const (
	FunctionFunctionDataCodeDataBundleTypeBundle FunctionFunctionDataCodeDataBundleType = "bundle"
)

func (FunctionFunctionDataCodeDataBundleType) IsKnown added in v0.4.0

type FunctionFunctionDataCodeDataInline added in v0.4.0

type FunctionFunctionDataCodeDataInline struct {
	Code           string                                           `json:"code,required"`
	RuntimeContext FunctionFunctionDataCodeDataInlineRuntimeContext `json:"runtime_context,required"`
	Type           FunctionFunctionDataCodeDataInlineType           `json:"type,required"`
	JSON           functionFunctionDataCodeDataInlineJSON           `json:"-"`
}

func (*FunctionFunctionDataCodeDataInline) UnmarshalJSON added in v0.4.0

func (r *FunctionFunctionDataCodeDataInline) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataCodeDataInlineRuntimeContext added in v0.4.0

type FunctionFunctionDataCodeDataInlineRuntimeContext struct {
	Runtime FunctionFunctionDataCodeDataInlineRuntimeContextRuntime `json:"runtime,required"`
	Version string                                                  `json:"version,required"`
	JSON    functionFunctionDataCodeDataInlineRuntimeContextJSON    `json:"-"`
}

func (*FunctionFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON added in v0.4.0

func (r *FunctionFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataCodeDataInlineRuntimeContextRuntime added in v0.4.0

type FunctionFunctionDataCodeDataInlineRuntimeContextRuntime string
const (
	FunctionFunctionDataCodeDataInlineRuntimeContextRuntimeNode   FunctionFunctionDataCodeDataInlineRuntimeContextRuntime = "node"
	FunctionFunctionDataCodeDataInlineRuntimeContextRuntimePython FunctionFunctionDataCodeDataInlineRuntimeContextRuntime = "python"
)

func (FunctionFunctionDataCodeDataInlineRuntimeContextRuntime) IsKnown added in v0.4.0

type FunctionFunctionDataCodeDataInlineType added in v0.4.0

type FunctionFunctionDataCodeDataInlineType string
const (
	FunctionFunctionDataCodeDataInlineTypeInline FunctionFunctionDataCodeDataInlineType = "inline"
)

func (FunctionFunctionDataCodeDataInlineType) IsKnown added in v0.4.0

type FunctionFunctionDataCodeDataType added in v0.4.0

type FunctionFunctionDataCodeDataType string
const (
	FunctionFunctionDataCodeDataTypeBundle FunctionFunctionDataCodeDataType = "bundle"
	FunctionFunctionDataCodeDataTypeInline FunctionFunctionDataCodeDataType = "inline"
)

func (FunctionFunctionDataCodeDataType) IsKnown added in v0.4.0

type FunctionFunctionDataCodeDataUnion added in v0.4.0

type FunctionFunctionDataCodeDataUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.FunctionFunctionDataCodeDataBundle or shared.FunctionFunctionDataCodeDataInline.

type FunctionFunctionDataCodeType

type FunctionFunctionDataCodeType string
const (
	FunctionFunctionDataCodeTypeCode FunctionFunctionDataCodeType = "code"
)

func (FunctionFunctionDataCodeType) IsKnown

func (r FunctionFunctionDataCodeType) IsKnown() bool

type FunctionFunctionDataGlobal

type FunctionFunctionDataGlobal struct {
	Name string                         `json:"name,required"`
	Type FunctionFunctionDataGlobalType `json:"type,required"`
	JSON functionFunctionDataGlobalJSON `json:"-"`
}

func (*FunctionFunctionDataGlobal) UnmarshalJSON

func (r *FunctionFunctionDataGlobal) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataGlobalType

type FunctionFunctionDataGlobalType string
const (
	FunctionFunctionDataGlobalTypeGlobal FunctionFunctionDataGlobalType = "global"
)

func (FunctionFunctionDataGlobalType) IsKnown

type FunctionFunctionDataPrompt

type FunctionFunctionDataPrompt struct {
	Type FunctionFunctionDataPromptType `json:"type,required"`
	JSON functionFunctionDataPromptJSON `json:"-"`
}

func (*FunctionFunctionDataPrompt) UnmarshalJSON

func (r *FunctionFunctionDataPrompt) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionDataPromptType

type FunctionFunctionDataPromptType string
const (
	FunctionFunctionDataPromptTypePrompt FunctionFunctionDataPromptType = "prompt"
)

func (FunctionFunctionDataPromptType) IsKnown

type FunctionFunctionDataType

type FunctionFunctionDataType string
const (
	FunctionFunctionDataTypePrompt FunctionFunctionDataType = "prompt"
	FunctionFunctionDataTypeCode   FunctionFunctionDataType = "code"
	FunctionFunctionDataTypeGlobal FunctionFunctionDataType = "global"
)

func (FunctionFunctionDataType) IsKnown

func (r FunctionFunctionDataType) IsKnown() bool

type FunctionFunctionDataUnion

type FunctionFunctionDataUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.FunctionFunctionDataPrompt, shared.FunctionFunctionDataCode or shared.FunctionFunctionDataGlobal.

type FunctionFunctionSchema added in v0.4.0

type FunctionFunctionSchema struct {
	Parameters interface{}                `json:"parameters,nullable"`
	Returns    interface{}                `json:"returns,nullable"`
	JSON       functionFunctionSchemaJSON `json:"-"`
}

JSON schema for the function's parameters and return type

func (*FunctionFunctionSchema) UnmarshalJSON added in v0.4.0

func (r *FunctionFunctionSchema) UnmarshalJSON(data []byte) (err error)

type FunctionFunctionType added in v0.4.0

type FunctionFunctionType string
const (
	FunctionFunctionTypeLlm    FunctionFunctionType = "llm"
	FunctionFunctionTypeScorer FunctionFunctionType = "scorer"
	FunctionFunctionTypeTask   FunctionFunctionType = "task"
	FunctionFunctionTypeTool   FunctionFunctionType = "tool"
)

func (FunctionFunctionType) IsKnown added in v0.4.0

func (r FunctionFunctionType) IsKnown() bool

type FunctionLogID

type FunctionLogID string

A literal 'p' which identifies the object as a project prompt

const (
	FunctionLogIDP FunctionLogID = "p"
)

func (FunctionLogID) IsKnown

func (r FunctionLogID) IsKnown() bool

type FunctionOrigin added in v0.4.0

type FunctionOrigin struct {
	// Id of the object the function is originating from
	ObjectID string `json:"object_id,required" format:"uuid"`
	// The object type that the ACL applies to
	ObjectType FunctionOriginObjectType `json:"object_type,required"`
	// The function exists for internal purposes and should not be displayed in the
	// list of functions.
	Internal bool               `json:"internal,nullable"`
	JSON     functionOriginJSON `json:"-"`
}

func (*FunctionOrigin) UnmarshalJSON added in v0.4.0

func (r *FunctionOrigin) UnmarshalJSON(data []byte) (err error)

type FunctionOriginObjectType added in v0.4.0

type FunctionOriginObjectType string

The object type that the ACL applies to

const (
	FunctionOriginObjectTypeOrganization  FunctionOriginObjectType = "organization"
	FunctionOriginObjectTypeProject       FunctionOriginObjectType = "project"
	FunctionOriginObjectTypeExperiment    FunctionOriginObjectType = "experiment"
	FunctionOriginObjectTypeDataset       FunctionOriginObjectType = "dataset"
	FunctionOriginObjectTypePrompt        FunctionOriginObjectType = "prompt"
	FunctionOriginObjectTypePromptSession FunctionOriginObjectType = "prompt_session"
	FunctionOriginObjectTypeGroup         FunctionOriginObjectType = "group"
	FunctionOriginObjectTypeRole          FunctionOriginObjectType = "role"
	FunctionOriginObjectTypeOrgMember     FunctionOriginObjectType = "org_member"
	FunctionOriginObjectTypeProjectLog    FunctionOriginObjectType = "project_log"
	FunctionOriginObjectTypeOrgProject    FunctionOriginObjectType = "org_project"
)

func (FunctionOriginObjectType) IsKnown added in v0.4.0

func (r FunctionOriginObjectType) IsKnown() bool

type FunctionToolChoice added in v0.4.0

type FunctionToolChoice struct {
	Name string                 `json:"name,required"`
	JSON functionToolChoiceJSON `json:"-"`
}

func (*FunctionToolChoice) UnmarshalJSON added in v0.4.0

func (r *FunctionToolChoice) UnmarshalJSON(data []byte) (err error)

type FunctionToolChoiceParam added in v0.4.0

type FunctionToolChoiceParam struct {
	Name param.Field[string] `json:"name,required"`
}

func (FunctionToolChoiceParam) MarshalJSON added in v0.4.0

func (r FunctionToolChoiceParam) MarshalJSON() (data []byte, err error)

type Group

type Group struct {
	// Unique identifier for the group
	ID string `json:"id,required" format:"uuid"`
	// Name of the group
	Name string `json:"name,required"`
	// Unique id for the organization that the group belongs under
	//
	// It is forbidden to change the org after creating a group
	OrgID string `json:"org_id,required" format:"uuid"`
	// Date of group creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Date of group deletion, or null if the group is still active
	DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
	// Textual description of the group
	Description string `json:"description,nullable"`
	// Ids of the groups this group inherits from
	//
	// An inheriting group has all the users contained in its member groups, as well as
	// all of their inherited users
	MemberGroups []string `json:"member_groups,nullable" format:"uuid"`
	// Ids of users which belong to this group
	MemberUsers []string `json:"member_users,nullable" format:"uuid"`
	// Identifies the user who created the group
	UserID string    `json:"user_id,nullable" format:"uuid"`
	JSON   groupJSON `json:"-"`
}

A group is a collection of users which can be assigned an ACL

Groups can consist of individual users, as well as a set of groups they inherit from

func (*Group) UnmarshalJSON

func (r *Group) UnmarshalJSON(data []byte) (err error)

type InsertDatasetEventMergeParam

type InsertDatasetEventMergeParam struct {
	// The `_is_merge` field controls how the row is merged with any existing row with
	// the same id in the DB. By default (or when set to `false`), the existing row is
	// completely replaced by the new row. When set to `true`, the new row is
	// deep-merged into the existing row
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
	// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
	// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
	// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
	// `{"id": "foo", "input": {"b": 11, "c": 20}}`
	IsMerge param.Field[bool] `json:"_is_merge,required"`
	// A unique identifier for the dataset event. If you don't provide one, BrainTrust
	// will generate one for you
	ID param.Field[string] `json:"id"`
	// The `_merge_paths` field allows controlling the depth of the merge. It can only
	// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
	// where each path is a list of field names. The deep merge will not descend below
	// any of the specified merge paths.
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
	// If we merge a new row as
	// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
	// the new row will be
	// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
	// In this case, due to the merge paths, we have replaced `input.a` and `output`,
	// but have still deep-merged `input` and `input.c`.
	MergePaths param.Field[[][]string] `json:"_merge_paths"`
	// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
	// will not show up in subsequent fetches for this dataset
	ObjectDelete param.Field[bool] `json:"_object_delete"`
	// The timestamp the dataset event was created
	Created param.Field[time.Time] `json:"created" format:"date-time"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object)
	Expected param.Field[interface{}] `json:"expected"`
	// The argument that uniquely define an input case (an arbitrary, JSON serializable
	// object)
	Input param.Field[interface{}] `json:"input"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// A list of tags to log
	Tags param.Field[[]string] `json:"tags"`
}

func (InsertDatasetEventMergeParam) ImplementsDatasetInsertParamsEventUnion added in v0.3.0

func (r InsertDatasetEventMergeParam) ImplementsDatasetInsertParamsEventUnion()

func (InsertDatasetEventMergeParam) MarshalJSON

func (r InsertDatasetEventMergeParam) MarshalJSON() (data []byte, err error)

type InsertDatasetEventReplaceParam

type InsertDatasetEventReplaceParam struct {
	// A unique identifier for the dataset event. If you don't provide one, BrainTrust
	// will generate one for you
	ID param.Field[string] `json:"id"`
	// The `_is_merge` field controls how the row is merged with any existing row with
	// the same id in the DB. By default (or when set to `false`), the existing row is
	// completely replaced by the new row. When set to `true`, the new row is
	// deep-merged into the existing row
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
	// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
	// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
	// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
	// `{"id": "foo", "input": {"b": 11, "c": 20}}`
	IsMerge param.Field[bool] `json:"_is_merge"`
	// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
	// will not show up in subsequent fetches for this dataset
	ObjectDelete param.Field[bool] `json:"_object_delete"`
	// Use the `_parent_id` field to create this row as a subspan of an existing row.
	// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
	// relationships are important for tracing (see the
	// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
	//
	// For example, say we have logged a row
	// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
	// We can create a sub-span of the parent row by logging
	// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
	// In the webapp, only the root span row `"abc"` will show up in the summary view.
	// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
	// clicking on the "abc" row.
	ParentID param.Field[string] `json:"_parent_id"`
	// The timestamp the dataset event was created
	Created param.Field[time.Time] `json:"created" format:"date-time"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object)
	Expected param.Field[interface{}] `json:"expected"`
	// The argument that uniquely define an input case (an arbitrary, JSON serializable
	// object)
	Input param.Field[interface{}] `json:"input"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// A list of tags to log
	Tags param.Field[[]string] `json:"tags"`
}

func (InsertDatasetEventReplaceParam) ImplementsDatasetInsertParamsEventUnion added in v0.3.0

func (r InsertDatasetEventReplaceParam) ImplementsDatasetInsertParamsEventUnion()

func (InsertDatasetEventReplaceParam) MarshalJSON

func (r InsertDatasetEventReplaceParam) MarshalJSON() (data []byte, err error)

type InsertEventsResponse

type InsertEventsResponse struct {
	// The ids of all rows that were inserted, aligning one-to-one with the rows
	// provided as input
	RowIDs []string                 `json:"row_ids,required"`
	JSON   insertEventsResponseJSON `json:"-"`
}

func (*InsertEventsResponse) UnmarshalJSON

func (r *InsertEventsResponse) UnmarshalJSON(data []byte) (err error)

type InsertExperimentEventMergeContextParam

type InsertExperimentEventMergeContextParam struct {
	// Name of the file in code where the experiment event was created
	CallerFilename param.Field[string] `json:"caller_filename"`
	// The function in code which created the experiment event
	CallerFunctionname param.Field[string] `json:"caller_functionname"`
	// Line of code where the experiment event was created
	CallerLineno param.Field[int64]     `json:"caller_lineno"`
	ExtraFields  map[string]interface{} `json:"-,extras"`
}

Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event

func (InsertExperimentEventMergeContextParam) MarshalJSON

func (r InsertExperimentEventMergeContextParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventMergeMetricsParam

type InsertExperimentEventMergeMetricsParam struct {
	// The number of tokens in the completion generated by the model (only set if this
	// is an LLM span)
	CompletionTokens param.Field[int64] `json:"completion_tokens"`
	// A unix timestamp recording when the section of code which produced the
	// experiment event finished
	End param.Field[float64] `json:"end"`
	// The number of tokens in the prompt used to generate the experiment event (only
	// set if this is an LLM span)
	PromptTokens param.Field[int64] `json:"prompt_tokens"`
	// A unix timestamp recording when the section of code which produced the
	// experiment event started
	Start param.Field[float64] `json:"start"`
	// The total number of tokens in the input and output of the experiment event.
	Tokens      param.Field[int64]     `json:"tokens"`
	ExtraFields map[string]interface{} `json:"-,extras"`
}

Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced

func (InsertExperimentEventMergeMetricsParam) MarshalJSON

func (r InsertExperimentEventMergeMetricsParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventMergeParam

type InsertExperimentEventMergeParam struct {
	// The `_is_merge` field controls how the row is merged with any existing row with
	// the same id in the DB. By default (or when set to `false`), the existing row is
	// completely replaced by the new row. When set to `true`, the new row is
	// deep-merged into the existing row
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
	// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
	// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
	// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
	// `{"id": "foo", "input": {"b": 11, "c": 20}}`
	IsMerge param.Field[bool] `json:"_is_merge,required"`
	// A unique identifier for the experiment event. If you don't provide one,
	// BrainTrust will generate one for you
	ID param.Field[string] `json:"id"`
	// The `_merge_paths` field allows controlling the depth of the merge. It can only
	// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
	// where each path is a list of field names. The deep merge will not descend below
	// any of the specified merge paths.
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
	// If we merge a new row as
	// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
	// the new row will be
	// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
	// In this case, due to the merge paths, we have replaced `input.a` and `output`,
	// but have still deep-merged `input` and `input.c`.
	MergePaths param.Field[[][]string] `json:"_merge_paths"`
	// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
	// will not show up in subsequent fetches for this experiment
	ObjectDelete param.Field[bool] `json:"_object_delete"`
	// Context is additional information about the code that produced the experiment
	// event. It is essentially the textual counterpart to `metrics`. Use the
	// `caller_*` attributes to track the location in code which produced the
	// experiment event
	Context param.Field[InsertExperimentEventMergeContextParam] `json:"context"`
	// The timestamp the experiment event was created
	Created param.Field[time.Time] `json:"created" format:"date-time"`
	// If the experiment is associated to a dataset, this is the event-level dataset id
	// this experiment event is tied to
	DatasetRecordID param.Field[string] `json:"dataset_record_id"`
	// The error that occurred, if any.
	Error param.Field[interface{}] `json:"error"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not.
	// Braintrust currently does not compare `output` to `expected` for you, since
	// there are so many different ways to do that correctly. Instead, these values are
	// just used to help you navigate your experiments while digging into analyses.
	// However, we may later use these values to re-score outputs or fine-tune your
	// models
	Expected param.Field[interface{}] `json:"expected"`
	// The arguments that uniquely define a test case (an arbitrary, JSON serializable
	// object). Later on, Braintrust will use the `input` to know whether two test
	// cases are the same between experiments, so they should not contain
	// experiment-specific state. A simple rule of thumb is that if you run the same
	// experiment twice, the `input` should be identical
	Input param.Field[interface{}] `json:"input"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// Metrics are numerical measurements tracking the execution of the code that
	// produced the experiment event. Use "start" and "end" to track the time span over
	// which the experiment event was produced
	Metrics param.Field[InsertExperimentEventMergeMetricsParam] `json:"metrics"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object), that allows you to determine whether the result is correct
	// or not. For example, in an app that generates SQL queries, the `output` should
	// be the _result_ of the SQL query generated by the model, not the query itself,
	// because there may be multiple valid queries that answer a single question
	Output param.Field[interface{}] `json:"output"`
	// A dictionary of numeric values (between 0 and 1) to log. The scores should give
	// you a variety of signals that help you determine how accurate the outputs are
	// compared to what you expect and diagnose failures. For example, a summarization
	// app might have one score that tells you how accurate the summary is, and another
	// that measures the word similarity between the generated and grouth truth
	// summary. The word similarity score could help you determine whether the
	// summarization was covering similar concepts or not. You can use these scores to
	// help you sort, filter, and compare experiments
	Scores param.Field[map[string]float64] `json:"scores"`
	// Human-identifying attributes of the span, such as name, type, etc.
	SpanAttributes param.Field[InsertExperimentEventMergeSpanAttributesParam] `json:"span_attributes"`
	// A list of tags to log
	Tags param.Field[[]string] `json:"tags"`
}

func (InsertExperimentEventMergeParam) ImplementsExperimentInsertParamsEventUnion added in v0.3.0

func (r InsertExperimentEventMergeParam) ImplementsExperimentInsertParamsEventUnion()

func (InsertExperimentEventMergeParam) MarshalJSON

func (r InsertExperimentEventMergeParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventMergeSpanAttributesParam

type InsertExperimentEventMergeSpanAttributesParam struct {
	// Name of the span, for display purposes only
	Name param.Field[string] `json:"name"`
	// Type of the span, for display purposes only
	Type        param.Field[InsertExperimentEventMergeSpanAttributesType] `json:"type"`
	ExtraFields map[string]interface{}                                    `json:"-,extras"`
}

Human-identifying attributes of the span, such as name, type, etc.

func (InsertExperimentEventMergeSpanAttributesParam) MarshalJSON

func (r InsertExperimentEventMergeSpanAttributesParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventMergeSpanAttributesType

type InsertExperimentEventMergeSpanAttributesType string

Type of the span, for display purposes only

const (
	InsertExperimentEventMergeSpanAttributesTypeLlm      InsertExperimentEventMergeSpanAttributesType = "llm"
	InsertExperimentEventMergeSpanAttributesTypeScore    InsertExperimentEventMergeSpanAttributesType = "score"
	InsertExperimentEventMergeSpanAttributesTypeFunction InsertExperimentEventMergeSpanAttributesType = "function"
	InsertExperimentEventMergeSpanAttributesTypeEval     InsertExperimentEventMergeSpanAttributesType = "eval"
	InsertExperimentEventMergeSpanAttributesTypeTask     InsertExperimentEventMergeSpanAttributesType = "task"
	InsertExperimentEventMergeSpanAttributesTypeTool     InsertExperimentEventMergeSpanAttributesType = "tool"
)

func (InsertExperimentEventMergeSpanAttributesType) IsKnown

type InsertExperimentEventReplaceContextParam

type InsertExperimentEventReplaceContextParam struct {
	// Name of the file in code where the experiment event was created
	CallerFilename param.Field[string] `json:"caller_filename"`
	// The function in code which created the experiment event
	CallerFunctionname param.Field[string] `json:"caller_functionname"`
	// Line of code where the experiment event was created
	CallerLineno param.Field[int64]     `json:"caller_lineno"`
	ExtraFields  map[string]interface{} `json:"-,extras"`
}

Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event

func (InsertExperimentEventReplaceContextParam) MarshalJSON

func (r InsertExperimentEventReplaceContextParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventReplaceMetricsParam

type InsertExperimentEventReplaceMetricsParam struct {
	// The number of tokens in the completion generated by the model (only set if this
	// is an LLM span)
	CompletionTokens param.Field[int64] `json:"completion_tokens"`
	// A unix timestamp recording when the section of code which produced the
	// experiment event finished
	End param.Field[float64] `json:"end"`
	// The number of tokens in the prompt used to generate the experiment event (only
	// set if this is an LLM span)
	PromptTokens param.Field[int64] `json:"prompt_tokens"`
	// A unix timestamp recording when the section of code which produced the
	// experiment event started
	Start param.Field[float64] `json:"start"`
	// The total number of tokens in the input and output of the experiment event.
	Tokens      param.Field[int64]     `json:"tokens"`
	ExtraFields map[string]interface{} `json:"-,extras"`
}

Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced

func (InsertExperimentEventReplaceMetricsParam) MarshalJSON

func (r InsertExperimentEventReplaceMetricsParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventReplaceParam

type InsertExperimentEventReplaceParam struct {
	// A unique identifier for the experiment event. If you don't provide one,
	// BrainTrust will generate one for you
	ID param.Field[string] `json:"id"`
	// The `_is_merge` field controls how the row is merged with any existing row with
	// the same id in the DB. By default (or when set to `false`), the existing row is
	// completely replaced by the new row. When set to `true`, the new row is
	// deep-merged into the existing row
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
	// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
	// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
	// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
	// `{"id": "foo", "input": {"b": 11, "c": 20}}`
	IsMerge param.Field[bool] `json:"_is_merge"`
	// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
	// will not show up in subsequent fetches for this experiment
	ObjectDelete param.Field[bool] `json:"_object_delete"`
	// Use the `_parent_id` field to create this row as a subspan of an existing row.
	// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
	// relationships are important for tracing (see the
	// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
	//
	// For example, say we have logged a row
	// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
	// We can create a sub-span of the parent row by logging
	// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
	// In the webapp, only the root span row `"abc"` will show up in the summary view.
	// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
	// clicking on the "abc" row.
	ParentID param.Field[string] `json:"_parent_id"`
	// Context is additional information about the code that produced the experiment
	// event. It is essentially the textual counterpart to `metrics`. Use the
	// `caller_*` attributes to track the location in code which produced the
	// experiment event
	Context param.Field[InsertExperimentEventReplaceContextParam] `json:"context"`
	// The timestamp the experiment event was created
	Created param.Field[time.Time] `json:"created" format:"date-time"`
	// If the experiment is associated to a dataset, this is the event-level dataset id
	// this experiment event is tied to
	DatasetRecordID param.Field[string] `json:"dataset_record_id"`
	// The error that occurred, if any.
	Error param.Field[interface{}] `json:"error"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not.
	// Braintrust currently does not compare `output` to `expected` for you, since
	// there are so many different ways to do that correctly. Instead, these values are
	// just used to help you navigate your experiments while digging into analyses.
	// However, we may later use these values to re-score outputs or fine-tune your
	// models
	Expected param.Field[interface{}] `json:"expected"`
	// The arguments that uniquely define a test case (an arbitrary, JSON serializable
	// object). Later on, Braintrust will use the `input` to know whether two test
	// cases are the same between experiments, so they should not contain
	// experiment-specific state. A simple rule of thumb is that if you run the same
	// experiment twice, the `input` should be identical
	Input param.Field[interface{}] `json:"input"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// Metrics are numerical measurements tracking the execution of the code that
	// produced the experiment event. Use "start" and "end" to track the time span over
	// which the experiment event was produced
	Metrics param.Field[InsertExperimentEventReplaceMetricsParam] `json:"metrics"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object), that allows you to determine whether the result is correct
	// or not. For example, in an app that generates SQL queries, the `output` should
	// be the _result_ of the SQL query generated by the model, not the query itself,
	// because there may be multiple valid queries that answer a single question
	Output param.Field[interface{}] `json:"output"`
	// A dictionary of numeric values (between 0 and 1) to log. The scores should give
	// you a variety of signals that help you determine how accurate the outputs are
	// compared to what you expect and diagnose failures. For example, a summarization
	// app might have one score that tells you how accurate the summary is, and another
	// that measures the word similarity between the generated and grouth truth
	// summary. The word similarity score could help you determine whether the
	// summarization was covering similar concepts or not. You can use these scores to
	// help you sort, filter, and compare experiments
	Scores param.Field[map[string]float64] `json:"scores"`
	// Human-identifying attributes of the span, such as name, type, etc.
	SpanAttributes param.Field[InsertExperimentEventReplaceSpanAttributesParam] `json:"span_attributes"`
	// A list of tags to log
	Tags param.Field[[]string] `json:"tags"`
}

func (InsertExperimentEventReplaceParam) ImplementsExperimentInsertParamsEventUnion added in v0.3.0

func (r InsertExperimentEventReplaceParam) ImplementsExperimentInsertParamsEventUnion()

func (InsertExperimentEventReplaceParam) MarshalJSON

func (r InsertExperimentEventReplaceParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventReplaceSpanAttributesParam

type InsertExperimentEventReplaceSpanAttributesParam struct {
	// Name of the span, for display purposes only
	Name param.Field[string] `json:"name"`
	// Type of the span, for display purposes only
	Type        param.Field[InsertExperimentEventReplaceSpanAttributesType] `json:"type"`
	ExtraFields map[string]interface{}                                      `json:"-,extras"`
}

Human-identifying attributes of the span, such as name, type, etc.

func (InsertExperimentEventReplaceSpanAttributesParam) MarshalJSON

func (r InsertExperimentEventReplaceSpanAttributesParam) MarshalJSON() (data []byte, err error)

type InsertExperimentEventReplaceSpanAttributesType

type InsertExperimentEventReplaceSpanAttributesType string

Type of the span, for display purposes only

const (
	InsertExperimentEventReplaceSpanAttributesTypeLlm      InsertExperimentEventReplaceSpanAttributesType = "llm"
	InsertExperimentEventReplaceSpanAttributesTypeScore    InsertExperimentEventReplaceSpanAttributesType = "score"
	InsertExperimentEventReplaceSpanAttributesTypeFunction InsertExperimentEventReplaceSpanAttributesType = "function"
	InsertExperimentEventReplaceSpanAttributesTypeEval     InsertExperimentEventReplaceSpanAttributesType = "eval"
	InsertExperimentEventReplaceSpanAttributesTypeTask     InsertExperimentEventReplaceSpanAttributesType = "task"
	InsertExperimentEventReplaceSpanAttributesTypeTool     InsertExperimentEventReplaceSpanAttributesType = "tool"
)

func (InsertExperimentEventReplaceSpanAttributesType) IsKnown

type InsertProjectLogsEventMergeContextParam

type InsertProjectLogsEventMergeContextParam struct {
	// Name of the file in code where the project logs event was created
	CallerFilename param.Field[string] `json:"caller_filename"`
	// The function in code which created the project logs event
	CallerFunctionname param.Field[string] `json:"caller_functionname"`
	// Line of code where the project logs event was created
	CallerLineno param.Field[int64]     `json:"caller_lineno"`
	ExtraFields  map[string]interface{} `json:"-,extras"`
}

Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event

func (InsertProjectLogsEventMergeContextParam) MarshalJSON

func (r InsertProjectLogsEventMergeContextParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventMergeMetricsParam

type InsertProjectLogsEventMergeMetricsParam struct {
	// The number of tokens in the completion generated by the model (only set if this
	// is an LLM span)
	CompletionTokens param.Field[int64] `json:"completion_tokens"`
	// A unix timestamp recording when the section of code which produced the project
	// logs event finished
	End param.Field[float64] `json:"end"`
	// The number of tokens in the prompt used to generate the project logs event (only
	// set if this is an LLM span)
	PromptTokens param.Field[int64] `json:"prompt_tokens"`
	// A unix timestamp recording when the section of code which produced the project
	// logs event started
	Start param.Field[float64] `json:"start"`
	// The total number of tokens in the input and output of the project logs event.
	Tokens      param.Field[int64]     `json:"tokens"`
	ExtraFields map[string]interface{} `json:"-,extras"`
}

Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced

func (InsertProjectLogsEventMergeMetricsParam) MarshalJSON

func (r InsertProjectLogsEventMergeMetricsParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventMergeParam

type InsertProjectLogsEventMergeParam struct {
	// The `_is_merge` field controls how the row is merged with any existing row with
	// the same id in the DB. By default (or when set to `false`), the existing row is
	// completely replaced by the new row. When set to `true`, the new row is
	// deep-merged into the existing row
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
	// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
	// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
	// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
	// `{"id": "foo", "input": {"b": 11, "c": 20}}`
	IsMerge param.Field[bool] `json:"_is_merge,required"`
	// A unique identifier for the project logs event. If you don't provide one,
	// BrainTrust will generate one for you
	ID param.Field[string] `json:"id"`
	// The `_merge_paths` field allows controlling the depth of the merge. It can only
	// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
	// where each path is a list of field names. The deep merge will not descend below
	// any of the specified merge paths.
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
	// If we merge a new row as
	// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
	// the new row will be
	// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
	// In this case, due to the merge paths, we have replaced `input.a` and `output`,
	// but have still deep-merged `input` and `input.c`.
	MergePaths param.Field[[][]string] `json:"_merge_paths"`
	// Pass `_object_delete=true` to mark the project logs event deleted. Deleted
	// events will not show up in subsequent fetches for this project logs
	ObjectDelete param.Field[bool] `json:"_object_delete"`
	// Context is additional information about the code that produced the project logs
	// event. It is essentially the textual counterpart to `metrics`. Use the
	// `caller_*` attributes to track the location in code which produced the project
	// logs event
	Context param.Field[InsertProjectLogsEventMergeContextParam] `json:"context"`
	// The timestamp the project logs event was created
	Created param.Field[time.Time] `json:"created" format:"date-time"`
	// The error that occurred, if any.
	Error param.Field[interface{}] `json:"error"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not.
	// Braintrust currently does not compare `output` to `expected` for you, since
	// there are so many different ways to do that correctly. Instead, these values are
	// just used to help you navigate while digging into analyses. However, we may
	// later use these values to re-score outputs or fine-tune your models.
	Expected param.Field[interface{}] `json:"expected"`
	// The arguments that uniquely define a user input (an arbitrary, JSON serializable
	// object).
	Input param.Field[interface{}] `json:"input"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// Metrics are numerical measurements tracking the execution of the code that
	// produced the project logs event. Use "start" and "end" to track the time span
	// over which the project logs event was produced
	Metrics param.Field[InsertProjectLogsEventMergeMetricsParam] `json:"metrics"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object), that allows you to determine whether the result is correct
	// or not. For example, in an app that generates SQL queries, the `output` should
	// be the _result_ of the SQL query generated by the model, not the query itself,
	// because there may be multiple valid queries that answer a single question.
	Output param.Field[interface{}] `json:"output"`
	// A dictionary of numeric values (between 0 and 1) to log. The scores should give
	// you a variety of signals that help you determine how accurate the outputs are
	// compared to what you expect and diagnose failures. For example, a summarization
	// app might have one score that tells you how accurate the summary is, and another
	// that measures the word similarity between the generated and grouth truth
	// summary. The word similarity score could help you determine whether the
	// summarization was covering similar concepts or not. You can use these scores to
	// help you sort, filter, and compare logs.
	Scores param.Field[map[string]float64] `json:"scores"`
	// Human-identifying attributes of the span, such as name, type, etc.
	SpanAttributes param.Field[InsertProjectLogsEventMergeSpanAttributesParam] `json:"span_attributes"`
	// A list of tags to log
	Tags param.Field[[]string] `json:"tags"`
}

func (InsertProjectLogsEventMergeParam) ImplementsProjectLogInsertParamsEventUnion added in v0.3.0

func (r InsertProjectLogsEventMergeParam) ImplementsProjectLogInsertParamsEventUnion()

func (InsertProjectLogsEventMergeParam) MarshalJSON

func (r InsertProjectLogsEventMergeParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventMergeSpanAttributesParam

type InsertProjectLogsEventMergeSpanAttributesParam struct {
	// Name of the span, for display purposes only
	Name param.Field[string] `json:"name"`
	// Type of the span, for display purposes only
	Type        param.Field[InsertProjectLogsEventMergeSpanAttributesType] `json:"type"`
	ExtraFields map[string]interface{}                                     `json:"-,extras"`
}

Human-identifying attributes of the span, such as name, type, etc.

func (InsertProjectLogsEventMergeSpanAttributesParam) MarshalJSON

func (r InsertProjectLogsEventMergeSpanAttributesParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventMergeSpanAttributesType

type InsertProjectLogsEventMergeSpanAttributesType string

Type of the span, for display purposes only

const (
	InsertProjectLogsEventMergeSpanAttributesTypeLlm      InsertProjectLogsEventMergeSpanAttributesType = "llm"
	InsertProjectLogsEventMergeSpanAttributesTypeScore    InsertProjectLogsEventMergeSpanAttributesType = "score"
	InsertProjectLogsEventMergeSpanAttributesTypeFunction InsertProjectLogsEventMergeSpanAttributesType = "function"
	InsertProjectLogsEventMergeSpanAttributesTypeEval     InsertProjectLogsEventMergeSpanAttributesType = "eval"
	InsertProjectLogsEventMergeSpanAttributesTypeTask     InsertProjectLogsEventMergeSpanAttributesType = "task"
	InsertProjectLogsEventMergeSpanAttributesTypeTool     InsertProjectLogsEventMergeSpanAttributesType = "tool"
)

func (InsertProjectLogsEventMergeSpanAttributesType) IsKnown

type InsertProjectLogsEventReplaceContextParam

type InsertProjectLogsEventReplaceContextParam struct {
	// Name of the file in code where the project logs event was created
	CallerFilename param.Field[string] `json:"caller_filename"`
	// The function in code which created the project logs event
	CallerFunctionname param.Field[string] `json:"caller_functionname"`
	// Line of code where the project logs event was created
	CallerLineno param.Field[int64]     `json:"caller_lineno"`
	ExtraFields  map[string]interface{} `json:"-,extras"`
}

Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event

func (InsertProjectLogsEventReplaceContextParam) MarshalJSON

func (r InsertProjectLogsEventReplaceContextParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventReplaceMetricsParam

type InsertProjectLogsEventReplaceMetricsParam struct {
	// The number of tokens in the completion generated by the model (only set if this
	// is an LLM span)
	CompletionTokens param.Field[int64] `json:"completion_tokens"`
	// A unix timestamp recording when the section of code which produced the project
	// logs event finished
	End param.Field[float64] `json:"end"`
	// The number of tokens in the prompt used to generate the project logs event (only
	// set if this is an LLM span)
	PromptTokens param.Field[int64] `json:"prompt_tokens"`
	// A unix timestamp recording when the section of code which produced the project
	// logs event started
	Start param.Field[float64] `json:"start"`
	// The total number of tokens in the input and output of the project logs event.
	Tokens      param.Field[int64]     `json:"tokens"`
	ExtraFields map[string]interface{} `json:"-,extras"`
}

Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced

func (InsertProjectLogsEventReplaceMetricsParam) MarshalJSON

func (r InsertProjectLogsEventReplaceMetricsParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventReplaceParam

type InsertProjectLogsEventReplaceParam struct {
	// A unique identifier for the project logs event. If you don't provide one,
	// BrainTrust will generate one for you
	ID param.Field[string] `json:"id"`
	// The `_is_merge` field controls how the row is merged with any existing row with
	// the same id in the DB. By default (or when set to `false`), the existing row is
	// completely replaced by the new row. When set to `true`, the new row is
	// deep-merged into the existing row
	//
	// For example, say there is an existing row in the DB
	// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
	// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
	// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
	// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
	// `{"id": "foo", "input": {"b": 11, "c": 20}}`
	IsMerge param.Field[bool] `json:"_is_merge"`
	// Pass `_object_delete=true` to mark the project logs event deleted. Deleted
	// events will not show up in subsequent fetches for this project logs
	ObjectDelete param.Field[bool] `json:"_object_delete"`
	// Use the `_parent_id` field to create this row as a subspan of an existing row.
	// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
	// relationships are important for tracing (see the
	// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
	//
	// For example, say we have logged a row
	// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
	// We can create a sub-span of the parent row by logging
	// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
	// In the webapp, only the root span row `"abc"` will show up in the summary view.
	// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
	// clicking on the "abc" row.
	ParentID param.Field[string] `json:"_parent_id"`
	// Context is additional information about the code that produced the project logs
	// event. It is essentially the textual counterpart to `metrics`. Use the
	// `caller_*` attributes to track the location in code which produced the project
	// logs event
	Context param.Field[InsertProjectLogsEventReplaceContextParam] `json:"context"`
	// The timestamp the project logs event was created
	Created param.Field[time.Time] `json:"created" format:"date-time"`
	// The error that occurred, if any.
	Error param.Field[interface{}] `json:"error"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not.
	// Braintrust currently does not compare `output` to `expected` for you, since
	// there are so many different ways to do that correctly. Instead, these values are
	// just used to help you navigate while digging into analyses. However, we may
	// later use these values to re-score outputs or fine-tune your models.
	Expected param.Field[interface{}] `json:"expected"`
	// The arguments that uniquely define a user input (an arbitrary, JSON serializable
	// object).
	Input param.Field[interface{}] `json:"input"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata param.Field[map[string]interface{}] `json:"metadata"`
	// Metrics are numerical measurements tracking the execution of the code that
	// produced the project logs event. Use "start" and "end" to track the time span
	// over which the project logs event was produced
	Metrics param.Field[InsertProjectLogsEventReplaceMetricsParam] `json:"metrics"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object), that allows you to determine whether the result is correct
	// or not. For example, in an app that generates SQL queries, the `output` should
	// be the _result_ of the SQL query generated by the model, not the query itself,
	// because there may be multiple valid queries that answer a single question.
	Output param.Field[interface{}] `json:"output"`
	// A dictionary of numeric values (between 0 and 1) to log. The scores should give
	// you a variety of signals that help you determine how accurate the outputs are
	// compared to what you expect and diagnose failures. For example, a summarization
	// app might have one score that tells you how accurate the summary is, and another
	// that measures the word similarity between the generated and grouth truth
	// summary. The word similarity score could help you determine whether the
	// summarization was covering similar concepts or not. You can use these scores to
	// help you sort, filter, and compare logs.
	Scores param.Field[map[string]float64] `json:"scores"`
	// Human-identifying attributes of the span, such as name, type, etc.
	SpanAttributes param.Field[InsertProjectLogsEventReplaceSpanAttributesParam] `json:"span_attributes"`
	// A list of tags to log
	Tags param.Field[[]string] `json:"tags"`
}

func (InsertProjectLogsEventReplaceParam) ImplementsProjectLogInsertParamsEventUnion added in v0.3.0

func (r InsertProjectLogsEventReplaceParam) ImplementsProjectLogInsertParamsEventUnion()

func (InsertProjectLogsEventReplaceParam) MarshalJSON

func (r InsertProjectLogsEventReplaceParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventReplaceSpanAttributesParam

type InsertProjectLogsEventReplaceSpanAttributesParam struct {
	// Name of the span, for display purposes only
	Name param.Field[string] `json:"name"`
	// Type of the span, for display purposes only
	Type        param.Field[InsertProjectLogsEventReplaceSpanAttributesType] `json:"type"`
	ExtraFields map[string]interface{}                                       `json:"-,extras"`
}

Human-identifying attributes of the span, such as name, type, etc.

func (InsertProjectLogsEventReplaceSpanAttributesParam) MarshalJSON

func (r InsertProjectLogsEventReplaceSpanAttributesParam) MarshalJSON() (data []byte, err error)

type InsertProjectLogsEventReplaceSpanAttributesType

type InsertProjectLogsEventReplaceSpanAttributesType string

Type of the span, for display purposes only

const (
	InsertProjectLogsEventReplaceSpanAttributesTypeLlm      InsertProjectLogsEventReplaceSpanAttributesType = "llm"
	InsertProjectLogsEventReplaceSpanAttributesTypeScore    InsertProjectLogsEventReplaceSpanAttributesType = "score"
	InsertProjectLogsEventReplaceSpanAttributesTypeFunction InsertProjectLogsEventReplaceSpanAttributesType = "function"
	InsertProjectLogsEventReplaceSpanAttributesTypeEval     InsertProjectLogsEventReplaceSpanAttributesType = "eval"
	InsertProjectLogsEventReplaceSpanAttributesTypeTask     InsertProjectLogsEventReplaceSpanAttributesType = "task"
	InsertProjectLogsEventReplaceSpanAttributesTypeTool     InsertProjectLogsEventReplaceSpanAttributesType = "tool"
)

func (InsertProjectLogsEventReplaceSpanAttributesType) IsKnown

type MetricSummary

type MetricSummary struct {
	// Number of improvements in the metric
	Improvements int64 `json:"improvements,required"`
	// Average metric across all examples
	Metric float64 `json:"metric,required"`
	// Name of the metric
	Name string `json:"name,required"`
	// Number of regressions in the metric
	Regressions int64 `json:"regressions,required"`
	// Unit label for the metric
	Unit string `json:"unit,required"`
	// Difference in metric between the current and comparison experiment
	Diff float64           `json:"diff"`
	JSON metricSummaryJSON `json:"-"`
}

Summary of a metric's performance

func (*MetricSummary) UnmarshalJSON

func (r *MetricSummary) UnmarshalJSON(data []byte) (err error)

type OnlineScoreConfig added in v0.4.0

type OnlineScoreConfig struct {
	// The sampling rate for online scoring
	SamplingRate float64 `json:"sampling_rate,required"`
	// The list of scorers to use for online scoring
	Scorers []OnlineScoreConfigScorer `json:"scorers,required"`
	// Whether to trigger online scoring on the root span of each trace
	ApplyToRootSpan bool `json:"apply_to_root_span,nullable"`
	// Trigger online scoring on any spans with a name in this list
	ApplyToSpanNames []string              `json:"apply_to_span_names,nullable"`
	JSON             onlineScoreConfigJSON `json:"-"`
}

func (*OnlineScoreConfig) UnmarshalJSON added in v0.4.0

func (r *OnlineScoreConfig) UnmarshalJSON(data []byte) (err error)

type OnlineScoreConfigParam added in v0.4.0

type OnlineScoreConfigParam struct {
	// The sampling rate for online scoring
	SamplingRate param.Field[float64] `json:"sampling_rate,required"`
	// The list of scorers to use for online scoring
	Scorers param.Field[[]OnlineScoreConfigScorersUnionParam] `json:"scorers,required"`
	// Whether to trigger online scoring on the root span of each trace
	ApplyToRootSpan param.Field[bool] `json:"apply_to_root_span"`
	// Trigger online scoring on any spans with a name in this list
	ApplyToSpanNames param.Field[[]string] `json:"apply_to_span_names"`
}

func (OnlineScoreConfigParam) MarshalJSON added in v0.4.0

func (r OnlineScoreConfigParam) MarshalJSON() (data []byte, err error)

type OnlineScoreConfigScorer added in v0.4.0

type OnlineScoreConfigScorer struct {
	Type OnlineScoreConfigScorersType `json:"type,required"`
	ID   string                       `json:"id"`
	Name string                       `json:"name"`
	JSON onlineScoreConfigScorerJSON  `json:"-"`
	// contains filtered or unexported fields
}

func (OnlineScoreConfigScorer) AsUnion added in v0.4.0

AsUnion returns a OnlineScoreConfigScorersUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.OnlineScoreConfigScorersFunction, shared.OnlineScoreConfigScorersGlobal.

func (*OnlineScoreConfigScorer) UnmarshalJSON added in v0.4.0

func (r *OnlineScoreConfigScorer) UnmarshalJSON(data []byte) (err error)

type OnlineScoreConfigScorerParam added in v0.4.0

type OnlineScoreConfigScorerParam struct {
	Type param.Field[OnlineScoreConfigScorersType] `json:"type,required"`
	ID   param.Field[string]                       `json:"id"`
	Name param.Field[string]                       `json:"name"`
}

func (OnlineScoreConfigScorerParam) MarshalJSON added in v0.4.0

func (r OnlineScoreConfigScorerParam) MarshalJSON() (data []byte, err error)

type OnlineScoreConfigScorersFunction added in v0.4.0

type OnlineScoreConfigScorersFunction struct {
	ID   string                               `json:"id,required"`
	Type OnlineScoreConfigScorersFunctionType `json:"type,required"`
	JSON onlineScoreConfigScorersFunctionJSON `json:"-"`
}

func (*OnlineScoreConfigScorersFunction) UnmarshalJSON added in v0.4.0

func (r *OnlineScoreConfigScorersFunction) UnmarshalJSON(data []byte) (err error)

type OnlineScoreConfigScorersFunctionParam added in v0.4.0

type OnlineScoreConfigScorersFunctionParam struct {
	ID   param.Field[string]                               `json:"id,required"`
	Type param.Field[OnlineScoreConfigScorersFunctionType] `json:"type,required"`
}

func (OnlineScoreConfigScorersFunctionParam) MarshalJSON added in v0.4.0

func (r OnlineScoreConfigScorersFunctionParam) MarshalJSON() (data []byte, err error)

type OnlineScoreConfigScorersFunctionType added in v0.4.0

type OnlineScoreConfigScorersFunctionType string
const (
	OnlineScoreConfigScorersFunctionTypeFunction OnlineScoreConfigScorersFunctionType = "function"
)

func (OnlineScoreConfigScorersFunctionType) IsKnown added in v0.4.0

type OnlineScoreConfigScorersGlobal added in v0.4.0

type OnlineScoreConfigScorersGlobal struct {
	Name string                             `json:"name,required"`
	Type OnlineScoreConfigScorersGlobalType `json:"type,required"`
	JSON onlineScoreConfigScorersGlobalJSON `json:"-"`
}

func (*OnlineScoreConfigScorersGlobal) UnmarshalJSON added in v0.4.0

func (r *OnlineScoreConfigScorersGlobal) UnmarshalJSON(data []byte) (err error)

type OnlineScoreConfigScorersGlobalParam added in v0.4.0

type OnlineScoreConfigScorersGlobalParam struct {
	Name param.Field[string]                             `json:"name,required"`
	Type param.Field[OnlineScoreConfigScorersGlobalType] `json:"type,required"`
}

func (OnlineScoreConfigScorersGlobalParam) MarshalJSON added in v0.4.0

func (r OnlineScoreConfigScorersGlobalParam) MarshalJSON() (data []byte, err error)

type OnlineScoreConfigScorersGlobalType added in v0.4.0

type OnlineScoreConfigScorersGlobalType string
const (
	OnlineScoreConfigScorersGlobalTypeGlobal OnlineScoreConfigScorersGlobalType = "global"
)

func (OnlineScoreConfigScorersGlobalType) IsKnown added in v0.4.0

type OnlineScoreConfigScorersType added in v0.4.0

type OnlineScoreConfigScorersType string
const (
	OnlineScoreConfigScorersTypeFunction OnlineScoreConfigScorersType = "function"
	OnlineScoreConfigScorersTypeGlobal   OnlineScoreConfigScorersType = "global"
)

func (OnlineScoreConfigScorersType) IsKnown added in v0.4.0

func (r OnlineScoreConfigScorersType) IsKnown() bool

type OnlineScoreConfigScorersUnion added in v0.4.0

type OnlineScoreConfigScorersUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.OnlineScoreConfigScorersFunction or shared.OnlineScoreConfigScorersGlobal.

type OnlineScoreConfigScorersUnionParam added in v0.4.0

type OnlineScoreConfigScorersUnionParam interface {
	// contains filtered or unexported methods
}

Satisfied by shared.OnlineScoreConfigScorersFunctionParam, shared.OnlineScoreConfigScorersGlobalParam, OnlineScoreConfigScorerParam.

type Organization

type Organization struct {
	// Unique identifier for the organization
	ID string `json:"id,required" format:"uuid"`
	// Name of the organization
	Name   string `json:"name,required"`
	APIURL string `json:"api_url,nullable"`
	// Date of organization creation
	Created        time.Time        `json:"created,nullable" format:"date-time"`
	IsUniversalAPI bool             `json:"is_universal_api,nullable"`
	ProxyURL       string           `json:"proxy_url,nullable"`
	RealtimeURL    string           `json:"realtime_url,nullable"`
	JSON           organizationJSON `json:"-"`
}

func (*Organization) UnmarshalJSON

func (r *Organization) UnmarshalJSON(data []byte) (err error)

type PatchOrganizationMembersOutput added in v0.4.0

type PatchOrganizationMembersOutput struct {
	Status PatchOrganizationMembersOutputStatus `json:"status,required"`
	// If invite emails failed to send for some reason, the patch operation will still
	// complete, but we will return an error message here
	SendEmailError string                             `json:"send_email_error,nullable"`
	JSON           patchOrganizationMembersOutputJSON `json:"-"`
}

func (*PatchOrganizationMembersOutput) UnmarshalJSON added in v0.4.0

func (r *PatchOrganizationMembersOutput) UnmarshalJSON(data []byte) (err error)

type PatchOrganizationMembersOutputStatus added in v0.4.0

type PatchOrganizationMembersOutputStatus string
const (
	PatchOrganizationMembersOutputStatusSuccess PatchOrganizationMembersOutputStatus = "success"
)

func (PatchOrganizationMembersOutputStatus) IsKnown added in v0.4.0

type PathLookupFilterParam

type PathLookupFilterParam struct {
	// List of fields describing the path to the value to be checked against. For
	// instance, if you wish to filter on the value of `c` in
	// `{"input": {"a": {"b": {"c": "hello"}}}}`, pass `path=["input", "a", "b", "c"]`
	Path param.Field[[]string] `json:"path,required"`
	// Denotes the type of filter as a path-lookup filter
	Type param.Field[PathLookupFilterType] `json:"type,required"`
	// The value to compare equality-wise against the event value at the specified
	// `path`. The value must be a "primitive", that is, any JSON-serializable object
	// except for objects and arrays. For instance, if you wish to filter on the value
	// of "input.a.b.c" in the object `{"input": {"a": {"b": {"c": "hello"}}}}`, pass
	// `value="hello"`
	Value param.Field[interface{}] `json:"value"`
}

A path-lookup filter describes an equality comparison against a specific sub-field in the event row. For instance, if you wish to filter on the value of `c` in `{"input": {"a": {"b": {"c": "hello"}}}}`, pass `path=["input", "a", "b", "c"]` and `value="hello"`

func (PathLookupFilterParam) MarshalJSON

func (r PathLookupFilterParam) MarshalJSON() (data []byte, err error)

type PathLookupFilterType

type PathLookupFilterType string

Denotes the type of filter as a path-lookup filter

const (
	PathLookupFilterTypePathLookup PathLookupFilterType = "path_lookup"
)

func (PathLookupFilterType) IsKnown

func (r PathLookupFilterType) IsKnown() bool

type Project

type Project struct {
	// Unique identifier for the project
	ID string `json:"id,required" format:"uuid"`
	// Name of the project
	Name string `json:"name,required"`
	// Unique id for the organization that the project belongs under
	OrgID string `json:"org_id,required" format:"uuid"`
	// Date of project creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Date of project deletion, or null if the project is still active
	DeletedAt time.Time       `json:"deleted_at,nullable" format:"date-time"`
	Settings  ProjectSettings `json:"settings,nullable"`
	// Identifies the user who created the project
	UserID string      `json:"user_id,nullable" format:"uuid"`
	JSON   projectJSON `json:"-"`
}

func (*Project) UnmarshalJSON

func (r *Project) UnmarshalJSON(data []byte) (err error)

type ProjectLogsEvent

type ProjectLogsEvent struct {
	// A unique identifier for the project logs event. If you don't provide one,
	// BrainTrust will generate one for you
	ID string `json:"id,required"`
	// The transaction id of an event is unique to the network operation that processed
	// the event insertion. Transaction ids are monotonically increasing over time and
	// can be used to retrieve a versioned snapshot of the project logs (see the
	// `version` parameter)
	XactID string `json:"_xact_id,required"`
	// The timestamp the project logs event was created
	Created time.Time `json:"created,required" format:"date-time"`
	// A literal 'g' which identifies the log as a project log
	LogID ProjectLogsEventLogID `json:"log_id,required"`
	// Unique id for the organization that the project belongs under
	OrgID string `json:"org_id,required" format:"uuid"`
	// Unique identifier for the project
	ProjectID string `json:"project_id,required" format:"uuid"`
	// The `span_id` of the root of the trace this project logs event belongs to
	RootSpanID string `json:"root_span_id,required"`
	// A unique identifier used to link different project logs events together as part
	// of a full trace. See the
	// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
	// on tracing
	SpanID string `json:"span_id,required"`
	// Context is additional information about the code that produced the project logs
	// event. It is essentially the textual counterpart to `metrics`. Use the
	// `caller_*` attributes to track the location in code which produced the project
	// logs event
	Context ProjectLogsEventContext `json:"context,nullable"`
	// The error that occurred, if any.
	Error interface{} `json:"error,nullable"`
	// The ground truth value (an arbitrary, JSON serializable object) that you'd
	// compare to `output` to determine if your `output` value is correct or not.
	// Braintrust currently does not compare `output` to `expected` for you, since
	// there are so many different ways to do that correctly. Instead, these values are
	// just used to help you navigate while digging into analyses. However, we may
	// later use these values to re-score outputs or fine-tune your models.
	Expected interface{} `json:"expected,nullable"`
	// The arguments that uniquely define a user input (an arbitrary, JSON serializable
	// object).
	Input interface{} `json:"input,nullable"`
	// A dictionary with additional data about the test example, model outputs, or just
	// about anything else that's relevant, that you can use to help find and analyze
	// examples later. For example, you could log the `prompt`, example's `id`, or
	// anything else that would be useful to slice/dice later. The values in `metadata`
	// can be any JSON-serializable type, but its keys must be strings
	Metadata map[string]interface{} `json:"metadata,nullable"`
	// Metrics are numerical measurements tracking the execution of the code that
	// produced the project logs event. Use "start" and "end" to track the time span
	// over which the project logs event was produced
	Metrics ProjectLogsEventMetrics `json:"metrics,nullable"`
	// The output of your application, including post-processing (an arbitrary, JSON
	// serializable object), that allows you to determine whether the result is correct
	// or not. For example, in an app that generates SQL queries, the `output` should
	// be the _result_ of the SQL query generated by the model, not the query itself,
	// because there may be multiple valid queries that answer a single question.
	Output interface{} `json:"output,nullable"`
	// A dictionary of numeric values (between 0 and 1) to log. The scores should give
	// you a variety of signals that help you determine how accurate the outputs are
	// compared to what you expect and diagnose failures. For example, a summarization
	// app might have one score that tells you how accurate the summary is, and another
	// that measures the word similarity between the generated and grouth truth
	// summary. The word similarity score could help you determine whether the
	// summarization was covering similar concepts or not. You can use these scores to
	// help you sort, filter, and compare logs.
	Scores map[string]float64 `json:"scores,nullable"`
	// Human-identifying attributes of the span, such as name, type, etc.
	SpanAttributes ProjectLogsEventSpanAttributes `json:"span_attributes,nullable"`
	// An array of the parent `span_ids` of this project logs event. This should be
	// empty for the root span of a trace, and should most often contain just one
	// parent element for subspans
	SpanParents []string `json:"span_parents,nullable"`
	// A list of tags to log
	Tags []string             `json:"tags,nullable"`
	JSON projectLogsEventJSON `json:"-"`
}

func (*ProjectLogsEvent) UnmarshalJSON

func (r *ProjectLogsEvent) UnmarshalJSON(data []byte) (err error)

type ProjectLogsEventContext

type ProjectLogsEventContext struct {
	// Name of the file in code where the project logs event was created
	CallerFilename string `json:"caller_filename,nullable"`
	// The function in code which created the project logs event
	CallerFunctionname string `json:"caller_functionname,nullable"`
	// Line of code where the project logs event was created
	CallerLineno int64                       `json:"caller_lineno,nullable"`
	ExtraFields  map[string]interface{}      `json:"-,extras"`
	JSON         projectLogsEventContextJSON `json:"-"`
}

Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event

func (*ProjectLogsEventContext) UnmarshalJSON

func (r *ProjectLogsEventContext) UnmarshalJSON(data []byte) (err error)

type ProjectLogsEventLogID

type ProjectLogsEventLogID string

A literal 'g' which identifies the log as a project log

const (
	ProjectLogsEventLogIDG ProjectLogsEventLogID = "g"
)

func (ProjectLogsEventLogID) IsKnown

func (r ProjectLogsEventLogID) IsKnown() bool

type ProjectLogsEventMetrics

type ProjectLogsEventMetrics struct {
	// The number of tokens in the completion generated by the model (only set if this
	// is an LLM span)
	CompletionTokens int64 `json:"completion_tokens,nullable"`
	// A unix timestamp recording when the section of code which produced the project
	// logs event finished
	End float64 `json:"end,nullable"`
	// The number of tokens in the prompt used to generate the project logs event (only
	// set if this is an LLM span)
	PromptTokens int64 `json:"prompt_tokens,nullable"`
	// A unix timestamp recording when the section of code which produced the project
	// logs event started
	Start float64 `json:"start,nullable"`
	// The total number of tokens in the input and output of the project logs event.
	Tokens      int64                       `json:"tokens,nullable"`
	ExtraFields map[string]interface{}      `json:"-,extras"`
	JSON        projectLogsEventMetricsJSON `json:"-"`
}

Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced

func (*ProjectLogsEventMetrics) UnmarshalJSON

func (r *ProjectLogsEventMetrics) UnmarshalJSON(data []byte) (err error)

type ProjectLogsEventSpanAttributes

type ProjectLogsEventSpanAttributes struct {
	// Name of the span, for display purposes only
	Name string `json:"name,nullable"`
	// Type of the span, for display purposes only
	Type        ProjectLogsEventSpanAttributesType `json:"type,nullable"`
	ExtraFields map[string]interface{}             `json:"-,extras"`
	JSON        projectLogsEventSpanAttributesJSON `json:"-"`
}

Human-identifying attributes of the span, such as name, type, etc.

func (*ProjectLogsEventSpanAttributes) UnmarshalJSON

func (r *ProjectLogsEventSpanAttributes) UnmarshalJSON(data []byte) (err error)

type ProjectLogsEventSpanAttributesType

type ProjectLogsEventSpanAttributesType string

Type of the span, for display purposes only

const (
	ProjectLogsEventSpanAttributesTypeLlm      ProjectLogsEventSpanAttributesType = "llm"
	ProjectLogsEventSpanAttributesTypeScore    ProjectLogsEventSpanAttributesType = "score"
	ProjectLogsEventSpanAttributesTypeFunction ProjectLogsEventSpanAttributesType = "function"
	ProjectLogsEventSpanAttributesTypeEval     ProjectLogsEventSpanAttributesType = "eval"
	ProjectLogsEventSpanAttributesTypeTask     ProjectLogsEventSpanAttributesType = "task"
	ProjectLogsEventSpanAttributesTypeTool     ProjectLogsEventSpanAttributesType = "tool"
)

func (ProjectLogsEventSpanAttributesType) IsKnown

type ProjectScore

type ProjectScore struct {
	// Unique identifier for the project score
	ID string `json:"id,required" format:"uuid"`
	// Name of the project score
	Name string `json:"name,required"`
	// Unique identifier for the project that the project score belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// The type of the configured score
	ScoreType ProjectScoreType `json:"score_type,required"`
	UserID    string           `json:"user_id,required" format:"uuid"`
	// For categorical-type project scores, the list of all categories
	Categories ProjectScoreCategoriesUnion `json:"categories"`
	Config     ProjectScoreConfig          `json:"config,nullable"`
	// Date of project score creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Textual description of the project score
	Description string `json:"description,nullable"`
	// An optional LexoRank-based string that sets the sort position for the score in
	// the UI
	Position string           `json:"position,nullable"`
	JSON     projectScoreJSON `json:"-"`
}

A project score is a user-configured score, which can be manually-labeled through the UI

func (*ProjectScore) UnmarshalJSON

func (r *ProjectScore) UnmarshalJSON(data []byte) (err error)

type ProjectScoreCategoriesCategorical

type ProjectScoreCategoriesCategorical []ProjectScoreCategory

type ProjectScoreCategoriesMinimum

type ProjectScoreCategoriesMinimum []string

type ProjectScoreCategoriesNullableVariant

type ProjectScoreCategoriesNullableVariant struct {
	JSON projectScoreCategoriesNullableVariantJSON `json:"-"`
}

func (*ProjectScoreCategoriesNullableVariant) UnmarshalJSON

func (r *ProjectScoreCategoriesNullableVariant) UnmarshalJSON(data []byte) (err error)

type ProjectScoreCategoriesUnion

type ProjectScoreCategoriesUnion interface {
	// contains filtered or unexported methods
}

For categorical-type project scores, the list of all categories

Union satisfied by shared.ProjectScoreCategoriesCategorical, shared.ProjectScoreCategoriesMinimum or shared.ProjectScoreCategoriesNullableVariant.

type ProjectScoreCategory

type ProjectScoreCategory struct {
	// Name of the category
	Name string `json:"name,required"`
	// Numerical value of the category. Must be between 0 and 1, inclusive
	Value float64                  `json:"value,required"`
	JSON  projectScoreCategoryJSON `json:"-"`
}

For categorical-type project scores, defines a single category

func (*ProjectScoreCategory) UnmarshalJSON

func (r *ProjectScoreCategory) UnmarshalJSON(data []byte) (err error)

type ProjectScoreCategoryParam

type ProjectScoreCategoryParam struct {
	// Name of the category
	Name param.Field[string] `json:"name,required"`
	// Numerical value of the category. Must be between 0 and 1, inclusive
	Value param.Field[float64] `json:"value,required"`
}

For categorical-type project scores, defines a single category

func (ProjectScoreCategoryParam) MarshalJSON

func (r ProjectScoreCategoryParam) MarshalJSON() (data []byte, err error)

type ProjectScoreConfig

type ProjectScoreConfig struct {
	Destination ProjectScoreConfigDestination `json:"destination,nullable"`
	MultiSelect bool                          `json:"multi_select,nullable"`
	Online      OnlineScoreConfig             `json:"online,nullable"`
	JSON        projectScoreConfigJSON        `json:"-"`
}

func (*ProjectScoreConfig) UnmarshalJSON

func (r *ProjectScoreConfig) UnmarshalJSON(data []byte) (err error)

type ProjectScoreConfigDestination

type ProjectScoreConfigDestination string
const (
	ProjectScoreConfigDestinationExpected ProjectScoreConfigDestination = "expected"
)

func (ProjectScoreConfigDestination) IsKnown

func (r ProjectScoreConfigDestination) IsKnown() bool

type ProjectScoreConfigParam added in v0.4.0

type ProjectScoreConfigParam struct {
	Destination param.Field[ProjectScoreConfigDestination] `json:"destination"`
	MultiSelect param.Field[bool]                          `json:"multi_select"`
	Online      param.Field[OnlineScoreConfigParam]        `json:"online"`
}

func (ProjectScoreConfigParam) MarshalJSON added in v0.4.0

func (r ProjectScoreConfigParam) MarshalJSON() (data []byte, err error)

type ProjectScoreType added in v0.4.0

type ProjectScoreType string

The type of the configured score

const (
	ProjectScoreTypeSlider      ProjectScoreType = "slider"
	ProjectScoreTypeCategorical ProjectScoreType = "categorical"
	ProjectScoreTypeWeighted    ProjectScoreType = "weighted"
	ProjectScoreTypeMinimum     ProjectScoreType = "minimum"
	ProjectScoreTypeOnline      ProjectScoreType = "online"
)

func (ProjectScoreType) ImplementsProjectScoreListParamsScoreTypeUnion added in v0.4.0

func (r ProjectScoreType) ImplementsProjectScoreListParamsScoreTypeUnion()

func (ProjectScoreType) IsKnown added in v0.4.0

func (r ProjectScoreType) IsKnown() bool

type ProjectSettings

type ProjectSettings struct {
	// The key used to join two experiments (defaults to `input`).
	ComparisonKey string              `json:"comparison_key,nullable"`
	JSON          projectSettingsJSON `json:"-"`
}

func (*ProjectSettings) UnmarshalJSON

func (r *ProjectSettings) UnmarshalJSON(data []byte) (err error)

type ProjectSettingsParam added in v0.4.0

type ProjectSettingsParam struct {
	// The key used to join two experiments (defaults to `input`).
	ComparisonKey param.Field[string] `json:"comparison_key"`
}

func (ProjectSettingsParam) MarshalJSON added in v0.4.0

func (r ProjectSettingsParam) MarshalJSON() (data []byte, err error)

type ProjectTag

type ProjectTag struct {
	// Unique identifier for the project tag
	ID string `json:"id,required" format:"uuid"`
	// Name of the project tag
	Name string `json:"name,required"`
	// Unique identifier for the project that the project tag belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	UserID    string `json:"user_id,required" format:"uuid"`
	// Color of the tag for the UI
	Color string `json:"color,nullable"`
	// Date of project tag creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Textual description of the project tag
	Description string         `json:"description,nullable"`
	JSON        projectTagJSON `json:"-"`
}

A project tag is a user-configured tag for tracking and filtering your experiments, logs, and other data

func (*ProjectTag) UnmarshalJSON

func (r *ProjectTag) UnmarshalJSON(data []byte) (err error)

type Prompt

type Prompt struct {
	// Unique identifier for the prompt
	ID string `json:"id,required" format:"uuid"`
	// The transaction id of an event is unique to the network operation that processed
	// the event insertion. Transaction ids are monotonically increasing over time and
	// can be used to retrieve a versioned snapshot of the prompt (see the `version`
	// parameter)
	XactID string `json:"_xact_id,required"`
	// A literal 'p' which identifies the object as a project prompt
	LogID PromptLogID `json:"log_id,required"`
	// Name of the prompt
	Name string `json:"name,required"`
	// Unique identifier for the organization
	OrgID string `json:"org_id,required" format:"uuid"`
	// Unique identifier for the project that the prompt belongs under
	ProjectID string `json:"project_id,required" format:"uuid"`
	// Unique identifier for the prompt
	Slug string `json:"slug,required"`
	// Date of prompt creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Textual description of the prompt
	Description  string             `json:"description,nullable"`
	FunctionType PromptFunctionType `json:"function_type,nullable"`
	// User-controlled metadata about the prompt
	Metadata map[string]interface{} `json:"metadata,nullable"`
	// The prompt, model, and its parameters
	PromptData PromptData `json:"prompt_data,nullable"`
	// A list of tags for the prompt
	Tags []string   `json:"tags,nullable"`
	JSON promptJSON `json:"-"`
}

func (*Prompt) UnmarshalJSON

func (r *Prompt) UnmarshalJSON(data []byte) (err error)

type PromptData

type PromptData struct {
	Options       PromptDataOptions        `json:"options,nullable"`
	Origin        PromptDataOrigin         `json:"origin,nullable"`
	Parser        PromptDataParser         `json:"parser,nullable"`
	Prompt        PromptDataPrompt         `json:"prompt"`
	ToolFunctions []PromptDataToolFunction `json:"tool_functions,nullable"`
	JSON          promptDataJSON           `json:"-"`
}

The prompt, model, and its parameters

func (*PromptData) UnmarshalJSON

func (r *PromptData) UnmarshalJSON(data []byte) (err error)

type PromptDataOptions

type PromptDataOptions struct {
	Model    string                       `json:"model"`
	Params   PromptDataOptionsParamsUnion `json:"params"`
	Position string                       `json:"position"`
	JSON     promptDataOptionsJSON        `json:"-"`
}

func (*PromptDataOptions) UnmarshalJSON

func (r *PromptDataOptions) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParam

type PromptDataOptionsParam struct {
	Model    param.Field[string]                            `json:"model"`
	Params   param.Field[PromptDataOptionsParamsUnionParam] `json:"params"`
	Position param.Field[string]                            `json:"position"`
}

func (PromptDataOptionsParam) MarshalJSON

func (r PromptDataOptionsParam) MarshalJSON() (data []byte, err error)

type PromptDataOptionsParamsAnthropicModelParams

type PromptDataOptionsParamsAnthropicModelParams struct {
	MaxTokens   float64 `json:"max_tokens,required"`
	Temperature float64 `json:"temperature,required"`
	// This is a legacy parameter that should not be used.
	MaxTokensToSample float64                                         `json:"max_tokens_to_sample"`
	StopSequences     []string                                        `json:"stop_sequences"`
	TopK              float64                                         `json:"top_k"`
	TopP              float64                                         `json:"top_p"`
	UseCache          bool                                            `json:"use_cache"`
	JSON              promptDataOptionsParamsAnthropicModelParamsJSON `json:"-"`
}

func (*PromptDataOptionsParamsAnthropicModelParams) UnmarshalJSON

func (r *PromptDataOptionsParamsAnthropicModelParams) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParamsAnthropicModelParamsParam

type PromptDataOptionsParamsAnthropicModelParamsParam struct {
	MaxTokens   param.Field[float64] `json:"max_tokens,required"`
	Temperature param.Field[float64] `json:"temperature,required"`
	// This is a legacy parameter that should not be used.
	MaxTokensToSample param.Field[float64]  `json:"max_tokens_to_sample"`
	StopSequences     param.Field[[]string] `json:"stop_sequences"`
	TopK              param.Field[float64]  `json:"top_k"`
	TopP              param.Field[float64]  `json:"top_p"`
	UseCache          param.Field[bool]     `json:"use_cache"`
}

func (PromptDataOptionsParamsAnthropicModelParamsParam) MarshalJSON

func (r PromptDataOptionsParamsAnthropicModelParamsParam) MarshalJSON() (data []byte, err error)

type PromptDataOptionsParamsGoogleModelParams

type PromptDataOptionsParamsGoogleModelParams struct {
	MaxOutputTokens float64                                      `json:"maxOutputTokens"`
	Temperature     float64                                      `json:"temperature"`
	TopK            float64                                      `json:"topK"`
	TopP            float64                                      `json:"topP"`
	UseCache        bool                                         `json:"use_cache"`
	JSON            promptDataOptionsParamsGoogleModelParamsJSON `json:"-"`
}

func (*PromptDataOptionsParamsGoogleModelParams) UnmarshalJSON

func (r *PromptDataOptionsParamsGoogleModelParams) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParamsGoogleModelParamsParam

type PromptDataOptionsParamsGoogleModelParamsParam struct {
	MaxOutputTokens param.Field[float64] `json:"maxOutputTokens"`
	Temperature     param.Field[float64] `json:"temperature"`
	TopK            param.Field[float64] `json:"topK"`
	TopP            param.Field[float64] `json:"topP"`
	UseCache        param.Field[bool]    `json:"use_cache"`
}

func (PromptDataOptionsParamsGoogleModelParamsParam) MarshalJSON

func (r PromptDataOptionsParamsGoogleModelParamsParam) MarshalJSON() (data []byte, err error)

type PromptDataOptionsParamsJsCompletionParams

type PromptDataOptionsParamsJsCompletionParams struct {
	UseCache bool                                          `json:"use_cache"`
	JSON     promptDataOptionsParamsJsCompletionParamsJSON `json:"-"`
}

func (*PromptDataOptionsParamsJsCompletionParams) UnmarshalJSON

func (r *PromptDataOptionsParamsJsCompletionParams) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParamsJsCompletionParamsParam

type PromptDataOptionsParamsJsCompletionParamsParam struct {
	UseCache param.Field[bool] `json:"use_cache"`
}

func (PromptDataOptionsParamsJsCompletionParamsParam) MarshalJSON

func (r PromptDataOptionsParamsJsCompletionParamsParam) MarshalJSON() (data []byte, err error)

type PromptDataOptionsParamsOpenAIModelParams

type PromptDataOptionsParamsOpenAIModelParams struct {
	FrequencyPenalty float64                                                   `json:"frequency_penalty"`
	FunctionCall     PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion `json:"function_call"`
	MaxTokens        float64                                                   `json:"max_tokens"`
	N                float64                                                   `json:"n"`
	PresencePenalty  float64                                                   `json:"presence_penalty"`
	ResponseFormat   PromptDataOptionsParamsOpenAIModelParamsResponseFormat    `json:"response_format,nullable"`
	Stop             []string                                                  `json:"stop"`
	Temperature      float64                                                   `json:"temperature"`
	ToolChoice       ToolChoiceUnion                                           `json:"tool_choice"`
	TopP             float64                                                   `json:"top_p"`
	UseCache         bool                                                      `json:"use_cache"`
	JSON             promptDataOptionsParamsOpenAIModelParamsJSON              `json:"-"`
}

func (*PromptDataOptionsParamsOpenAIModelParams) UnmarshalJSON

func (r *PromptDataOptionsParamsOpenAIModelParams) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto string
const (
	PromptDataOptionsParamsOpenAIModelParamsFunctionCallAutoAuto PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto = "auto"
)

func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto) IsKnown

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction struct {
	Name string                                                           `json:"name,required"`
	JSON promptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionJSON `json:"-"`
}

func (*PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam struct {
	Name param.Field[string] `json:"name,required"`
}

func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone

type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone string
const (
	PromptDataOptionsParamsOpenAIModelParamsFunctionCallNoneNone PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone = "none"
)

func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone) IsKnown

type PromptDataOptionsParamsOpenAIModelParamsParam

type PromptDataOptionsParamsOpenAIModelParamsParam struct {
	FrequencyPenalty param.Field[float64]                                                        `json:"frequency_penalty"`
	FunctionCall     param.Field[PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam] `json:"function_call"`
	MaxTokens        param.Field[float64]                                                        `json:"max_tokens"`
	N                param.Field[float64]                                                        `json:"n"`
	PresencePenalty  param.Field[float64]                                                        `json:"presence_penalty"`
	ResponseFormat   param.Field[PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam]    `json:"response_format"`
	Stop             param.Field[[]string]                                                       `json:"stop"`
	Temperature      param.Field[float64]                                                        `json:"temperature"`
	ToolChoice       param.Field[ToolChoiceUnionParam]                                           `json:"tool_choice"`
	TopP             param.Field[float64]                                                        `json:"top_p"`
	UseCache         param.Field[bool]                                                           `json:"use_cache"`
}

func (PromptDataOptionsParamsOpenAIModelParamsParam) MarshalJSON

func (r PromptDataOptionsParamsOpenAIModelParamsParam) MarshalJSON() (data []byte, err error)

type PromptDataOptionsParamsOpenAIModelParamsResponseFormat

type PromptDataOptionsParamsOpenAIModelParamsResponseFormat struct {
	Type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType `json:"type,required"`
	JSON promptDataOptionsParamsOpenAIModelParamsResponseFormatJSON `json:"-"`
}

func (*PromptDataOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON

func (r *PromptDataOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam

type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam struct {
	Type param.Field[PromptDataOptionsParamsOpenAIModelParamsResponseFormatType] `json:"type,required"`
}

func (PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON

type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType

type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType string
const (
	PromptDataOptionsParamsOpenAIModelParamsResponseFormatTypeJsonObject PromptDataOptionsParamsOpenAIModelParamsResponseFormatType = "json_object"
)

func (PromptDataOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown

type PromptDataOptionsParamsWindowAIModelParams

type PromptDataOptionsParamsWindowAIModelParams struct {
	Temperature float64                                        `json:"temperature"`
	TopK        float64                                        `json:"topK"`
	UseCache    bool                                           `json:"use_cache"`
	JSON        promptDataOptionsParamsWindowAIModelParamsJSON `json:"-"`
}

func (*PromptDataOptionsParamsWindowAIModelParams) UnmarshalJSON

func (r *PromptDataOptionsParamsWindowAIModelParams) UnmarshalJSON(data []byte) (err error)

type PromptDataOptionsParamsWindowAIModelParamsParam

type PromptDataOptionsParamsWindowAIModelParamsParam struct {
	Temperature param.Field[float64] `json:"temperature"`
	TopK        param.Field[float64] `json:"topK"`
	UseCache    param.Field[bool]    `json:"use_cache"`
}

func (PromptDataOptionsParamsWindowAIModelParamsParam) MarshalJSON

func (r PromptDataOptionsParamsWindowAIModelParamsParam) MarshalJSON() (data []byte, err error)

type PromptDataOrigin

type PromptDataOrigin struct {
	ProjectID     string               `json:"project_id"`
	PromptID      string               `json:"prompt_id"`
	PromptVersion string               `json:"prompt_version"`
	JSON          promptDataOriginJSON `json:"-"`
}

func (*PromptDataOrigin) UnmarshalJSON

func (r *PromptDataOrigin) UnmarshalJSON(data []byte) (err error)

type PromptDataOriginParam

type PromptDataOriginParam struct {
	ProjectID     param.Field[string] `json:"project_id"`
	PromptID      param.Field[string] `json:"prompt_id"`
	PromptVersion param.Field[string] `json:"prompt_version"`
}

func (PromptDataOriginParam) MarshalJSON

func (r PromptDataOriginParam) MarshalJSON() (data []byte, err error)

type PromptDataParam

type PromptDataParam struct {
	Options       param.Field[PromptDataOptionsParam]              `json:"options"`
	Origin        param.Field[PromptDataOriginParam]               `json:"origin"`
	Parser        param.Field[PromptDataParserParam]               `json:"parser"`
	Prompt        param.Field[PromptDataPromptUnionParam]          `json:"prompt"`
	ToolFunctions param.Field[[]PromptDataToolFunctionsUnionParam] `json:"tool_functions"`
}

The prompt, model, and its parameters

func (PromptDataParam) MarshalJSON

func (r PromptDataParam) MarshalJSON() (data []byte, err error)

type PromptDataParser added in v0.4.0

type PromptDataParser struct {
	ChoiceScores map[string]float64   `json:"choice_scores,required"`
	Type         PromptDataParserType `json:"type,required"`
	UseCot       bool                 `json:"use_cot,required"`
	JSON         promptDataParserJSON `json:"-"`
}

func (*PromptDataParser) UnmarshalJSON added in v0.4.0

func (r *PromptDataParser) UnmarshalJSON(data []byte) (err error)

type PromptDataParserParam added in v0.4.0

type PromptDataParserParam struct {
	ChoiceScores param.Field[map[string]float64]   `json:"choice_scores,required"`
	Type         param.Field[PromptDataParserType] `json:"type,required"`
	UseCot       param.Field[bool]                 `json:"use_cot,required"`
}

func (PromptDataParserParam) MarshalJSON added in v0.4.0

func (r PromptDataParserParam) MarshalJSON() (data []byte, err error)

type PromptDataParserType added in v0.4.0

type PromptDataParserType string
const (
	PromptDataParserTypeLlmClassifier PromptDataParserType = "llm_classifier"
)

func (PromptDataParserType) IsKnown added in v0.4.0

func (r PromptDataParserType) IsKnown() bool

type PromptDataPrompt

type PromptDataPrompt struct {
	Type    PromptDataPromptType `json:"type"`
	Content string               `json:"content"`
	// This field can have the runtime type of [[]PromptDataPromptChatMessage].
	Messages interface{}          `json:"messages,required"`
	Tools    string               `json:"tools"`
	JSON     promptDataPromptJSON `json:"-"`
	// contains filtered or unexported fields
}

func (PromptDataPrompt) AsUnion

AsUnion returns a PromptDataPromptUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.PromptDataPromptCompletion, shared.PromptDataPromptChat, shared.PromptDataPromptNullableVariant.

func (*PromptDataPrompt) UnmarshalJSON

func (r *PromptDataPrompt) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChat

type PromptDataPromptChat struct {
	Messages []PromptDataPromptChatMessage `json:"messages,required"`
	Type     PromptDataPromptChatType      `json:"type,required"`
	Tools    string                        `json:"tools"`
	JSON     promptDataPromptChatJSON      `json:"-"`
}

func (*PromptDataPromptChat) UnmarshalJSON

func (r *PromptDataPromptChat) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessage

type PromptDataPromptChatMessage struct {
	// This field can have the runtime type of [string],
	// [PromptDataPromptChatMessagesUserContentUnion].
	Content interface{}                      `json:"content,required"`
	Role    PromptDataPromptChatMessagesRole `json:"role,required"`
	Name    string                           `json:"name"`
	// This field can have the runtime type of
	// [PromptDataPromptChatMessagesAssistantFunctionCall].
	FunctionCall interface{} `json:"function_call,required"`
	// This field can have the runtime type of [[]ChatCompletionMessageToolCall].
	ToolCalls  interface{}                     `json:"tool_calls,required"`
	ToolCallID string                          `json:"tool_call_id"`
	JSON       promptDataPromptChatMessageJSON `json:"-"`
	// contains filtered or unexported fields
}

func (*PromptDataPromptChatMessage) UnmarshalJSON

func (r *PromptDataPromptChatMessage) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessageParam

type PromptDataPromptChatMessageParam struct {
	Content      param.Field[interface{}]                      `json:"content,required"`
	Role         param.Field[PromptDataPromptChatMessagesRole] `json:"role,required"`
	Name         param.Field[string]                           `json:"name"`
	FunctionCall param.Field[interface{}]                      `json:"function_call,required"`
	ToolCalls    param.Field[interface{}]                      `json:"tool_calls,required"`
	ToolCallID   param.Field[string]                           `json:"tool_call_id"`
}

func (PromptDataPromptChatMessageParam) MarshalJSON

func (r PromptDataPromptChatMessageParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesAssistant

type PromptDataPromptChatMessagesAssistant struct {
	Role         PromptDataPromptChatMessagesAssistantRole         `json:"role,required"`
	Content      string                                            `json:"content,nullable"`
	FunctionCall PromptDataPromptChatMessagesAssistantFunctionCall `json:"function_call,nullable"`
	Name         string                                            `json:"name,nullable"`
	ToolCalls    []ChatCompletionMessageToolCall                   `json:"tool_calls,nullable"`
	JSON         promptDataPromptChatMessagesAssistantJSON         `json:"-"`
}

func (*PromptDataPromptChatMessagesAssistant) UnmarshalJSON

func (r *PromptDataPromptChatMessagesAssistant) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesAssistantFunctionCall

type PromptDataPromptChatMessagesAssistantFunctionCall struct {
	Arguments string                                                `json:"arguments,required"`
	Name      string                                                `json:"name,required"`
	JSON      promptDataPromptChatMessagesAssistantFunctionCallJSON `json:"-"`
}

func (*PromptDataPromptChatMessagesAssistantFunctionCall) UnmarshalJSON

func (r *PromptDataPromptChatMessagesAssistantFunctionCall) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesAssistantFunctionCallParam

type PromptDataPromptChatMessagesAssistantFunctionCallParam struct {
	Arguments param.Field[string] `json:"arguments,required"`
	Name      param.Field[string] `json:"name,required"`
}

func (PromptDataPromptChatMessagesAssistantFunctionCallParam) MarshalJSON

type PromptDataPromptChatMessagesAssistantParam

type PromptDataPromptChatMessagesAssistantParam struct {
	Role         param.Field[PromptDataPromptChatMessagesAssistantRole]              `json:"role,required"`
	Content      param.Field[string]                                                 `json:"content"`
	FunctionCall param.Field[PromptDataPromptChatMessagesAssistantFunctionCallParam] `json:"function_call"`
	Name         param.Field[string]                                                 `json:"name"`
	ToolCalls    param.Field[[]ChatCompletionMessageToolCallParam]                   `json:"tool_calls"`
}

func (PromptDataPromptChatMessagesAssistantParam) MarshalJSON

func (r PromptDataPromptChatMessagesAssistantParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesAssistantRole

type PromptDataPromptChatMessagesAssistantRole string
const (
	PromptDataPromptChatMessagesAssistantRoleAssistant PromptDataPromptChatMessagesAssistantRole = "assistant"
)

func (PromptDataPromptChatMessagesAssistantRole) IsKnown

type PromptDataPromptChatMessagesFallback

type PromptDataPromptChatMessagesFallback struct {
	Role    PromptDataPromptChatMessagesFallbackRole `json:"role,required"`
	Content string                                   `json:"content,nullable"`
	JSON    promptDataPromptChatMessagesFallbackJSON `json:"-"`
}

func (*PromptDataPromptChatMessagesFallback) UnmarshalJSON

func (r *PromptDataPromptChatMessagesFallback) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesFallbackParam

type PromptDataPromptChatMessagesFallbackParam struct {
	Role    param.Field[PromptDataPromptChatMessagesFallbackRole] `json:"role,required"`
	Content param.Field[string]                                   `json:"content"`
}

func (PromptDataPromptChatMessagesFallbackParam) MarshalJSON

func (r PromptDataPromptChatMessagesFallbackParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesFallbackRole

type PromptDataPromptChatMessagesFallbackRole string
const (
	PromptDataPromptChatMessagesFallbackRoleModel PromptDataPromptChatMessagesFallbackRole = "model"
)

func (PromptDataPromptChatMessagesFallbackRole) IsKnown

type PromptDataPromptChatMessagesFunction

type PromptDataPromptChatMessagesFunction struct {
	Name    string                                   `json:"name,required"`
	Role    PromptDataPromptChatMessagesFunctionRole `json:"role,required"`
	Content string                                   `json:"content"`
	JSON    promptDataPromptChatMessagesFunctionJSON `json:"-"`
}

func (*PromptDataPromptChatMessagesFunction) UnmarshalJSON

func (r *PromptDataPromptChatMessagesFunction) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesFunctionParam

type PromptDataPromptChatMessagesFunctionParam struct {
	Name    param.Field[string]                                   `json:"name,required"`
	Role    param.Field[PromptDataPromptChatMessagesFunctionRole] `json:"role,required"`
	Content param.Field[string]                                   `json:"content"`
}

func (PromptDataPromptChatMessagesFunctionParam) MarshalJSON

func (r PromptDataPromptChatMessagesFunctionParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesFunctionRole

type PromptDataPromptChatMessagesFunctionRole string
const (
	PromptDataPromptChatMessagesFunctionRoleFunction PromptDataPromptChatMessagesFunctionRole = "function"
)

func (PromptDataPromptChatMessagesFunctionRole) IsKnown

type PromptDataPromptChatMessagesRole

type PromptDataPromptChatMessagesRole string
const (
	PromptDataPromptChatMessagesRoleSystem    PromptDataPromptChatMessagesRole = "system"
	PromptDataPromptChatMessagesRoleUser      PromptDataPromptChatMessagesRole = "user"
	PromptDataPromptChatMessagesRoleAssistant PromptDataPromptChatMessagesRole = "assistant"
	PromptDataPromptChatMessagesRoleTool      PromptDataPromptChatMessagesRole = "tool"
	PromptDataPromptChatMessagesRoleFunction  PromptDataPromptChatMessagesRole = "function"
	PromptDataPromptChatMessagesRoleModel     PromptDataPromptChatMessagesRole = "model"
)

func (PromptDataPromptChatMessagesRole) IsKnown

type PromptDataPromptChatMessagesSystem

type PromptDataPromptChatMessagesSystem struct {
	Role    PromptDataPromptChatMessagesSystemRole `json:"role,required"`
	Content string                                 `json:"content"`
	Name    string                                 `json:"name"`
	JSON    promptDataPromptChatMessagesSystemJSON `json:"-"`
}

func (*PromptDataPromptChatMessagesSystem) UnmarshalJSON

func (r *PromptDataPromptChatMessagesSystem) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesSystemParam

type PromptDataPromptChatMessagesSystemParam struct {
	Role    param.Field[PromptDataPromptChatMessagesSystemRole] `json:"role,required"`
	Content param.Field[string]                                 `json:"content"`
	Name    param.Field[string]                                 `json:"name"`
}

func (PromptDataPromptChatMessagesSystemParam) MarshalJSON

func (r PromptDataPromptChatMessagesSystemParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesSystemRole

type PromptDataPromptChatMessagesSystemRole string
const (
	PromptDataPromptChatMessagesSystemRoleSystem PromptDataPromptChatMessagesSystemRole = "system"
)

func (PromptDataPromptChatMessagesSystemRole) IsKnown

type PromptDataPromptChatMessagesTool

type PromptDataPromptChatMessagesTool struct {
	Role       PromptDataPromptChatMessagesToolRole `json:"role,required"`
	Content    string                               `json:"content"`
	ToolCallID string                               `json:"tool_call_id"`
	JSON       promptDataPromptChatMessagesToolJSON `json:"-"`
}

func (*PromptDataPromptChatMessagesTool) UnmarshalJSON

func (r *PromptDataPromptChatMessagesTool) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesToolParam

type PromptDataPromptChatMessagesToolParam struct {
	Role       param.Field[PromptDataPromptChatMessagesToolRole] `json:"role,required"`
	Content    param.Field[string]                               `json:"content"`
	ToolCallID param.Field[string]                               `json:"tool_call_id"`
}

func (PromptDataPromptChatMessagesToolParam) MarshalJSON

func (r PromptDataPromptChatMessagesToolParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesToolRole

type PromptDataPromptChatMessagesToolRole string
const (
	PromptDataPromptChatMessagesToolRoleTool PromptDataPromptChatMessagesToolRole = "tool"
)

func (PromptDataPromptChatMessagesToolRole) IsKnown

type PromptDataPromptChatMessagesUser

type PromptDataPromptChatMessagesUser struct {
	Role    PromptDataPromptChatMessagesUserRole         `json:"role,required"`
	Content PromptDataPromptChatMessagesUserContentUnion `json:"content"`
	Name    string                                       `json:"name"`
	JSON    promptDataPromptChatMessagesUserJSON         `json:"-"`
}

func (*PromptDataPromptChatMessagesUser) UnmarshalJSON

func (r *PromptDataPromptChatMessagesUser) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptChatMessagesUserContentArray

type PromptDataPromptChatMessagesUserContentArray []ChatCompletionContentPart

func (PromptDataPromptChatMessagesUserContentArray) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion

func (r PromptDataPromptChatMessagesUserContentArray) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()

type PromptDataPromptChatMessagesUserContentArrayParam

type PromptDataPromptChatMessagesUserContentArrayParam []ChatCompletionContentPartUnionParam

func (PromptDataPromptChatMessagesUserContentArrayParam) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam

func (r PromptDataPromptChatMessagesUserContentArrayParam) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()

type PromptDataPromptChatMessagesUserContentUnion

type PromptDataPromptChatMessagesUserContentUnion interface {
	ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
}

Union satisfied by shared.UnionString or shared.PromptDataPromptChatMessagesUserContentArray.

type PromptDataPromptChatMessagesUserContentUnionParam

type PromptDataPromptChatMessagesUserContentUnionParam interface {
	ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
}

Satisfied by shared.UnionString, shared.PromptDataPromptChatMessagesUserContentArrayParam.

type PromptDataPromptChatMessagesUserParam

type PromptDataPromptChatMessagesUserParam struct {
	Role    param.Field[PromptDataPromptChatMessagesUserRole]              `json:"role,required"`
	Content param.Field[PromptDataPromptChatMessagesUserContentUnionParam] `json:"content"`
	Name    param.Field[string]                                            `json:"name"`
}

func (PromptDataPromptChatMessagesUserParam) MarshalJSON

func (r PromptDataPromptChatMessagesUserParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatMessagesUserRole

type PromptDataPromptChatMessagesUserRole string
const (
	PromptDataPromptChatMessagesUserRoleUser PromptDataPromptChatMessagesUserRole = "user"
)

func (PromptDataPromptChatMessagesUserRole) IsKnown

type PromptDataPromptChatParam

type PromptDataPromptChatParam struct {
	Messages param.Field[[]PromptDataPromptChatMessagesUnionParam] `json:"messages,required"`
	Type     param.Field[PromptDataPromptChatType]                 `json:"type,required"`
	Tools    param.Field[string]                                   `json:"tools"`
}

func (PromptDataPromptChatParam) MarshalJSON

func (r PromptDataPromptChatParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptChatType

type PromptDataPromptChatType string
const (
	PromptDataPromptChatTypeChat PromptDataPromptChatType = "chat"
)

func (PromptDataPromptChatType) IsKnown

func (r PromptDataPromptChatType) IsKnown() bool

type PromptDataPromptCompletion

type PromptDataPromptCompletion struct {
	Content string                         `json:"content,required"`
	Type    PromptDataPromptCompletionType `json:"type,required"`
	JSON    promptDataPromptCompletionJSON `json:"-"`
}

func (*PromptDataPromptCompletion) UnmarshalJSON

func (r *PromptDataPromptCompletion) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptCompletionParam

type PromptDataPromptCompletionParam struct {
	Content param.Field[string]                         `json:"content,required"`
	Type    param.Field[PromptDataPromptCompletionType] `json:"type,required"`
}

func (PromptDataPromptCompletionParam) MarshalJSON

func (r PromptDataPromptCompletionParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptCompletionType

type PromptDataPromptCompletionType string
const (
	PromptDataPromptCompletionTypeCompletion PromptDataPromptCompletionType = "completion"
)

func (PromptDataPromptCompletionType) IsKnown

type PromptDataPromptNullableVariant

type PromptDataPromptNullableVariant struct {
	JSON promptDataPromptNullableVariantJSON `json:"-"`
}

func (*PromptDataPromptNullableVariant) UnmarshalJSON

func (r *PromptDataPromptNullableVariant) UnmarshalJSON(data []byte) (err error)

type PromptDataPromptNullableVariantParam

type PromptDataPromptNullableVariantParam struct {
}

func (PromptDataPromptNullableVariantParam) MarshalJSON

func (r PromptDataPromptNullableVariantParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptParam

type PromptDataPromptParam struct {
	Type     param.Field[PromptDataPromptType] `json:"type"`
	Content  param.Field[string]               `json:"content"`
	Messages param.Field[interface{}]          `json:"messages,required"`
	Tools    param.Field[string]               `json:"tools"`
}

func (PromptDataPromptParam) MarshalJSON

func (r PromptDataPromptParam) MarshalJSON() (data []byte, err error)

type PromptDataPromptType

type PromptDataPromptType string
const (
	PromptDataPromptTypeCompletion PromptDataPromptType = "completion"
	PromptDataPromptTypeChat       PromptDataPromptType = "chat"
)

func (PromptDataPromptType) IsKnown

func (r PromptDataPromptType) IsKnown() bool

type PromptDataPromptUnion

type PromptDataPromptUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.PromptDataPromptCompletion, shared.PromptDataPromptChat or shared.PromptDataPromptNullableVariant.

type PromptDataPromptUnionParam

type PromptDataPromptUnionParam interface {
	// contains filtered or unexported methods
}

Satisfied by shared.PromptDataPromptCompletionParam, shared.PromptDataPromptChatParam, shared.PromptDataPromptNullableVariantParam, PromptDataPromptParam.

type PromptDataToolFunction added in v0.4.0

type PromptDataToolFunction struct {
	Type PromptDataToolFunctionsType `json:"type,required"`
	ID   string                      `json:"id"`
	Name string                      `json:"name"`
	JSON promptDataToolFunctionJSON  `json:"-"`
	// contains filtered or unexported fields
}

func (PromptDataToolFunction) AsUnion added in v0.4.0

AsUnion returns a PromptDataToolFunctionsUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are shared.PromptDataToolFunctionsFunction, shared.PromptDataToolFunctionsGlobal.

func (*PromptDataToolFunction) UnmarshalJSON added in v0.4.0

func (r *PromptDataToolFunction) UnmarshalJSON(data []byte) (err error)

type PromptDataToolFunctionParam added in v0.4.0

type PromptDataToolFunctionParam struct {
	Type param.Field[PromptDataToolFunctionsType] `json:"type,required"`
	ID   param.Field[string]                      `json:"id"`
	Name param.Field[string]                      `json:"name"`
}

func (PromptDataToolFunctionParam) MarshalJSON added in v0.4.0

func (r PromptDataToolFunctionParam) MarshalJSON() (data []byte, err error)

type PromptDataToolFunctionsFunction added in v0.4.0

type PromptDataToolFunctionsFunction struct {
	ID   string                              `json:"id,required"`
	Type PromptDataToolFunctionsFunctionType `json:"type,required"`
	JSON promptDataToolFunctionsFunctionJSON `json:"-"`
}

func (*PromptDataToolFunctionsFunction) UnmarshalJSON added in v0.4.0

func (r *PromptDataToolFunctionsFunction) UnmarshalJSON(data []byte) (err error)

type PromptDataToolFunctionsFunctionParam added in v0.4.0

type PromptDataToolFunctionsFunctionParam struct {
	ID   param.Field[string]                              `json:"id,required"`
	Type param.Field[PromptDataToolFunctionsFunctionType] `json:"type,required"`
}

func (PromptDataToolFunctionsFunctionParam) MarshalJSON added in v0.4.0

func (r PromptDataToolFunctionsFunctionParam) MarshalJSON() (data []byte, err error)

type PromptDataToolFunctionsFunctionType added in v0.4.0

type PromptDataToolFunctionsFunctionType string
const (
	PromptDataToolFunctionsFunctionTypeFunction PromptDataToolFunctionsFunctionType = "function"
)

func (PromptDataToolFunctionsFunctionType) IsKnown added in v0.4.0

type PromptDataToolFunctionsGlobal added in v0.4.0

type PromptDataToolFunctionsGlobal struct {
	Name string                            `json:"name,required"`
	Type PromptDataToolFunctionsGlobalType `json:"type,required"`
	JSON promptDataToolFunctionsGlobalJSON `json:"-"`
}

func (*PromptDataToolFunctionsGlobal) UnmarshalJSON added in v0.4.0

func (r *PromptDataToolFunctionsGlobal) UnmarshalJSON(data []byte) (err error)

type PromptDataToolFunctionsGlobalParam added in v0.4.0

type PromptDataToolFunctionsGlobalParam struct {
	Name param.Field[string]                            `json:"name,required"`
	Type param.Field[PromptDataToolFunctionsGlobalType] `json:"type,required"`
}

func (PromptDataToolFunctionsGlobalParam) MarshalJSON added in v0.4.0

func (r PromptDataToolFunctionsGlobalParam) MarshalJSON() (data []byte, err error)

type PromptDataToolFunctionsGlobalType added in v0.4.0

type PromptDataToolFunctionsGlobalType string
const (
	PromptDataToolFunctionsGlobalTypeGlobal PromptDataToolFunctionsGlobalType = "global"
)

func (PromptDataToolFunctionsGlobalType) IsKnown added in v0.4.0

type PromptDataToolFunctionsType added in v0.4.0

type PromptDataToolFunctionsType string
const (
	PromptDataToolFunctionsTypeFunction PromptDataToolFunctionsType = "function"
	PromptDataToolFunctionsTypeGlobal   PromptDataToolFunctionsType = "global"
)

func (PromptDataToolFunctionsType) IsKnown added in v0.4.0

func (r PromptDataToolFunctionsType) IsKnown() bool

type PromptDataToolFunctionsUnion added in v0.4.0

type PromptDataToolFunctionsUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.PromptDataToolFunctionsFunction or shared.PromptDataToolFunctionsGlobal.

type PromptDataToolFunctionsUnionParam added in v0.4.0

type PromptDataToolFunctionsUnionParam interface {
	// contains filtered or unexported methods
}

Satisfied by shared.PromptDataToolFunctionsFunctionParam, shared.PromptDataToolFunctionsGlobalParam, PromptDataToolFunctionParam.

type PromptFunctionType added in v0.4.0

type PromptFunctionType string
const (
	PromptFunctionTypeLlm    PromptFunctionType = "llm"
	PromptFunctionTypeScorer PromptFunctionType = "scorer"
	PromptFunctionTypeTask   PromptFunctionType = "task"
	PromptFunctionTypeTool   PromptFunctionType = "tool"
)

func (PromptFunctionType) IsKnown added in v0.4.0

func (r PromptFunctionType) IsKnown() bool

type PromptLogID

type PromptLogID string

A literal 'p' which identifies the object as a project prompt

const (
	PromptLogIDP PromptLogID = "p"
)

func (PromptLogID) IsKnown

func (r PromptLogID) IsKnown() bool

type RepoInfo

type RepoInfo struct {
	// Email of the author of the most recent commit
	AuthorEmail string `json:"author_email,nullable"`
	// Name of the author of the most recent commit
	AuthorName string `json:"author_name,nullable"`
	// Name of the branch the most recent commit belongs to
	Branch string `json:"branch,nullable"`
	// SHA of most recent commit
	Commit string `json:"commit,nullable"`
	// Most recent commit message
	CommitMessage string `json:"commit_message,nullable"`
	// Time of the most recent commit
	CommitTime string `json:"commit_time,nullable"`
	// Whether or not the repo had uncommitted changes when snapshotted
	Dirty bool `json:"dirty,nullable"`
	// If the repo was dirty when run, this includes the diff between the current state
	// of the repo and the most recent commit.
	GitDiff string `json:"git_diff,nullable"`
	// Name of the tag on the most recent commit
	Tag  string       `json:"tag,nullable"`
	JSON repoInfoJSON `json:"-"`
}

Metadata about the state of the repo when the experiment was created

func (*RepoInfo) UnmarshalJSON

func (r *RepoInfo) UnmarshalJSON(data []byte) (err error)

type RepoInfoParam

type RepoInfoParam struct {
	// Email of the author of the most recent commit
	AuthorEmail param.Field[string] `json:"author_email"`
	// Name of the author of the most recent commit
	AuthorName param.Field[string] `json:"author_name"`
	// Name of the branch the most recent commit belongs to
	Branch param.Field[string] `json:"branch"`
	// SHA of most recent commit
	Commit param.Field[string] `json:"commit"`
	// Most recent commit message
	CommitMessage param.Field[string] `json:"commit_message"`
	// Time of the most recent commit
	CommitTime param.Field[string] `json:"commit_time"`
	// Whether or not the repo had uncommitted changes when snapshotted
	Dirty param.Field[bool] `json:"dirty"`
	// If the repo was dirty when run, this includes the diff between the current state
	// of the repo and the most recent commit.
	GitDiff param.Field[string] `json:"git_diff"`
	// Name of the tag on the most recent commit
	Tag param.Field[string] `json:"tag"`
}

Metadata about the state of the repo when the experiment was created

func (RepoInfoParam) MarshalJSON

func (r RepoInfoParam) MarshalJSON() (data []byte, err error)

type Role

type Role struct {
	// Unique identifier for the role
	ID string `json:"id,required" format:"uuid"`
	// Name of the role
	Name string `json:"name,required"`
	// Date of role creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Date of role deletion, or null if the role is still active
	DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
	// Textual description of the role
	Description string `json:"description,nullable"`
	// (permission, restrict_object_type) tuples which belong to this role
	MemberPermissions []RoleMemberPermission `json:"member_permissions,nullable"`
	// Ids of the roles this role inherits from
	//
	// An inheriting role has all the permissions contained in its member roles, as
	// well as all of their inherited permissions
	MemberRoles []string `json:"member_roles,nullable" format:"uuid"`
	// Unique id for the organization that the role belongs under
	//
	// A null org_id indicates a system role, which may be assigned to anybody and
	// inherited by any other role, but cannot be edited.
	//
	// It is forbidden to change the org after creating a role
	OrgID string `json:"org_id,nullable" format:"uuid"`
	// Identifies the user who created the role
	UserID string   `json:"user_id,nullable" format:"uuid"`
	JSON   roleJSON `json:"-"`
}

A role is a collection of permissions which can be granted as part of an ACL

Roles can consist of individual permissions, as well as a set of roles they inherit from

func (*Role) UnmarshalJSON

func (r *Role) UnmarshalJSON(data []byte) (err error)

type RoleMemberPermission

type RoleMemberPermission struct {
	// Each permission permits a certain type of operation on an object in the system
	//
	// Permissions can be assigned to to objects on an individual basis, or grouped
	// into roles
	Permission RoleMemberPermissionsPermission `json:"permission,required"`
	// The object type that the ACL applies to
	RestrictObjectType RoleMemberPermissionsRestrictObjectType `json:"restrict_object_type,nullable"`
	JSON               roleMemberPermissionJSON                `json:"-"`
}

func (*RoleMemberPermission) UnmarshalJSON

func (r *RoleMemberPermission) UnmarshalJSON(data []byte) (err error)

type RoleMemberPermissionsPermission

type RoleMemberPermissionsPermission string

Each permission permits a certain type of operation on an object in the system

Permissions can be assigned to to objects on an individual basis, or grouped into roles

const (
	RoleMemberPermissionsPermissionCreate     RoleMemberPermissionsPermission = "create"
	RoleMemberPermissionsPermissionRead       RoleMemberPermissionsPermission = "read"
	RoleMemberPermissionsPermissionUpdate     RoleMemberPermissionsPermission = "update"
	RoleMemberPermissionsPermissionDelete     RoleMemberPermissionsPermission = "delete"
	RoleMemberPermissionsPermissionCreateACLs RoleMemberPermissionsPermission = "create_acls"
	RoleMemberPermissionsPermissionReadACLs   RoleMemberPermissionsPermission = "read_acls"
	RoleMemberPermissionsPermissionUpdateACLs RoleMemberPermissionsPermission = "update_acls"
	RoleMemberPermissionsPermissionDeleteACLs RoleMemberPermissionsPermission = "delete_acls"
)

func (RoleMemberPermissionsPermission) IsKnown

type RoleMemberPermissionsRestrictObjectType

type RoleMemberPermissionsRestrictObjectType string

The object type that the ACL applies to

const (
	RoleMemberPermissionsRestrictObjectTypeOrganization  RoleMemberPermissionsRestrictObjectType = "organization"
	RoleMemberPermissionsRestrictObjectTypeProject       RoleMemberPermissionsRestrictObjectType = "project"
	RoleMemberPermissionsRestrictObjectTypeExperiment    RoleMemberPermissionsRestrictObjectType = "experiment"
	RoleMemberPermissionsRestrictObjectTypeDataset       RoleMemberPermissionsRestrictObjectType = "dataset"
	RoleMemberPermissionsRestrictObjectTypePrompt        RoleMemberPermissionsRestrictObjectType = "prompt"
	RoleMemberPermissionsRestrictObjectTypePromptSession RoleMemberPermissionsRestrictObjectType = "prompt_session"
	RoleMemberPermissionsRestrictObjectTypeGroup         RoleMemberPermissionsRestrictObjectType = "group"
	RoleMemberPermissionsRestrictObjectTypeRole          RoleMemberPermissionsRestrictObjectType = "role"
	RoleMemberPermissionsRestrictObjectTypeOrgMember     RoleMemberPermissionsRestrictObjectType = "org_member"
	RoleMemberPermissionsRestrictObjectTypeProjectLog    RoleMemberPermissionsRestrictObjectType = "project_log"
	RoleMemberPermissionsRestrictObjectTypeOrgProject    RoleMemberPermissionsRestrictObjectType = "org_project"
)

func (RoleMemberPermissionsRestrictObjectType) IsKnown

type ScoreSummary

type ScoreSummary struct {
	// Number of improvements in the score
	Improvements int64 `json:"improvements,required"`
	// Name of the score
	Name string `json:"name,required"`
	// Number of regressions in the score
	Regressions int64 `json:"regressions,required"`
	// Average score across all examples
	Score float64 `json:"score,required"`
	// Difference in score between the current and comparison experiment
	Diff float64          `json:"diff"`
	JSON scoreSummaryJSON `json:"-"`
}

Summary of a score's performance

func (*ScoreSummary) UnmarshalJSON

func (r *ScoreSummary) UnmarshalJSON(data []byte) (err error)

type Scorer added in v0.4.0

type Scorer struct {
	Index int64      `json:"index,required"`
	Type  ScorerType `json:"type,required"`
	JSON  scorerJSON `json:"-"`
}

func (Scorer) ImplementsSharedCodeBundleLocationExperimentPosition added in v0.4.0

func (r Scorer) ImplementsSharedCodeBundleLocationExperimentPosition()

func (*Scorer) UnmarshalJSON added in v0.4.0

func (r *Scorer) UnmarshalJSON(data []byte) (err error)

type ScorerParam added in v0.4.0

type ScorerParam struct {
	Index param.Field[int64]      `json:"index,required"`
	Type  param.Field[ScorerType] `json:"type,required"`
}

func (ScorerParam) ImplementsSharedCodeBundleLocationExperimentPositionUnionParam added in v0.4.0

func (r ScorerParam) ImplementsSharedCodeBundleLocationExperimentPositionUnionParam()

func (ScorerParam) MarshalJSON added in v0.4.0

func (r ScorerParam) MarshalJSON() (data []byte, err error)

type ScorerType added in v0.4.0

type ScorerType string
const (
	ScorerTypeScorer ScorerType = "scorer"
)

func (ScorerType) IsKnown added in v0.4.0

func (r ScorerType) IsKnown() bool

type SummarizeDatasetResponse

type SummarizeDatasetResponse struct {
	// Name of the dataset
	DatasetName string `json:"dataset_name,required"`
	// URL to the dataset's page in the Braintrust app
	DatasetURL string `json:"dataset_url,required" format:"uri"`
	// Name of the project that the dataset belongs to
	ProjectName string `json:"project_name,required"`
	// URL to the project's page in the Braintrust app
	ProjectURL string `json:"project_url,required" format:"uri"`
	// Summary of a dataset's data
	DataSummary DataSummary                  `json:"data_summary,nullable"`
	JSON        summarizeDatasetResponseJSON `json:"-"`
}

Summary of a dataset

func (*SummarizeDatasetResponse) UnmarshalJSON

func (r *SummarizeDatasetResponse) UnmarshalJSON(data []byte) (err error)

type SummarizeExperimentResponse

type SummarizeExperimentResponse struct {
	// Name of the experiment
	ExperimentName string `json:"experiment_name,required"`
	// URL to the experiment's page in the Braintrust app
	ExperimentURL string `json:"experiment_url,required" format:"uri"`
	// Name of the project that the experiment belongs to
	ProjectName string `json:"project_name,required"`
	// URL to the project's page in the Braintrust app
	ProjectURL string `json:"project_url,required" format:"uri"`
	// The experiment which scores are baselined against
	ComparisonExperimentName string `json:"comparison_experiment_name,nullable"`
	// Summary of the experiment's metrics
	Metrics map[string]MetricSummary `json:"metrics,nullable"`
	// Summary of the experiment's scores
	Scores map[string]ScoreSummary         `json:"scores,nullable"`
	JSON   summarizeExperimentResponseJSON `json:"-"`
}

Summary of an experiment

func (*SummarizeExperimentResponse) UnmarshalJSON

func (r *SummarizeExperimentResponse) UnmarshalJSON(data []byte) (err error)

type Task added in v0.4.0

type Task struct {
	Type TaskType `json:"type,required"`
	JSON taskJSON `json:"-"`
}

func (Task) ImplementsSharedCodeBundleLocationExperimentPosition added in v0.4.0

func (r Task) ImplementsSharedCodeBundleLocationExperimentPosition()

func (*Task) UnmarshalJSON added in v0.4.0

func (r *Task) UnmarshalJSON(data []byte) (err error)

type TaskParam added in v0.4.0

type TaskParam struct {
	Type param.Field[TaskType] `json:"type,required"`
}

func (TaskParam) ImplementsSharedCodeBundleLocationExperimentPositionUnionParam added in v0.4.0

func (r TaskParam) ImplementsSharedCodeBundleLocationExperimentPositionUnionParam()

func (TaskParam) MarshalJSON added in v0.4.0

func (r TaskParam) MarshalJSON() (data []byte, err error)

type TaskType added in v0.4.0

type TaskType string
const (
	TaskTypeTask TaskType = "task"
)

func (TaskType) IsKnown added in v0.4.0

func (r TaskType) IsKnown() bool

type ToolChoiceAuto added in v0.4.0

type ToolChoiceAuto string
const (
	ToolChoiceAutoAuto ToolChoiceAuto = "auto"
)

func (ToolChoiceAuto) IsKnown added in v0.4.0

func (r ToolChoiceAuto) IsKnown() bool

type ToolChoiceFunction added in v0.4.0

type ToolChoiceFunction struct {
	Function FunctionToolChoice     `json:"function,required"`
	Type     ToolChoiceFunctionType `json:"type,required"`
	JSON     toolChoiceFunctionJSON `json:"-"`
}

func (*ToolChoiceFunction) UnmarshalJSON added in v0.4.0

func (r *ToolChoiceFunction) UnmarshalJSON(data []byte) (err error)

type ToolChoiceFunctionParam added in v0.4.0

type ToolChoiceFunctionParam struct {
	Function param.Field[FunctionToolChoiceParam] `json:"function,required"`
	Type     param.Field[ToolChoiceFunctionType]  `json:"type,required"`
}

func (ToolChoiceFunctionParam) MarshalJSON added in v0.4.0

func (r ToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)

type ToolChoiceFunctionType added in v0.4.0

type ToolChoiceFunctionType string
const (
	ToolChoiceFunctionTypeFunction ToolChoiceFunctionType = "function"
)

func (ToolChoiceFunctionType) IsKnown added in v0.4.0

func (r ToolChoiceFunctionType) IsKnown() bool

type ToolChoiceNone added in v0.4.0

type ToolChoiceNone string
const (
	ToolChoiceNoneNone ToolChoiceNone = "none"
)

func (ToolChoiceNone) IsKnown added in v0.4.0

func (r ToolChoiceNone) IsKnown() bool

type ToolChoiceUnion added in v0.4.0

type ToolChoiceUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by shared.ToolChoiceAuto, shared.ToolChoiceNone or shared.ToolChoiceFunction.

type ToolChoiceUnionParam added in v0.4.0

type ToolChoiceUnionParam interface {
	// contains filtered or unexported methods
}

Satisfied by shared.ToolChoiceAuto, shared.ToolChoiceNone, shared.ToolChoiceFunctionParam.

type UnionString

type UnionString string

func (UnionString) ImplementsACLListParamsIDsUnion

func (UnionString) ImplementsACLListParamsIDsUnion()

func (UnionString) ImplementsAISecretListParamsAISecretTypeUnion added in v0.4.0

func (UnionString) ImplementsAISecretListParamsAISecretTypeUnion()

func (UnionString) ImplementsAISecretListParamsIDsUnion added in v0.4.0

func (UnionString) ImplementsAISecretListParamsIDsUnion()

func (UnionString) ImplementsAPIKeyListParamsIDsUnion

func (UnionString) ImplementsAPIKeyListParamsIDsUnion()

func (UnionString) ImplementsDatasetListParamsIDsUnion

func (UnionString) ImplementsDatasetListParamsIDsUnion()

func (UnionString) ImplementsEnvVarListParamsIDsUnion added in v0.4.0

func (UnionString) ImplementsEnvVarListParamsIDsUnion()

func (UnionString) ImplementsExperimentListParamsIDsUnion

func (UnionString) ImplementsExperimentListParamsIDsUnion()

func (UnionString) ImplementsFunctionInvokeParamsMessagesUserContentUnion added in v0.4.0

func (UnionString) ImplementsFunctionInvokeParamsMessagesUserContentUnion()

func (UnionString) ImplementsFunctionInvokeParamsParentUnion added in v0.4.0

func (UnionString) ImplementsFunctionInvokeParamsParentUnion()

func (UnionString) ImplementsFunctionListParamsIDsUnion

func (UnionString) ImplementsFunctionListParamsIDsUnion()

func (UnionString) ImplementsGroupListParamsIDsUnion

func (UnionString) ImplementsGroupListParamsIDsUnion()

func (UnionString) ImplementsOrganizationListParamsIDsUnion

func (UnionString) ImplementsOrganizationListParamsIDsUnion()

func (UnionString) ImplementsProjectListParamsIDsUnion

func (UnionString) ImplementsProjectListParamsIDsUnion()

func (UnionString) ImplementsProjectScoreListParamsIDsUnion

func (UnionString) ImplementsProjectScoreListParamsIDsUnion()

func (UnionString) ImplementsProjectTagListParamsIDsUnion

func (UnionString) ImplementsProjectTagListParamsIDsUnion()

func (UnionString) ImplementsPromptListParamsIDsUnion

func (UnionString) ImplementsPromptListParamsIDsUnion()

func (UnionString) ImplementsRoleListParamsIDsUnion

func (UnionString) ImplementsRoleListParamsIDsUnion()

func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion

func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()

func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam

func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()

func (UnionString) ImplementsUserListParamsEmailUnion

func (UnionString) ImplementsUserListParamsEmailUnion()

func (UnionString) ImplementsUserListParamsFamilyNameUnion

func (UnionString) ImplementsUserListParamsFamilyNameUnion()

func (UnionString) ImplementsUserListParamsGivenNameUnion

func (UnionString) ImplementsUserListParamsGivenNameUnion()

func (UnionString) ImplementsUserListParamsIDsUnion

func (UnionString) ImplementsUserListParamsIDsUnion()

func (UnionString) ImplementsViewListParamsIDsUnion

func (UnionString) ImplementsViewListParamsIDsUnion()

type User

type User struct {
	// Unique identifier for the user
	ID string `json:"id,required" format:"uuid"`
	// URL of the user's Avatar image
	AvatarURL string `json:"avatar_url,nullable"`
	// Date of user creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// The user's email
	Email string `json:"email,nullable"`
	// Family name of the user
	FamilyName string `json:"family_name,nullable"`
	// Given name of the user
	GivenName string   `json:"given_name,nullable"`
	JSON      userJSON `json:"-"`
}

func (*User) UnmarshalJSON

func (r *User) UnmarshalJSON(data []byte) (err error)

type View

type View struct {
	// Unique identifier for the view
	ID string `json:"id,required" format:"uuid"`
	// Name of the view
	Name string `json:"name,required"`
	// The id of the object the view applies to
	ObjectID string `json:"object_id,required" format:"uuid"`
	// The object type that the ACL applies to
	ObjectType ViewObjectType `json:"object_type,required"`
	// Type of table that the view corresponds to.
	ViewType ViewViewType `json:"view_type,required,nullable"`
	// Date of view creation
	Created time.Time `json:"created,nullable" format:"date-time"`
	// Date of role deletion, or null if the role is still active
	DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
	// Options for the view in the app
	Options ViewOptions `json:"options,nullable"`
	// Identifies the user who created the view
	UserID string `json:"user_id,nullable" format:"uuid"`
	// The view definition
	ViewData ViewData `json:"view_data,nullable"`
	JSON     viewJSON `json:"-"`
}

func (*View) UnmarshalJSON

func (r *View) UnmarshalJSON(data []byte) (err error)

type ViewData

type ViewData struct {
	Search ViewDataSearch `json:"search,nullable"`
	JSON   viewDataJSON   `json:"-"`
}

The view definition

func (*ViewData) UnmarshalJSON

func (r *ViewData) UnmarshalJSON(data []byte) (err error)

type ViewDataParam

type ViewDataParam struct {
	Search param.Field[ViewDataSearchParam] `json:"search"`
}

The view definition

func (ViewDataParam) MarshalJSON

func (r ViewDataParam) MarshalJSON() (data []byte, err error)

type ViewDataSearch

type ViewDataSearch struct {
	Filter []interface{}      `json:"filter,nullable"`
	Match  []interface{}      `json:"match,nullable"`
	Sort   []interface{}      `json:"sort,nullable"`
	Tag    []interface{}      `json:"tag,nullable"`
	JSON   viewDataSearchJSON `json:"-"`
}

func (*ViewDataSearch) UnmarshalJSON

func (r *ViewDataSearch) UnmarshalJSON(data []byte) (err error)

type ViewDataSearchParam

type ViewDataSearchParam struct {
	Filter param.Field[[]interface{}] `json:"filter"`
	Match  param.Field[[]interface{}] `json:"match"`
	Sort   param.Field[[]interface{}] `json:"sort"`
	Tag    param.Field[[]interface{}] `json:"tag"`
}

func (ViewDataSearchParam) MarshalJSON

func (r ViewDataSearchParam) MarshalJSON() (data []byte, err error)

type ViewObjectType

type ViewObjectType string

The object type that the ACL applies to

const (
	ViewObjectTypeOrganization  ViewObjectType = "organization"
	ViewObjectTypeProject       ViewObjectType = "project"
	ViewObjectTypeExperiment    ViewObjectType = "experiment"
	ViewObjectTypeDataset       ViewObjectType = "dataset"
	ViewObjectTypePrompt        ViewObjectType = "prompt"
	ViewObjectTypePromptSession ViewObjectType = "prompt_session"
	ViewObjectTypeGroup         ViewObjectType = "group"
	ViewObjectTypeRole          ViewObjectType = "role"
	ViewObjectTypeOrgMember     ViewObjectType = "org_member"
	ViewObjectTypeProjectLog    ViewObjectType = "project_log"
	ViewObjectTypeOrgProject    ViewObjectType = "org_project"
)

func (ViewObjectType) IsKnown

func (r ViewObjectType) IsKnown() bool

type ViewOptions

type ViewOptions struct {
	ColumnOrder      []string           `json:"columnOrder,nullable"`
	ColumnSizing     map[string]float64 `json:"columnSizing,nullable"`
	ColumnVisibility map[string]bool    `json:"columnVisibility,nullable"`
	JSON             viewOptionsJSON    `json:"-"`
}

Options for the view in the app

func (*ViewOptions) UnmarshalJSON

func (r *ViewOptions) UnmarshalJSON(data []byte) (err error)

type ViewOptionsParam

type ViewOptionsParam struct {
	ColumnOrder      param.Field[[]string]           `json:"columnOrder"`
	ColumnSizing     param.Field[map[string]float64] `json:"columnSizing"`
	ColumnVisibility param.Field[map[string]bool]    `json:"columnVisibility"`
}

Options for the view in the app

func (ViewOptionsParam) MarshalJSON

func (r ViewOptionsParam) MarshalJSON() (data []byte, err error)

type ViewViewType

type ViewViewType string

Type of table that the view corresponds to.

const (
	ViewViewTypeProjects    ViewViewType = "projects"
	ViewViewTypeLogs        ViewViewType = "logs"
	ViewViewTypeExperiments ViewViewType = "experiments"
	ViewViewTypeDatasets    ViewViewType = "datasets"
	ViewViewTypePrompts     ViewViewType = "prompts"
	ViewViewTypePlaygrounds ViewViewType = "playgrounds"
	ViewViewTypeExperiment  ViewViewType = "experiment"
	ViewViewTypeDataset     ViewViewType = "dataset"
)

func (ViewViewType) IsKnown

func (r ViewViewType) IsKnown() bool

Jump to

Keyboard shortcuts

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