Documentation
¶
Index ¶
- type ACL
- type ACLBatchUpdateResponse
- type ACLObjectType
- type AISecret
- type APIKey
- type ChatCompletionContentPartImage
- type ChatCompletionContentPartImageImageURL
- type ChatCompletionContentPartImageImageURLDetail
- type ChatCompletionContentPartImageImageURLParam
- type ChatCompletionContentPartImageParam
- func (r ChatCompletionContentPartImageParam) ImplementsFunctionInvokeParamsMessagesUserContentArrayItemUnion()
- func (r ChatCompletionContentPartImageParam) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam()
- func (r ChatCompletionContentPartImageParam) MarshalJSON() (data []byte, err error)
- type ChatCompletionContentPartImageType
- type ChatCompletionContentPartText
- type ChatCompletionContentPartTextParam
- func (r ChatCompletionContentPartTextParam) ImplementsFunctionInvokeParamsMessagesUserContentArrayItemUnion()
- func (r ChatCompletionContentPartTextParam) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam()
- func (r ChatCompletionContentPartTextParam) MarshalJSON() (data []byte, err error)
- type ChatCompletionContentPartTextType
- type ChatCompletionMessageToolCall
- type ChatCompletionMessageToolCallFunction
- type ChatCompletionMessageToolCallFunctionParam
- type ChatCompletionMessageToolCallParam
- type ChatCompletionMessageToolCallType
- type CodeBundle
- type CodeBundleLocation
- type CodeBundleLocationExperiment
- type CodeBundleLocationExperimentParam
- type CodeBundleLocationExperimentPosition
- type CodeBundleLocationExperimentPositionParam
- type CodeBundleLocationExperimentPositionScorer
- type CodeBundleLocationExperimentPositionScorerParam
- type CodeBundleLocationExperimentPositionScorerType
- type CodeBundleLocationExperimentPositionType
- type CodeBundleLocationExperimentPositionTypeParam
- type CodeBundleLocationExperimentPositionTypeType
- type CodeBundleLocationExperimentPositionUnion
- type CodeBundleLocationExperimentPositionUnionParam
- type CodeBundleLocationExperimentType
- type CodeBundleLocationFunction
- type CodeBundleLocationFunctionParam
- type CodeBundleLocationFunctionType
- type CodeBundleLocationParam
- type CodeBundleLocationType
- type CodeBundleLocationUnion
- type CodeBundleLocationUnionParam
- type CodeBundleParam
- type CodeBundleRuntimeContext
- type CodeBundleRuntimeContextParam
- type CodeBundleRuntimeContextRuntime
- type CreateAPIKeyOutput
- type DataSummary
- type Dataset
- type DatasetEvent
- type DatasetEventMetadata
- type EnvVar
- type EnvVarObjectType
- type Experiment
- type ExperimentEvent
- type ExperimentEventContext
- type ExperimentEventMetadata
- type ExperimentEventMetrics
- type FeedbackDatasetItemParam
- type FeedbackDatasetItemSource
- type FeedbackExperimentItemParam
- type FeedbackExperimentItemSource
- type FeedbackProjectLogsItemParam
- type FeedbackProjectLogsItemSource
- type FeedbackResponseSchema
- type FeedbackResponseSchemaStatus
- type FetchDatasetEventsResponse
- type FetchExperimentEventsResponse
- type FetchProjectLogsEventsResponse
- type Function
- type FunctionFunctionData
- type FunctionFunctionDataCode
- type FunctionFunctionDataCodeData
- type FunctionFunctionDataCodeDataBundle
- type FunctionFunctionDataCodeDataBundleType
- type FunctionFunctionDataCodeDataInline
- type FunctionFunctionDataCodeDataInlineRuntimeContext
- type FunctionFunctionDataCodeDataInlineRuntimeContextRuntime
- type FunctionFunctionDataCodeDataInlineType
- type FunctionFunctionDataCodeDataType
- type FunctionFunctionDataCodeDataUnion
- type FunctionFunctionDataCodeType
- type FunctionFunctionDataGlobal
- type FunctionFunctionDataGlobalType
- type FunctionFunctionDataPrompt
- type FunctionFunctionDataPromptType
- type FunctionFunctionDataType
- type FunctionFunctionDataUnion
- type FunctionFunctionSchema
- type FunctionFunctionType
- type FunctionLogID
- type FunctionOrigin
- type Group
- type InsertDatasetEventMetadataParam
- type InsertDatasetEventParam
- type InsertEventsResponse
- type InsertExperimentEventContextParam
- type InsertExperimentEventMetadataParam
- type InsertExperimentEventMetricsParam
- type InsertExperimentEventParam
- type InsertProjectLogsEventContextParam
- type InsertProjectLogsEventMetadataParam
- type InsertProjectLogsEventMetricsParam
- type InsertProjectLogsEventParam
- type MetricSummary
- type ObjectReference
- type ObjectReferenceObjectType
- type ObjectReferenceParam
- type OnlineScoreConfig
- type OnlineScoreConfigParam
- type OnlineScoreConfigScorer
- type OnlineScoreConfigScorerParam
- type OnlineScoreConfigScorersFunction
- type OnlineScoreConfigScorersFunctionParam
- type OnlineScoreConfigScorersFunctionType
- type OnlineScoreConfigScorersGlobal
- type OnlineScoreConfigScorersGlobalParam
- type OnlineScoreConfigScorersGlobalType
- type OnlineScoreConfigScorersType
- type OnlineScoreConfigScorersUnion
- type OnlineScoreConfigScorersUnionParam
- type Organization
- type PatchOrganizationMembersOutput
- type PatchOrganizationMembersOutputStatus
- type Permission
- type Project
- type ProjectLogsEvent
- type ProjectLogsEventContext
- type ProjectLogsEventLogID
- type ProjectLogsEventMetadata
- type ProjectLogsEventMetrics
- type ProjectScore
- type ProjectScoreCategoriesCategorical
- type ProjectScoreCategoriesMinimum
- type ProjectScoreCategoriesUnion
- type ProjectScoreCategory
- type ProjectScoreCategoryParam
- type ProjectScoreConfig
- type ProjectScoreConfigParam
- type ProjectScoreType
- type ProjectSettings
- type ProjectSettingsParam
- type ProjectSettingsSpanFieldOrder
- type ProjectSettingsSpanFieldOrderLayout
- type ProjectSettingsSpanFieldOrderParam
- type ProjectTag
- type Prompt
- type PromptData
- type PromptDataOrigin
- type PromptDataOriginParam
- type PromptDataParam
- type PromptDataParser
- type PromptDataParserParam
- type PromptDataParserType
- type PromptDataPrompt
- type PromptDataPromptChat
- type PromptDataPromptChatMessage
- type PromptDataPromptChatMessageParam
- type PromptDataPromptChatMessagesAssistant
- type PromptDataPromptChatMessagesAssistantFunctionCall
- type PromptDataPromptChatMessagesAssistantFunctionCallParam
- type PromptDataPromptChatMessagesAssistantParam
- type PromptDataPromptChatMessagesAssistantRole
- type PromptDataPromptChatMessagesFallback
- type PromptDataPromptChatMessagesFallbackParam
- type PromptDataPromptChatMessagesFallbackRole
- type PromptDataPromptChatMessagesFunction
- type PromptDataPromptChatMessagesFunctionParam
- type PromptDataPromptChatMessagesFunctionRole
- type PromptDataPromptChatMessagesRole
- type PromptDataPromptChatMessagesSystem
- type PromptDataPromptChatMessagesSystemParam
- type PromptDataPromptChatMessagesSystemRole
- type PromptDataPromptChatMessagesTool
- type PromptDataPromptChatMessagesToolParam
- type PromptDataPromptChatMessagesToolRole
- type PromptDataPromptChatMessagesUnion
- type PromptDataPromptChatMessagesUnionParam
- type PromptDataPromptChatMessagesUser
- type PromptDataPromptChatMessagesUserContentArray
- type PromptDataPromptChatMessagesUserContentArrayParam
- type PromptDataPromptChatMessagesUserContentArrayUnionItem
- type PromptDataPromptChatMessagesUserContentArrayUnionItemParam
- type PromptDataPromptChatMessagesUserContentUnion
- type PromptDataPromptChatMessagesUserContentUnionParam
- type PromptDataPromptChatMessagesUserParam
- type PromptDataPromptChatMessagesUserRole
- type PromptDataPromptChatParam
- type PromptDataPromptChatType
- type PromptDataPromptCompletion
- type PromptDataPromptCompletionParam
- type PromptDataPromptCompletionType
- type PromptDataPromptParam
- type PromptDataPromptType
- type PromptDataPromptUnion
- type PromptDataPromptUnionParam
- type PromptDataToolFunction
- type PromptDataToolFunctionParam
- type PromptDataToolFunctionsFunction
- type PromptDataToolFunctionsFunctionParam
- type PromptDataToolFunctionsFunctionType
- type PromptDataToolFunctionsGlobal
- type PromptDataToolFunctionsGlobalParam
- type PromptDataToolFunctionsGlobalType
- type PromptDataToolFunctionsType
- type PromptDataToolFunctionsUnion
- type PromptDataToolFunctionsUnionParam
- type PromptFunctionType
- type PromptLogID
- type PromptOptions
- type PromptOptionsParam
- type PromptOptionsParamsAnthropicModelParams
- type PromptOptionsParamsAnthropicModelParamsParam
- type PromptOptionsParamsGoogleModelParams
- type PromptOptionsParamsGoogleModelParamsParam
- type PromptOptionsParamsJsCompletionParams
- type PromptOptionsParamsJsCompletionParamsParam
- type PromptOptionsParamsOpenAIModelParams
- type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction
- type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam
- type PromptOptionsParamsOpenAIModelParamsFunctionCallString
- type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion
- type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam
- type PromptOptionsParamsOpenAIModelParamsParam
- type PromptOptionsParamsOpenAIModelParamsReasoningEffort
- type PromptOptionsParamsOpenAIModelParamsResponseFormat
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType
- type PromptOptionsParamsOpenAIModelParamsResponseFormatParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatText
- type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatTextType
- type PromptOptionsParamsOpenAIModelParamsResponseFormatType
- type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion
- type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType
- type PromptOptionsParamsOpenAIModelParamsToolChoiceString
- type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion
- type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam
- type PromptOptionsParamsUnion
- type PromptOptionsParamsUnionParam
- type PromptOptionsParamsWindowAIModelParams
- type PromptOptionsParamsWindowAIModelParamsParam
- type RepoInfo
- type RepoInfoParam
- type Role
- type RoleMemberPermission
- type ScoreSummary
- type SpanAttributes
- type SpanAttributesParam
- type SpanIFrame
- type SpanType
- type SummarizeDatasetResponse
- type SummarizeExperimentResponse
- type UnionString
- func (UnionString) ImplementsACLListParamsIDsUnion()
- func (UnionString) ImplementsAISecretListParamsAISecretTypeUnion()
- func (UnionString) ImplementsAISecretListParamsIDsUnion()
- func (UnionString) ImplementsAPIKeyListParamsIDsUnion()
- func (UnionString) ImplementsDatasetListParamsIDsUnion()
- func (UnionString) ImplementsEnvVarListParamsIDsUnion()
- func (UnionString) ImplementsEvalNewParamsParentUnion()
- func (UnionString) ImplementsExperimentListParamsIDsUnion()
- func (UnionString) ImplementsFunctionInvokeParamsMessagesUserContentUnion()
- func (UnionString) ImplementsFunctionInvokeParamsParentUnion()
- func (UnionString) ImplementsFunctionListParamsIDsUnion()
- func (UnionString) ImplementsGroupListParamsIDsUnion()
- func (UnionString) ImplementsOrganizationListParamsIDsUnion()
- func (UnionString) ImplementsProjectListParamsIDsUnion()
- func (UnionString) ImplementsProjectScoreListParamsIDsUnion()
- func (UnionString) ImplementsProjectTagListParamsIDsUnion()
- func (UnionString) ImplementsPromptDataPromptChatMessagesUserContentUnion()
- func (UnionString) ImplementsPromptDataPromptChatMessagesUserContentUnionParam()
- func (UnionString) ImplementsPromptListParamsIDsUnion()
- func (UnionString) ImplementsRoleListParamsIDsUnion()
- func (UnionString) ImplementsSpanIframeListParamsIDsUnion()
- func (UnionString) ImplementsUserListParamsEmailUnion()
- func (UnionString) ImplementsUserListParamsFamilyNameUnion()
- func (UnionString) ImplementsUserListParamsGivenNameUnion()
- func (UnionString) ImplementsUserListParamsIDsUnion()
- func (UnionString) ImplementsViewListParamsIDsUnion()
- type User
- type View
- type ViewData
- type ViewDataParam
- type ViewDataSearch
- type ViewDataSearchParam
- type ViewOptions
- type ViewOptionsParam
- type ViewType
- type ViewViewType
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"` // Permission the ACL grants. Exactly one of `permission` and `role_id` will be // provided Permission Permission `json:"permission,nullable"` // When setting a permission directly, optionally restricts the permission grant to // just the specified object type. Cannot be set alongside a `role_id`. RestrictObjectType ACLObjectType `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 ¶
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 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"` // Date of last AI secret update UpdatedAt time.Time `json:"updated_at,nullable" format:"date-time"` JSON aiSecretJSON `json:"-"` }
func (*AISecret) UnmarshalJSON ¶ added in v0.4.0
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 ¶
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) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItem ¶ added in v0.6.0
func (r ChatCompletionContentPartImage) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItem()
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
func (r ChatCompletionContentPartImageImageURLDetail) IsKnown() bool
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) ImplementsFunctionInvokeParamsMessagesUserContentArrayItemUnion ¶ added in v0.6.0
func (r ChatCompletionContentPartImageParam) ImplementsFunctionInvokeParamsMessagesUserContentArrayItemUnion()
func (ChatCompletionContentPartImageParam) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam ¶ added in v0.6.0
func (r ChatCompletionContentPartImageParam) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam()
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
func (r ChatCompletionContentPartImageType) IsKnown() bool
type ChatCompletionContentPartText ¶ added in v0.4.0
type ChatCompletionContentPartText struct { Type ChatCompletionContentPartTextType `json:"type,required"` Text string `json:"text"` JSON chatCompletionContentPartTextJSON `json:"-"` }
func (ChatCompletionContentPartText) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItem ¶ added in v0.6.0
func (r ChatCompletionContentPartText) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItem()
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) ImplementsFunctionInvokeParamsMessagesUserContentArrayItemUnion ¶ added in v0.6.0
func (r ChatCompletionContentPartTextParam) ImplementsFunctionInvokeParamsMessagesUserContentArrayItemUnion()
func (ChatCompletionContentPartTextParam) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam ¶ added in v0.6.0
func (r ChatCompletionContentPartTextParam) ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam()
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
func (r ChatCompletionContentPartTextType) IsKnown() bool
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
func (r ChatCompletionMessageToolCallType) IsKnown() bool
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"` Index int64 `json:"index"` // This field can have the runtime type of [CodeBundleLocationExperimentPosition]. Position interface{} `json:"position"` JSON codeBundleLocationJSON `json:"-"` // contains filtered or unexported fields }
func (CodeBundleLocation) AsUnion ¶ added in v0.4.0
func (r CodeBundleLocation) AsUnion() CodeBundleLocationUnion
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
func (r CodeBundleLocationExperimentPosition) AsUnion() CodeBundleLocationExperimentPositionUnion
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.CodeBundleLocationExperimentPositionType, shared.CodeBundleLocationExperimentPositionScorer.
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) MarshalJSON ¶ added in v0.4.0
func (r CodeBundleLocationExperimentPositionParam) MarshalJSON() (data []byte, err error)
type CodeBundleLocationExperimentPositionScorer ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorer struct { Index int64 `json:"index,required"` Type CodeBundleLocationExperimentPositionScorerType `json:"type,required"` JSON codeBundleLocationExperimentPositionScorerJSON `json:"-"` }
func (*CodeBundleLocationExperimentPositionScorer) UnmarshalJSON ¶ added in v0.5.0
func (r *CodeBundleLocationExperimentPositionScorer) UnmarshalJSON(data []byte) (err error)
type CodeBundleLocationExperimentPositionScorerParam ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorerParam struct { Index param.Field[int64] `json:"index,required"` Type param.Field[CodeBundleLocationExperimentPositionScorerType] `json:"type,required"` }
func (CodeBundleLocationExperimentPositionScorerParam) MarshalJSON ¶ added in v0.5.0
func (r CodeBundleLocationExperimentPositionScorerParam) MarshalJSON() (data []byte, err error)
type CodeBundleLocationExperimentPositionScorerType ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorerType string
const (
CodeBundleLocationExperimentPositionScorerTypeScorer CodeBundleLocationExperimentPositionScorerType = "scorer"
)
func (CodeBundleLocationExperimentPositionScorerType) IsKnown ¶ added in v0.5.0
func (r CodeBundleLocationExperimentPositionScorerType) IsKnown() bool
type CodeBundleLocationExperimentPositionType ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionType struct { Type CodeBundleLocationExperimentPositionTypeType `json:"type,required"` JSON codeBundleLocationExperimentPositionTypeJSON `json:"-"` }
func (*CodeBundleLocationExperimentPositionType) UnmarshalJSON ¶ added in v0.5.0
func (r *CodeBundleLocationExperimentPositionType) UnmarshalJSON(data []byte) (err error)
type CodeBundleLocationExperimentPositionTypeParam ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionTypeParam struct {
Type param.Field[CodeBundleLocationExperimentPositionTypeType] `json:"type,required"`
}
func (CodeBundleLocationExperimentPositionTypeParam) MarshalJSON ¶ added in v0.5.0
func (r CodeBundleLocationExperimentPositionTypeParam) MarshalJSON() (data []byte, err error)
type CodeBundleLocationExperimentPositionTypeType ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionTypeType string
const (
CodeBundleLocationExperimentPositionTypeTypeTask CodeBundleLocationExperimentPositionTypeType = "task"
)
func (CodeBundleLocationExperimentPositionTypeType) IsKnown ¶ added in v0.5.0
func (r CodeBundleLocationExperimentPositionTypeType) IsKnown() bool
type CodeBundleLocationExperimentPositionUnion ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.CodeBundleLocationExperimentPositionType or shared.CodeBundleLocationExperimentPositionScorer.
type CodeBundleLocationExperimentPositionUnionParam ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.CodeBundleLocationExperimentPositionTypeParam, shared.CodeBundleLocationExperimentPositionScorerParam, CodeBundleLocationExperimentPositionParam.
type CodeBundleLocationExperimentType ¶ added in v0.4.0
type CodeBundleLocationExperimentType string
const (
CodeBundleLocationExperimentTypeExperiment CodeBundleLocationExperimentType = "experiment"
)
func (CodeBundleLocationExperimentType) IsKnown ¶ added in v0.4.0
func (r CodeBundleLocationExperimentType) IsKnown() bool
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
func (r CodeBundleLocationFunctionType) IsKnown() bool
type CodeBundleLocationParam ¶ added in v0.4.0
type CodeBundleLocationParam struct { Type param.Field[CodeBundleLocationType] `json:"type,required"` EvalName param.Field[string] `json:"eval_name"` Index param.Field[int64] `json:"index"` Position param.Field[interface{}] `json:"position"` }
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
func (r CodeBundleRuntimeContextRuntime) IsKnown() bool
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 ¶
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"` // A unique identifier for 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"` // The argument that uniquely define an input case (an arbitrary, JSON serializable // object) Input interface{} `json:"input"` // Whether this span is a root span IsRoot bool `json:"is_root,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 DatasetEventMetadata `json:"metadata,nullable"` // Indicates the event was copied from another object. Origin ObjectReference `json:"origin,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 DatasetEventMetadata ¶ added in v0.6.0
type DatasetEventMetadata struct { // The model used for this example Model string `json:"model,nullable"` ExtraFields map[string]interface{} `json:"-,extras"` JSON datasetEventMetadataJSON `json:"-"` }
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
func (*DatasetEventMetadata) UnmarshalJSON ¶ added in v0.6.0
func (r *DatasetEventMetadata) 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
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"` // A unique identifier for 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"` // The error that occurred, if any. Error 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 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 interface{} `json:"input"` // Whether this span is a root span IsRoot bool `json:"is_root,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 ExperimentEventMetadata `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"` // Indicates the event was copied from another object. Origin ObjectReference `json:"origin,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"` // 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 SpanAttributes `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 ExperimentEventMetadata ¶ added in v0.6.0
type ExperimentEventMetadata struct { // The model used for this example Model string `json:"model,nullable"` ExtraFields map[string]interface{} `json:"-,extras"` JSON experimentEventMetadataJSON `json:"-"` }
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
func (*ExperimentEventMetadata) UnmarshalJSON ¶ added in v0.6.0
func (r *ExperimentEventMetadata) UnmarshalJSON(data []byte) (err error)
type ExperimentEventMetrics ¶
type ExperimentEventMetrics struct { // This metric is deprecated CallerFilename interface{} `json:"caller_filename"` // This metric is deprecated CallerFunctionname interface{} `json:"caller_functionname"` // This metric is deprecated CallerLineno interface{} `json:"caller_lineno"` // 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]float64 `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 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. Note, this metadata does // not correspond to the main event itself, but rather the audit log attached to // the event. 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"` // A list of tags to log Tags param.Field[[]string] `json:"tags"` }
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. Note, this metadata does // not correspond to the main event itself, but rather the audit log attached to // the event. 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"` // A list of tags to log Tags param.Field[[]string] `json:"tags"` }
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. Note, this metadata does // not correspond to the main event itself, but rather the audit log attached to // the event. 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"` // A list of tags to log Tags param.Field[[]string] `json:"tags"` }
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 ¶
type FunctionFunctionData ¶
type FunctionFunctionData struct { Type FunctionFunctionDataType `json:"type,required"` // This field can have the runtime type of [FunctionFunctionDataCodeData]. Data interface{} `json:"data"` Name string `json:"name"` JSON functionFunctionDataJSON `json:"-"` // contains filtered or unexported fields }
func (FunctionFunctionData) AsUnion ¶
func (r FunctionFunctionData) AsUnion() FunctionFunctionDataUnion
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 { BundleID string `json:"bundle_id"` Code string `json:"code"` // This field can have the runtime type of [CodeBundleLocation]. Location interface{} `json:"location"` // A preview of the code Preview string `json:"preview,nullable"` // This field can have the runtime type of [CodeBundleRuntimeContext], // [FunctionFunctionDataCodeDataInlineRuntimeContext]. RuntimeContext interface{} `json:"runtime_context"` Type FunctionFunctionDataCodeDataType `json:"type"` JSON functionFunctionDataCodeDataJSON `json:"-"` // contains filtered or unexported fields }
func (FunctionFunctionDataCodeData) AsUnion ¶ added in v0.4.0
func (r FunctionFunctionDataCodeData) AsUnion() FunctionFunctionDataCodeDataUnion
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
func (r FunctionFunctionDataCodeDataBundleType) IsKnown() bool
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
func (r FunctionFunctionDataCodeDataInlineRuntimeContextRuntime) IsKnown() bool
type FunctionFunctionDataCodeDataInlineType ¶ added in v0.4.0
type FunctionFunctionDataCodeDataInlineType string
const (
FunctionFunctionDataCodeDataInlineTypeInline FunctionFunctionDataCodeDataInlineType = "inline"
)
func (FunctionFunctionDataCodeDataInlineType) IsKnown ¶ added in v0.4.0
func (r FunctionFunctionDataCodeDataInlineType) IsKnown() bool
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
func (r FunctionFunctionDataCodeDataType) IsKnown() bool
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 ¶
func (r FunctionFunctionDataGlobalType) IsKnown() bool
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 ¶
func (r FunctionFunctionDataPromptType) IsKnown() bool
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"` Returns interface{} `json:"returns"` 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 ACLObjectType `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 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 ¶
type InsertDatasetEventMetadataParam ¶ added in v0.6.0
type InsertDatasetEventMetadataParam struct { // The model used for this example Model param.Field[string] `json:"model"` ExtraFields map[string]interface{} `json:"-,extras"` }
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
func (InsertDatasetEventMetadataParam) MarshalJSON ¶ added in v0.6.0
func (r InsertDatasetEventMetadataParam) MarshalJSON() (data []byte, err error)
type InsertDatasetEventParam ¶ added in v0.5.0
type InsertDatasetEventParam 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, if one is found. If no existing row is found, // the new row is inserted as is. // // 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"` // The `_merge_paths` field allows controlling the depth of the merge, when // `_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"` // DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support // for `_parent_id` will be dropped in a future version of Braintrust. Log // `span_id`, `root_span_id`, and `span_parents` explicitly instead. // // Use the `_parent_id` field to create this row as a subspan of an existing row. // 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. // // If the row is being merged into an existing row, this field will be ignored. 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[InsertDatasetEventMetadataParam] `json:"metadata"` // Indicates the event was copied from another object. Origin param.Field[ObjectReferenceParam] `json:"origin"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. RootSpanID param.Field[string] `json:"root_span_id"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. SpanID param.Field[string] `json:"span_id"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. SpanParents param.Field[[]string] `json:"span_parents"` // A list of tags to log Tags param.Field[[]string] `json:"tags"` }
A dataset event
func (InsertDatasetEventParam) MarshalJSON ¶ added in v0.5.0
func (r InsertDatasetEventParam) 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 InsertExperimentEventContextParam ¶ added in v0.5.0
type InsertExperimentEventContextParam 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 (InsertExperimentEventContextParam) MarshalJSON ¶ added in v0.5.0
func (r InsertExperimentEventContextParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMetadataParam ¶ added in v0.6.0
type InsertExperimentEventMetadataParam struct { // The model used for this example Model param.Field[string] `json:"model"` ExtraFields map[string]interface{} `json:"-,extras"` }
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
func (InsertExperimentEventMetadataParam) MarshalJSON ¶ added in v0.6.0
func (r InsertExperimentEventMetadataParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMetricsParam ¶ added in v0.5.0
type InsertExperimentEventMetricsParam struct { // This metric is deprecated CallerFilename param.Field[interface{}] `json:"caller_filename"` // This metric is deprecated CallerFunctionname param.Field[interface{}] `json:"caller_functionname"` // This metric is deprecated CallerLineno param.Field[interface{}] `json:"caller_lineno"` // 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]float64 `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 (InsertExperimentEventMetricsParam) MarshalJSON ¶ added in v0.5.0
func (r InsertExperimentEventMetricsParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventParam ¶ added in v0.5.0
type InsertExperimentEventParam 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, if one is found. If no existing row is found, // the new row is inserted as is. // // 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"` // The `_merge_paths` field allows controlling the depth of the merge, when // `_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"` // DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support // for `_parent_id` will be dropped in a future version of Braintrust. Log // `span_id`, `root_span_id`, and `span_parents` explicitly instead. // // Use the `_parent_id` field to create this row as a subspan of an existing row. // 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. // // If the row is being merged into an existing row, this field will be ignored. 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[InsertExperimentEventContextParam] `json:"context"` // The timestamp the experiment 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 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[InsertExperimentEventMetadataParam] `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[InsertExperimentEventMetricsParam] `json:"metrics"` // Indicates the event was copied from another object. Origin param.Field[ObjectReferenceParam] `json:"origin"` // 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"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. RootSpanID param.Field[string] `json:"root_span_id"` // 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[SpanAttributesParam] `json:"span_attributes"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. SpanID param.Field[string] `json:"span_id"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. SpanParents param.Field[[]string] `json:"span_parents"` // A list of tags to log Tags param.Field[[]string] `json:"tags"` }
An experiment event
func (InsertExperimentEventParam) MarshalJSON ¶ added in v0.5.0
func (r InsertExperimentEventParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventContextParam ¶ added in v0.5.0
type InsertProjectLogsEventContextParam 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 (InsertProjectLogsEventContextParam) MarshalJSON ¶ added in v0.5.0
func (r InsertProjectLogsEventContextParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMetadataParam ¶ added in v0.6.0
type InsertProjectLogsEventMetadataParam struct { // The model used for this example Model param.Field[string] `json:"model"` ExtraFields map[string]interface{} `json:"-,extras"` }
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
func (InsertProjectLogsEventMetadataParam) MarshalJSON ¶ added in v0.6.0
func (r InsertProjectLogsEventMetadataParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMetricsParam ¶ added in v0.5.0
type InsertProjectLogsEventMetricsParam struct { // This metric is deprecated CallerFilename param.Field[interface{}] `json:"caller_filename"` // This metric is deprecated CallerFunctionname param.Field[interface{}] `json:"caller_functionname"` // This metric is deprecated CallerLineno param.Field[interface{}] `json:"caller_lineno"` // 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]float64 `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 (InsertProjectLogsEventMetricsParam) MarshalJSON ¶ added in v0.5.0
func (r InsertProjectLogsEventMetricsParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventParam ¶ added in v0.5.0
type InsertProjectLogsEventParam 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, if one is found. If no existing row is found, // the new row is inserted as is. // // 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"` // The `_merge_paths` field allows controlling the depth of the merge, when // `_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"` // DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support // for `_parent_id` will be dropped in a future version of Braintrust. Log // `span_id`, `root_span_id`, and `span_parents` explicitly instead. // // Use the `_parent_id` field to create this row as a subspan of an existing row. // 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. // // If the row is being merged into an existing row, this field will be ignored. 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[InsertProjectLogsEventContextParam] `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[InsertProjectLogsEventMetadataParam] `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[InsertProjectLogsEventMetricsParam] `json:"metrics"` // Indicates the event was copied from another object. Origin param.Field[ObjectReferenceParam] `json:"origin"` // 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"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. RootSpanID param.Field[string] `json:"root_span_id"` // 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[SpanAttributesParam] `json:"span_attributes"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. SpanID param.Field[string] `json:"span_id"` // Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which // is now deprecated. The span_id is a unique identifier describing the row's place // in the a trace, and the root_span_id is a unique identifier for the whole trace. // See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full // details. // // For example, say we have logged a row // `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`. // We can create a sub-span of the parent row by logging // `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "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. // // If the row is being merged into an existing row, this field will be ignored. SpanParents param.Field[[]string] `json:"span_parents"` // A list of tags to log Tags param.Field[[]string] `json:"tags"` }
A project logs event
func (InsertProjectLogsEventParam) MarshalJSON ¶ added in v0.5.0
func (r InsertProjectLogsEventParam) MarshalJSON() (data []byte, err error)
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 ObjectReference ¶ added in v0.6.0
type ObjectReference struct { // ID of the original event. ID string `json:"id,required"` // Transaction ID of the original event. XactID string `json:"_xact_id,required"` // ID of the object the event is originating from. ObjectID string `json:"object_id,required" format:"uuid"` // Type of the object the event is originating from. ObjectType ObjectReferenceObjectType `json:"object_type,required"` // Created timestamp of the original event. Used to help sort in the UI Created string `json:"created,nullable"` JSON objectReferenceJSON `json:"-"` }
Indicates the event was copied from another object.
func (*ObjectReference) UnmarshalJSON ¶ added in v0.6.0
func (r *ObjectReference) UnmarshalJSON(data []byte) (err error)
type ObjectReferenceObjectType ¶ added in v0.6.0
type ObjectReferenceObjectType string
Type of the object the event is originating from.
const ( ObjectReferenceObjectTypeExperiment ObjectReferenceObjectType = "experiment" ObjectReferenceObjectTypeDataset ObjectReferenceObjectType = "dataset" ObjectReferenceObjectTypePrompt ObjectReferenceObjectType = "prompt" ObjectReferenceObjectTypeFunction ObjectReferenceObjectType = "function" ObjectReferenceObjectTypePromptSession ObjectReferenceObjectType = "prompt_session" ObjectReferenceObjectTypeProjectLogs ObjectReferenceObjectType = "project_logs" )
func (ObjectReferenceObjectType) IsKnown ¶ added in v0.6.0
func (r ObjectReferenceObjectType) IsKnown() bool
type ObjectReferenceParam ¶ added in v0.6.0
type ObjectReferenceParam struct { // ID of the original event. ID param.Field[string] `json:"id,required"` // Transaction ID of the original event. XactID param.Field[string] `json:"_xact_id,required"` // ID of the object the event is originating from. ObjectID param.Field[string] `json:"object_id,required" format:"uuid"` // Type of the object the event is originating from. ObjectType param.Field[ObjectReferenceObjectType] `json:"object_type,required"` // Created timestamp of the original event. Used to help sort in the UI Created param.Field[string] `json:"created"` }
Indicates the event was copied from another object.
func (ObjectReferenceParam) MarshalJSON ¶ added in v0.6.0
func (r ObjectReferenceParam) MarshalJSON() (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
func (r OnlineScoreConfigScorer) AsUnion() OnlineScoreConfigScorersUnion
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
func (r OnlineScoreConfigScorersFunctionType) IsKnown() bool
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
func (r OnlineScoreConfigScorersGlobalType) IsKnown() bool
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 { // The id of the org that was modified. OrgID string `json:"org_id,required"` 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
func (r PatchOrganizationMembersOutputStatus) IsKnown() bool
type Permission ¶ added in v0.7.0
type Permission 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 ( PermissionCreate Permission = "create" PermissionRead Permission = "read" PermissionUpdate Permission = "update" PermissionDelete Permission = "delete" PermissionCreateACLs Permission = "create_acls" PermissionReadACLs Permission = "read_acls" PermissionUpdateACLs Permission = "update_acls" PermissionDeleteACLs Permission = "delete_acls" )
func (Permission) IsKnown ¶ added in v0.7.0
func (r Permission) 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 ¶
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"` // A unique identifier for 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"` // 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"` // The arguments that uniquely define a user input (an arbitrary, JSON serializable // object). Input interface{} `json:"input"` // Whether this span is a root span IsRoot bool `json:"is_root,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 ProjectLogsEventMetadata `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"` // Indicates the event was copied from another object. Origin ObjectReference `json:"origin,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"` // 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 SpanAttributes `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 ProjectLogsEventMetadata ¶ added in v0.6.0
type ProjectLogsEventMetadata struct { // The model used for this example Model string `json:"model,nullable"` ExtraFields map[string]interface{} `json:"-,extras"` JSON projectLogsEventMetadataJSON `json:"-"` }
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
func (*ProjectLogsEventMetadata) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectLogsEventMetadata) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventMetrics ¶
type ProjectLogsEventMetrics struct { // This metric is deprecated CallerFilename interface{} `json:"caller_filename"` // This metric is deprecated CallerFunctionname interface{} `json:"caller_functionname"` // This metric is deprecated CallerLineno interface{} `json:"caller_lineno"` // 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]float64 `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 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,nullable"` 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 ProjectScoreCategoriesUnion ¶
type ProjectScoreCategoriesUnion interface {
// contains filtered or unexported methods
}
For categorical-type project scores, the list of all categories
Union satisfied by shared.ProjectScoreCategoriesCategorical or shared.ProjectScoreCategoriesMinimum.
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 string `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 ProjectScoreConfigParam ¶ added in v0.4.0
type ProjectScoreConfigParam struct { Destination param.Field[string] `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" ProjectScoreTypeMaximum ProjectScoreType = "maximum" ProjectScoreTypeOnline ProjectScoreType = "online" ProjectScoreTypeFreeForm ProjectScoreType = "free-form" )
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 id of the experiment to use as the default baseline for comparisons BaselineExperimentID string `json:"baseline_experiment_id,nullable" format:"uuid"` // The key used to join two experiments (defaults to `input`) ComparisonKey string `json:"comparison_key,nullable"` // The order of the fields to display in the trace view SpanFieldOrder []ProjectSettingsSpanFieldOrder `json:"spanFieldOrder,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 id of the experiment to use as the default baseline for comparisons BaselineExperimentID param.Field[string] `json:"baseline_experiment_id" format:"uuid"` // The key used to join two experiments (defaults to `input`) ComparisonKey param.Field[string] `json:"comparison_key"` // The order of the fields to display in the trace view SpanFieldOrder param.Field[[]ProjectSettingsSpanFieldOrderParam] `json:"spanFieldOrder"` }
func (ProjectSettingsParam) MarshalJSON ¶ added in v0.4.0
func (r ProjectSettingsParam) MarshalJSON() (data []byte, err error)
type ProjectSettingsSpanFieldOrder ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrder struct { ColumnID string `json:"column_id,required"` ObjectType string `json:"object_type,required"` Position string `json:"position,required"` Layout ProjectSettingsSpanFieldOrderLayout `json:"layout,nullable"` JSON projectSettingsSpanFieldOrderJSON `json:"-"` }
func (*ProjectSettingsSpanFieldOrder) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectSettingsSpanFieldOrder) UnmarshalJSON(data []byte) (err error)
type ProjectSettingsSpanFieldOrderLayout ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrderLayout string
const ( ProjectSettingsSpanFieldOrderLayoutFull ProjectSettingsSpanFieldOrderLayout = "full" ProjectSettingsSpanFieldOrderLayoutTwoColumn ProjectSettingsSpanFieldOrderLayout = "two_column" )
func (ProjectSettingsSpanFieldOrderLayout) IsKnown ¶ added in v0.6.0
func (r ProjectSettingsSpanFieldOrderLayout) IsKnown() bool
type ProjectSettingsSpanFieldOrderParam ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrderParam struct { ColumnID param.Field[string] `json:"column_id,required"` ObjectType param.Field[string] `json:"object_type,required"` Position param.Field[string] `json:"position,required"` Layout param.Field[ProjectSettingsSpanFieldOrderLayout] `json:"layout"` }
func (ProjectSettingsSpanFieldOrderParam) MarshalJSON ¶ added in v0.6.0
func (r ProjectSettingsSpanFieldOrderParam) 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 ¶
type PromptData ¶
type PromptData struct { Options PromptOptions `json:"options,nullable"` Origin PromptDataOrigin `json:"origin,nullable"` Parser PromptDataParser `json:"parser,nullable"` Prompt PromptDataPrompt `json:"prompt,nullable"` 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 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[PromptOptionsParam] `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,required"` Content string `json:"content"` // This field can have the runtime type of [[]PromptDataPromptChatMessage]. Messages interface{} `json:"messages"` Tools string `json:"tools"` JSON promptDataPromptJSON `json:"-"` // contains filtered or unexported fields }
func (PromptDataPrompt) AsUnion ¶
func (r PromptDataPrompt) AsUnion() PromptDataPromptUnion
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.
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 { Role PromptDataPromptChatMessagesRole `json:"role,required"` // This field can have the runtime type of [string], // [PromptDataPromptChatMessagesUserContentUnion]. Content interface{} `json:"content"` // This field can have the runtime type of // [PromptDataPromptChatMessagesAssistantFunctionCall]. FunctionCall interface{} `json:"function_call"` Name string `json:"name,nullable"` ToolCallID string `json:"tool_call_id"` // This field can have the runtime type of [[]ChatCompletionMessageToolCall]. ToolCalls interface{} `json:"tool_calls"` JSON promptDataPromptChatMessageJSON `json:"-"` // contains filtered or unexported fields }
func (PromptDataPromptChatMessage) AsUnion ¶
func (r PromptDataPromptChatMessage) AsUnion() PromptDataPromptChatMessagesUnion
AsUnion returns a PromptDataPromptChatMessagesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.PromptDataPromptChatMessagesSystem, shared.PromptDataPromptChatMessagesUser, shared.PromptDataPromptChatMessagesAssistant, shared.PromptDataPromptChatMessagesTool, shared.PromptDataPromptChatMessagesFunction, shared.PromptDataPromptChatMessagesFallback.
func (*PromptDataPromptChatMessage) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessage) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessageParam ¶
type PromptDataPromptChatMessageParam struct { Role param.Field[PromptDataPromptChatMessagesRole] `json:"role,required"` Content param.Field[interface{}] `json:"content"` FunctionCall param.Field[interface{}] `json:"function_call"` Name param.Field[string] `json:"name"` ToolCallID param.Field[string] `json:"tool_call_id"` ToolCalls param.Field[interface{}] `json:"tool_calls"` }
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 ¶
func (r PromptDataPromptChatMessagesAssistantFunctionCallParam) MarshalJSON() (data []byte, err error)
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 ¶
func (r PromptDataPromptChatMessagesAssistantRole) IsKnown() bool
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 ¶
func (r PromptDataPromptChatMessagesFallbackRole) IsKnown() bool
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 ¶
func (r PromptDataPromptChatMessagesFunctionRole) IsKnown() bool
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 ¶
func (r PromptDataPromptChatMessagesRole) IsKnown() bool
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 ¶
func (r PromptDataPromptChatMessagesSystemRole) IsKnown() bool
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 ¶
func (r PromptDataPromptChatMessagesToolRole) IsKnown() bool
type PromptDataPromptChatMessagesUnion ¶
type PromptDataPromptChatMessagesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataPromptChatMessagesSystem, shared.PromptDataPromptChatMessagesUser, shared.PromptDataPromptChatMessagesAssistant, shared.PromptDataPromptChatMessagesTool, shared.PromptDataPromptChatMessagesFunction or shared.PromptDataPromptChatMessagesFallback.
type PromptDataPromptChatMessagesUnionParam ¶
type PromptDataPromptChatMessagesUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptChatMessagesSystemParam, shared.PromptDataPromptChatMessagesUserParam, shared.PromptDataPromptChatMessagesAssistantParam, shared.PromptDataPromptChatMessagesToolParam, shared.PromptDataPromptChatMessagesFunctionParam, shared.PromptDataPromptChatMessagesFallbackParam, PromptDataPromptChatMessageParam.
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 []PromptDataPromptChatMessagesUserContentArrayUnionItem
func (PromptDataPromptChatMessagesUserContentArray) ImplementsPromptDataPromptChatMessagesUserContentUnion ¶ added in v0.6.0
func (r PromptDataPromptChatMessagesUserContentArray) ImplementsPromptDataPromptChatMessagesUserContentUnion()
type PromptDataPromptChatMessagesUserContentArrayParam ¶
type PromptDataPromptChatMessagesUserContentArrayParam []PromptDataPromptChatMessagesUserContentArrayUnionItemParam
func (PromptDataPromptChatMessagesUserContentArrayParam) ImplementsPromptDataPromptChatMessagesUserContentUnionParam ¶ added in v0.6.0
func (r PromptDataPromptChatMessagesUserContentArrayParam) ImplementsPromptDataPromptChatMessagesUserContentUnionParam()
type PromptDataPromptChatMessagesUserContentArrayUnionItem ¶
type PromptDataPromptChatMessagesUserContentArrayUnionItem interface {
ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItem()
}
Union satisfied by shared.ChatCompletionContentPartText or shared.ChatCompletionContentPartImage.
type PromptDataPromptChatMessagesUserContentArrayUnionItemParam ¶
type PromptDataPromptChatMessagesUserContentArrayUnionItemParam interface {
ImplementsPromptDataPromptChatMessagesUserContentArrayUnionItemParam()
}
Satisfied by shared.ChatCompletionContentPartTextParam, shared.ChatCompletionContentPartImageParam.
type PromptDataPromptChatMessagesUserContentUnion ¶
type PromptDataPromptChatMessagesUserContentUnion interface {
ImplementsPromptDataPromptChatMessagesUserContentUnion()
}
Union satisfied by shared.UnionString or shared.PromptDataPromptChatMessagesUserContentArray.
type PromptDataPromptChatMessagesUserContentUnionParam ¶
type PromptDataPromptChatMessagesUserContentUnionParam interface {
ImplementsPromptDataPromptChatMessagesUserContentUnionParam()
}
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 ¶
func (r PromptDataPromptChatMessagesUserRole) IsKnown() bool
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 ¶
func (r PromptDataPromptCompletionType) IsKnown() bool
type PromptDataPromptParam ¶
type PromptDataPromptParam struct { Type param.Field[PromptDataPromptType] `json:"type,required"` Content param.Field[string] `json:"content"` Messages param.Field[interface{}] `json:"messages"` 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 or shared.PromptDataPromptChat.
type PromptDataPromptUnionParam ¶
type PromptDataPromptUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptCompletionParam, shared.PromptDataPromptChatParam, 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
func (r PromptDataToolFunction) AsUnion() PromptDataToolFunctionsUnion
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
func (r PromptDataToolFunctionsFunctionType) IsKnown() bool
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
func (r PromptDataToolFunctionsGlobalType) IsKnown() bool
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 PromptOptions ¶ added in v0.5.0
type PromptOptions struct { Model string `json:"model"` Params PromptOptionsParamsUnion `json:"params"` Position string `json:"position"` JSON promptOptionsJSON `json:"-"` }
func (*PromptOptions) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptions) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParam ¶ added in v0.5.0
type PromptOptionsParam struct { Model param.Field[string] `json:"model"` Params param.Field[PromptOptionsParamsUnionParam] `json:"params"` Position param.Field[string] `json:"position"` }
func (PromptOptionsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsAnthropicModelParams ¶ added in v0.5.0
type PromptOptionsParamsAnthropicModelParams 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 promptOptionsParamsAnthropicModelParamsJSON `json:"-"` }
func (*PromptOptionsParamsAnthropicModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsAnthropicModelParams) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsAnthropicModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsAnthropicModelParamsParam 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 (PromptOptionsParamsAnthropicModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsAnthropicModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsGoogleModelParams ¶ added in v0.5.0
type PromptOptionsParamsGoogleModelParams struct { MaxOutputTokens float64 `json:"maxOutputTokens"` Temperature float64 `json:"temperature"` TopK float64 `json:"topK"` TopP float64 `json:"topP"` UseCache bool `json:"use_cache"` JSON promptOptionsParamsGoogleModelParamsJSON `json:"-"` }
func (*PromptOptionsParamsGoogleModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsGoogleModelParams) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsGoogleModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsGoogleModelParamsParam 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 (PromptOptionsParamsGoogleModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsGoogleModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsJsCompletionParams ¶ added in v0.5.0
type PromptOptionsParamsJsCompletionParams struct { UseCache bool `json:"use_cache"` JSON promptOptionsParamsJsCompletionParamsJSON `json:"-"` }
func (*PromptOptionsParamsJsCompletionParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsJsCompletionParams) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsJsCompletionParamsParam ¶ added in v0.5.0
type PromptOptionsParamsJsCompletionParamsParam struct {
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptOptionsParamsJsCompletionParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsJsCompletionParamsParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParams ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParams struct { FrequencyPenalty float64 `json:"frequency_penalty"` FunctionCall PromptOptionsParamsOpenAIModelParamsFunctionCallUnion `json:"function_call"` // The successor to max_tokens MaxCompletionTokens float64 `json:"max_completion_tokens"` MaxTokens float64 `json:"max_tokens"` N float64 `json:"n"` PresencePenalty float64 `json:"presence_penalty"` ReasoningEffort PromptOptionsParamsOpenAIModelParamsReasoningEffort `json:"reasoning_effort"` ResponseFormat PromptOptionsParamsOpenAIModelParamsResponseFormat `json:"response_format,nullable"` Stop []string `json:"stop"` Temperature float64 `json:"temperature"` ToolChoice PromptOptionsParamsOpenAIModelParamsToolChoiceUnion `json:"tool_choice"` TopP float64 `json:"top_p"` UseCache bool `json:"use_cache"` JSON promptOptionsParamsOpenAIModelParamsJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParams) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction struct { Name string `json:"name,required"` JSON promptOptionsParamsOpenAIModelParamsFunctionCallFunctionJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam struct {
Name param.Field[string] `json:"name,required"`
}
func (PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsFunctionCallString ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallString string
const ( PromptOptionsParamsOpenAIModelParamsFunctionCallStringAuto PromptOptionsParamsOpenAIModelParamsFunctionCallString = "auto" PromptOptionsParamsOpenAIModelParamsFunctionCallStringNone PromptOptionsParamsOpenAIModelParamsFunctionCallString = "none" )
func (PromptOptionsParamsOpenAIModelParamsFunctionCallString) IsKnown ¶ added in v0.6.0
func (r PromptOptionsParamsOpenAIModelParamsFunctionCallString) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptOptionsParamsOpenAIModelParamsFunctionCallString or shared.PromptOptionsParamsOpenAIModelParamsFunctionCallFunction.
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptOptionsParamsOpenAIModelParamsFunctionCallString, shared.PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam.
type PromptOptionsParamsOpenAIModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsParam struct { FrequencyPenalty param.Field[float64] `json:"frequency_penalty"` FunctionCall param.Field[PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam] `json:"function_call"` // The successor to max_tokens MaxCompletionTokens param.Field[float64] `json:"max_completion_tokens"` MaxTokens param.Field[float64] `json:"max_tokens"` N param.Field[float64] `json:"n"` PresencePenalty param.Field[float64] `json:"presence_penalty"` ReasoningEffort param.Field[PromptOptionsParamsOpenAIModelParamsReasoningEffort] `json:"reasoning_effort"` ResponseFormat param.Field[PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam] `json:"response_format"` Stop param.Field[[]string] `json:"stop"` Temperature param.Field[float64] `json:"temperature"` ToolChoice param.Field[PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam] `json:"tool_choice"` TopP param.Field[float64] `json:"top_p"` UseCache param.Field[bool] `json:"use_cache"` }
func (PromptOptionsParamsOpenAIModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsReasoningEffort ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsReasoningEffort string
const ( PromptOptionsParamsOpenAIModelParamsReasoningEffortLow PromptOptionsParamsOpenAIModelParamsReasoningEffort = "low" PromptOptionsParamsOpenAIModelParamsReasoningEffortMedium PromptOptionsParamsOpenAIModelParamsReasoningEffort = "medium" PromptOptionsParamsOpenAIModelParamsReasoningEffortHigh PromptOptionsParamsOpenAIModelParamsReasoningEffort = "high" )
func (PromptOptionsParamsOpenAIModelParamsReasoningEffort) IsKnown ¶ added in v0.6.0
func (r PromptOptionsParamsOpenAIModelParamsReasoningEffort) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsResponseFormat ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormat struct { Type PromptOptionsParamsOpenAIModelParamsResponseFormatType `json:"type,required"` // This field can have the runtime type of // [PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema]. JsonSchema interface{} `json:"json_schema"` JSON promptOptionsParamsOpenAIModelParamsResponseFormatJSON `json:"-"` // contains filtered or unexported fields }
func (PromptOptionsParamsOpenAIModelParamsResponseFormat) AsUnion ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormat) AsUnion() PromptOptionsParamsOpenAIModelParamsResponseFormatUnion
AsUnion returns a PromptOptionsParamsOpenAIModelParamsResponseFormatUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject, shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema, shared.PromptOptionsParamsOpenAIModelParamsResponseFormatText.
func (*PromptOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject struct { Type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType `json:"type,required"` JSON promptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam struct {
Type param.Field[PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType] `json:"type,required"`
}
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType string
const (
PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectTypeJsonObject PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType = "json_object"
)
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType) IsKnown ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectType) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema struct { JsonSchema PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema `json:"json_schema,required"` Type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType `json:"type,required"` JSON promptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema struct { Name string `json:"name,required"` Description string `json:"description"` Schema string `json:"schema"` Strict bool `json:"strict,nullable"` JSON promptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam struct { Name param.Field[string] `json:"name,required"` Description param.Field[string] `json:"description"` Schema param.Field[string] `json:"schema"` Strict param.Field[bool] `json:"strict"` }
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam struct { JsonSchema param.Field[PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam] `json:"json_schema,required"` Type param.Field[PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType] `json:"type,required"` }
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType string
const (
PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaTypeJsonSchema PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType = "json_schema"
)
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType) IsKnown ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaType) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsResponseFormatParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatParam struct { Type param.Field[PromptOptionsParamsOpenAIModelParamsResponseFormatType] `json:"type,required"` JsonSchema param.Field[interface{}] `json:"json_schema"` }
func (PromptOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatText ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatText struct { Type PromptOptionsParamsOpenAIModelParamsResponseFormatTextType `json:"type,required"` JSON promptOptionsParamsOpenAIModelParamsResponseFormatTextJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatText) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatText) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam struct {
Type param.Field[PromptOptionsParamsOpenAIModelParamsResponseFormatTextType] `json:"type,required"`
}
func (PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextType ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextType string
const (
PromptOptionsParamsOpenAIModelParamsResponseFormatTextTypeText PromptOptionsParamsOpenAIModelParamsResponseFormatTextType = "text"
)
func (PromptOptionsParamsOpenAIModelParamsResponseFormatTextType) IsKnown ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatTextType) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsResponseFormatType ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatType string
const ( PromptOptionsParamsOpenAIModelParamsResponseFormatTypeJsonObject PromptOptionsParamsOpenAIModelParamsResponseFormatType = "json_object" PromptOptionsParamsOpenAIModelParamsResponseFormatTypeJsonSchema PromptOptionsParamsOpenAIModelParamsResponseFormatType = "json_schema" PromptOptionsParamsOpenAIModelParamsResponseFormatTypeText PromptOptionsParamsOpenAIModelParamsResponseFormatType = "text" )
func (PromptOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject, shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema or shared.PromptOptionsParamsOpenAIModelParamsResponseFormatText.
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam, shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam, shared.PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam, PromptOptionsParamsOpenAIModelParamsResponseFormatParam.
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction struct { Function PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction `json:"function,required"` Type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType `json:"type,required"` JSON promptOptionsParamsOpenAIModelParamsToolChoiceFunctionJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction struct { Name string `json:"name,required"` JSON promptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionJSON `json:"-"` }
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam struct {
Name param.Field[string] `json:"name,required"`
}
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam struct { Function param.Field[PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam] `json:"function,required"` Type param.Field[PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType] `json:"type,required"` }
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType string
const (
PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionTypeFunction PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType = "function"
)
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType) IsKnown ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionType) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsToolChoiceString ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceString string
const ( PromptOptionsParamsOpenAIModelParamsToolChoiceStringAuto PromptOptionsParamsOpenAIModelParamsToolChoiceString = "auto" PromptOptionsParamsOpenAIModelParamsToolChoiceStringNone PromptOptionsParamsOpenAIModelParamsToolChoiceString = "none" PromptOptionsParamsOpenAIModelParamsToolChoiceStringRequired PromptOptionsParamsOpenAIModelParamsToolChoiceString = "required" )
func (PromptOptionsParamsOpenAIModelParamsToolChoiceString) IsKnown ¶ added in v0.6.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceString) IsKnown() bool
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptOptionsParamsOpenAIModelParamsToolChoiceString or shared.PromptOptionsParamsOpenAIModelParamsToolChoiceFunction.
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptOptionsParamsOpenAIModelParamsToolChoiceString, shared.PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam.
type PromptOptionsParamsUnion ¶ added in v0.5.0
type PromptOptionsParamsUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptOptionsParamsOpenAIModelParams, shared.PromptOptionsParamsAnthropicModelParams, shared.PromptOptionsParamsGoogleModelParams, shared.PromptOptionsParamsWindowAIModelParams or shared.PromptOptionsParamsJsCompletionParams.
type PromptOptionsParamsUnionParam ¶ added in v0.5.0
type PromptOptionsParamsUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptOptionsParamsOpenAIModelParamsParam, shared.PromptOptionsParamsAnthropicModelParamsParam, shared.PromptOptionsParamsGoogleModelParamsParam, shared.PromptOptionsParamsWindowAIModelParamsParam, shared.PromptOptionsParamsJsCompletionParamsParam.
type PromptOptionsParamsWindowAIModelParams ¶ added in v0.5.0
type PromptOptionsParamsWindowAIModelParams struct { Temperature float64 `json:"temperature"` TopK float64 `json:"topK"` UseCache bool `json:"use_cache"` JSON promptOptionsParamsWindowAIModelParamsJSON `json:"-"` }
func (*PromptOptionsParamsWindowAIModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsWindowAIModelParams) UnmarshalJSON(data []byte) (err error)
type PromptOptionsParamsWindowAIModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsWindowAIModelParamsParam struct { Temperature param.Field[float64] `json:"temperature"` TopK param.Field[float64] `json:"topK"` UseCache param.Field[bool] `json:"use_cache"` }
func (PromptOptionsParamsWindowAIModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsWindowAIModelParamsParam) MarshalJSON() (data []byte, err error)
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 ¶
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 ¶
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 Permission `json:"permission,required"` // The object type that the ACL applies to RestrictObjectType ACLObjectType `json:"restrict_object_type,nullable"` JSON roleMemberPermissionJSON `json:"-"` }
func (*RoleMemberPermission) UnmarshalJSON ¶
func (r *RoleMemberPermission) UnmarshalJSON(data []byte) (err error)
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 SpanAttributes ¶ added in v0.5.0
type SpanAttributes struct { // Name of the span, for display purposes only Name string `json:"name,nullable"` // Type of the span, for display purposes only Type SpanType `json:"type,nullable"` ExtraFields map[string]interface{} `json:"-,extras"` JSON spanAttributesJSON `json:"-"` }
Human-identifying attributes of the span, such as name, type, etc.
func (*SpanAttributes) UnmarshalJSON ¶ added in v0.5.0
func (r *SpanAttributes) UnmarshalJSON(data []byte) (err error)
type SpanAttributesParam ¶ added in v0.5.0
type SpanAttributesParam 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[SpanType] `json:"type"` ExtraFields map[string]interface{} `json:"-,extras"` }
Human-identifying attributes of the span, such as name, type, etc.
func (SpanAttributesParam) MarshalJSON ¶ added in v0.5.0
func (r SpanAttributesParam) MarshalJSON() (data []byte, err error)
type SpanIFrame ¶ added in v0.5.0
type SpanIFrame struct { // Unique identifier for the span iframe ID string `json:"id,required" format:"uuid"` // Name of the span iframe Name string `json:"name,required"` // Unique identifier for the project that the span iframe belongs under ProjectID string `json:"project_id,required" format:"uuid"` // URL to embed the project viewer in an iframe URL string `json:"url,required"` // Date of span iframe creation Created time.Time `json:"created,nullable" format:"date-time"` // Date of span iframe deletion, or null if the span iframe is still active DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` // Textual description of the span iframe Description string `json:"description,nullable"` // Whether to post messages to the iframe containing the span's data. This is // useful when you want to render more data than fits in the URL. PostMessage bool `json:"post_message,nullable"` // Identifies the user who created the span iframe UserID string `json:"user_id,nullable" format:"uuid"` JSON spanIFrameJSON `json:"-"` }
func (*SpanIFrame) UnmarshalJSON ¶ added in v0.5.0
func (r *SpanIFrame) UnmarshalJSON(data []byte) (err error)
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 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) ImplementsEvalNewParamsParentUnion ¶ added in v0.6.0
func (UnionString) ImplementsEvalNewParamsParentUnion()
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) ImplementsPromptDataPromptChatMessagesUserContentUnion ¶ added in v0.6.0
func (UnionString) ImplementsPromptDataPromptChatMessagesUserContentUnion()
func (UnionString) ImplementsPromptDataPromptChatMessagesUserContentUnionParam ¶ added in v0.6.0
func (UnionString) ImplementsPromptDataPromptChatMessagesUserContentUnionParam()
func (UnionString) ImplementsPromptListParamsIDsUnion ¶
func (UnionString) ImplementsPromptListParamsIDsUnion()
func (UnionString) ImplementsRoleListParamsIDsUnion ¶
func (UnionString) ImplementsRoleListParamsIDsUnion()
func (UnionString) ImplementsSpanIframeListParamsIDsUnion ¶ added in v0.5.0
func (UnionString) ImplementsSpanIframeListParamsIDsUnion()
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 ¶
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 ACLObjectType `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 ¶
type ViewData ¶
type ViewData struct { Search ViewDataSearch `json:"search,nullable"` JSON viewDataJSON `json:"-"` }
The view definition
func (*ViewData) UnmarshalJSON ¶
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 ViewOptions ¶
type ViewOptions struct { ColumnOrder []string `json:"columnOrder,nullable"` ColumnSizing map[string]float64 `json:"columnSizing,nullable"` ColumnVisibility map[string]bool `json:"columnVisibility,nullable"` Grouping string `json:"grouping,nullable"` Layout string `json:"layout,nullable"` RowHeight string `json:"rowHeight,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"` Grouping param.Field[string] `json:"grouping"` Layout param.Field[string] `json:"layout"` RowHeight param.Field[string] `json:"rowHeight"` }
Options for the view in the app
func (ViewOptionsParam) MarshalJSON ¶
func (r ViewOptionsParam) MarshalJSON() (data []byte, err error)
type ViewType ¶ added in v0.7.0
type ViewType string
Type of table that the view corresponds to.
const ( ViewTypeProjects ViewType = "projects" ViewTypeExperiments ViewType = "experiments" ViewTypeExperiment ViewType = "experiment" ViewTypePlaygrounds ViewType = "playgrounds" ViewTypePlayground ViewType = "playground" ViewTypeDatasets ViewType = "datasets" ViewTypeDataset ViewType = "dataset" ViewTypePrompts ViewType = "prompts" ViewTypeTools ViewType = "tools" ViewTypeScorers ViewType = "scorers" ViewTypeLogs ViewType = "logs" )
type ViewViewType ¶
type ViewViewType string
Type of table that the view corresponds to.
const ( ViewViewTypeProjects ViewViewType = "projects" ViewViewTypeExperiments ViewViewType = "experiments" ViewViewTypeExperiment ViewViewType = "experiment" ViewViewTypePlaygrounds ViewViewType = "playgrounds" ViewViewTypePlayground ViewViewType = "playground" ViewViewTypeDatasets ViewViewType = "datasets" ViewViewTypeDataset ViewViewType = "dataset" ViewViewTypePrompts ViewViewType = "prompts" ViewViewTypeTools ViewViewType = "tools" ViewViewTypeScorers ViewViewType = "scorers" ViewViewTypeLogs ViewViewType = "logs" )
func (ViewViewType) IsKnown ¶
func (r ViewViewType) IsKnown() bool