Documentation
¶
Index ¶
- type ACL
- type ACLObjectType
- type ACLPermission
- type ACLRestrictObjectType
- type APIKey
- type CreateACLObjectType
- type CreateACLParam
- type CreateACLPermission
- type CreateACLRestrictObjectType
- type CreateAPIKeyOutput
- type CreateDatasetParam
- type CreateExperimentParam
- type CreateFunctionFunctionDataCodeDataLocationParam
- type CreateFunctionFunctionDataCodeDataLocationPositionScoreParam
- type CreateFunctionFunctionDataCodeDataLocationPositionTask
- type CreateFunctionFunctionDataCodeDataLocationPositionUnionParam
- type CreateFunctionFunctionDataCodeDataLocationType
- type CreateFunctionFunctionDataCodeDataParam
- type CreateFunctionFunctionDataCodeDataRuntimeContextParam
- type CreateFunctionFunctionDataCodeDataRuntimeContextRuntime
- type CreateFunctionFunctionDataCodeParam
- type CreateFunctionFunctionDataCodeType
- type CreateFunctionFunctionDataGlobalParam
- type CreateFunctionFunctionDataGlobalType
- type CreateFunctionFunctionDataParam
- type CreateFunctionFunctionDataPromptParam
- type CreateFunctionFunctionDataPromptType
- type CreateFunctionFunctionDataType
- type CreateFunctionFunctionDataUnionParam
- type CreateFunctionParam
- type CreateGroupParam
- type CreateProjectParam
- type CreateProjectScoreCategoriesCategoricalParam
- type CreateProjectScoreCategoriesMinimumParam
- type CreateProjectScoreCategoriesNullableVariantParam
- type CreateProjectScoreCategoriesUnionParam
- type CreateProjectScoreParam
- type CreateProjectScoreScoreType
- type CreateProjectTagParam
- type CreatePromptParam
- type CreateRoleMemberPermissionParam
- type CreateRoleMemberPermissionsPermission
- type CreateRoleMemberPermissionsRestrictObjectType
- type CreateRoleParam
- type CreateViewObjectType
- type CreateViewParam
- type CreateViewViewType
- type DataSummary
- type Dataset
- type DatasetEvent
- type DeleteViewObjectType
- type DeleteViewParam
- type Experiment
- type ExperimentEvent
- type ExperimentEventContext
- type ExperimentEventMetrics
- type ExperimentEventSpanAttributes
- type ExperimentEventSpanAttributesType
- type FeedbackDatasetEventRequestParam
- type FeedbackDatasetItemParam
- type FeedbackDatasetItemSource
- type FeedbackExperimentEventRequestParam
- type FeedbackExperimentItemParam
- type FeedbackExperimentItemSource
- type FeedbackProjectLogsEventRequestParam
- type FeedbackProjectLogsItemParam
- type FeedbackProjectLogsItemSource
- type FetchDatasetEventsResponse
- type FetchEventsRequestParam
- type FetchExperimentEventsResponse
- type FetchProjectLogsEventsResponse
- type Function
- type FunctionFunctionData
- type FunctionFunctionDataCode
- type FunctionFunctionDataCodeData
- type FunctionFunctionDataCodeDataLocation
- type FunctionFunctionDataCodeDataLocationPositionScore
- type FunctionFunctionDataCodeDataLocationPositionTask
- type FunctionFunctionDataCodeDataLocationPositionUnion
- type FunctionFunctionDataCodeDataLocationType
- type FunctionFunctionDataCodeDataRuntimeContext
- type FunctionFunctionDataCodeDataRuntimeContextRuntime
- type FunctionFunctionDataCodeType
- type FunctionFunctionDataGlobal
- type FunctionFunctionDataGlobalType
- type FunctionFunctionDataPrompt
- type FunctionFunctionDataPromptType
- type FunctionFunctionDataType
- type FunctionFunctionDataUnion
- type FunctionLogID
- type Group
- type InsertDatasetEventMergeParam
- type InsertDatasetEventReplaceParam
- type InsertDatasetEventRequestEventParam
- type InsertDatasetEventRequestEventsUnionParam
- type InsertDatasetEventRequestParam
- type InsertEventsResponse
- type InsertExperimentEventMergeContextParam
- type InsertExperimentEventMergeMetricsParam
- type InsertExperimentEventMergeParam
- type InsertExperimentEventMergeSpanAttributesParam
- type InsertExperimentEventMergeSpanAttributesType
- type InsertExperimentEventReplaceContextParam
- type InsertExperimentEventReplaceMetricsParam
- type InsertExperimentEventReplaceParam
- type InsertExperimentEventReplaceSpanAttributesParam
- type InsertExperimentEventReplaceSpanAttributesType
- type InsertExperimentEventRequestEventParam
- type InsertExperimentEventRequestEventsUnionParam
- type InsertExperimentEventRequestParam
- type InsertProjectLogsEventMergeContextParam
- type InsertProjectLogsEventMergeMetricsParam
- type InsertProjectLogsEventMergeParam
- type InsertProjectLogsEventMergeSpanAttributesParam
- type InsertProjectLogsEventMergeSpanAttributesType
- type InsertProjectLogsEventReplaceContextParam
- type InsertProjectLogsEventReplaceMetricsParam
- type InsertProjectLogsEventReplaceParam
- type InsertProjectLogsEventReplaceSpanAttributesParam
- type InsertProjectLogsEventReplaceSpanAttributesType
- type InsertProjectLogsEventRequestEventParam
- type InsertProjectLogsEventRequestEventsUnionParam
- type InsertProjectLogsEventRequestParam
- type MetricSummary
- type Organization
- type PatchDatasetParam
- type PatchExperimentParam
- type PatchFunctionFunctionDataCodeDataLocationParam
- type PatchFunctionFunctionDataCodeDataLocationPositionScoreParam
- type PatchFunctionFunctionDataCodeDataLocationPositionTask
- type PatchFunctionFunctionDataCodeDataLocationPositionUnionParam
- type PatchFunctionFunctionDataCodeDataLocationType
- type PatchFunctionFunctionDataCodeDataParam
- type PatchFunctionFunctionDataCodeDataRuntimeContextParam
- type PatchFunctionFunctionDataCodeDataRuntimeContextRuntime
- type PatchFunctionFunctionDataCodeParam
- type PatchFunctionFunctionDataCodeType
- type PatchFunctionFunctionDataGlobalParam
- type PatchFunctionFunctionDataGlobalType
- type PatchFunctionFunctionDataNullableVariantParam
- type PatchFunctionFunctionDataParam
- type PatchFunctionFunctionDataPromptParam
- type PatchFunctionFunctionDataPromptType
- type PatchFunctionFunctionDataType
- type PatchFunctionFunctionDataUnionParam
- type PatchFunctionParam
- type PatchGroupParam
- type PatchOrganizationMembersInviteUsersParam
- type PatchOrganizationMembersParam
- type PatchOrganizationMembersRemoveUsersParam
- type PatchOrganizationParam
- type PatchProjectParam
- type PatchProjectScoreCategoriesCategoricalParam
- type PatchProjectScoreCategoriesMinimumParam
- type PatchProjectScoreCategoriesNullableVariantParam
- type PatchProjectScoreCategoriesUnionParam
- type PatchProjectScoreParam
- type PatchProjectScoreScoreType
- type PatchProjectSettingsParam
- type PatchProjectTagParam
- type PatchPromptParam
- type PatchRoleAddMemberPermissionParam
- type PatchRoleAddMemberPermissionsPermission
- type PatchRoleAddMemberPermissionsRestrictObjectType
- type PatchRoleParam
- type PatchRoleRemoveMemberPermissionParam
- type PatchRoleRemoveMemberPermissionsPermission
- type PatchRoleRemoveMemberPermissionsRestrictObjectType
- type PatchViewObjectType
- type PatchViewParam
- type PatchViewViewType
- type PathLookupFilterParam
- type PathLookupFilterType
- type Project
- type ProjectLogsEvent
- type ProjectLogsEventContext
- type ProjectLogsEventLogID
- type ProjectLogsEventMetrics
- type ProjectLogsEventSpanAttributes
- type ProjectLogsEventSpanAttributesType
- type ProjectScore
- type ProjectScoreCategoriesCategorical
- type ProjectScoreCategoriesMinimum
- type ProjectScoreCategoriesNullableVariant
- type ProjectScoreCategoriesUnion
- type ProjectScoreCategory
- type ProjectScoreCategoryParam
- type ProjectScoreConfig
- type ProjectScoreConfigDestination
- type ProjectScoreScoreType
- type ProjectSettings
- type ProjectTag
- type Prompt
- type PromptData
- type PromptDataOptions
- type PromptDataOptionsParam
- type PromptDataOptionsParamsAnthropicModelParams
- type PromptDataOptionsParamsAnthropicModelParamsParam
- type PromptDataOptionsParamsGoogleModelParams
- type PromptDataOptionsParamsGoogleModelParamsParam
- type PromptDataOptionsParamsJsCompletionParams
- type PromptDataOptionsParamsJsCompletionParamsParam
- type PromptDataOptionsParamsOpenAIModelParams
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam
- type PromptDataOptionsParamsOpenAIModelParamsParam
- type PromptDataOptionsParamsOpenAIModelParamsResponseFormat
- type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam
- type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam
- type PromptDataOptionsParamsUnion
- type PromptDataOptionsParamsUnionParam
- type PromptDataOptionsParamsWindowAIModelParams
- type PromptDataOptionsParamsWindowAIModelParamsParam
- type PromptDataOrigin
- type PromptDataOriginParam
- type PromptDataParam
- type PromptDataPrompt
- type PromptDataPromptChat
- type PromptDataPromptChatMessage
- type PromptDataPromptChatMessageParam
- type PromptDataPromptChatMessagesAssistant
- type PromptDataPromptChatMessagesAssistantFunctionCall
- type PromptDataPromptChatMessagesAssistantFunctionCallParam
- type PromptDataPromptChatMessagesAssistantParam
- type PromptDataPromptChatMessagesAssistantRole
- type PromptDataPromptChatMessagesAssistantToolCall
- type PromptDataPromptChatMessagesAssistantToolCallParam
- type PromptDataPromptChatMessagesAssistantToolCallsFunction
- type PromptDataPromptChatMessagesAssistantToolCallsFunctionParam
- type PromptDataPromptChatMessagesAssistantToolCallsType
- 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 PromptDataPromptChatMessagesUserContentArrayImageURL
- type PromptDataPromptChatMessagesUserContentArrayImageURLImageURL
- type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail
- type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam
- type PromptDataPromptChatMessagesUserContentArrayImageURLParam
- type PromptDataPromptChatMessagesUserContentArrayImageURLType
- type PromptDataPromptChatMessagesUserContentArrayItem
- type PromptDataPromptChatMessagesUserContentArrayItemParam
- type PromptDataPromptChatMessagesUserContentArrayParam
- type PromptDataPromptChatMessagesUserContentArrayText
- type PromptDataPromptChatMessagesUserContentArrayTextParam
- type PromptDataPromptChatMessagesUserContentArrayTextType
- type PromptDataPromptChatMessagesUserContentArrayType
- type PromptDataPromptChatMessagesUserContentArrayUnionItem
- type PromptDataPromptChatMessagesUserContentArrayUnionItemParam
- type PromptDataPromptChatMessagesUserContentUnion
- type PromptDataPromptChatMessagesUserContentUnionParam
- type PromptDataPromptChatMessagesUserParam
- type PromptDataPromptChatMessagesUserRole
- type PromptDataPromptChatParam
- type PromptDataPromptChatType
- type PromptDataPromptCompletion
- type PromptDataPromptCompletionParam
- type PromptDataPromptCompletionType
- type PromptDataPromptNullableVariant
- type PromptDataPromptNullableVariantParam
- type PromptDataPromptParam
- type PromptDataPromptType
- type PromptDataPromptUnion
- type PromptDataPromptUnionParam
- type PromptLogID
- type RepoInfo
- type RepoInfoParam
- type Role
- type RoleMemberPermission
- type RoleMemberPermissionsPermission
- type RoleMemberPermissionsRestrictObjectType
- type ScoreSummary
- type SummarizeDatasetResponse
- type SummarizeExperimentResponse
- type UnionString
- func (UnionString) ImplementsACLListParamsIDsUnion()
- func (UnionString) ImplementsAPIKeyListParamsIDsUnion()
- func (UnionString) ImplementsDatasetListParamsIDsUnion()
- func (UnionString) ImplementsExperimentListParamsIDsUnion()
- func (UnionString) ImplementsFunctionListParamsIDsUnion()
- func (UnionString) ImplementsGroupListParamsIDsUnion()
- func (UnionString) ImplementsOrganizationListParamsIDsUnion()
- func (UnionString) ImplementsProjectListParamsIDsUnion()
- func (UnionString) ImplementsProjectScoreListParamsIDsUnion()
- func (UnionString) ImplementsProjectTagListParamsIDsUnion()
- func (UnionString) ImplementsPromptListParamsIDsUnion()
- func (UnionString) ImplementsRoleListParamsIDsUnion()
- func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
- func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
- 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 ViewObjectType
- type ViewOptions
- type ViewOptionsParam
- 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,nullable"`
// 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 ACLPermission `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 ACLRestrictObjectType `json:"restrict_object_type,nullable"`
// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
RoleID string `json:"role_id,nullable" format:"uuid"`
// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
UserID string `json:"user_id,nullable" format:"uuid"`
JSON aclJSON `json:"-"`
}
An ACL grants a certain permission or role to a certain user or group on an object.
ACLs are inherited across the object hierarchy. So for example, if a user has read permissions on a project, they will also have read permissions on any experiment, dataset, etc. created within that project.
To restrict a grant to a particular sub-object, you may specify `restrict_object_type` in the ACL, as part of a direct permission grant or as part of a role.
func (*ACL) UnmarshalJSON ¶
type ACLObjectType ¶
type ACLObjectType string
The object type that the ACL applies to
const ( ACLObjectTypeOrganization ACLObjectType = "organization" ACLObjectTypeProject ACLObjectType = "project" ACLObjectTypeExperiment ACLObjectType = "experiment" ACLObjectTypeDataset ACLObjectType = "dataset" ACLObjectTypePrompt ACLObjectType = "prompt" ACLObjectTypePromptSession ACLObjectType = "prompt_session" ACLObjectTypeGroup ACLObjectType = "group" ACLObjectTypeRole ACLObjectType = "role" ACLObjectTypeOrgMember ACLObjectType = "org_member" ACLObjectTypeProjectLog ACLObjectType = "project_log" ACLObjectTypeOrgProject ACLObjectType = "org_project" )
func (ACLObjectType) IsKnown ¶
func (r ACLObjectType) IsKnown() bool
type ACLPermission ¶
type ACLPermission string
Permission the ACL grants. Exactly one of `permission` and `role_id` will be provided
const ( ACLPermissionCreate ACLPermission = "create" ACLPermissionRead ACLPermission = "read" ACLPermissionUpdate ACLPermission = "update" ACLPermissionDelete ACLPermission = "delete" ACLPermissionCreateACLs ACLPermission = "create_acls" ACLPermissionReadACLs ACLPermission = "read_acls" ACLPermissionUpdateACLs ACLPermission = "update_acls" ACLPermissionDeleteACLs ACLPermission = "delete_acls" )
func (ACLPermission) IsKnown ¶
func (r ACLPermission) IsKnown() bool
type ACLRestrictObjectType ¶
type ACLRestrictObjectType string
When setting a permission directly, optionally restricts the permission grant to just the specified object type. Cannot be set alongside a `role_id`.
const ( ACLRestrictObjectTypeOrganization ACLRestrictObjectType = "organization" ACLRestrictObjectTypeProject ACLRestrictObjectType = "project" ACLRestrictObjectTypeExperiment ACLRestrictObjectType = "experiment" ACLRestrictObjectTypeDataset ACLRestrictObjectType = "dataset" ACLRestrictObjectTypePrompt ACLRestrictObjectType = "prompt" ACLRestrictObjectTypePromptSession ACLRestrictObjectType = "prompt_session" ACLRestrictObjectTypeGroup ACLRestrictObjectType = "group" ACLRestrictObjectTypeRole ACLRestrictObjectType = "role" ACLRestrictObjectTypeOrgMember ACLRestrictObjectType = "org_member" ACLRestrictObjectTypeProjectLog ACLRestrictObjectType = "project_log" ACLRestrictObjectTypeOrgProject ACLRestrictObjectType = "org_project" )
func (ACLRestrictObjectType) IsKnown ¶
func (r ACLRestrictObjectType) IsKnown() bool
type 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 CreateACLObjectType ¶
type CreateACLObjectType string
The object type that the ACL applies to
const ( CreateACLObjectTypeOrganization CreateACLObjectType = "organization" CreateACLObjectTypeProject CreateACLObjectType = "project" CreateACLObjectTypeExperiment CreateACLObjectType = "experiment" CreateACLObjectTypeDataset CreateACLObjectType = "dataset" CreateACLObjectTypePrompt CreateACLObjectType = "prompt" CreateACLObjectTypePromptSession CreateACLObjectType = "prompt_session" CreateACLObjectTypeGroup CreateACLObjectType = "group" CreateACLObjectTypeRole CreateACLObjectType = "role" CreateACLObjectTypeOrgMember CreateACLObjectType = "org_member" CreateACLObjectTypeProjectLog CreateACLObjectType = "project_log" CreateACLObjectTypeOrgProject CreateACLObjectType = "org_project" )
func (CreateACLObjectType) IsKnown ¶
func (r CreateACLObjectType) IsKnown() bool
type CreateACLParam ¶
type CreateACLParam struct {
// The id of the object the ACL applies to
ObjectID param.Field[string] `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType param.Field[CreateACLObjectType] `json:"object_type,required"`
// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
GroupID param.Field[string] `json:"group_id" format:"uuid"`
// Permission the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
Permission param.Field[CreateACLPermission] `json:"permission"`
// When setting a permission directly, optionally restricts the permission grant to
// just the specified object type. Cannot be set alongside a `role_id`.
RestrictObjectType param.Field[CreateACLRestrictObjectType] `json:"restrict_object_type"`
// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
RoleID param.Field[string] `json:"role_id" format:"uuid"`
// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
UserID param.Field[string] `json:"user_id" format:"uuid"`
}
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 (CreateACLParam) MarshalJSON ¶
func (r CreateACLParam) MarshalJSON() (data []byte, err error)
type CreateACLPermission ¶
type CreateACLPermission string
Permission the ACL grants. Exactly one of `permission` and `role_id` will be provided
const ( CreateACLPermissionCreate CreateACLPermission = "create" CreateACLPermissionRead CreateACLPermission = "read" CreateACLPermissionUpdate CreateACLPermission = "update" CreateACLPermissionDelete CreateACLPermission = "delete" CreateACLPermissionCreateACLs CreateACLPermission = "create_acls" CreateACLPermissionReadACLs CreateACLPermission = "read_acls" CreateACLPermissionUpdateACLs CreateACLPermission = "update_acls" CreateACLPermissionDeleteACLs CreateACLPermission = "delete_acls" )
func (CreateACLPermission) IsKnown ¶
func (r CreateACLPermission) IsKnown() bool
type CreateACLRestrictObjectType ¶
type CreateACLRestrictObjectType string
When setting a permission directly, optionally restricts the permission grant to just the specified object type. Cannot be set alongside a `role_id`.
const ( CreateACLRestrictObjectTypeOrganization CreateACLRestrictObjectType = "organization" CreateACLRestrictObjectTypeProject CreateACLRestrictObjectType = "project" CreateACLRestrictObjectTypeExperiment CreateACLRestrictObjectType = "experiment" CreateACLRestrictObjectTypeDataset CreateACLRestrictObjectType = "dataset" CreateACLRestrictObjectTypePrompt CreateACLRestrictObjectType = "prompt" CreateACLRestrictObjectTypePromptSession CreateACLRestrictObjectType = "prompt_session" CreateACLRestrictObjectTypeGroup CreateACLRestrictObjectType = "group" CreateACLRestrictObjectTypeRole CreateACLRestrictObjectType = "role" CreateACLRestrictObjectTypeOrgMember CreateACLRestrictObjectType = "org_member" CreateACLRestrictObjectTypeProjectLog CreateACLRestrictObjectType = "project_log" CreateACLRestrictObjectTypeOrgProject CreateACLRestrictObjectType = "org_project" )
func (CreateACLRestrictObjectType) IsKnown ¶
func (r CreateACLRestrictObjectType) 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 CreateDatasetParam ¶
type CreateDatasetParam struct {
// Name of the dataset. Within a project, dataset names are unique
Name param.Field[string] `json:"name,required"`
// Textual description of the dataset
Description param.Field[string] `json:"description"`
// Unique identifier for the project that the dataset belongs under
ProjectID param.Field[string] `json:"project_id" format:"uuid"`
}
func (CreateDatasetParam) MarshalJSON ¶
func (r CreateDatasetParam) MarshalJSON() (data []byte, err error)
type CreateExperimentParam ¶
type CreateExperimentParam struct {
// Unique identifier for the project that the experiment belongs under
ProjectID param.Field[string] `json:"project_id,required" format:"uuid"`
// Id of default base experiment to compare against when viewing this experiment
BaseExpID param.Field[string] `json:"base_exp_id" format:"uuid"`
// Identifier of the linked dataset, or null if the experiment is not linked to a
// dataset
DatasetID param.Field[string] `json:"dataset_id" 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 param.Field[string] `json:"dataset_version"`
// Textual description of the experiment
Description param.Field[string] `json:"description"`
// Normally, creating an experiment with the same name as an existing experiment
// will return the existing one un-modified. But if `ensure_new` is true,
// registration will generate a new experiment with a unique name in case of a
// conflict.
EnsureNew param.Field[bool] `json:"ensure_new"`
// User-controlled metadata about the experiment
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Name of the experiment. Within a project, experiment names are unique
Name param.Field[string] `json:"name"`
// Whether or not the experiment is public. Public experiments can be viewed by
// anybody inside or outside the organization
Public param.Field[bool] `json:"public"`
// Metadata about the state of the repo when the experiment was created
RepoInfo param.Field[RepoInfoParam] `json:"repo_info"`
}
func (CreateExperimentParam) MarshalJSON ¶
func (r CreateExperimentParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataCodeDataLocationParam ¶
type CreateFunctionFunctionDataCodeDataLocationParam struct {
EvalName param.Field[string] `json:"eval_name,required"`
Position param.Field[CreateFunctionFunctionDataCodeDataLocationPositionUnionParam] `json:"position,required"`
Type param.Field[CreateFunctionFunctionDataCodeDataLocationType] `json:"type,required"`
}
func (CreateFunctionFunctionDataCodeDataLocationParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataCodeDataLocationParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataCodeDataLocationPositionScoreParam ¶
type CreateFunctionFunctionDataCodeDataLocationPositionScoreParam struct {
Score param.Field[float64] `json:"score,required"`
}
func (CreateFunctionFunctionDataCodeDataLocationPositionScoreParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataCodeDataLocationPositionScoreParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataCodeDataLocationPositionTask ¶
type CreateFunctionFunctionDataCodeDataLocationPositionTask string
const (
CreateFunctionFunctionDataCodeDataLocationPositionTaskTask CreateFunctionFunctionDataCodeDataLocationPositionTask = "task"
)
func (CreateFunctionFunctionDataCodeDataLocationPositionTask) IsKnown ¶
func (r CreateFunctionFunctionDataCodeDataLocationPositionTask) IsKnown() bool
type CreateFunctionFunctionDataCodeDataLocationPositionUnionParam ¶
type CreateFunctionFunctionDataCodeDataLocationPositionUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.CreateFunctionFunctionDataCodeDataLocationPositionTask, shared.CreateFunctionFunctionDataCodeDataLocationPositionScoreParam.
type CreateFunctionFunctionDataCodeDataLocationType ¶
type CreateFunctionFunctionDataCodeDataLocationType string
const (
CreateFunctionFunctionDataCodeDataLocationTypeExperiment CreateFunctionFunctionDataCodeDataLocationType = "experiment"
)
func (CreateFunctionFunctionDataCodeDataLocationType) IsKnown ¶
func (r CreateFunctionFunctionDataCodeDataLocationType) IsKnown() bool
type CreateFunctionFunctionDataCodeDataParam ¶
type CreateFunctionFunctionDataCodeDataParam struct {
BundleID param.Field[string] `json:"bundle_id,required"`
Location param.Field[CreateFunctionFunctionDataCodeDataLocationParam] `json:"location,required"`
RuntimeContext param.Field[CreateFunctionFunctionDataCodeDataRuntimeContextParam] `json:"runtime_context,required"`
}
func (CreateFunctionFunctionDataCodeDataParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataCodeDataParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataCodeDataRuntimeContextParam ¶
type CreateFunctionFunctionDataCodeDataRuntimeContextParam struct {
Runtime param.Field[CreateFunctionFunctionDataCodeDataRuntimeContextRuntime] `json:"runtime,required"`
Version param.Field[string] `json:"version,required"`
}
func (CreateFunctionFunctionDataCodeDataRuntimeContextParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataCodeDataRuntimeContextParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataCodeDataRuntimeContextRuntime ¶
type CreateFunctionFunctionDataCodeDataRuntimeContextRuntime string
const (
CreateFunctionFunctionDataCodeDataRuntimeContextRuntimeNode CreateFunctionFunctionDataCodeDataRuntimeContextRuntime = "node"
)
func (CreateFunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown ¶
func (r CreateFunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown() bool
type CreateFunctionFunctionDataCodeParam ¶
type CreateFunctionFunctionDataCodeParam struct {
Data param.Field[CreateFunctionFunctionDataCodeDataParam] `json:"data,required"`
Type param.Field[CreateFunctionFunctionDataCodeType] `json:"type,required"`
}
func (CreateFunctionFunctionDataCodeParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataCodeParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataCodeType ¶
type CreateFunctionFunctionDataCodeType string
const (
CreateFunctionFunctionDataCodeTypeCode CreateFunctionFunctionDataCodeType = "code"
)
func (CreateFunctionFunctionDataCodeType) IsKnown ¶
func (r CreateFunctionFunctionDataCodeType) IsKnown() bool
type CreateFunctionFunctionDataGlobalParam ¶
type CreateFunctionFunctionDataGlobalParam struct {
Name param.Field[string] `json:"name,required"`
Type param.Field[CreateFunctionFunctionDataGlobalType] `json:"type,required"`
}
func (CreateFunctionFunctionDataGlobalParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataGlobalParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataGlobalType ¶
type CreateFunctionFunctionDataGlobalType string
const (
CreateFunctionFunctionDataGlobalTypeGlobal CreateFunctionFunctionDataGlobalType = "global"
)
func (CreateFunctionFunctionDataGlobalType) IsKnown ¶
func (r CreateFunctionFunctionDataGlobalType) IsKnown() bool
type CreateFunctionFunctionDataParam ¶
type CreateFunctionFunctionDataParam struct {
Type param.Field[CreateFunctionFunctionDataType] `json:"type,required"`
Data param.Field[interface{}] `json:"data,required"`
Name param.Field[string] `json:"name"`
}
func (CreateFunctionFunctionDataParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataPromptParam ¶
type CreateFunctionFunctionDataPromptParam struct {
Type param.Field[CreateFunctionFunctionDataPromptType] `json:"type,required"`
}
func (CreateFunctionFunctionDataPromptParam) MarshalJSON ¶
func (r CreateFunctionFunctionDataPromptParam) MarshalJSON() (data []byte, err error)
type CreateFunctionFunctionDataPromptType ¶
type CreateFunctionFunctionDataPromptType string
const (
CreateFunctionFunctionDataPromptTypePrompt CreateFunctionFunctionDataPromptType = "prompt"
)
func (CreateFunctionFunctionDataPromptType) IsKnown ¶
func (r CreateFunctionFunctionDataPromptType) IsKnown() bool
type CreateFunctionFunctionDataType ¶
type CreateFunctionFunctionDataType string
const ( CreateFunctionFunctionDataTypePrompt CreateFunctionFunctionDataType = "prompt" CreateFunctionFunctionDataTypeCode CreateFunctionFunctionDataType = "code" CreateFunctionFunctionDataTypeGlobal CreateFunctionFunctionDataType = "global" )
func (CreateFunctionFunctionDataType) IsKnown ¶
func (r CreateFunctionFunctionDataType) IsKnown() bool
type CreateFunctionFunctionDataUnionParam ¶
type CreateFunctionFunctionDataUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.CreateFunctionFunctionDataPromptParam, shared.CreateFunctionFunctionDataCodeParam, shared.CreateFunctionFunctionDataGlobalParam, CreateFunctionFunctionDataParam.
type CreateFunctionParam ¶
type CreateFunctionParam struct {
FunctionData param.Field[CreateFunctionFunctionDataUnionParam] `json:"function_data,required"`
// Name of the prompt
Name param.Field[string] `json:"name,required"`
// Unique identifier for the project that the prompt belongs under
ProjectID param.Field[string] `json:"project_id,required" format:"uuid"`
// Unique identifier for the prompt
Slug param.Field[string] `json:"slug,required"`
// Textual description of the prompt
Description param.Field[string] `json:"description"`
// The prompt, model, and its parameters
PromptData param.Field[PromptDataParam] `json:"prompt_data"`
// A list of tags for the prompt
Tags param.Field[[]string] `json:"tags"`
}
func (CreateFunctionParam) MarshalJSON ¶
func (r CreateFunctionParam) MarshalJSON() (data []byte, err error)
type CreateGroupParam ¶
type CreateGroupParam struct {
// Name of the group
Name param.Field[string] `json:"name,required"`
// Textual description of the group
Description param.Field[string] `json:"description"`
// 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 param.Field[[]string] `json:"member_groups" format:"uuid"`
// Ids of users which belong to this group
MemberUsers param.Field[[]string] `json:"member_users" format:"uuid"`
// For nearly all users, this parameter should be unnecessary. But in the rare case
// that your API key belongs to multiple organizations, you may specify the name of
// the organization the group belongs in.
OrgName param.Field[string] `json:"org_name"`
}
func (CreateGroupParam) MarshalJSON ¶
func (r CreateGroupParam) MarshalJSON() (data []byte, err error)
type CreateProjectParam ¶
type CreateProjectParam struct {
// Name of the project
Name param.Field[string] `json:"name,required"`
// For nearly all users, this parameter should be unnecessary. But in the rare case
// that your API key belongs to multiple organizations, you may specify the name of
// the organization the project belongs in.
OrgName param.Field[string] `json:"org_name"`
}
func (CreateProjectParam) MarshalJSON ¶
func (r CreateProjectParam) MarshalJSON() (data []byte, err error)
type CreateProjectScoreCategoriesCategoricalParam ¶
type CreateProjectScoreCategoriesCategoricalParam []ProjectScoreCategoryParam
type CreateProjectScoreCategoriesMinimumParam ¶
type CreateProjectScoreCategoriesMinimumParam []string
type CreateProjectScoreCategoriesNullableVariantParam ¶
type CreateProjectScoreCategoriesNullableVariantParam struct {
}
func (CreateProjectScoreCategoriesNullableVariantParam) MarshalJSON ¶
func (r CreateProjectScoreCategoriesNullableVariantParam) MarshalJSON() (data []byte, err error)
type CreateProjectScoreCategoriesUnionParam ¶
type CreateProjectScoreCategoriesUnionParam interface {
// contains filtered or unexported methods
}
For categorical-type project scores, the list of all categories
Satisfied by shared.CreateProjectScoreCategoriesCategoricalParam, shared.CreateProjectScoreCategoriesMinimumParam, shared.CreateProjectScoreCategoriesNullableVariantParam.
type CreateProjectScoreParam ¶
type CreateProjectScoreParam struct {
// Name of the project score
Name param.Field[string] `json:"name,required"`
// Unique identifier for the project that the project score belongs under
ProjectID param.Field[string] `json:"project_id,required" format:"uuid"`
// The type of the configured score
ScoreType param.Field[CreateProjectScoreScoreType] `json:"score_type,required"`
// For categorical-type project scores, the list of all categories
Categories param.Field[CreateProjectScoreCategoriesUnionParam] `json:"categories"`
// Textual description of the project score
Description param.Field[string] `json:"description"`
}
func (CreateProjectScoreParam) MarshalJSON ¶
func (r CreateProjectScoreParam) MarshalJSON() (data []byte, err error)
type CreateProjectScoreScoreType ¶
type CreateProjectScoreScoreType string
The type of the configured score
const ( CreateProjectScoreScoreTypeSlider CreateProjectScoreScoreType = "slider" CreateProjectScoreScoreTypeCategorical CreateProjectScoreScoreType = "categorical" CreateProjectScoreScoreTypeWeighted CreateProjectScoreScoreType = "weighted" CreateProjectScoreScoreTypeMinimum CreateProjectScoreScoreType = "minimum" )
func (CreateProjectScoreScoreType) IsKnown ¶
func (r CreateProjectScoreScoreType) IsKnown() bool
type CreateProjectTagParam ¶
type CreateProjectTagParam struct {
// Name of the project tag
Name param.Field[string] `json:"name,required"`
// Unique identifier for the project that the project tag belongs under
ProjectID param.Field[string] `json:"project_id,required" format:"uuid"`
// Color of the tag for the UI
Color param.Field[string] `json:"color"`
// Textual description of the project tag
Description param.Field[string] `json:"description"`
}
func (CreateProjectTagParam) MarshalJSON ¶
func (r CreateProjectTagParam) MarshalJSON() (data []byte, err error)
type CreatePromptParam ¶
type CreatePromptParam struct {
// Name of the prompt
Name param.Field[string] `json:"name,required"`
// Unique identifier for the project that the prompt belongs under
ProjectID param.Field[string] `json:"project_id,required" format:"uuid"`
// Unique identifier for the prompt
Slug param.Field[string] `json:"slug,required"`
// Textual description of the prompt
Description param.Field[string] `json:"description"`
// The prompt, model, and its parameters
PromptData param.Field[PromptDataParam] `json:"prompt_data"`
// A list of tags for the prompt
Tags param.Field[[]string] `json:"tags"`
}
func (CreatePromptParam) MarshalJSON ¶
func (r CreatePromptParam) MarshalJSON() (data []byte, err error)
type CreateRoleMemberPermissionParam ¶
type CreateRoleMemberPermissionParam 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 param.Field[CreateRoleMemberPermissionsPermission] `json:"permission,required"`
// The object type that the ACL applies to
RestrictObjectType param.Field[CreateRoleMemberPermissionsRestrictObjectType] `json:"restrict_object_type"`
}
func (CreateRoleMemberPermissionParam) MarshalJSON ¶
func (r CreateRoleMemberPermissionParam) MarshalJSON() (data []byte, err error)
type CreateRoleMemberPermissionsPermission ¶
type CreateRoleMemberPermissionsPermission 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 ( CreateRoleMemberPermissionsPermissionCreate CreateRoleMemberPermissionsPermission = "create" CreateRoleMemberPermissionsPermissionRead CreateRoleMemberPermissionsPermission = "read" CreateRoleMemberPermissionsPermissionUpdate CreateRoleMemberPermissionsPermission = "update" CreateRoleMemberPermissionsPermissionDelete CreateRoleMemberPermissionsPermission = "delete" CreateRoleMemberPermissionsPermissionCreateACLs CreateRoleMemberPermissionsPermission = "create_acls" CreateRoleMemberPermissionsPermissionReadACLs CreateRoleMemberPermissionsPermission = "read_acls" CreateRoleMemberPermissionsPermissionUpdateACLs CreateRoleMemberPermissionsPermission = "update_acls" CreateRoleMemberPermissionsPermissionDeleteACLs CreateRoleMemberPermissionsPermission = "delete_acls" )
func (CreateRoleMemberPermissionsPermission) IsKnown ¶
func (r CreateRoleMemberPermissionsPermission) IsKnown() bool
type CreateRoleMemberPermissionsRestrictObjectType ¶
type CreateRoleMemberPermissionsRestrictObjectType string
The object type that the ACL applies to
const ( CreateRoleMemberPermissionsRestrictObjectTypeOrganization CreateRoleMemberPermissionsRestrictObjectType = "organization" CreateRoleMemberPermissionsRestrictObjectTypeProject CreateRoleMemberPermissionsRestrictObjectType = "project" CreateRoleMemberPermissionsRestrictObjectTypeExperiment CreateRoleMemberPermissionsRestrictObjectType = "experiment" CreateRoleMemberPermissionsRestrictObjectTypeDataset CreateRoleMemberPermissionsRestrictObjectType = "dataset" CreateRoleMemberPermissionsRestrictObjectTypePrompt CreateRoleMemberPermissionsRestrictObjectType = "prompt" CreateRoleMemberPermissionsRestrictObjectTypePromptSession CreateRoleMemberPermissionsRestrictObjectType = "prompt_session" CreateRoleMemberPermissionsRestrictObjectTypeGroup CreateRoleMemberPermissionsRestrictObjectType = "group" CreateRoleMemberPermissionsRestrictObjectTypeRole CreateRoleMemberPermissionsRestrictObjectType = "role" CreateRoleMemberPermissionsRestrictObjectTypeOrgMember CreateRoleMemberPermissionsRestrictObjectType = "org_member" CreateRoleMemberPermissionsRestrictObjectTypeProjectLog CreateRoleMemberPermissionsRestrictObjectType = "project_log" CreateRoleMemberPermissionsRestrictObjectTypeOrgProject CreateRoleMemberPermissionsRestrictObjectType = "org_project" )
func (CreateRoleMemberPermissionsRestrictObjectType) IsKnown ¶
func (r CreateRoleMemberPermissionsRestrictObjectType) IsKnown() bool
type CreateRoleParam ¶
type CreateRoleParam struct {
// Name of the role
Name param.Field[string] `json:"name,required"`
// Textual description of the role
Description param.Field[string] `json:"description"`
// (permission, restrict_object_type) tuples which belong to this role
MemberPermissions param.Field[[]CreateRoleMemberPermissionParam] `json:"member_permissions"`
// 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 param.Field[[]string] `json:"member_roles" format:"uuid"`
// For nearly all users, this parameter should be unnecessary. But in the rare case
// that your API key belongs to multiple organizations, you may specify the name of
// the organization the role belongs in.
OrgName param.Field[string] `json:"org_name"`
}
func (CreateRoleParam) MarshalJSON ¶
func (r CreateRoleParam) MarshalJSON() (data []byte, err error)
type CreateViewObjectType ¶
type CreateViewObjectType string
The object type that the ACL applies to
const ( CreateViewObjectTypeOrganization CreateViewObjectType = "organization" CreateViewObjectTypeProject CreateViewObjectType = "project" CreateViewObjectTypeExperiment CreateViewObjectType = "experiment" CreateViewObjectTypeDataset CreateViewObjectType = "dataset" CreateViewObjectTypePrompt CreateViewObjectType = "prompt" CreateViewObjectTypePromptSession CreateViewObjectType = "prompt_session" CreateViewObjectTypeGroup CreateViewObjectType = "group" CreateViewObjectTypeRole CreateViewObjectType = "role" CreateViewObjectTypeOrgMember CreateViewObjectType = "org_member" CreateViewObjectTypeProjectLog CreateViewObjectType = "project_log" CreateViewObjectTypeOrgProject CreateViewObjectType = "org_project" )
func (CreateViewObjectType) IsKnown ¶
func (r CreateViewObjectType) IsKnown() bool
type CreateViewParam ¶
type CreateViewParam struct {
// Name of the view
Name param.Field[string] `json:"name,required"`
// The id of the object the view applies to
ObjectID param.Field[string] `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType param.Field[CreateViewObjectType] `json:"object_type,required"`
// Type of table that the view corresponds to.
ViewType param.Field[CreateViewViewType] `json:"view_type,required"`
// Date of role deletion, or null if the role is still active
DeletedAt param.Field[time.Time] `json:"deleted_at" format:"date-time"`
// Options for the view in the app
Options param.Field[ViewOptionsParam] `json:"options"`
// Identifies the user who created the view
UserID param.Field[string] `json:"user_id" format:"uuid"`
// The view definition
ViewData param.Field[ViewDataParam] `json:"view_data"`
}
func (CreateViewParam) MarshalJSON ¶
func (r CreateViewParam) MarshalJSON() (data []byte, err error)
type CreateViewViewType ¶
type CreateViewViewType string
Type of table that the view corresponds to.
const ( CreateViewViewTypeProjects CreateViewViewType = "projects" CreateViewViewTypeLogs CreateViewViewType = "logs" CreateViewViewTypeExperiments CreateViewViewType = "experiments" CreateViewViewTypeDatasets CreateViewViewType = "datasets" CreateViewViewTypePrompts CreateViewViewType = "prompts" CreateViewViewTypePlaygrounds CreateViewViewType = "playgrounds" CreateViewViewTypeExperiment CreateViewViewType = "experiment" CreateViewViewTypeDataset CreateViewViewType = "dataset" )
func (CreateViewViewType) IsKnown ¶
func (r CreateViewViewType) IsKnown() bool
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"`
// 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"`
// Unique identifier for the project that the dataset belongs under
ProjectID string `json:"project_id,nullable" format:"uuid"`
// 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"`
// The `span_id` of the root of the trace this dataset event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different dataset events together as part of a
// full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected interface{} `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input 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 map[string]interface{} `json:"metadata,nullable"`
// Unique identifier for the project that the dataset belongs under
ProjectID string `json:"project_id,nullable" format:"uuid"`
// 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 DeleteViewObjectType ¶
type DeleteViewObjectType string
The object type that the ACL applies to
const ( DeleteViewObjectTypeOrganization DeleteViewObjectType = "organization" DeleteViewObjectTypeProject DeleteViewObjectType = "project" DeleteViewObjectTypeExperiment DeleteViewObjectType = "experiment" DeleteViewObjectTypeDataset DeleteViewObjectType = "dataset" DeleteViewObjectTypePrompt DeleteViewObjectType = "prompt" DeleteViewObjectTypePromptSession DeleteViewObjectType = "prompt_session" DeleteViewObjectTypeGroup DeleteViewObjectType = "group" DeleteViewObjectTypeRole DeleteViewObjectType = "role" DeleteViewObjectTypeOrgMember DeleteViewObjectType = "org_member" DeleteViewObjectTypeProjectLog DeleteViewObjectType = "project_log" DeleteViewObjectTypeOrgProject DeleteViewObjectType = "org_project" )
func (DeleteViewObjectType) IsKnown ¶
func (r DeleteViewObjectType) IsKnown() bool
type DeleteViewParam ¶
type DeleteViewParam struct {
// The id of the object the view applies to
ObjectID param.Field[string] `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType param.Field[DeleteViewObjectType] `json:"object_type,required"`
}
func (DeleteViewParam) MarshalJSON ¶
func (r DeleteViewParam) MarshalJSON() (data []byte, err error)
type Experiment ¶
type Experiment struct {
// Unique identifier for the experiment
ID string `json:"id,required" format:"uuid"`
// Name of the experiment. Within a project, experiment names are unique
Name string `json:"name,required"`
// Unique identifier for the project that the experiment belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// Whether or not the experiment is public. Public experiments can be viewed by
// anybody inside or outside the organization
Public bool `json:"public,required"`
// Id of default base experiment to compare against when viewing this experiment
BaseExpID string `json:"base_exp_id,nullable" format:"uuid"`
// Commit, taken directly from `repo_info.commit`
Commit string `json:"commit,nullable"`
// Date of experiment creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Identifier of the linked dataset, or null if the experiment is not linked to a
// dataset
DatasetID string `json:"dataset_id,nullable" format:"uuid"`
// Version number of the linked dataset the experiment was run against. This can be
// used to reproduce the experiment after the dataset has been modified.
DatasetVersion string `json:"dataset_version,nullable"`
// Date of experiment deletion, or null if the experiment is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the experiment
Description string `json:"description,nullable"`
// User-controlled metadata about the experiment
Metadata map[string]interface{} `json:"metadata,nullable"`
// Metadata about the state of the repo when the experiment was created
RepoInfo RepoInfo `json:"repo_info,nullable"`
// Identifies the user who created the experiment
UserID string `json:"user_id,nullable" format:"uuid"`
JSON experimentJSON `json:"-"`
}
func (*Experiment) UnmarshalJSON ¶
func (r *Experiment) UnmarshalJSON(data []byte) (err error)
type ExperimentEvent ¶
type ExperimentEvent struct {
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the experiment (see the
// `version` parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the experiment event was created
Created time.Time `json:"created,required" format:"date-time"`
// Unique identifier for the experiment
ExperimentID string `json:"experiment_id,required" format:"uuid"`
// Unique identifier for the project that the experiment belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// The `span_id` of the root of the trace this experiment event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different experiment events together as part of
// a full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context ExperimentEventContext `json:"context,nullable"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID string `json:"dataset_record_id,nullable"`
// The error that occurred, if any.
Error interface{} `json:"error"`
// 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"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata map[string]interface{} `json:"metadata,nullable"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics ExperimentEventMetrics `json:"metrics,nullable"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output interface{} `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores map[string]float64 `json:"scores,nullable"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes ExperimentEventSpanAttributes `json:"span_attributes,nullable"`
// An array of the parent `span_ids` of this experiment event. This should be empty
// for the root span of a trace, and should most often contain just one parent
// element for subspans
SpanParents []string `json:"span_parents,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
JSON experimentEventJSON `json:"-"`
}
func (*ExperimentEvent) UnmarshalJSON ¶
func (r *ExperimentEvent) UnmarshalJSON(data []byte) (err error)
type ExperimentEventContext ¶
type ExperimentEventContext struct {
// Name of the file in code where the experiment event was created
CallerFilename string `json:"caller_filename,nullable"`
// The function in code which created the experiment event
CallerFunctionname string `json:"caller_functionname,nullable"`
// Line of code where the experiment event was created
CallerLineno int64 `json:"caller_lineno,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON experimentEventContextJSON `json:"-"`
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (*ExperimentEventContext) UnmarshalJSON ¶
func (r *ExperimentEventContext) UnmarshalJSON(data []byte) (err error)
type ExperimentEventMetrics ¶
type ExperimentEventMetrics struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens int64 `json:"completion_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End float64 `json:"end,nullable"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens int64 `json:"prompt_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start float64 `json:"start,nullable"`
// The total number of tokens in the input and output of the experiment event.
Tokens int64 `json:"tokens,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON experimentEventMetricsJSON `json:"-"`
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (*ExperimentEventMetrics) UnmarshalJSON ¶
func (r *ExperimentEventMetrics) UnmarshalJSON(data []byte) (err error)
type ExperimentEventSpanAttributes ¶
type ExperimentEventSpanAttributes struct {
// Name of the span, for display purposes only
Name string `json:"name,nullable"`
// Type of the span, for display purposes only
Type ExperimentEventSpanAttributesType `json:"type,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON experimentEventSpanAttributesJSON `json:"-"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (*ExperimentEventSpanAttributes) UnmarshalJSON ¶
func (r *ExperimentEventSpanAttributes) UnmarshalJSON(data []byte) (err error)
type ExperimentEventSpanAttributesType ¶
type ExperimentEventSpanAttributesType string
Type of the span, for display purposes only
const ( ExperimentEventSpanAttributesTypeLlm ExperimentEventSpanAttributesType = "llm" ExperimentEventSpanAttributesTypeScore ExperimentEventSpanAttributesType = "score" ExperimentEventSpanAttributesTypeFunction ExperimentEventSpanAttributesType = "function" ExperimentEventSpanAttributesTypeEval ExperimentEventSpanAttributesType = "eval" ExperimentEventSpanAttributesTypeTask ExperimentEventSpanAttributesType = "task" ExperimentEventSpanAttributesTypeTool ExperimentEventSpanAttributesType = "tool" )
func (ExperimentEventSpanAttributesType) IsKnown ¶
func (r ExperimentEventSpanAttributesType) IsKnown() bool
type FeedbackDatasetEventRequestParam ¶
type FeedbackDatasetEventRequestParam struct {
// A list of dataset feedback items
Feedback param.Field[[]FeedbackDatasetItemParam] `json:"feedback,required"`
}
func (FeedbackDatasetEventRequestParam) MarshalJSON ¶
func (r FeedbackDatasetEventRequestParam) MarshalJSON() (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.
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
Source param.Field[FeedbackDatasetItemSource] `json:"source"`
}
func (FeedbackDatasetItemParam) MarshalJSON ¶
func (r FeedbackDatasetItemParam) MarshalJSON() (data []byte, err error)
type FeedbackDatasetItemSource ¶
type FeedbackDatasetItemSource string
The source of the feedback. Must be one of "external" (default), "app", or "api"
const ( FeedbackDatasetItemSourceApp FeedbackDatasetItemSource = "app" FeedbackDatasetItemSourceAPI FeedbackDatasetItemSource = "api" FeedbackDatasetItemSourceExternal FeedbackDatasetItemSource = "external" )
func (FeedbackDatasetItemSource) IsKnown ¶
func (r FeedbackDatasetItemSource) IsKnown() bool
type FeedbackExperimentEventRequestParam ¶
type FeedbackExperimentEventRequestParam struct {
// A list of experiment feedback items
Feedback param.Field[[]FeedbackExperimentItemParam] `json:"feedback,required"`
}
func (FeedbackExperimentEventRequestParam) MarshalJSON ¶
func (r FeedbackExperimentEventRequestParam) MarshalJSON() (data []byte, err error)
type FeedbackExperimentItemParam ¶
type FeedbackExperimentItemParam struct {
// The id of the experiment event to log feedback for. This is the row `id`
// returned by `POST /v1/experiment/{experiment_id}/insert`
ID param.Field[string] `json:"id,required"`
// An optional comment string to log about the experiment event
Comment param.Field[string] `json:"comment"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not
Expected param.Field[interface{}] `json:"expected"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI.
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A dictionary of numeric values (between 0 and 1) to log. These scores will be
// merged into the existing scores for the experiment event
Scores param.Field[map[string]float64] `json:"scores"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
Source param.Field[FeedbackExperimentItemSource] `json:"source"`
}
func (FeedbackExperimentItemParam) MarshalJSON ¶
func (r FeedbackExperimentItemParam) MarshalJSON() (data []byte, err error)
type FeedbackExperimentItemSource ¶
type FeedbackExperimentItemSource string
The source of the feedback. Must be one of "external" (default), "app", or "api"
const ( FeedbackExperimentItemSourceApp FeedbackExperimentItemSource = "app" FeedbackExperimentItemSourceAPI FeedbackExperimentItemSource = "api" FeedbackExperimentItemSourceExternal FeedbackExperimentItemSource = "external" )
func (FeedbackExperimentItemSource) IsKnown ¶
func (r FeedbackExperimentItemSource) IsKnown() bool
type FeedbackProjectLogsEventRequestParam ¶
type FeedbackProjectLogsEventRequestParam struct {
// A list of project logs feedback items
Feedback param.Field[[]FeedbackProjectLogsItemParam] `json:"feedback,required"`
}
func (FeedbackProjectLogsEventRequestParam) MarshalJSON ¶
func (r FeedbackProjectLogsEventRequestParam) MarshalJSON() (data []byte, err error)
type FeedbackProjectLogsItemParam ¶
type FeedbackProjectLogsItemParam struct {
// The id of the project logs event to log feedback for. This is the row `id`
// returned by `POST /v1/project_logs/{project_id}/insert`
ID param.Field[string] `json:"id,required"`
// An optional comment string to log about the project logs event
Comment param.Field[string] `json:"comment"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not
Expected param.Field[interface{}] `json:"expected"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI.
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A dictionary of numeric values (between 0 and 1) to log. These scores will be
// merged into the existing scores for the project logs event
Scores param.Field[map[string]float64] `json:"scores"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
Source param.Field[FeedbackProjectLogsItemSource] `json:"source"`
}
func (FeedbackProjectLogsItemParam) MarshalJSON ¶
func (r FeedbackProjectLogsItemParam) MarshalJSON() (data []byte, err error)
type FeedbackProjectLogsItemSource ¶
type FeedbackProjectLogsItemSource string
The source of the feedback. Must be one of "external" (default), "app", or "api"
const ( FeedbackProjectLogsItemSourceApp FeedbackProjectLogsItemSource = "app" FeedbackProjectLogsItemSourceAPI FeedbackProjectLogsItemSource = "api" FeedbackProjectLogsItemSourceExternal FeedbackProjectLogsItemSource = "external" )
func (FeedbackProjectLogsItemSource) IsKnown ¶
func (r FeedbackProjectLogsItemSource) IsKnown() bool
type 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 FetchEventsRequestParam ¶
type FetchEventsRequestParam struct {
// An opaque string to be used as a cursor for the next page of results, in order
// from latest to earliest.
//
// The string can be obtained directly from the `cursor` property of the previous
// fetch query
Cursor param.Field[string] `json:"cursor"`
// A list of filters on the events to fetch. Currently, only path-lookup type
// filters are supported, but we may add more in the future
Filters param.Field[[]PathLookupFilterParam] `json:"filters"`
// limit the number of traces fetched
//
// Fetch queries may be paginated if the total result size is expected to be large
// (e.g. project_logs which accumulate over a long time). Note that fetch queries
// only support pagination in descending time order (from latest to earliest
// `_xact_id`. Furthermore, later pages may return rows which showed up in earlier
// pages, except with an earlier `_xact_id`. This happens because pagination occurs
// over the whole version history of the event log. You will most likely want to
// exclude any such duplicate, outdated rows (by `id`) from your combined result
// set.
//
// The `limit` parameter controls the number of full traces to return. So you may
// end up with more individual rows than the specified limit if you are fetching
// events containing traces.
Limit param.Field[int64] `json:"limit"`
// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in
// favor of the explicit 'cursor' returned by object fetch requests. Please prefer
// the 'cursor' argument going forwards.
//
// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
//
// Since a paginated fetch query returns results in order from latest to earliest,
// the cursor for the next page can be found as the row with the minimum (earliest)
// value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit`
// for an overview of paginating fetch queries.
MaxRootSpanID param.Field[string] `json:"max_root_span_id"`
// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in
// favor of the explicit 'cursor' returned by object fetch requests. Please prefer
// the 'cursor' argument going forwards.
//
// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
//
// Since a paginated fetch query returns results in order from latest to earliest,
// the cursor for the next page can be found as the row with the minimum (earliest)
// value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit`
// for an overview of paginating fetch queries.
MaxXactID param.Field[string] `json:"max_xact_id"`
// Retrieve a snapshot of events from a past time
//
// The version id is essentially a filter on the latest event transaction id. You
// can use the `max_xact_id` returned by a past fetch as the version to reproduce
// that exact fetch.
Version param.Field[string] `json:"version"`
}
func (FetchEventsRequestParam) MarshalJSON ¶
func (r FetchEventsRequestParam) MarshalJSON() (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"`
// 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 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,required"`
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,required"`
Location FunctionFunctionDataCodeDataLocation `json:"location,required"`
RuntimeContext FunctionFunctionDataCodeDataRuntimeContext `json:"runtime_context,required"`
JSON functionFunctionDataCodeDataJSON `json:"-"`
}
func (*FunctionFunctionDataCodeData) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeData) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataLocation ¶
type FunctionFunctionDataCodeDataLocation struct {
EvalName string `json:"eval_name,required"`
Position FunctionFunctionDataCodeDataLocationPositionUnion `json:"position,required"`
Type FunctionFunctionDataCodeDataLocationType `json:"type,required"`
JSON functionFunctionDataCodeDataLocationJSON `json:"-"`
}
func (*FunctionFunctionDataCodeDataLocation) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeDataLocation) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataLocationPositionScore ¶
type FunctionFunctionDataCodeDataLocationPositionScore struct {
Score float64 `json:"score,required"`
JSON functionFunctionDataCodeDataLocationPositionScoreJSON `json:"-"`
}
func (*FunctionFunctionDataCodeDataLocationPositionScore) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeDataLocationPositionScore) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataLocationPositionTask ¶
type FunctionFunctionDataCodeDataLocationPositionTask string
const (
FunctionFunctionDataCodeDataLocationPositionTaskTask FunctionFunctionDataCodeDataLocationPositionTask = "task"
)
func (FunctionFunctionDataCodeDataLocationPositionTask) IsKnown ¶
func (r FunctionFunctionDataCodeDataLocationPositionTask) IsKnown() bool
type FunctionFunctionDataCodeDataLocationPositionUnion ¶
type FunctionFunctionDataCodeDataLocationPositionUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.FunctionFunctionDataCodeDataLocationPositionTask or shared.FunctionFunctionDataCodeDataLocationPositionScore.
type FunctionFunctionDataCodeDataLocationType ¶
type FunctionFunctionDataCodeDataLocationType string
const (
FunctionFunctionDataCodeDataLocationTypeExperiment FunctionFunctionDataCodeDataLocationType = "experiment"
)
func (FunctionFunctionDataCodeDataLocationType) IsKnown ¶
func (r FunctionFunctionDataCodeDataLocationType) IsKnown() bool
type FunctionFunctionDataCodeDataRuntimeContext ¶
type FunctionFunctionDataCodeDataRuntimeContext struct {
Runtime FunctionFunctionDataCodeDataRuntimeContextRuntime `json:"runtime,required"`
Version string `json:"version,required"`
JSON functionFunctionDataCodeDataRuntimeContextJSON `json:"-"`
}
func (*FunctionFunctionDataCodeDataRuntimeContext) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeDataRuntimeContext) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataRuntimeContextRuntime ¶
type FunctionFunctionDataCodeDataRuntimeContextRuntime string
const (
FunctionFunctionDataCodeDataRuntimeContextRuntimeNode FunctionFunctionDataCodeDataRuntimeContextRuntime = "node"
)
func (FunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown ¶
func (r FunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown() bool
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 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 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 InsertDatasetEventMergeParam ¶
type InsertDatasetEventMergeParam struct {
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge,required"`
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID param.Field[string] `json:"id"`
// The `_merge_paths` field allows controlling the depth of the merge. It can only
// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
// where each path is a list of field names. The deep merge will not descend below
// any of the specified merge paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths param.Field[[][]string] `json:"_merge_paths"`
// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
// will not show up in subsequent fetches for this dataset
ObjectDelete param.Field[bool] `json:"_object_delete"`
// The timestamp the dataset event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected param.Field[interface{}] `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertDatasetEventMergeParam) ImplementsSharedInsertDatasetEventRequestEventsUnionParam ¶
func (r InsertDatasetEventMergeParam) ImplementsSharedInsertDatasetEventRequestEventsUnionParam()
func (InsertDatasetEventMergeParam) MarshalJSON ¶
func (r InsertDatasetEventMergeParam) MarshalJSON() (data []byte, err error)
type InsertDatasetEventReplaceParam ¶
type InsertDatasetEventReplaceParam struct {
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID param.Field[string] `json:"id"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
// will not show up in subsequent fetches for this dataset
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
// The timestamp the dataset event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected param.Field[interface{}] `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertDatasetEventReplaceParam) ImplementsSharedInsertDatasetEventRequestEventsUnionParam ¶
func (r InsertDatasetEventReplaceParam) ImplementsSharedInsertDatasetEventRequestEventsUnionParam()
func (InsertDatasetEventReplaceParam) MarshalJSON ¶
func (r InsertDatasetEventReplaceParam) MarshalJSON() (data []byte, err error)
type InsertDatasetEventRequestEventParam ¶
type InsertDatasetEventRequestEventParam struct {
Input param.Field[interface{}] `json:"input,required"`
Expected param.Field[interface{}] `json:"expected,required"`
Metadata param.Field[interface{}] `json:"metadata,required"`
Tags param.Field[interface{}] `json:"tags,required"`
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID param.Field[string] `json:"id"`
// The timestamp the dataset event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
// will not show up in subsequent fetches for this dataset
ObjectDelete param.Field[bool] `json:"_object_delete"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
MergePaths param.Field[interface{}] `json:"_merge_paths,required"`
}
A dataset event
func (InsertDatasetEventRequestEventParam) ImplementsSharedInsertDatasetEventRequestEventsUnionParam ¶
func (r InsertDatasetEventRequestEventParam) ImplementsSharedInsertDatasetEventRequestEventsUnionParam()
func (InsertDatasetEventRequestEventParam) MarshalJSON ¶
func (r InsertDatasetEventRequestEventParam) MarshalJSON() (data []byte, err error)
type InsertDatasetEventRequestEventsUnionParam ¶
type InsertDatasetEventRequestEventsUnionParam interface {
}
A dataset event
Satisfied by shared.InsertDatasetEventReplaceParam, shared.InsertDatasetEventMergeParam, InsertDatasetEventRequestEventParam.
type InsertDatasetEventRequestParam ¶
type InsertDatasetEventRequestParam struct {
// A list of dataset events to insert
Events param.Field[[]InsertDatasetEventRequestEventsUnionParam] `json:"events,required"`
}
func (InsertDatasetEventRequestParam) MarshalJSON ¶
func (r InsertDatasetEventRequestParam) MarshalJSON() (data []byte, err error)
type InsertEventsResponse ¶
type InsertEventsResponse struct {
// The ids of all rows that were inserted, aligning one-to-one with the rows
// provided as input
RowIDs []string `json:"row_ids,required"`
JSON insertEventsResponseJSON `json:"-"`
}
func (*InsertEventsResponse) UnmarshalJSON ¶
func (r *InsertEventsResponse) UnmarshalJSON(data []byte) (err error)
type InsertExperimentEventMergeContextParam ¶
type InsertExperimentEventMergeContextParam struct {
// Name of the file in code where the experiment event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the experiment event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the experiment event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (InsertExperimentEventMergeContextParam) MarshalJSON ¶
func (r InsertExperimentEventMergeContextParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeMetricsParam ¶
type InsertExperimentEventMergeMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the experiment event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (InsertExperimentEventMergeMetricsParam) MarshalJSON ¶
func (r InsertExperimentEventMergeMetricsParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeParam ¶
type InsertExperimentEventMergeParam struct {
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge,required"`
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_merge_paths` field allows controlling the depth of the merge. It can only
// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
// where each path is a list of field names. The deep merge will not descend below
// any of the specified merge paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths param.Field[[][]string] `json:"_merge_paths"`
// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
// will not show up in subsequent fetches for this experiment
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context param.Field[InsertExperimentEventMergeContextParam] `json:"context"`
// The timestamp the experiment event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID param.Field[string] `json:"dataset_record_id"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate your experiments while digging into analyses.
// However, we may later use these values to re-score outputs or fine-tune your
// models
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a test case (an arbitrary, JSON serializable
// object). Later on, Braintrust will use the `input` to know whether two test
// cases are the same between experiments, so they should not contain
// experiment-specific state. A simple rule of thumb is that if you run the same
// experiment twice, the `input` should be identical
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics param.Field[InsertExperimentEventMergeMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertExperimentEventMergeSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertExperimentEventMergeParam) ImplementsSharedInsertExperimentEventRequestEventsUnionParam ¶
func (r InsertExperimentEventMergeParam) ImplementsSharedInsertExperimentEventRequestEventsUnionParam()
func (InsertExperimentEventMergeParam) MarshalJSON ¶
func (r InsertExperimentEventMergeParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeSpanAttributesParam ¶
type InsertExperimentEventMergeSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertExperimentEventMergeSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertExperimentEventMergeSpanAttributesParam) MarshalJSON ¶
func (r InsertExperimentEventMergeSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeSpanAttributesType ¶
type InsertExperimentEventMergeSpanAttributesType string
Type of the span, for display purposes only
const ( InsertExperimentEventMergeSpanAttributesTypeLlm InsertExperimentEventMergeSpanAttributesType = "llm" InsertExperimentEventMergeSpanAttributesTypeScore InsertExperimentEventMergeSpanAttributesType = "score" InsertExperimentEventMergeSpanAttributesTypeFunction InsertExperimentEventMergeSpanAttributesType = "function" InsertExperimentEventMergeSpanAttributesTypeEval InsertExperimentEventMergeSpanAttributesType = "eval" InsertExperimentEventMergeSpanAttributesTypeTask InsertExperimentEventMergeSpanAttributesType = "task" InsertExperimentEventMergeSpanAttributesTypeTool InsertExperimentEventMergeSpanAttributesType = "tool" )
func (InsertExperimentEventMergeSpanAttributesType) IsKnown ¶
func (r InsertExperimentEventMergeSpanAttributesType) IsKnown() bool
type InsertExperimentEventReplaceContextParam ¶
type InsertExperimentEventReplaceContextParam struct {
// Name of the file in code where the experiment event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the experiment event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the experiment event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (InsertExperimentEventReplaceContextParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceContextParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceMetricsParam ¶
type InsertExperimentEventReplaceMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the experiment event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (InsertExperimentEventReplaceMetricsParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceMetricsParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceParam ¶
type InsertExperimentEventReplaceParam struct {
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
// will not show up in subsequent fetches for this experiment
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context param.Field[InsertExperimentEventReplaceContextParam] `json:"context"`
// The timestamp the experiment event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID param.Field[string] `json:"dataset_record_id"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate your experiments while digging into analyses.
// However, we may later use these values to re-score outputs or fine-tune your
// models
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a test case (an arbitrary, JSON serializable
// object). Later on, Braintrust will use the `input` to know whether two test
// cases are the same between experiments, so they should not contain
// experiment-specific state. A simple rule of thumb is that if you run the same
// experiment twice, the `input` should be identical
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics param.Field[InsertExperimentEventReplaceMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertExperimentEventReplaceSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertExperimentEventReplaceParam) ImplementsSharedInsertExperimentEventRequestEventsUnionParam ¶
func (r InsertExperimentEventReplaceParam) ImplementsSharedInsertExperimentEventRequestEventsUnionParam()
func (InsertExperimentEventReplaceParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceSpanAttributesParam ¶
type InsertExperimentEventReplaceSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertExperimentEventReplaceSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertExperimentEventReplaceSpanAttributesParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceSpanAttributesType ¶
type InsertExperimentEventReplaceSpanAttributesType string
Type of the span, for display purposes only
const ( InsertExperimentEventReplaceSpanAttributesTypeLlm InsertExperimentEventReplaceSpanAttributesType = "llm" InsertExperimentEventReplaceSpanAttributesTypeScore InsertExperimentEventReplaceSpanAttributesType = "score" InsertExperimentEventReplaceSpanAttributesTypeFunction InsertExperimentEventReplaceSpanAttributesType = "function" InsertExperimentEventReplaceSpanAttributesTypeEval InsertExperimentEventReplaceSpanAttributesType = "eval" InsertExperimentEventReplaceSpanAttributesTypeTask InsertExperimentEventReplaceSpanAttributesType = "task" InsertExperimentEventReplaceSpanAttributesTypeTool InsertExperimentEventReplaceSpanAttributesType = "tool" )
func (InsertExperimentEventReplaceSpanAttributesType) IsKnown ¶
func (r InsertExperimentEventReplaceSpanAttributesType) IsKnown() bool
type InsertExperimentEventRequestEventParam ¶
type InsertExperimentEventRequestEventParam struct {
Input param.Field[interface{}] `json:"input,required"`
Output param.Field[interface{}] `json:"output,required"`
Expected param.Field[interface{}] `json:"expected,required"`
Error param.Field[interface{}] `json:"error,required"`
Scores param.Field[interface{}] `json:"scores,required"`
Metadata param.Field[interface{}] `json:"metadata,required"`
Tags param.Field[interface{}] `json:"tags,required"`
Metrics param.Field[interface{}] `json:"metrics,required"`
Context param.Field[interface{}] `json:"context,required"`
SpanAttributes param.Field[interface{}] `json:"span_attributes,required"`
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID param.Field[string] `json:"dataset_record_id"`
// The timestamp the experiment event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// 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"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
MergePaths param.Field[interface{}] `json:"_merge_paths,required"`
}
An experiment event
func (InsertExperimentEventRequestEventParam) ImplementsSharedInsertExperimentEventRequestEventsUnionParam ¶
func (r InsertExperimentEventRequestEventParam) ImplementsSharedInsertExperimentEventRequestEventsUnionParam()
func (InsertExperimentEventRequestEventParam) MarshalJSON ¶
func (r InsertExperimentEventRequestEventParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventRequestEventsUnionParam ¶
type InsertExperimentEventRequestEventsUnionParam interface {
}
An experiment event
Satisfied by shared.InsertExperimentEventReplaceParam, shared.InsertExperimentEventMergeParam, InsertExperimentEventRequestEventParam.
type InsertExperimentEventRequestParam ¶
type InsertExperimentEventRequestParam struct {
// A list of experiment events to insert
Events param.Field[[]InsertExperimentEventRequestEventsUnionParam] `json:"events,required"`
}
func (InsertExperimentEventRequestParam) MarshalJSON ¶
func (r InsertExperimentEventRequestParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeContextParam ¶
type InsertProjectLogsEventMergeContextParam struct {
// Name of the file in code where the project logs event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the project logs event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the project logs event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (InsertProjectLogsEventMergeContextParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeContextParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeMetricsParam ¶
type InsertProjectLogsEventMergeMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the project logs event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (InsertProjectLogsEventMergeMetricsParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeMetricsParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeParam ¶
type InsertProjectLogsEventMergeParam struct {
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge,required"`
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_merge_paths` field allows controlling the depth of the merge. It can only
// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
// where each path is a list of field names. The deep merge will not descend below
// any of the specified merge paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths param.Field[[][]string] `json:"_merge_paths"`
// Pass `_object_delete=true` to mark the project logs event deleted. Deleted
// events will not show up in subsequent fetches for this project logs
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context param.Field[InsertProjectLogsEventMergeContextParam] `json:"context"`
// The timestamp the project logs event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate while digging into analyses. However, we may
// later use these values to re-score outputs or fine-tune your models.
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics param.Field[InsertProjectLogsEventMergeMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertProjectLogsEventMergeSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertProjectLogsEventMergeParam) ImplementsSharedInsertProjectLogsEventRequestEventsUnionParam ¶
func (r InsertProjectLogsEventMergeParam) ImplementsSharedInsertProjectLogsEventRequestEventsUnionParam()
func (InsertProjectLogsEventMergeParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeSpanAttributesParam ¶
type InsertProjectLogsEventMergeSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertProjectLogsEventMergeSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertProjectLogsEventMergeSpanAttributesParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeSpanAttributesType ¶
type InsertProjectLogsEventMergeSpanAttributesType string
Type of the span, for display purposes only
const ( InsertProjectLogsEventMergeSpanAttributesTypeLlm InsertProjectLogsEventMergeSpanAttributesType = "llm" InsertProjectLogsEventMergeSpanAttributesTypeScore InsertProjectLogsEventMergeSpanAttributesType = "score" InsertProjectLogsEventMergeSpanAttributesTypeFunction InsertProjectLogsEventMergeSpanAttributesType = "function" InsertProjectLogsEventMergeSpanAttributesTypeEval InsertProjectLogsEventMergeSpanAttributesType = "eval" InsertProjectLogsEventMergeSpanAttributesTypeTask InsertProjectLogsEventMergeSpanAttributesType = "task" InsertProjectLogsEventMergeSpanAttributesTypeTool InsertProjectLogsEventMergeSpanAttributesType = "tool" )
func (InsertProjectLogsEventMergeSpanAttributesType) IsKnown ¶
func (r InsertProjectLogsEventMergeSpanAttributesType) IsKnown() bool
type InsertProjectLogsEventReplaceContextParam ¶
type InsertProjectLogsEventReplaceContextParam struct {
// Name of the file in code where the project logs event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the project logs event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the project logs event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (InsertProjectLogsEventReplaceContextParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceContextParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceMetricsParam ¶
type InsertProjectLogsEventReplaceMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the project logs event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (InsertProjectLogsEventReplaceMetricsParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceMetricsParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceParam ¶
type InsertProjectLogsEventReplaceParam struct {
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Pass `_object_delete=true` to mark the project logs event deleted. Deleted
// events will not show up in subsequent fetches for this project logs
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context param.Field[InsertProjectLogsEventReplaceContextParam] `json:"context"`
// The timestamp the project logs event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate while digging into analyses. However, we may
// later use these values to re-score outputs or fine-tune your models.
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics param.Field[InsertProjectLogsEventReplaceMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertProjectLogsEventReplaceSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertProjectLogsEventReplaceParam) ImplementsSharedInsertProjectLogsEventRequestEventsUnionParam ¶
func (r InsertProjectLogsEventReplaceParam) ImplementsSharedInsertProjectLogsEventRequestEventsUnionParam()
func (InsertProjectLogsEventReplaceParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceSpanAttributesParam ¶
type InsertProjectLogsEventReplaceSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertProjectLogsEventReplaceSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertProjectLogsEventReplaceSpanAttributesParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceSpanAttributesType ¶
type InsertProjectLogsEventReplaceSpanAttributesType string
Type of the span, for display purposes only
const ( InsertProjectLogsEventReplaceSpanAttributesTypeLlm InsertProjectLogsEventReplaceSpanAttributesType = "llm" InsertProjectLogsEventReplaceSpanAttributesTypeScore InsertProjectLogsEventReplaceSpanAttributesType = "score" InsertProjectLogsEventReplaceSpanAttributesTypeFunction InsertProjectLogsEventReplaceSpanAttributesType = "function" InsertProjectLogsEventReplaceSpanAttributesTypeEval InsertProjectLogsEventReplaceSpanAttributesType = "eval" InsertProjectLogsEventReplaceSpanAttributesTypeTask InsertProjectLogsEventReplaceSpanAttributesType = "task" InsertProjectLogsEventReplaceSpanAttributesTypeTool InsertProjectLogsEventReplaceSpanAttributesType = "tool" )
func (InsertProjectLogsEventReplaceSpanAttributesType) IsKnown ¶
func (r InsertProjectLogsEventReplaceSpanAttributesType) IsKnown() bool
type InsertProjectLogsEventRequestEventParam ¶
type InsertProjectLogsEventRequestEventParam struct {
Input param.Field[interface{}] `json:"input,required"`
Output param.Field[interface{}] `json:"output,required"`
Expected param.Field[interface{}] `json:"expected,required"`
Error param.Field[interface{}] `json:"error,required"`
Scores param.Field[interface{}] `json:"scores,required"`
Metadata param.Field[interface{}] `json:"metadata,required"`
Tags param.Field[interface{}] `json:"tags,required"`
Metrics param.Field[interface{}] `json:"metrics,required"`
Context param.Field[interface{}] `json:"context,required"`
SpanAttributes param.Field[interface{}] `json:"span_attributes,required"`
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The timestamp the project logs event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// 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"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
MergePaths param.Field[interface{}] `json:"_merge_paths,required"`
}
A project logs event
func (InsertProjectLogsEventRequestEventParam) ImplementsSharedInsertProjectLogsEventRequestEventsUnionParam ¶
func (r InsertProjectLogsEventRequestEventParam) ImplementsSharedInsertProjectLogsEventRequestEventsUnionParam()
func (InsertProjectLogsEventRequestEventParam) MarshalJSON ¶
func (r InsertProjectLogsEventRequestEventParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventRequestEventsUnionParam ¶
type InsertProjectLogsEventRequestEventsUnionParam interface {
}
A project logs event
Satisfied by shared.InsertProjectLogsEventReplaceParam, shared.InsertProjectLogsEventMergeParam, InsertProjectLogsEventRequestEventParam.
type InsertProjectLogsEventRequestParam ¶
type InsertProjectLogsEventRequestParam struct {
// A list of project logs events to insert
Events param.Field[[]InsertProjectLogsEventRequestEventsUnionParam] `json:"events,required"`
}
func (InsertProjectLogsEventRequestParam) MarshalJSON ¶
func (r InsertProjectLogsEventRequestParam) 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 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 PatchDatasetParam ¶
type PatchDatasetParam struct {
// Textual description of the dataset
Description param.Field[string] `json:"description"`
// User-controlled metadata about the dataset
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Name of the dataset. Within a project, dataset names are unique
Name param.Field[string] `json:"name"`
}
func (PatchDatasetParam) MarshalJSON ¶
func (r PatchDatasetParam) MarshalJSON() (data []byte, err error)
type PatchExperimentParam ¶
type PatchExperimentParam struct {
// Id of default base experiment to compare against when viewing this experiment
BaseExpID param.Field[string] `json:"base_exp_id" format:"uuid"`
// Identifier of the linked dataset, or null if the experiment is not linked to a
// dataset
DatasetID param.Field[string] `json:"dataset_id" 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 param.Field[string] `json:"dataset_version"`
// Textual description of the experiment
Description param.Field[string] `json:"description"`
// User-controlled metadata about the experiment
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Name of the experiment. Within a project, experiment names are unique
Name param.Field[string] `json:"name"`
// Whether or not the experiment is public. Public experiments can be viewed by
// anybody inside or outside the organization
Public param.Field[bool] `json:"public"`
// Metadata about the state of the repo when the experiment was created
RepoInfo param.Field[RepoInfoParam] `json:"repo_info"`
}
func (PatchExperimentParam) MarshalJSON ¶
func (r PatchExperimentParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataCodeDataLocationParam ¶
type PatchFunctionFunctionDataCodeDataLocationParam struct {
EvalName param.Field[string] `json:"eval_name,required"`
Position param.Field[PatchFunctionFunctionDataCodeDataLocationPositionUnionParam] `json:"position,required"`
Type param.Field[PatchFunctionFunctionDataCodeDataLocationType] `json:"type,required"`
}
func (PatchFunctionFunctionDataCodeDataLocationParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataCodeDataLocationParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataCodeDataLocationPositionScoreParam ¶
type PatchFunctionFunctionDataCodeDataLocationPositionScoreParam struct {
Score param.Field[float64] `json:"score,required"`
}
func (PatchFunctionFunctionDataCodeDataLocationPositionScoreParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataCodeDataLocationPositionScoreParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataCodeDataLocationPositionTask ¶
type PatchFunctionFunctionDataCodeDataLocationPositionTask string
const (
PatchFunctionFunctionDataCodeDataLocationPositionTaskTask PatchFunctionFunctionDataCodeDataLocationPositionTask = "task"
)
func (PatchFunctionFunctionDataCodeDataLocationPositionTask) IsKnown ¶
func (r PatchFunctionFunctionDataCodeDataLocationPositionTask) IsKnown() bool
type PatchFunctionFunctionDataCodeDataLocationPositionUnionParam ¶
type PatchFunctionFunctionDataCodeDataLocationPositionUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PatchFunctionFunctionDataCodeDataLocationPositionTask, shared.PatchFunctionFunctionDataCodeDataLocationPositionScoreParam.
type PatchFunctionFunctionDataCodeDataLocationType ¶
type PatchFunctionFunctionDataCodeDataLocationType string
const (
PatchFunctionFunctionDataCodeDataLocationTypeExperiment PatchFunctionFunctionDataCodeDataLocationType = "experiment"
)
func (PatchFunctionFunctionDataCodeDataLocationType) IsKnown ¶
func (r PatchFunctionFunctionDataCodeDataLocationType) IsKnown() bool
type PatchFunctionFunctionDataCodeDataParam ¶
type PatchFunctionFunctionDataCodeDataParam struct {
BundleID param.Field[string] `json:"bundle_id,required"`
Location param.Field[PatchFunctionFunctionDataCodeDataLocationParam] `json:"location,required"`
RuntimeContext param.Field[PatchFunctionFunctionDataCodeDataRuntimeContextParam] `json:"runtime_context,required"`
}
func (PatchFunctionFunctionDataCodeDataParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataCodeDataParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataCodeDataRuntimeContextParam ¶
type PatchFunctionFunctionDataCodeDataRuntimeContextParam struct {
Runtime param.Field[PatchFunctionFunctionDataCodeDataRuntimeContextRuntime] `json:"runtime,required"`
Version param.Field[string] `json:"version,required"`
}
func (PatchFunctionFunctionDataCodeDataRuntimeContextParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataCodeDataRuntimeContextParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataCodeDataRuntimeContextRuntime ¶
type PatchFunctionFunctionDataCodeDataRuntimeContextRuntime string
const (
PatchFunctionFunctionDataCodeDataRuntimeContextRuntimeNode PatchFunctionFunctionDataCodeDataRuntimeContextRuntime = "node"
)
func (PatchFunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown ¶
func (r PatchFunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown() bool
type PatchFunctionFunctionDataCodeParam ¶
type PatchFunctionFunctionDataCodeParam struct {
Data param.Field[PatchFunctionFunctionDataCodeDataParam] `json:"data,required"`
Type param.Field[PatchFunctionFunctionDataCodeType] `json:"type,required"`
}
func (PatchFunctionFunctionDataCodeParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataCodeParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataCodeType ¶
type PatchFunctionFunctionDataCodeType string
const (
PatchFunctionFunctionDataCodeTypeCode PatchFunctionFunctionDataCodeType = "code"
)
func (PatchFunctionFunctionDataCodeType) IsKnown ¶
func (r PatchFunctionFunctionDataCodeType) IsKnown() bool
type PatchFunctionFunctionDataGlobalParam ¶
type PatchFunctionFunctionDataGlobalParam struct {
Name param.Field[string] `json:"name,required"`
Type param.Field[PatchFunctionFunctionDataGlobalType] `json:"type,required"`
}
func (PatchFunctionFunctionDataGlobalParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataGlobalParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataGlobalType ¶
type PatchFunctionFunctionDataGlobalType string
const (
PatchFunctionFunctionDataGlobalTypeGlobal PatchFunctionFunctionDataGlobalType = "global"
)
func (PatchFunctionFunctionDataGlobalType) IsKnown ¶
func (r PatchFunctionFunctionDataGlobalType) IsKnown() bool
type PatchFunctionFunctionDataNullableVariantParam ¶
type PatchFunctionFunctionDataNullableVariantParam struct {
}
func (PatchFunctionFunctionDataNullableVariantParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataNullableVariantParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataParam ¶
type PatchFunctionFunctionDataParam struct {
Type param.Field[PatchFunctionFunctionDataType] `json:"type"`
Data param.Field[interface{}] `json:"data,required"`
Name param.Field[string] `json:"name"`
}
func (PatchFunctionFunctionDataParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataPromptParam ¶
type PatchFunctionFunctionDataPromptParam struct {
Type param.Field[PatchFunctionFunctionDataPromptType] `json:"type,required"`
}
func (PatchFunctionFunctionDataPromptParam) MarshalJSON ¶
func (r PatchFunctionFunctionDataPromptParam) MarshalJSON() (data []byte, err error)
type PatchFunctionFunctionDataPromptType ¶
type PatchFunctionFunctionDataPromptType string
const (
PatchFunctionFunctionDataPromptTypePrompt PatchFunctionFunctionDataPromptType = "prompt"
)
func (PatchFunctionFunctionDataPromptType) IsKnown ¶
func (r PatchFunctionFunctionDataPromptType) IsKnown() bool
type PatchFunctionFunctionDataType ¶
type PatchFunctionFunctionDataType string
const ( PatchFunctionFunctionDataTypePrompt PatchFunctionFunctionDataType = "prompt" PatchFunctionFunctionDataTypeCode PatchFunctionFunctionDataType = "code" PatchFunctionFunctionDataTypeGlobal PatchFunctionFunctionDataType = "global" )
func (PatchFunctionFunctionDataType) IsKnown ¶
func (r PatchFunctionFunctionDataType) IsKnown() bool
type PatchFunctionFunctionDataUnionParam ¶
type PatchFunctionFunctionDataUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PatchFunctionFunctionDataPromptParam, shared.PatchFunctionFunctionDataCodeParam, shared.PatchFunctionFunctionDataGlobalParam, shared.PatchFunctionFunctionDataNullableVariantParam, PatchFunctionFunctionDataParam.
type PatchFunctionParam ¶
type PatchFunctionParam struct {
// Textual description of the prompt
Description param.Field[string] `json:"description"`
FunctionData param.Field[PatchFunctionFunctionDataUnionParam] `json:"function_data"`
// Name of the prompt
Name param.Field[string] `json:"name"`
// The prompt, model, and its parameters
PromptData param.Field[PromptDataParam] `json:"prompt_data"`
// A list of tags for the prompt
Tags param.Field[[]string] `json:"tags"`
}
func (PatchFunctionParam) MarshalJSON ¶
func (r PatchFunctionParam) MarshalJSON() (data []byte, err error)
type PatchGroupParam ¶
type PatchGroupParam struct {
// A list of group IDs to add to the group's inheriting-from set
AddMemberGroups param.Field[[]string] `json:"add_member_groups" format:"uuid"`
// A list of user IDs to add to the group
AddMemberUsers param.Field[[]string] `json:"add_member_users" format:"uuid"`
// Textual description of the group
Description param.Field[string] `json:"description"`
// Name of the group
Name param.Field[string] `json:"name"`
// A list of group IDs to remove from the group's inheriting-from set
RemoveMemberGroups param.Field[[]string] `json:"remove_member_groups" format:"uuid"`
// A list of user IDs to remove from the group
RemoveMemberUsers param.Field[[]string] `json:"remove_member_users" format:"uuid"`
}
func (PatchGroupParam) MarshalJSON ¶
func (r PatchGroupParam) MarshalJSON() (data []byte, err error)
type PatchOrganizationMembersInviteUsersParam ¶
type PatchOrganizationMembersInviteUsersParam struct {
// Emails of users to invite
Emails param.Field[[]string] `json:"emails"`
// Optional id of a group to add newly-invited users to. Cannot specify both a
// group id and a group name.
GroupID param.Field[string] `json:"group_id" format:"uuid"`
// Optional name of a group to add newly-invited users to. Cannot specify both a
// group id and a group name.
GroupName param.Field[string] `json:"group_name"`
// Ids of existing users to invite
IDs param.Field[[]string] `json:"ids" format:"uuid"`
// If true, send invite emails to the users who wore actually added
SendInviteEmails param.Field[bool] `json:"send_invite_emails"`
}
Users to invite to the organization
func (PatchOrganizationMembersInviteUsersParam) MarshalJSON ¶
func (r PatchOrganizationMembersInviteUsersParam) MarshalJSON() (data []byte, err error)
type PatchOrganizationMembersParam ¶
type PatchOrganizationMembersParam struct {
// Users to invite to the organization
InviteUsers param.Field[PatchOrganizationMembersInviteUsersParam] `json:"invite_users"`
// For nearly all users, this parameter should be unnecessary. But in the rare case
// that your API key belongs to multiple organizations, or in case you want to
// explicitly assert the organization you are modifying, you may specify the id of
// the organization.
OrgID param.Field[string] `json:"org_id"`
// For nearly all users, this parameter should be unnecessary. But in the rare case
// that your API key belongs to multiple organizations, or in case you want to
// explicitly assert the organization you are modifying, you may specify the name
// of the organization.
OrgName param.Field[string] `json:"org_name"`
// Users to remove from the organization
RemoveUsers param.Field[PatchOrganizationMembersRemoveUsersParam] `json:"remove_users"`
}
func (PatchOrganizationMembersParam) MarshalJSON ¶
func (r PatchOrganizationMembersParam) MarshalJSON() (data []byte, err error)
type PatchOrganizationMembersRemoveUsersParam ¶
type PatchOrganizationMembersRemoveUsersParam struct {
// Emails of users to remove
Emails param.Field[[]string] `json:"emails"`
// Ids of users to remove
IDs param.Field[[]string] `json:"ids" format:"uuid"`
}
Users to remove from the organization
func (PatchOrganizationMembersRemoveUsersParam) MarshalJSON ¶
func (r PatchOrganizationMembersRemoveUsersParam) MarshalJSON() (data []byte, err error)
type PatchOrganizationParam ¶
type PatchOrganizationParam struct {
APIURL param.Field[string] `json:"api_url"`
IsUniversalAPI param.Field[bool] `json:"is_universal_api"`
// Name of the organization
Name param.Field[string] `json:"name"`
ProxyURL param.Field[string] `json:"proxy_url"`
RealtimeURL param.Field[string] `json:"realtime_url"`
}
func (PatchOrganizationParam) MarshalJSON ¶
func (r PatchOrganizationParam) MarshalJSON() (data []byte, err error)
type PatchProjectParam ¶
type PatchProjectParam struct {
// Name of the project
Name param.Field[string] `json:"name"`
// Project settings. Patch operations replace all settings, so make sure you
// include all settings you want to keep.
Settings param.Field[PatchProjectSettingsParam] `json:"settings"`
}
func (PatchProjectParam) MarshalJSON ¶
func (r PatchProjectParam) MarshalJSON() (data []byte, err error)
type PatchProjectScoreCategoriesCategoricalParam ¶
type PatchProjectScoreCategoriesCategoricalParam []ProjectScoreCategoryParam
type PatchProjectScoreCategoriesMinimumParam ¶
type PatchProjectScoreCategoriesMinimumParam []string
type PatchProjectScoreCategoriesNullableVariantParam ¶
type PatchProjectScoreCategoriesNullableVariantParam struct {
}
func (PatchProjectScoreCategoriesNullableVariantParam) MarshalJSON ¶
func (r PatchProjectScoreCategoriesNullableVariantParam) MarshalJSON() (data []byte, err error)
type PatchProjectScoreCategoriesUnionParam ¶
type PatchProjectScoreCategoriesUnionParam interface {
// contains filtered or unexported methods
}
For categorical-type project scores, the list of all categories
Satisfied by shared.PatchProjectScoreCategoriesCategoricalParam, shared.PatchProjectScoreCategoriesMinimumParam, shared.PatchProjectScoreCategoriesNullableVariantParam.
type PatchProjectScoreParam ¶
type PatchProjectScoreParam struct {
// For categorical-type project scores, the list of all categories
Categories param.Field[PatchProjectScoreCategoriesUnionParam] `json:"categories"`
// Textual description of the project score
Description param.Field[string] `json:"description"`
// Name of the project score
Name param.Field[string] `json:"name"`
// The type of the configured score
ScoreType param.Field[PatchProjectScoreScoreType] `json:"score_type"`
}
func (PatchProjectScoreParam) MarshalJSON ¶
func (r PatchProjectScoreParam) MarshalJSON() (data []byte, err error)
type PatchProjectScoreScoreType ¶
type PatchProjectScoreScoreType string
The type of the configured score
const ( PatchProjectScoreScoreTypeSlider PatchProjectScoreScoreType = "slider" PatchProjectScoreScoreTypeCategorical PatchProjectScoreScoreType = "categorical" PatchProjectScoreScoreTypeWeighted PatchProjectScoreScoreType = "weighted" PatchProjectScoreScoreTypeMinimum PatchProjectScoreScoreType = "minimum" )
func (PatchProjectScoreScoreType) IsKnown ¶
func (r PatchProjectScoreScoreType) IsKnown() bool
type PatchProjectSettingsParam ¶
type PatchProjectSettingsParam struct {
// The key used to join two experiments (defaults to `input`).
ComparisonKey param.Field[string] `json:"comparison_key"`
}
Project settings. Patch operations replace all settings, so make sure you include all settings you want to keep.
func (PatchProjectSettingsParam) MarshalJSON ¶
func (r PatchProjectSettingsParam) MarshalJSON() (data []byte, err error)
type PatchProjectTagParam ¶
type PatchProjectTagParam struct {
// Color of the tag for the UI
Color param.Field[string] `json:"color"`
// Textual description of the project tag
Description param.Field[string] `json:"description"`
// Name of the project tag
Name param.Field[string] `json:"name"`
}
func (PatchProjectTagParam) MarshalJSON ¶
func (r PatchProjectTagParam) MarshalJSON() (data []byte, err error)
type PatchPromptParam ¶
type PatchPromptParam struct {
// Textual description of the prompt
Description param.Field[string] `json:"description"`
// Name of the prompt
Name param.Field[string] `json:"name"`
// The prompt, model, and its parameters
PromptData param.Field[PromptDataParam] `json:"prompt_data"`
// A list of tags for the prompt
Tags param.Field[[]string] `json:"tags"`
}
func (PatchPromptParam) MarshalJSON ¶
func (r PatchPromptParam) MarshalJSON() (data []byte, err error)
type PatchRoleAddMemberPermissionParam ¶
type PatchRoleAddMemberPermissionParam 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 param.Field[PatchRoleAddMemberPermissionsPermission] `json:"permission,required"`
// The object type that the ACL applies to
RestrictObjectType param.Field[PatchRoleAddMemberPermissionsRestrictObjectType] `json:"restrict_object_type"`
}
func (PatchRoleAddMemberPermissionParam) MarshalJSON ¶
func (r PatchRoleAddMemberPermissionParam) MarshalJSON() (data []byte, err error)
type PatchRoleAddMemberPermissionsPermission ¶
type PatchRoleAddMemberPermissionsPermission 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 ( PatchRoleAddMemberPermissionsPermissionCreate PatchRoleAddMemberPermissionsPermission = "create" PatchRoleAddMemberPermissionsPermissionRead PatchRoleAddMemberPermissionsPermission = "read" PatchRoleAddMemberPermissionsPermissionUpdate PatchRoleAddMemberPermissionsPermission = "update" PatchRoleAddMemberPermissionsPermissionDelete PatchRoleAddMemberPermissionsPermission = "delete" PatchRoleAddMemberPermissionsPermissionCreateACLs PatchRoleAddMemberPermissionsPermission = "create_acls" PatchRoleAddMemberPermissionsPermissionReadACLs PatchRoleAddMemberPermissionsPermission = "read_acls" PatchRoleAddMemberPermissionsPermissionUpdateACLs PatchRoleAddMemberPermissionsPermission = "update_acls" PatchRoleAddMemberPermissionsPermissionDeleteACLs PatchRoleAddMemberPermissionsPermission = "delete_acls" )
func (PatchRoleAddMemberPermissionsPermission) IsKnown ¶
func (r PatchRoleAddMemberPermissionsPermission) IsKnown() bool
type PatchRoleAddMemberPermissionsRestrictObjectType ¶
type PatchRoleAddMemberPermissionsRestrictObjectType string
The object type that the ACL applies to
const ( PatchRoleAddMemberPermissionsRestrictObjectTypeOrganization PatchRoleAddMemberPermissionsRestrictObjectType = "organization" PatchRoleAddMemberPermissionsRestrictObjectTypeProject PatchRoleAddMemberPermissionsRestrictObjectType = "project" PatchRoleAddMemberPermissionsRestrictObjectTypeExperiment PatchRoleAddMemberPermissionsRestrictObjectType = "experiment" PatchRoleAddMemberPermissionsRestrictObjectTypeDataset PatchRoleAddMemberPermissionsRestrictObjectType = "dataset" PatchRoleAddMemberPermissionsRestrictObjectTypePrompt PatchRoleAddMemberPermissionsRestrictObjectType = "prompt" PatchRoleAddMemberPermissionsRestrictObjectTypePromptSession PatchRoleAddMemberPermissionsRestrictObjectType = "prompt_session" PatchRoleAddMemberPermissionsRestrictObjectTypeGroup PatchRoleAddMemberPermissionsRestrictObjectType = "group" PatchRoleAddMemberPermissionsRestrictObjectTypeRole PatchRoleAddMemberPermissionsRestrictObjectType = "role" PatchRoleAddMemberPermissionsRestrictObjectTypeOrgMember PatchRoleAddMemberPermissionsRestrictObjectType = "org_member" PatchRoleAddMemberPermissionsRestrictObjectTypeProjectLog PatchRoleAddMemberPermissionsRestrictObjectType = "project_log" PatchRoleAddMemberPermissionsRestrictObjectTypeOrgProject PatchRoleAddMemberPermissionsRestrictObjectType = "org_project" )
func (PatchRoleAddMemberPermissionsRestrictObjectType) IsKnown ¶
func (r PatchRoleAddMemberPermissionsRestrictObjectType) IsKnown() bool
type PatchRoleParam ¶
type PatchRoleParam struct {
// A list of permissions to add to the role
AddMemberPermissions param.Field[[]PatchRoleAddMemberPermissionParam] `json:"add_member_permissions"`
// A list of role IDs to add to the role's inheriting-from set
AddMemberRoles param.Field[[]string] `json:"add_member_roles" format:"uuid"`
// Textual description of the role
Description param.Field[string] `json:"description"`
// Name of the role
Name param.Field[string] `json:"name"`
// A list of permissions to remove from the role
RemoveMemberPermissions param.Field[[]PatchRoleRemoveMemberPermissionParam] `json:"remove_member_permissions"`
// A list of role IDs to remove from the role's inheriting-from set
RemoveMemberRoles param.Field[[]string] `json:"remove_member_roles" format:"uuid"`
}
func (PatchRoleParam) MarshalJSON ¶
func (r PatchRoleParam) MarshalJSON() (data []byte, err error)
type PatchRoleRemoveMemberPermissionParam ¶
type PatchRoleRemoveMemberPermissionParam 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 param.Field[PatchRoleRemoveMemberPermissionsPermission] `json:"permission,required"`
// The object type that the ACL applies to
RestrictObjectType param.Field[PatchRoleRemoveMemberPermissionsRestrictObjectType] `json:"restrict_object_type"`
}
func (PatchRoleRemoveMemberPermissionParam) MarshalJSON ¶
func (r PatchRoleRemoveMemberPermissionParam) MarshalJSON() (data []byte, err error)
type PatchRoleRemoveMemberPermissionsPermission ¶
type PatchRoleRemoveMemberPermissionsPermission 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 ( PatchRoleRemoveMemberPermissionsPermissionCreate PatchRoleRemoveMemberPermissionsPermission = "create" PatchRoleRemoveMemberPermissionsPermissionRead PatchRoleRemoveMemberPermissionsPermission = "read" PatchRoleRemoveMemberPermissionsPermissionUpdate PatchRoleRemoveMemberPermissionsPermission = "update" PatchRoleRemoveMemberPermissionsPermissionDelete PatchRoleRemoveMemberPermissionsPermission = "delete" PatchRoleRemoveMemberPermissionsPermissionCreateACLs PatchRoleRemoveMemberPermissionsPermission = "create_acls" PatchRoleRemoveMemberPermissionsPermissionReadACLs PatchRoleRemoveMemberPermissionsPermission = "read_acls" PatchRoleRemoveMemberPermissionsPermissionUpdateACLs PatchRoleRemoveMemberPermissionsPermission = "update_acls" PatchRoleRemoveMemberPermissionsPermissionDeleteACLs PatchRoleRemoveMemberPermissionsPermission = "delete_acls" )
func (PatchRoleRemoveMemberPermissionsPermission) IsKnown ¶
func (r PatchRoleRemoveMemberPermissionsPermission) IsKnown() bool
type PatchRoleRemoveMemberPermissionsRestrictObjectType ¶
type PatchRoleRemoveMemberPermissionsRestrictObjectType string
The object type that the ACL applies to
const ( PatchRoleRemoveMemberPermissionsRestrictObjectTypeOrganization PatchRoleRemoveMemberPermissionsRestrictObjectType = "organization" PatchRoleRemoveMemberPermissionsRestrictObjectTypeProject PatchRoleRemoveMemberPermissionsRestrictObjectType = "project" PatchRoleRemoveMemberPermissionsRestrictObjectTypeExperiment PatchRoleRemoveMemberPermissionsRestrictObjectType = "experiment" PatchRoleRemoveMemberPermissionsRestrictObjectTypeDataset PatchRoleRemoveMemberPermissionsRestrictObjectType = "dataset" PatchRoleRemoveMemberPermissionsRestrictObjectTypePrompt PatchRoleRemoveMemberPermissionsRestrictObjectType = "prompt" PatchRoleRemoveMemberPermissionsRestrictObjectTypePromptSession PatchRoleRemoveMemberPermissionsRestrictObjectType = "prompt_session" PatchRoleRemoveMemberPermissionsRestrictObjectTypeGroup PatchRoleRemoveMemberPermissionsRestrictObjectType = "group" PatchRoleRemoveMemberPermissionsRestrictObjectTypeRole PatchRoleRemoveMemberPermissionsRestrictObjectType = "role" PatchRoleRemoveMemberPermissionsRestrictObjectTypeOrgMember PatchRoleRemoveMemberPermissionsRestrictObjectType = "org_member" PatchRoleRemoveMemberPermissionsRestrictObjectTypeProjectLog PatchRoleRemoveMemberPermissionsRestrictObjectType = "project_log" PatchRoleRemoveMemberPermissionsRestrictObjectTypeOrgProject PatchRoleRemoveMemberPermissionsRestrictObjectType = "org_project" )
func (PatchRoleRemoveMemberPermissionsRestrictObjectType) IsKnown ¶
func (r PatchRoleRemoveMemberPermissionsRestrictObjectType) IsKnown() bool
type PatchViewObjectType ¶
type PatchViewObjectType string
The object type that the ACL applies to
const ( PatchViewObjectTypeOrganization PatchViewObjectType = "organization" PatchViewObjectTypeProject PatchViewObjectType = "project" PatchViewObjectTypeExperiment PatchViewObjectType = "experiment" PatchViewObjectTypeDataset PatchViewObjectType = "dataset" PatchViewObjectTypePrompt PatchViewObjectType = "prompt" PatchViewObjectTypePromptSession PatchViewObjectType = "prompt_session" PatchViewObjectTypeGroup PatchViewObjectType = "group" PatchViewObjectTypeRole PatchViewObjectType = "role" PatchViewObjectTypeOrgMember PatchViewObjectType = "org_member" PatchViewObjectTypeProjectLog PatchViewObjectType = "project_log" PatchViewObjectTypeOrgProject PatchViewObjectType = "org_project" )
func (PatchViewObjectType) IsKnown ¶
func (r PatchViewObjectType) IsKnown() bool
type PatchViewParam ¶
type PatchViewParam struct {
// The id of the object the view applies to
ObjectID param.Field[string] `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType param.Field[PatchViewObjectType] `json:"object_type,required"`
// Name of the view
Name param.Field[string] `json:"name"`
// Options for the view in the app
Options param.Field[ViewOptionsParam] `json:"options"`
// Identifies the user who created the view
UserID param.Field[string] `json:"user_id" format:"uuid"`
// The view definition
ViewData param.Field[ViewDataParam] `json:"view_data"`
// Type of table that the view corresponds to.
ViewType param.Field[PatchViewViewType] `json:"view_type"`
}
func (PatchViewParam) MarshalJSON ¶
func (r PatchViewParam) MarshalJSON() (data []byte, err error)
type PatchViewViewType ¶
type PatchViewViewType string
Type of table that the view corresponds to.
const ( PatchViewViewTypeProjects PatchViewViewType = "projects" PatchViewViewTypeLogs PatchViewViewType = "logs" PatchViewViewTypeExperiments PatchViewViewType = "experiments" PatchViewViewTypeDatasets PatchViewViewType = "datasets" PatchViewViewTypePrompts PatchViewViewType = "prompts" PatchViewViewTypePlaygrounds PatchViewViewType = "playgrounds" PatchViewViewTypeExperiment PatchViewViewType = "experiment" PatchViewViewTypeDataset PatchViewViewType = "dataset" )
func (PatchViewViewType) IsKnown ¶
func (r PatchViewViewType) IsKnown() bool
type PathLookupFilterParam ¶
type PathLookupFilterParam struct {
// List of fields describing the path to the value to be checked against. For
// instance, if you wish to filter on the value of `c` in
// `{"input": {"a": {"b": {"c": "hello"}}}}`, pass `path=["input", "a", "b", "c"]`
Path param.Field[[]string] `json:"path,required"`
// Denotes the type of filter as a path-lookup filter
Type param.Field[PathLookupFilterType] `json:"type,required"`
// The value to compare equality-wise against the event value at the specified
// `path`. The value must be a "primitive", that is, any JSON-serializable object
// except for objects and arrays. For instance, if you wish to filter on the value
// of "input.a.b.c" in the object `{"input": {"a": {"b": {"c": "hello"}}}}`, pass
// `value="hello"`
Value param.Field[interface{}] `json:"value"`
}
A path-lookup filter describes an equality comparison against a specific sub-field in the event row. For instance, if you wish to filter on the value of `c` in `{"input": {"a": {"b": {"c": "hello"}}}}`, pass `path=["input", "a", "b", "c"]` and `value="hello"`
func (PathLookupFilterParam) MarshalJSON ¶
func (r PathLookupFilterParam) MarshalJSON() (data []byte, err error)
type PathLookupFilterType ¶
type PathLookupFilterType string
Denotes the type of filter as a path-lookup filter
const (
PathLookupFilterTypePathLookup PathLookupFilterType = "path_lookup"
)
func (PathLookupFilterType) IsKnown ¶
func (r PathLookupFilterType) IsKnown() bool
type Project ¶
type Project struct {
// Unique identifier for the project
ID string `json:"id,required" format:"uuid"`
// Name of the project
Name string `json:"name,required"`
// Unique id for the organization that the project belongs under
OrgID string `json:"org_id,required" format:"uuid"`
// Date of project creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of project deletion, or null if the project is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
Settings ProjectSettings `json:"settings,nullable"`
// Identifies the user who created the project
UserID string `json:"user_id,nullable" format:"uuid"`
JSON projectJSON `json:"-"`
}
func (*Project) UnmarshalJSON ¶
type ProjectLogsEvent ¶
type ProjectLogsEvent struct {
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the project logs (see the
// `version` parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the project logs event was created
Created time.Time `json:"created,required" format:"date-time"`
// A literal 'g' which identifies the log as a project log
LogID ProjectLogsEventLogID `json:"log_id,required"`
// Unique id for the organization that the project belongs under
OrgID string `json:"org_id,required" format:"uuid"`
// Unique identifier for the project
ProjectID string `json:"project_id,required" format:"uuid"`
// The `span_id` of the root of the trace this project logs event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different project logs events together as part
// of a full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context ProjectLogsEventContext `json:"context,nullable"`
// The error that occurred, if any.
Error interface{} `json:"error"`
// 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"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata map[string]interface{} `json:"metadata,nullable"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics ProjectLogsEventMetrics `json:"metrics,nullable"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output interface{} `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores map[string]float64 `json:"scores,nullable"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes ProjectLogsEventSpanAttributes `json:"span_attributes,nullable"`
// An array of the parent `span_ids` of this project logs event. This should be
// empty for the root span of a trace, and should most often contain just one
// parent element for subspans
SpanParents []string `json:"span_parents,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
JSON projectLogsEventJSON `json:"-"`
}
func (*ProjectLogsEvent) UnmarshalJSON ¶
func (r *ProjectLogsEvent) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventContext ¶
type ProjectLogsEventContext struct {
// Name of the file in code where the project logs event was created
CallerFilename string `json:"caller_filename,nullable"`
// The function in code which created the project logs event
CallerFunctionname string `json:"caller_functionname,nullable"`
// Line of code where the project logs event was created
CallerLineno int64 `json:"caller_lineno,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON projectLogsEventContextJSON `json:"-"`
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (*ProjectLogsEventContext) UnmarshalJSON ¶
func (r *ProjectLogsEventContext) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventLogID ¶
type ProjectLogsEventLogID string
A literal 'g' which identifies the log as a project log
const (
ProjectLogsEventLogIDG ProjectLogsEventLogID = "g"
)
func (ProjectLogsEventLogID) IsKnown ¶
func (r ProjectLogsEventLogID) IsKnown() bool
type ProjectLogsEventMetrics ¶
type ProjectLogsEventMetrics struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens int64 `json:"completion_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End float64 `json:"end,nullable"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens int64 `json:"prompt_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start float64 `json:"start,nullable"`
// The total number of tokens in the input and output of the project logs event.
Tokens int64 `json:"tokens,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON projectLogsEventMetricsJSON `json:"-"`
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (*ProjectLogsEventMetrics) UnmarshalJSON ¶
func (r *ProjectLogsEventMetrics) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventSpanAttributes ¶
type ProjectLogsEventSpanAttributes struct {
// Name of the span, for display purposes only
Name string `json:"name,nullable"`
// Type of the span, for display purposes only
Type ProjectLogsEventSpanAttributesType `json:"type,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON projectLogsEventSpanAttributesJSON `json:"-"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (*ProjectLogsEventSpanAttributes) UnmarshalJSON ¶
func (r *ProjectLogsEventSpanAttributes) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventSpanAttributesType ¶
type ProjectLogsEventSpanAttributesType string
Type of the span, for display purposes only
const ( ProjectLogsEventSpanAttributesTypeLlm ProjectLogsEventSpanAttributesType = "llm" ProjectLogsEventSpanAttributesTypeScore ProjectLogsEventSpanAttributesType = "score" ProjectLogsEventSpanAttributesTypeFunction ProjectLogsEventSpanAttributesType = "function" ProjectLogsEventSpanAttributesTypeEval ProjectLogsEventSpanAttributesType = "eval" ProjectLogsEventSpanAttributesTypeTask ProjectLogsEventSpanAttributesType = "task" ProjectLogsEventSpanAttributesTypeTool ProjectLogsEventSpanAttributesType = "tool" )
func (ProjectLogsEventSpanAttributesType) IsKnown ¶
func (r ProjectLogsEventSpanAttributesType) IsKnown() bool
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 ProjectScoreScoreType `json:"score_type,required,nullable"`
UserID string `json:"user_id,required" format:"uuid"`
// For categorical-type project scores, the list of all categories
Categories ProjectScoreCategoriesUnion `json:"categories"`
Config ProjectScoreConfig `json:"config,nullable"`
// Date of project score creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the project score
Description string `json:"description,nullable"`
// An optional LexoRank-based string that sets the sort position for the score in
// the UI
Position string `json:"position,nullable"`
JSON projectScoreJSON `json:"-"`
}
A project score is a user-configured score, which can be manually-labeled through the UI
func (*ProjectScore) UnmarshalJSON ¶
func (r *ProjectScore) UnmarshalJSON(data []byte) (err error)
type ProjectScoreCategoriesCategorical ¶
type ProjectScoreCategoriesCategorical []ProjectScoreCategory
type ProjectScoreCategoriesMinimum ¶
type ProjectScoreCategoriesMinimum []string
type ProjectScoreCategoriesNullableVariant ¶
type ProjectScoreCategoriesNullableVariant struct {
JSON projectScoreCategoriesNullableVariantJSON `json:"-"`
}
func (*ProjectScoreCategoriesNullableVariant) UnmarshalJSON ¶
func (r *ProjectScoreCategoriesNullableVariant) UnmarshalJSON(data []byte) (err error)
type ProjectScoreCategoriesUnion ¶
type ProjectScoreCategoriesUnion interface {
// contains filtered or unexported methods
}
For categorical-type project scores, the list of all categories
Union satisfied by shared.ProjectScoreCategoriesCategorical, shared.ProjectScoreCategoriesMinimum or shared.ProjectScoreCategoriesNullableVariant.
type ProjectScoreCategory ¶
type ProjectScoreCategory struct {
// Name of the category
Name string `json:"name,required"`
// Numerical value of the category. Must be between 0 and 1, inclusive
Value float64 `json:"value,required"`
JSON projectScoreCategoryJSON `json:"-"`
}
For categorical-type project scores, defines a single category
func (*ProjectScoreCategory) UnmarshalJSON ¶
func (r *ProjectScoreCategory) UnmarshalJSON(data []byte) (err error)
type ProjectScoreCategoryParam ¶
type ProjectScoreCategoryParam struct {
// Name of the category
Name param.Field[string] `json:"name,required"`
// Numerical value of the category. Must be between 0 and 1, inclusive
Value param.Field[float64] `json:"value,required"`
}
For categorical-type project scores, defines a single category
func (ProjectScoreCategoryParam) MarshalJSON ¶
func (r ProjectScoreCategoryParam) MarshalJSON() (data []byte, err error)
type ProjectScoreConfig ¶
type ProjectScoreConfig struct {
Destination ProjectScoreConfigDestination `json:"destination,nullable"`
MultiSelect bool `json:"multi_select,nullable"`
JSON projectScoreConfigJSON `json:"-"`
}
func (*ProjectScoreConfig) UnmarshalJSON ¶
func (r *ProjectScoreConfig) UnmarshalJSON(data []byte) (err error)
type ProjectScoreConfigDestination ¶
type ProjectScoreConfigDestination string
const (
ProjectScoreConfigDestinationExpected ProjectScoreConfigDestination = "expected"
)
func (ProjectScoreConfigDestination) IsKnown ¶
func (r ProjectScoreConfigDestination) IsKnown() bool
type ProjectScoreScoreType ¶
type ProjectScoreScoreType string
The type of the configured score
const ( ProjectScoreScoreTypeSlider ProjectScoreScoreType = "slider" ProjectScoreScoreTypeCategorical ProjectScoreScoreType = "categorical" ProjectScoreScoreTypeWeighted ProjectScoreScoreType = "weighted" ProjectScoreScoreTypeMinimum ProjectScoreScoreType = "minimum" )
func (ProjectScoreScoreType) IsKnown ¶
func (r ProjectScoreScoreType) IsKnown() bool
type ProjectSettings ¶
type ProjectSettings struct {
// The key used to join two experiments (defaults to `input`).
ComparisonKey string `json:"comparison_key,nullable"`
JSON projectSettingsJSON `json:"-"`
}
func (*ProjectSettings) UnmarshalJSON ¶
func (r *ProjectSettings) UnmarshalJSON(data []byte) (err error)
type 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"`
// 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 PromptDataOptions `json:"options,nullable"`
Origin PromptDataOrigin `json:"origin,nullable"`
Prompt PromptDataPrompt `json:"prompt"`
JSON promptDataJSON `json:"-"`
}
The prompt, model, and its parameters
func (*PromptData) UnmarshalJSON ¶
func (r *PromptData) UnmarshalJSON(data []byte) (err error)
type PromptDataOptions ¶
type PromptDataOptions struct {
Model string `json:"model"`
Params PromptDataOptionsParamsUnion `json:"params"`
Position string `json:"position"`
JSON promptDataOptionsJSON `json:"-"`
}
func (*PromptDataOptions) UnmarshalJSON ¶
func (r *PromptDataOptions) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParam ¶
type PromptDataOptionsParam struct {
Model param.Field[string] `json:"model"`
Params param.Field[PromptDataOptionsParamsUnionParam] `json:"params"`
Position param.Field[string] `json:"position"`
}
func (PromptDataOptionsParam) MarshalJSON ¶
func (r PromptDataOptionsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsAnthropicModelParams ¶
type PromptDataOptionsParamsAnthropicModelParams struct {
MaxTokens float64 `json:"max_tokens,required"`
Temperature float64 `json:"temperature,required"`
// This is a legacy parameter that should not be used.
MaxTokensToSample float64 `json:"max_tokens_to_sample"`
StopSequences []string `json:"stop_sequences"`
TopK float64 `json:"top_k"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsAnthropicModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsAnthropicModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsAnthropicModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsAnthropicModelParamsParam ¶
type PromptDataOptionsParamsAnthropicModelParamsParam struct {
MaxTokens param.Field[float64] `json:"max_tokens,required"`
Temperature param.Field[float64] `json:"temperature,required"`
// This is a legacy parameter that should not be used.
MaxTokensToSample param.Field[float64] `json:"max_tokens_to_sample"`
StopSequences param.Field[[]string] `json:"stop_sequences"`
TopK param.Field[float64] `json:"top_k"`
TopP param.Field[float64] `json:"top_p"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsAnthropicModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsAnthropicModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsGoogleModelParams ¶
type PromptDataOptionsParamsGoogleModelParams struct {
MaxOutputTokens float64 `json:"maxOutputTokens"`
Temperature float64 `json:"temperature"`
TopK float64 `json:"topK"`
TopP float64 `json:"topP"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsGoogleModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsGoogleModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsGoogleModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsGoogleModelParamsParam ¶
type PromptDataOptionsParamsGoogleModelParamsParam struct {
MaxOutputTokens param.Field[float64] `json:"maxOutputTokens"`
Temperature param.Field[float64] `json:"temperature"`
TopK param.Field[float64] `json:"topK"`
TopP param.Field[float64] `json:"topP"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsGoogleModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsGoogleModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsJsCompletionParams ¶
type PromptDataOptionsParamsJsCompletionParams struct {
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsJsCompletionParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsJsCompletionParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsJsCompletionParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsJsCompletionParamsParam ¶
type PromptDataOptionsParamsJsCompletionParamsParam struct {
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsJsCompletionParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsJsCompletionParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParams ¶
type PromptDataOptionsParamsOpenAIModelParams struct {
FrequencyPenalty float64 `json:"frequency_penalty"`
FunctionCall PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion `json:"function_call"`
MaxTokens float64 `json:"max_tokens"`
N float64 `json:"n"`
PresencePenalty float64 `json:"presence_penalty"`
ResponseFormat PromptDataOptionsParamsOpenAIModelParamsResponseFormat `json:"response_format,nullable"`
Stop []string `json:"stop"`
Temperature float64 `json:"temperature"`
ToolChoice PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion `json:"tool_choice"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsOpenAIModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto string
const (
PromptDataOptionsParamsOpenAIModelParamsFunctionCallAutoAuto PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto = "auto"
)
func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction struct {
Name string `json:"name,required"`
JSON promptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam struct {
Name param.Field[string] `json:"name,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone string
const (
PromptDataOptionsParamsOpenAIModelParamsFunctionCallNoneNone PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone = "none"
)
func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto, shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone or shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction.
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto, shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone, shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam.
type PromptDataOptionsParamsOpenAIModelParamsParam ¶
type PromptDataOptionsParamsOpenAIModelParamsParam struct {
FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
FunctionCall param.Field[PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam] `json:"function_call"`
MaxTokens param.Field[float64] `json:"max_tokens"`
N param.Field[float64] `json:"n"`
PresencePenalty param.Field[float64] `json:"presence_penalty"`
ResponseFormat param.Field[PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam] `json:"response_format"`
Stop param.Field[[]string] `json:"stop"`
Temperature param.Field[float64] `json:"temperature"`
ToolChoice param.Field[PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam] `json:"tool_choice"`
TopP param.Field[float64] `json:"top_p"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsOpenAIModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsResponseFormat ¶
type PromptDataOptionsParamsOpenAIModelParamsResponseFormat struct {
Type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType `json:"type,required"`
JSON promptDataOptionsParamsOpenAIModelParamsResponseFormatJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam ¶
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam struct {
Type param.Field[PromptDataOptionsParamsOpenAIModelParamsResponseFormatType] `json:"type,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType ¶
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType string
const (
PromptDataOptionsParamsOpenAIModelParamsResponseFormatTypeJsonObject PromptDataOptionsParamsOpenAIModelParamsResponseFormatType = "json_object"
)
func (PromptDataOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto string
const (
PromptDataOptionsParamsOpenAIModelParamsToolChoiceAutoAuto PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto = "auto"
)
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction struct {
Function PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction `json:"function,required"`
Type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType `json:"type,required"`
JSON promptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction struct {
Name string `json:"name,required"`
JSON promptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam struct {
Name param.Field[string] `json:"name,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam struct {
Function param.Field[PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam] `json:"function,required"`
Type param.Field[PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType] `json:"type,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType string
const (
PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionTypeFunction PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType = "function"
)
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone string
const (
PromptDataOptionsParamsOpenAIModelParamsToolChoiceNoneNone PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone = "none"
)
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto, shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone or shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction.
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto, shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone, shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam.
type PromptDataOptionsParamsUnion ¶
type PromptDataOptionsParamsUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataOptionsParamsOpenAIModelParams, shared.PromptDataOptionsParamsAnthropicModelParams, shared.PromptDataOptionsParamsGoogleModelParams, shared.PromptDataOptionsParamsWindowAIModelParams or shared.PromptDataOptionsParamsJsCompletionParams.
type PromptDataOptionsParamsUnionParam ¶
type PromptDataOptionsParamsUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsParam, shared.PromptDataOptionsParamsAnthropicModelParamsParam, shared.PromptDataOptionsParamsGoogleModelParamsParam, shared.PromptDataOptionsParamsWindowAIModelParamsParam, shared.PromptDataOptionsParamsJsCompletionParamsParam.
type PromptDataOptionsParamsWindowAIModelParams ¶
type PromptDataOptionsParamsWindowAIModelParams struct {
Temperature float64 `json:"temperature"`
TopK float64 `json:"topK"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsWindowAIModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsWindowAIModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsWindowAIModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsWindowAIModelParamsParam ¶
type PromptDataOptionsParamsWindowAIModelParamsParam struct {
Temperature param.Field[float64] `json:"temperature"`
TopK param.Field[float64] `json:"topK"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsWindowAIModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsWindowAIModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOrigin ¶
type PromptDataOrigin struct {
ProjectID string `json:"project_id"`
PromptID string `json:"prompt_id"`
PromptVersion string `json:"prompt_version"`
JSON promptDataOriginJSON `json:"-"`
}
func (*PromptDataOrigin) UnmarshalJSON ¶
func (r *PromptDataOrigin) UnmarshalJSON(data []byte) (err error)
type PromptDataOriginParam ¶
type PromptDataOriginParam struct {
ProjectID param.Field[string] `json:"project_id"`
PromptID param.Field[string] `json:"prompt_id"`
PromptVersion param.Field[string] `json:"prompt_version"`
}
func (PromptDataOriginParam) MarshalJSON ¶
func (r PromptDataOriginParam) MarshalJSON() (data []byte, err error)
type PromptDataParam ¶
type PromptDataParam struct {
Options param.Field[PromptDataOptionsParam] `json:"options"`
Origin param.Field[PromptDataOriginParam] `json:"origin"`
Prompt param.Field[PromptDataPromptUnionParam] `json:"prompt"`
}
The prompt, model, and its parameters
func (PromptDataParam) MarshalJSON ¶
func (r PromptDataParam) MarshalJSON() (data []byte, err error)
type PromptDataPrompt ¶
type PromptDataPrompt struct {
Type PromptDataPromptType `json:"type"`
Content string `json:"content"`
// This field can have the runtime type of [[]PromptDataPromptChatMessage].
Messages interface{} `json:"messages,required"`
Tools string `json:"tools"`
JSON promptDataPromptJSON `json:"-"`
// contains filtered or unexported fields
}
func (PromptDataPrompt) AsUnion ¶
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, shared.PromptDataPromptNullableVariant.
func (*PromptDataPrompt) UnmarshalJSON ¶
func (r *PromptDataPrompt) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChat ¶
type PromptDataPromptChat struct {
Messages []PromptDataPromptChatMessage `json:"messages,required"`
Type PromptDataPromptChatType `json:"type,required"`
Tools string `json:"tools"`
JSON promptDataPromptChatJSON `json:"-"`
}
func (*PromptDataPromptChat) UnmarshalJSON ¶
func (r *PromptDataPromptChat) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessage ¶
type PromptDataPromptChatMessage struct {
// This field can have the runtime type of [string],
// [PromptDataPromptChatMessagesUserContentUnion].
Content interface{} `json:"content,required"`
Role PromptDataPromptChatMessagesRole `json:"role,required"`
Name string `json:"name"`
// This field can have the runtime type of
// [PromptDataPromptChatMessagesAssistantFunctionCall].
FunctionCall interface{} `json:"function_call,required"`
// This field can have the runtime type of
// [[]PromptDataPromptChatMessagesAssistantToolCall].
ToolCalls interface{} `json:"tool_calls,required"`
ToolCallID string `json:"tool_call_id"`
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 {
Content param.Field[interface{}] `json:"content,required"`
Role param.Field[PromptDataPromptChatMessagesRole] `json:"role,required"`
Name param.Field[string] `json:"name"`
FunctionCall param.Field[interface{}] `json:"function_call,required"`
ToolCalls param.Field[interface{}] `json:"tool_calls,required"`
ToolCallID param.Field[string] `json:"tool_call_id"`
}
func (PromptDataPromptChatMessageParam) MarshalJSON ¶
func (r PromptDataPromptChatMessageParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistant ¶
type PromptDataPromptChatMessagesAssistant struct {
Role PromptDataPromptChatMessagesAssistantRole `json:"role,required"`
Content string `json:"content,nullable"`
FunctionCall PromptDataPromptChatMessagesAssistantFunctionCall `json:"function_call,nullable"`
Name string `json:"name,nullable"`
ToolCalls []PromptDataPromptChatMessagesAssistantToolCall `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[[]PromptDataPromptChatMessagesAssistantToolCallParam] `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 PromptDataPromptChatMessagesAssistantToolCall ¶
type PromptDataPromptChatMessagesAssistantToolCall struct {
ID string `json:"id,required"`
Function PromptDataPromptChatMessagesAssistantToolCallsFunction `json:"function,required"`
Type PromptDataPromptChatMessagesAssistantToolCallsType `json:"type,required"`
JSON promptDataPromptChatMessagesAssistantToolCallJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesAssistantToolCall) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesAssistantToolCall) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesAssistantToolCallParam ¶
type PromptDataPromptChatMessagesAssistantToolCallParam struct {
ID param.Field[string] `json:"id,required"`
Function param.Field[PromptDataPromptChatMessagesAssistantToolCallsFunctionParam] `json:"function,required"`
Type param.Field[PromptDataPromptChatMessagesAssistantToolCallsType] `json:"type,required"`
}
func (PromptDataPromptChatMessagesAssistantToolCallParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesAssistantToolCallParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistantToolCallsFunction ¶
type PromptDataPromptChatMessagesAssistantToolCallsFunction struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
JSON promptDataPromptChatMessagesAssistantToolCallsFunctionJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesAssistantToolCallsFunction) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesAssistantToolCallsFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesAssistantToolCallsFunctionParam ¶
type PromptDataPromptChatMessagesAssistantToolCallsFunctionParam struct {
Arguments param.Field[string] `json:"arguments,required"`
Name param.Field[string] `json:"name,required"`
}
func (PromptDataPromptChatMessagesAssistantToolCallsFunctionParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesAssistantToolCallsFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistantToolCallsType ¶
type PromptDataPromptChatMessagesAssistantToolCallsType string
const (
PromptDataPromptChatMessagesAssistantToolCallsTypeFunction PromptDataPromptChatMessagesAssistantToolCallsType = "function"
)
func (PromptDataPromptChatMessagesAssistantToolCallsType) IsKnown ¶
func (r PromptDataPromptChatMessagesAssistantToolCallsType) 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 []PromptDataPromptChatMessagesUserContentArrayItem
func (PromptDataPromptChatMessagesUserContentArray) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion ¶
func (r PromptDataPromptChatMessagesUserContentArray) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
type PromptDataPromptChatMessagesUserContentArrayImageURL ¶
type PromptDataPromptChatMessagesUserContentArrayImageURL struct {
ImageURL PromptDataPromptChatMessagesUserContentArrayImageURLImageURL `json:"image_url,required"`
Type PromptDataPromptChatMessagesUserContentArrayImageURLType `json:"type,required"`
JSON promptDataPromptChatMessagesUserContentArrayImageURLJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUserContentArrayImageURL) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayImageURL) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURL ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURL struct {
URL string `json:"url,required"`
Detail PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail `json:"detail"`
JSON promptDataPromptChatMessagesUserContentArrayImageURLImageURLJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUserContentArrayImageURLImageURL) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayImageURLImageURL) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail string
const ( PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetailAuto PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail = "auto" PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetailLow PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail = "low" PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetailHigh PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail = "high" )
func (PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam struct {
URL param.Field[string] `json:"url,required"`
Detail param.Field[PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail] `json:"detail"`
}
func (PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLParam ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLParam struct {
ImageURL param.Field[PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam] `json:"image_url,required"`
Type param.Field[PromptDataPromptChatMessagesUserContentArrayImageURLType] `json:"type,required"`
}
func (PromptDataPromptChatMessagesUserContentArrayImageURLParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLType ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLType string
const (
PromptDataPromptChatMessagesUserContentArrayImageURLTypeImageURL PromptDataPromptChatMessagesUserContentArrayImageURLType = "image_url"
)
func (PromptDataPromptChatMessagesUserContentArrayImageURLType) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLType) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayItem ¶
type PromptDataPromptChatMessagesUserContentArrayItem struct {
Text string `json:"text"`
Type PromptDataPromptChatMessagesUserContentArrayType `json:"type,required"`
// This field can have the runtime type of
// [PromptDataPromptChatMessagesUserContentArrayImageURLImageURL].
ImageURL interface{} `json:"image_url,required"`
JSON promptDataPromptChatMessagesUserContentArrayItemJSON `json:"-"`
// contains filtered or unexported fields
}
func (PromptDataPromptChatMessagesUserContentArrayItem) AsUnion ¶
func (r PromptDataPromptChatMessagesUserContentArrayItem) AsUnion() PromptDataPromptChatMessagesUserContentArrayUnionItem
AsUnion returns a PromptDataPromptChatMessagesUserContentArrayUnionItem interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.PromptDataPromptChatMessagesUserContentArrayText, shared.PromptDataPromptChatMessagesUserContentArrayImageURL.
func (*PromptDataPromptChatMessagesUserContentArrayItem) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayItem) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayItemParam ¶
type PromptDataPromptChatMessagesUserContentArrayItemParam struct {
Text param.Field[string] `json:"text"`
Type param.Field[PromptDataPromptChatMessagesUserContentArrayType] `json:"type,required"`
ImageURL param.Field[interface{}] `json:"image_url,required"`
}
func (PromptDataPromptChatMessagesUserContentArrayItemParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayItemParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayParam ¶
type PromptDataPromptChatMessagesUserContentArrayParam []PromptDataPromptChatMessagesUserContentArrayUnionItemParam
func (PromptDataPromptChatMessagesUserContentArrayParam) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam ¶
func (r PromptDataPromptChatMessagesUserContentArrayParam) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
type PromptDataPromptChatMessagesUserContentArrayText ¶
type PromptDataPromptChatMessagesUserContentArrayText struct {
Type PromptDataPromptChatMessagesUserContentArrayTextType `json:"type,required"`
Text string `json:"text"`
JSON promptDataPromptChatMessagesUserContentArrayTextJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUserContentArrayText) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayText) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayTextParam ¶
type PromptDataPromptChatMessagesUserContentArrayTextParam struct {
Type param.Field[PromptDataPromptChatMessagesUserContentArrayTextType] `json:"type,required"`
Text param.Field[string] `json:"text"`
}
func (PromptDataPromptChatMessagesUserContentArrayTextParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayTextParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayTextType ¶
type PromptDataPromptChatMessagesUserContentArrayTextType string
const (
PromptDataPromptChatMessagesUserContentArrayTextTypeText PromptDataPromptChatMessagesUserContentArrayTextType = "text"
)
func (PromptDataPromptChatMessagesUserContentArrayTextType) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayTextType) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayType ¶
type PromptDataPromptChatMessagesUserContentArrayType string
const ( PromptDataPromptChatMessagesUserContentArrayTypeText PromptDataPromptChatMessagesUserContentArrayType = "text" PromptDataPromptChatMessagesUserContentArrayTypeImageURL PromptDataPromptChatMessagesUserContentArrayType = "image_url" )
func (PromptDataPromptChatMessagesUserContentArrayType) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayType) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayUnionItem ¶
type PromptDataPromptChatMessagesUserContentArrayUnionItem interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataPromptChatMessagesUserContentArrayText or shared.PromptDataPromptChatMessagesUserContentArrayImageURL.
type PromptDataPromptChatMessagesUserContentArrayUnionItemParam ¶
type PromptDataPromptChatMessagesUserContentArrayUnionItemParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptChatMessagesUserContentArrayTextParam, shared.PromptDataPromptChatMessagesUserContentArrayImageURLParam, PromptDataPromptChatMessagesUserContentArrayItemParam.
type PromptDataPromptChatMessagesUserContentUnion ¶
type PromptDataPromptChatMessagesUserContentUnion interface {
}
Union satisfied by shared.UnionString or shared.PromptDataPromptChatMessagesUserContentArray.
type PromptDataPromptChatMessagesUserContentUnionParam ¶
type PromptDataPromptChatMessagesUserContentUnionParam interface {
}
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 PromptDataPromptNullableVariant ¶
type PromptDataPromptNullableVariant struct {
JSON promptDataPromptNullableVariantJSON `json:"-"`
}
func (*PromptDataPromptNullableVariant) UnmarshalJSON ¶
func (r *PromptDataPromptNullableVariant) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptNullableVariantParam ¶
type PromptDataPromptNullableVariantParam struct {
}
func (PromptDataPromptNullableVariantParam) MarshalJSON ¶
func (r PromptDataPromptNullableVariantParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptParam ¶
type PromptDataPromptParam struct {
Type param.Field[PromptDataPromptType] `json:"type"`
Content param.Field[string] `json:"content"`
Messages param.Field[interface{}] `json:"messages,required"`
Tools param.Field[string] `json:"tools"`
}
func (PromptDataPromptParam) MarshalJSON ¶
func (r PromptDataPromptParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptType ¶
type PromptDataPromptType string
const ( PromptDataPromptTypeCompletion PromptDataPromptType = "completion" PromptDataPromptTypeChat PromptDataPromptType = "chat" )
func (PromptDataPromptType) IsKnown ¶
func (r PromptDataPromptType) IsKnown() bool
type PromptDataPromptUnion ¶
type PromptDataPromptUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataPromptCompletion, shared.PromptDataPromptChat or shared.PromptDataPromptNullableVariant.
type PromptDataPromptUnionParam ¶
type PromptDataPromptUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptCompletionParam, shared.PromptDataPromptChatParam, shared.PromptDataPromptNullableVariantParam, PromptDataPromptParam.
type PromptLogID ¶
type PromptLogID string
A literal 'p' which identifies the object as a project prompt
const (
PromptLogIDP PromptLogID = "p"
)
func (PromptLogID) IsKnown ¶
func (r PromptLogID) IsKnown() bool
type RepoInfo ¶
type RepoInfo struct {
// Email of the author of the most recent commit
AuthorEmail string `json:"author_email,nullable"`
// Name of the author of the most recent commit
AuthorName string `json:"author_name,nullable"`
// Name of the branch the most recent commit belongs to
Branch string `json:"branch,nullable"`
// SHA of most recent commit
Commit string `json:"commit,nullable"`
// Most recent commit message
CommitMessage string `json:"commit_message,nullable"`
// Time of the most recent commit
CommitTime string `json:"commit_time,nullable"`
// Whether or not the repo had uncommitted changes when snapshotted
Dirty bool `json:"dirty,nullable"`
// If the repo was dirty when run, this includes the diff between the current state
// of the repo and the most recent commit.
GitDiff string `json:"git_diff,nullable"`
// Name of the tag on the most recent commit
Tag string `json:"tag,nullable"`
JSON repoInfoJSON `json:"-"`
}
Metadata about the state of the repo when the experiment was created
func (*RepoInfo) UnmarshalJSON ¶
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 RoleMemberPermissionsPermission `json:"permission,required,nullable"`
// The object type that the ACL applies to
RestrictObjectType RoleMemberPermissionsRestrictObjectType `json:"restrict_object_type,nullable"`
JSON roleMemberPermissionJSON `json:"-"`
}
func (*RoleMemberPermission) UnmarshalJSON ¶
func (r *RoleMemberPermission) UnmarshalJSON(data []byte) (err error)
type RoleMemberPermissionsPermission ¶
type RoleMemberPermissionsPermission string
Each permission permits a certain type of operation on an object in the system
Permissions can be assigned to to objects on an individual basis, or grouped into roles
const ( RoleMemberPermissionsPermissionCreate RoleMemberPermissionsPermission = "create" RoleMemberPermissionsPermissionRead RoleMemberPermissionsPermission = "read" RoleMemberPermissionsPermissionUpdate RoleMemberPermissionsPermission = "update" RoleMemberPermissionsPermissionDelete RoleMemberPermissionsPermission = "delete" RoleMemberPermissionsPermissionCreateACLs RoleMemberPermissionsPermission = "create_acls" RoleMemberPermissionsPermissionReadACLs RoleMemberPermissionsPermission = "read_acls" RoleMemberPermissionsPermissionUpdateACLs RoleMemberPermissionsPermission = "update_acls" RoleMemberPermissionsPermissionDeleteACLs RoleMemberPermissionsPermission = "delete_acls" )
func (RoleMemberPermissionsPermission) IsKnown ¶
func (r RoleMemberPermissionsPermission) IsKnown() bool
type RoleMemberPermissionsRestrictObjectType ¶
type RoleMemberPermissionsRestrictObjectType string
The object type that the ACL applies to
const ( RoleMemberPermissionsRestrictObjectTypeOrganization RoleMemberPermissionsRestrictObjectType = "organization" RoleMemberPermissionsRestrictObjectTypeProject RoleMemberPermissionsRestrictObjectType = "project" RoleMemberPermissionsRestrictObjectTypeExperiment RoleMemberPermissionsRestrictObjectType = "experiment" RoleMemberPermissionsRestrictObjectTypeDataset RoleMemberPermissionsRestrictObjectType = "dataset" RoleMemberPermissionsRestrictObjectTypePrompt RoleMemberPermissionsRestrictObjectType = "prompt" RoleMemberPermissionsRestrictObjectTypePromptSession RoleMemberPermissionsRestrictObjectType = "prompt_session" RoleMemberPermissionsRestrictObjectTypeGroup RoleMemberPermissionsRestrictObjectType = "group" RoleMemberPermissionsRestrictObjectTypeRole RoleMemberPermissionsRestrictObjectType = "role" RoleMemberPermissionsRestrictObjectTypeOrgMember RoleMemberPermissionsRestrictObjectType = "org_member" RoleMemberPermissionsRestrictObjectTypeProjectLog RoleMemberPermissionsRestrictObjectType = "project_log" RoleMemberPermissionsRestrictObjectTypeOrgProject RoleMemberPermissionsRestrictObjectType = "org_project" )
func (RoleMemberPermissionsRestrictObjectType) IsKnown ¶
func (r RoleMemberPermissionsRestrictObjectType) IsKnown() bool
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 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) ImplementsAPIKeyListParamsIDsUnion ¶
func (UnionString) ImplementsAPIKeyListParamsIDsUnion()
func (UnionString) ImplementsDatasetListParamsIDsUnion ¶
func (UnionString) ImplementsDatasetListParamsIDsUnion()
func (UnionString) ImplementsExperimentListParamsIDsUnion ¶
func (UnionString) ImplementsExperimentListParamsIDsUnion()
func (UnionString) ImplementsFunctionListParamsIDsUnion ¶
func (UnionString) ImplementsFunctionListParamsIDsUnion()
func (UnionString) ImplementsGroupListParamsIDsUnion ¶
func (UnionString) ImplementsGroupListParamsIDsUnion()
func (UnionString) ImplementsOrganizationListParamsIDsUnion ¶
func (UnionString) ImplementsOrganizationListParamsIDsUnion()
func (UnionString) ImplementsProjectListParamsIDsUnion ¶
func (UnionString) ImplementsProjectListParamsIDsUnion()
func (UnionString) ImplementsProjectScoreListParamsIDsUnion ¶
func (UnionString) ImplementsProjectScoreListParamsIDsUnion()
func (UnionString) ImplementsProjectTagListParamsIDsUnion ¶
func (UnionString) ImplementsProjectTagListParamsIDsUnion()
func (UnionString) ImplementsPromptListParamsIDsUnion ¶
func (UnionString) ImplementsPromptListParamsIDsUnion()
func (UnionString) ImplementsRoleListParamsIDsUnion ¶
func (UnionString) ImplementsRoleListParamsIDsUnion()
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion ¶
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam ¶
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
func (UnionString) ImplementsUserListParamsEmailUnion ¶
func (UnionString) ImplementsUserListParamsEmailUnion()
func (UnionString) ImplementsUserListParamsFamilyNameUnion ¶
func (UnionString) ImplementsUserListParamsFamilyNameUnion()
func (UnionString) ImplementsUserListParamsGivenNameUnion ¶
func (UnionString) ImplementsUserListParamsGivenNameUnion()
func (UnionString) ImplementsUserListParamsIDsUnion ¶
func (UnionString) ImplementsUserListParamsIDsUnion()
func (UnionString) ImplementsViewListParamsIDsUnion ¶
func (UnionString) ImplementsViewListParamsIDsUnion()
type User ¶
type User struct {
// Unique identifier for the user
ID string `json:"id,required" format:"uuid"`
// URL of the user's Avatar image
AvatarURL string `json:"avatar_url,nullable"`
// Date of user creation
Created time.Time `json:"created,nullable" format:"date-time"`
// The user's email
Email string `json:"email,nullable"`
// Family name of the user
FamilyName string `json:"family_name,nullable"`
// Given name of the user
GivenName string `json:"given_name,nullable"`
JSON userJSON `json:"-"`
}
func (*User) UnmarshalJSON ¶
type View ¶
type View struct {
// Unique identifier for the view
ID string `json:"id,required" format:"uuid"`
// Name of the view
Name string `json:"name,required"`
// The id of the object the view applies to
ObjectID string `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType ViewObjectType `json:"object_type,required,nullable"`
// 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 ViewObjectType ¶
type ViewObjectType string
The object type that the ACL applies to
const ( ViewObjectTypeOrganization ViewObjectType = "organization" ViewObjectTypeProject ViewObjectType = "project" ViewObjectTypeExperiment ViewObjectType = "experiment" ViewObjectTypeDataset ViewObjectType = "dataset" ViewObjectTypePrompt ViewObjectType = "prompt" ViewObjectTypePromptSession ViewObjectType = "prompt_session" ViewObjectTypeGroup ViewObjectType = "group" ViewObjectTypeRole ViewObjectType = "role" ViewObjectTypeOrgMember ViewObjectType = "org_member" ViewObjectTypeProjectLog ViewObjectType = "project_log" ViewObjectTypeOrgProject ViewObjectType = "org_project" )
func (ViewObjectType) IsKnown ¶
func (r ViewObjectType) IsKnown() bool
type ViewOptions ¶
type ViewOptions struct {
ColumnOrder []string `json:"columnOrder,nullable"`
ColumnSizing map[string]float64 `json:"columnSizing,nullable"`
ColumnVisibility map[string]bool `json:"columnVisibility,nullable"`
JSON viewOptionsJSON `json:"-"`
}
Options for the view in the app
func (*ViewOptions) UnmarshalJSON ¶
func (r *ViewOptions) UnmarshalJSON(data []byte) (err error)
type ViewOptionsParam ¶
type ViewOptionsParam struct {
ColumnOrder param.Field[[]string] `json:"columnOrder"`
ColumnSizing param.Field[map[string]float64] `json:"columnSizing"`
ColumnVisibility param.Field[map[string]bool] `json:"columnVisibility"`
}
Options for the view in the app
func (ViewOptionsParam) MarshalJSON ¶
func (r ViewOptionsParam) MarshalJSON() (data []byte, err error)
type ViewViewType ¶
type ViewViewType string
Type of table that the view corresponds to.
const ( ViewViewTypeProjects ViewViewType = "projects" ViewViewTypeLogs ViewViewType = "logs" ViewViewTypeExperiments ViewViewType = "experiments" ViewViewTypeDatasets ViewViewType = "datasets" ViewViewTypePrompts ViewViewType = "prompts" ViewViewTypePlaygrounds ViewViewType = "playgrounds" ViewViewTypeExperiment ViewViewType = "experiment" ViewViewTypeDataset ViewViewType = "dataset" )
func (ViewViewType) IsKnown ¶
func (r ViewViewType) IsKnown() bool