Documentation
¶
Index ¶
- type ACL
- type ACLBatchUpdateResponse
- type ACLObjectType
- type AISecret
- type APIKey
- type ChatCompletionContentPartImage
- type ChatCompletionContentPartImageImageURL
- type ChatCompletionContentPartImageImageURLDetail
- type ChatCompletionContentPartImageImageURLParam
- type ChatCompletionContentPartImageParam
- type ChatCompletionContentPartImageType
- type ChatCompletionContentPartText
- type ChatCompletionContentPartTextParam
- type ChatCompletionContentPartTextType
- type ChatCompletionMessageToolCall
- type ChatCompletionMessageToolCallFunction
- type ChatCompletionMessageToolCallFunctionParam
- type ChatCompletionMessageToolCallParam
- type ChatCompletionMessageToolCallType
- type CodeBundle
- type CodeBundleLocationExperiment
- type CodeBundleLocationExperimentParam
- type CodeBundleLocationExperimentPositionScorer
- type CodeBundleLocationExperimentPositionScorerParam
- type CodeBundleLocationExperimentPositionType
- type CodeBundleLocationExperimentPositionTypeParam
- type CodeBundleLocationExperimentPositionUnion
- func (u CodeBundleLocationExperimentPositionUnion) AsCodeBundleLocationExperimentPositionType() (v CodeBundleLocationExperimentPositionType)
- func (u CodeBundleLocationExperimentPositionUnion) AsScorer() (v CodeBundleLocationExperimentPositionScorer)
- func (u CodeBundleLocationExperimentPositionUnion) RawJSON() string
- func (r *CodeBundleLocationExperimentPositionUnion) UnmarshalJSON(data []byte) error
- type CodeBundleLocationExperimentPositionUnionParam
- func (u CodeBundleLocationExperimentPositionUnionParam) GetIndex() *int64
- func (u CodeBundleLocationExperimentPositionUnionParam) GetType() *string
- func (u CodeBundleLocationExperimentPositionUnionParam) MarshalJSON() ([]byte, error)
- func (u *CodeBundleLocationExperimentPositionUnionParam) UnmarshalJSON(data []byte) error
- type CodeBundleLocationFunction
- type CodeBundleLocationFunctionParam
- type CodeBundleLocationUnion
- type CodeBundleLocationUnionParam
- func (u CodeBundleLocationUnionParam) GetEvalName() *string
- func (u CodeBundleLocationUnionParam) GetIndex() *int64
- func (u CodeBundleLocationUnionParam) GetPosition() *CodeBundleLocationExperimentPositionUnionParam
- func (u CodeBundleLocationUnionParam) GetType() *string
- func (u CodeBundleLocationUnionParam) MarshalJSON() ([]byte, error)
- func (u *CodeBundleLocationUnionParam) UnmarshalJSON(data []byte) error
- type CodeBundleParam
- type CodeBundleRuntimeContext
- type CodeBundleRuntimeContextParam
- type CreateAPIKeyOutput
- type DataSummary
- type Dataset
- type DatasetEvent
- type DatasetEventMetadata
- type EnvVar
- type EnvVarObjectType
- type Experiment
- type ExperimentEvent
- type ExperimentEventContext
- type ExperimentEventMetadata
- type ExperimentEventMetrics
- type FeedbackDatasetItemParam
- type FeedbackDatasetItemSource
- type FeedbackExperimentItemParam
- type FeedbackExperimentItemSource
- type FeedbackProjectLogsItemParam
- type FeedbackProjectLogsItemSource
- type FeedbackResponseSchema
- type FeedbackResponseSchemaStatus
- type FetchDatasetEventsResponse
- type FetchExperimentEventsResponse
- type FetchProjectLogsEventsResponse
- type Function
- type FunctionFunctionDataCode
- type FunctionFunctionDataCodeDataBundle
- type FunctionFunctionDataCodeDataInline
- type FunctionFunctionDataCodeDataInlineRuntimeContext
- type FunctionFunctionDataCodeDataUnion
- func (u FunctionFunctionDataCodeDataUnion) AsBundle() (v FunctionFunctionDataCodeDataBundle)
- func (u FunctionFunctionDataCodeDataUnion) AsInline() (v FunctionFunctionDataCodeDataInline)
- func (u FunctionFunctionDataCodeDataUnion) RawJSON() string
- func (r *FunctionFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
- type FunctionFunctionDataCodeDataUnionRuntimeContext
- type FunctionFunctionDataGlobal
- type FunctionFunctionDataPrompt
- type FunctionFunctionDataUnion
- func (u FunctionFunctionDataUnion) AsCode() (v FunctionFunctionDataCode)
- func (u FunctionFunctionDataUnion) AsGlobal() (v FunctionFunctionDataGlobal)
- func (u FunctionFunctionDataUnion) AsPrompt() (v FunctionFunctionDataPrompt)
- func (u FunctionFunctionDataUnion) RawJSON() string
- func (r *FunctionFunctionDataUnion) UnmarshalJSON(data []byte) error
- type FunctionFunctionSchema
- type FunctionFunctionType
- type FunctionLogID
- type FunctionOrigin
- type Group
- type InsertDatasetEventMetadataParam
- type InsertDatasetEventParam
- type InsertEventsResponse
- type InsertExperimentEventContextParam
- type InsertExperimentEventMetadataParam
- type InsertExperimentEventMetricsParam
- type InsertExperimentEventParam
- type InsertProjectLogsEventContextParam
- type InsertProjectLogsEventMetadataParam
- type InsertProjectLogsEventMetricsParam
- type InsertProjectLogsEventParam
- type MetricSummary
- type ObjectReference
- type ObjectReferenceObjectType
- type ObjectReferenceParam
- type OnlineScoreConfig
- type OnlineScoreConfigParam
- type OnlineScoreConfigScorerFunction
- type OnlineScoreConfigScorerFunctionParam
- type OnlineScoreConfigScorerGlobal
- type OnlineScoreConfigScorerGlobalParam
- type OnlineScoreConfigScorerUnion
- type OnlineScoreConfigScorerUnionParam
- func (u OnlineScoreConfigScorerUnionParam) GetID() *string
- func (u OnlineScoreConfigScorerUnionParam) GetName() *string
- func (u OnlineScoreConfigScorerUnionParam) GetType() *string
- func (u OnlineScoreConfigScorerUnionParam) MarshalJSON() ([]byte, error)
- func (u *OnlineScoreConfigScorerUnionParam) UnmarshalJSON(data []byte) error
- type Organization
- type PatchOrganizationMembersOutput
- type PatchOrganizationMembersOutputStatus
- type Permission
- type Project
- type ProjectLogsEvent
- type ProjectLogsEventContext
- type ProjectLogsEventLogID
- type ProjectLogsEventMetadata
- type ProjectLogsEventMetrics
- type ProjectScore
- type ProjectScoreCategoriesUnion
- type ProjectScoreCategory
- type ProjectScoreCategoryParam
- type ProjectScoreConfig
- type ProjectScoreConfigParam
- type ProjectScoreType
- type ProjectSettings
- type ProjectSettingsParam
- type ProjectSettingsSpanFieldOrder
- type ProjectSettingsSpanFieldOrderLayout
- type ProjectSettingsSpanFieldOrderParam
- type ProjectTag
- type Prompt
- type PromptData
- type PromptDataOrigin
- type PromptDataOriginParam
- type PromptDataParam
- type PromptDataParser
- type PromptDataParserParam
- type PromptDataPromptChat
- type PromptDataPromptChatMessageAssistant
- type PromptDataPromptChatMessageAssistantFunctionCall
- type PromptDataPromptChatMessageAssistantFunctionCallParam
- type PromptDataPromptChatMessageAssistantParam
- type PromptDataPromptChatMessageFallback
- type PromptDataPromptChatMessageFallbackParam
- type PromptDataPromptChatMessageFunction
- type PromptDataPromptChatMessageFunctionParam
- type PromptDataPromptChatMessageSystem
- type PromptDataPromptChatMessageSystemParam
- type PromptDataPromptChatMessageTool
- type PromptDataPromptChatMessageToolParam
- type PromptDataPromptChatMessageUnion
- func (u PromptDataPromptChatMessageUnion) AsAssistant() (v PromptDataPromptChatMessageAssistant)
- func (u PromptDataPromptChatMessageUnion) AsFallback() (v PromptDataPromptChatMessageFallback)
- func (u PromptDataPromptChatMessageUnion) AsFunction() (v PromptDataPromptChatMessageFunction)
- func (u PromptDataPromptChatMessageUnion) AsSystem() (v PromptDataPromptChatMessageSystem)
- func (u PromptDataPromptChatMessageUnion) AsTool() (v PromptDataPromptChatMessageTool)
- func (u PromptDataPromptChatMessageUnion) AsUser() (v PromptDataPromptChatMessageUser)
- func (u PromptDataPromptChatMessageUnion) RawJSON() string
- func (r *PromptDataPromptChatMessageUnion) UnmarshalJSON(data []byte) error
- type PromptDataPromptChatMessageUnionContent
- type PromptDataPromptChatMessageUnionParam
- func (u PromptDataPromptChatMessageUnionParam) GetContent() (res promptDataPromptChatMessageUnionParamContent)
- func (u PromptDataPromptChatMessageUnionParam) GetFunctionCall() *PromptDataPromptChatMessageAssistantFunctionCallParam
- func (u PromptDataPromptChatMessageUnionParam) GetName() *string
- func (u PromptDataPromptChatMessageUnionParam) GetRole() *string
- func (u PromptDataPromptChatMessageUnionParam) GetToolCallID() *string
- func (u PromptDataPromptChatMessageUnionParam) GetToolCalls() []ChatCompletionMessageToolCallParam
- func (u PromptDataPromptChatMessageUnionParam) MarshalJSON() ([]byte, error)
- func (u *PromptDataPromptChatMessageUnionParam) UnmarshalJSON(data []byte) error
- type PromptDataPromptChatMessageUser
- type PromptDataPromptChatMessageUserContentArrayItemUnion
- func (u PromptDataPromptChatMessageUserContentArrayItemUnion) AsImageURL() (v ChatCompletionContentPartImage)
- func (u PromptDataPromptChatMessageUserContentArrayItemUnion) AsText() (v ChatCompletionContentPartText)
- func (u PromptDataPromptChatMessageUserContentArrayItemUnion) RawJSON() string
- func (r *PromptDataPromptChatMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type PromptDataPromptChatMessageUserContentArrayItemUnionParam
- func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetImageURL() *ChatCompletionContentPartImageImageURLParam
- func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetText() *string
- func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetType() *string
- func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) MarshalJSON() ([]byte, error)
- func (u *PromptDataPromptChatMessageUserContentArrayItemUnionParam) UnmarshalJSON(data []byte) error
- type PromptDataPromptChatMessageUserContentUnion
- func (u PromptDataPromptChatMessageUserContentUnion) AsArray() (v []PromptDataPromptChatMessageUserContentArrayItemUnion)
- func (u PromptDataPromptChatMessageUserContentUnion) AsString() (v string)
- func (u PromptDataPromptChatMessageUserContentUnion) RawJSON() string
- func (r *PromptDataPromptChatMessageUserContentUnion) UnmarshalJSON(data []byte) error
- type PromptDataPromptChatMessageUserContentUnionParam
- type PromptDataPromptChatMessageUserParam
- type PromptDataPromptChatParam
- type PromptDataPromptCompletion
- type PromptDataPromptCompletionParam
- type PromptDataPromptUnion
- type PromptDataPromptUnionParam
- func (u PromptDataPromptUnionParam) GetContent() *string
- func (u PromptDataPromptUnionParam) GetMessages() []PromptDataPromptChatMessageUnionParam
- func (u PromptDataPromptUnionParam) GetTools() *string
- func (u PromptDataPromptUnionParam) GetType() *string
- func (u PromptDataPromptUnionParam) MarshalJSON() ([]byte, error)
- func (u *PromptDataPromptUnionParam) UnmarshalJSON(data []byte) error
- type PromptDataToolFunctionFunction
- type PromptDataToolFunctionFunctionParam
- type PromptDataToolFunctionGlobal
- type PromptDataToolFunctionGlobalParam
- type PromptDataToolFunctionUnion
- type PromptDataToolFunctionUnionParam
- func (u PromptDataToolFunctionUnionParam) GetID() *string
- func (u PromptDataToolFunctionUnionParam) GetName() *string
- func (u PromptDataToolFunctionUnionParam) GetType() *string
- func (u PromptDataToolFunctionUnionParam) MarshalJSON() ([]byte, error)
- func (u *PromptDataToolFunctionUnionParam) UnmarshalJSON(data []byte) error
- type PromptFunctionType
- type PromptLogID
- type PromptOptions
- type PromptOptionsParam
- type PromptOptionsParamsAnthropicModelParams
- type PromptOptionsParamsAnthropicModelParamsParam
- type PromptOptionsParamsGoogleModelParams
- type PromptOptionsParamsGoogleModelParamsParam
- type PromptOptionsParamsJsCompletionParams
- type PromptOptionsParamsJsCompletionParamsParam
- type PromptOptionsParamsOpenAIModelParams
- type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction
- type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam
- type PromptOptionsParamsOpenAIModelParamsFunctionCallString
- type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion
- func (u PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) AsFunction() (v PromptOptionsParamsOpenAIModelParamsFunctionCallFunction)
- func (u PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) AsPromptOptionsParamsOpenAIModelParamsFunctionCallString() (v PromptOptionsParamsOpenAIModelParamsFunctionCallString)
- func (u PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) RawJSON() string
- func (r *PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) UnmarshalJSON(data []byte) error
- type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam
- type PromptOptionsParamsOpenAIModelParamsParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatText
- type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsJsonObject() (v PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject)
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsJsonSchema() (v PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema)
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsText() (v PromptOptionsParamsOpenAIModelParamsResponseFormatText)
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) RawJSON() string
- func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) UnmarshalJSON(data []byte) error
- type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) GetJsonSchema() *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) GetType() *string
- func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) MarshalJSON() ([]byte, error)
- func (u *PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) UnmarshalJSON(data []byte) error
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceString
- type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion
- func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) AsFunction() (v PromptOptionsParamsOpenAIModelParamsToolChoiceFunction)
- func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) AsPromptOptionsParamsOpenAIModelParamsToolChoiceString() (v PromptOptionsParamsOpenAIModelParamsToolChoiceString)
- func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) RawJSON() string
- func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) UnmarshalJSON(data []byte) error
- type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam
- type PromptOptionsParamsUnion
- func (u PromptOptionsParamsUnion) AsAnthropicModelParams() (v PromptOptionsParamsAnthropicModelParams)
- func (u PromptOptionsParamsUnion) AsGoogleModelParams() (v PromptOptionsParamsGoogleModelParams)
- func (u PromptOptionsParamsUnion) AsJsCompletionParams() (v PromptOptionsParamsJsCompletionParams)
- func (u PromptOptionsParamsUnion) AsOpenAIModelParams() (v PromptOptionsParamsOpenAIModelParams)
- func (u PromptOptionsParamsUnion) AsWindowAIModelParams() (v PromptOptionsParamsWindowAIModelParams)
- func (u PromptOptionsParamsUnion) RawJSON() string
- func (r *PromptOptionsParamsUnion) UnmarshalJSON(data []byte) error
- type PromptOptionsParamsUnionParam
- func (u PromptOptionsParamsUnionParam) GetFrequencyPenalty() *float64
- func (u PromptOptionsParamsUnionParam) GetFunctionCall() *PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam
- func (u PromptOptionsParamsUnionParam) GetMaxCompletionTokens() *float64
- func (u PromptOptionsParamsUnionParam) GetMaxOutputTokens() *float64
- func (u PromptOptionsParamsUnionParam) GetMaxTokens() *float64
- func (u PromptOptionsParamsUnionParam) GetMaxTokensToSample() *float64
- func (u PromptOptionsParamsUnionParam) GetN() *float64
- func (u PromptOptionsParamsUnionParam) GetPresencePenalty() *float64
- func (u PromptOptionsParamsUnionParam) GetReasoningEffort() *string
- func (u PromptOptionsParamsUnionParam) GetResponseFormat() *PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam
- func (u PromptOptionsParamsUnionParam) GetStop() []string
- func (u PromptOptionsParamsUnionParam) GetStopSequences() []string
- func (u PromptOptionsParamsUnionParam) GetTemperature() *float64
- func (u PromptOptionsParamsUnionParam) GetToolChoice() *PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam
- func (u PromptOptionsParamsUnionParam) GetTopK() *float64
- func (u PromptOptionsParamsUnionParam) GetTopP() *float64
- func (u PromptOptionsParamsUnionParam) GetUseCache() *bool
- func (u PromptOptionsParamsUnionParam) MarshalJSON() ([]byte, error)
- func (u *PromptOptionsParamsUnionParam) UnmarshalJSON(data []byte) error
- type PromptOptionsParamsWindowAIModelParams
- type PromptOptionsParamsWindowAIModelParamsParam
- type RepoInfo
- type RepoInfoParam
- type Role
- type RoleMemberPermission
- type ScoreSummary
- type SpanAttributes
- type SpanAttributesParam
- type SpanIFrame
- type SpanType
- type SummarizeDatasetResponse
- type SummarizeExperimentResponse
- type User
- type View
- type ViewData
- type ViewDataParam
- type ViewDataSearch
- type ViewDataSearchParam
- type ViewOptions
- type ViewOptionsParam
- type ViewType
- type ViewViewType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct {
// Unique identifier for the acl
ID string `json:"id,required" format:"uuid"`
// The organization the ACL's referred object belongs to
ObjectOrgID string `json:"_object_org_id,required" format:"uuid"`
// The id of the object the ACL applies to
ObjectID string `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
//
// Any of "organization", "project", "experiment", "dataset", "prompt",
// "prompt_session", "group", "role", "org_member", "project_log", "org_project".
ObjectType ACLObjectType `json:"object_type,required"`
// Date of acl creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
GroupID string `json:"group_id,nullable" format:"uuid"`
// Permission the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
//
// Any of "create", "read", "update", "delete", "create_acls", "read_acls",
// "update_acls", "delete_acls".
Permission Permission `json:"permission,nullable"`
// When setting a permission directly, optionally restricts the permission grant to
// just the specified object type. Cannot be set alongside a `role_id`.
//
// Any of "organization", "project", "experiment", "dataset", "prompt",
// "prompt_session", "group", "role", "org_member", "project_log", "org_project".
RestrictObjectType ACLObjectType `json:"restrict_object_type,nullable"`
// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
RoleID string `json:"role_id,nullable" format:"uuid"`
// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
UserID string `json:"user_id,nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ObjectOrgID respjson.Field
ObjectID respjson.Field
ObjectType respjson.Field
Created respjson.Field
GroupID respjson.Field
Permission respjson.Field
RestrictObjectType respjson.Field
RoleID respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An ACL grants a certain permission or role to a certain user or group on an object.
ACLs are inherited across the object hierarchy. So for example, if a user has read permissions on a project, they will also have read permissions on any experiment, dataset, etc. created within that project.
To restrict a grant to a particular sub-object, you may specify `restrict_object_type` in the ACL, as part of a direct permission grant or as part of a role.
func (*ACL) UnmarshalJSON ¶
type ACLBatchUpdateResponse ¶ added in v0.4.0
type ACLBatchUpdateResponse struct {
// An ACL grants a certain permission or role to a certain user or group on an
// object.
//
// ACLs are inherited across the object hierarchy. So for example, if a user has
// read permissions on a project, they will also have read permissions on any
// experiment, dataset, etc. created within that project.
//
// To restrict a grant to a particular sub-object, you may specify
// `restrict_object_type` in the ACL, as part of a direct permission grant or as
// part of a role.
AddedACLs []ACL `json:"added_acls,required"`
// An ACL grants a certain permission or role to a certain user or group on an
// object.
//
// ACLs are inherited across the object hierarchy. So for example, if a user has
// read permissions on a project, they will also have read permissions on any
// experiment, dataset, etc. created within that project.
//
// To restrict a grant to a particular sub-object, you may specify
// `restrict_object_type` in the ACL, as part of a direct permission grant or as
// part of a role.
RemovedACLs []ACL `json:"removed_acls,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AddedACLs respjson.Field
RemovedACLs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ACLBatchUpdateResponse) RawJSON ¶ added in v0.8.0
func (r ACLBatchUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ACLBatchUpdateResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *ACLBatchUpdateResponse) UnmarshalJSON(data []byte) error
type ACLObjectType ¶
type ACLObjectType string
The object type that the ACL applies to
const ( ACLObjectTypeOrganization ACLObjectType = "organization" ACLObjectTypeProject ACLObjectType = "project" ACLObjectTypeExperiment ACLObjectType = "experiment" ACLObjectTypeDataset ACLObjectType = "dataset" ACLObjectTypePrompt ACLObjectType = "prompt" ACLObjectTypePromptSession ACLObjectType = "prompt_session" ACLObjectTypeGroup ACLObjectType = "group" ACLObjectTypeRole ACLObjectType = "role" ACLObjectTypeOrgMember ACLObjectType = "org_member" ACLObjectTypeProjectLog ACLObjectType = "project_log" ACLObjectTypeOrgProject ACLObjectType = "org_project" )
type AISecret ¶ added in v0.4.0
type AISecret struct {
// Unique identifier for the AI secret
ID string `json:"id,required" format:"uuid"`
// Name of the AI secret
Name string `json:"name,required"`
// Unique identifier for the organization
OrgID string `json:"org_id,required" format:"uuid"`
// Date of AI secret creation
Created time.Time `json:"created,nullable" format:"date-time"`
Metadata map[string]any `json:"metadata,nullable"`
PreviewSecret string `json:"preview_secret,nullable"`
Type string `json:"type,nullable"`
// Date of last AI secret update
UpdatedAt time.Time `json:"updated_at,nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrgID respjson.Field
Created respjson.Field
Metadata respjson.Field
PreviewSecret respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*AISecret) UnmarshalJSON ¶ added in v0.4.0
type APIKey ¶
type APIKey struct {
// Unique identifier for the api key
ID string `json:"id,required" format:"uuid"`
// Name of the api key
Name string `json:"name,required"`
PreviewName string `json:"preview_name,required"`
// Date of api key creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Unique identifier for the organization
OrgID string `json:"org_id,nullable" format:"uuid"`
// Unique identifier for the user
UserID string `json:"user_id,nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
PreviewName respjson.Field
Created respjson.Field
OrgID respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*APIKey) UnmarshalJSON ¶
type ChatCompletionContentPartImage ¶ added in v0.4.0
type ChatCompletionContentPartImage struct {
ImageURL ChatCompletionContentPartImageImageURL `json:"image_url,required"`
// Any of "image_url".
Type ChatCompletionContentPartImageType `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImageURL respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionContentPartImage) RawJSON ¶ added in v0.8.0
func (r ChatCompletionContentPartImage) RawJSON() string
Returns the unmodified JSON received from the API
func (ChatCompletionContentPartImage) ToParam ¶ added in v0.8.0
func (r ChatCompletionContentPartImage) ToParam() ChatCompletionContentPartImageParam
ToParam converts this ChatCompletionContentPartImage to a ChatCompletionContentPartImageParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ChatCompletionContentPartImageParam.Overrides()
func (*ChatCompletionContentPartImage) UnmarshalJSON ¶ added in v0.4.0
func (r *ChatCompletionContentPartImage) UnmarshalJSON(data []byte) error
type ChatCompletionContentPartImageImageURL ¶ added in v0.4.0
type ChatCompletionContentPartImageImageURL struct {
URL string `json:"url,required"`
// Any of "auto", "low", "high".
Detail ChatCompletionContentPartImageImageURLDetail `json:"detail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Detail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionContentPartImageImageURL) RawJSON ¶ added in v0.8.0
func (r ChatCompletionContentPartImageImageURL) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionContentPartImageImageURL) UnmarshalJSON ¶ added in v0.4.0
func (r *ChatCompletionContentPartImageImageURL) UnmarshalJSON(data []byte) error
type ChatCompletionContentPartImageImageURLDetail ¶ added in v0.4.0
type ChatCompletionContentPartImageImageURLDetail string
const ( ChatCompletionContentPartImageImageURLDetailAuto ChatCompletionContentPartImageImageURLDetail = "auto" ChatCompletionContentPartImageImageURLDetailLow ChatCompletionContentPartImageImageURLDetail = "low" ChatCompletionContentPartImageImageURLDetailHigh ChatCompletionContentPartImageImageURLDetail = "high" )
type ChatCompletionContentPartImageImageURLParam ¶ added in v0.4.0
type ChatCompletionContentPartImageImageURLParam struct {
URL string `json:"url,required"`
// Any of "auto", "low", "high".
Detail ChatCompletionContentPartImageImageURLDetail `json:"detail,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (ChatCompletionContentPartImageImageURLParam) MarshalJSON ¶ added in v0.4.0
func (r ChatCompletionContentPartImageImageURLParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionContentPartImageImageURLParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ChatCompletionContentPartImageImageURLParam) UnmarshalJSON(data []byte) error
type ChatCompletionContentPartImageParam ¶ added in v0.4.0
type ChatCompletionContentPartImageParam struct {
ImageURL ChatCompletionContentPartImageImageURLParam `json:"image_url,omitzero,required"`
// Any of "image_url".
Type ChatCompletionContentPartImageType `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties ImageURL, Type are required.
func (ChatCompletionContentPartImageParam) MarshalJSON ¶ added in v0.4.0
func (r ChatCompletionContentPartImageParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionContentPartImageParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ChatCompletionContentPartImageParam) UnmarshalJSON(data []byte) error
type ChatCompletionContentPartImageType ¶ added in v0.4.0
type ChatCompletionContentPartImageType string
const (
ChatCompletionContentPartImageTypeImageURL ChatCompletionContentPartImageType = "image_url"
)
type ChatCompletionContentPartText ¶ added in v0.4.0
type ChatCompletionContentPartText struct {
// Any of "text".
Type ChatCompletionContentPartTextType `json:"type,required"`
Text string `json:"text"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionContentPartText) RawJSON ¶ added in v0.8.0
func (r ChatCompletionContentPartText) RawJSON() string
Returns the unmodified JSON received from the API
func (ChatCompletionContentPartText) ToParam ¶ added in v0.8.0
func (r ChatCompletionContentPartText) ToParam() ChatCompletionContentPartTextParam
ToParam converts this ChatCompletionContentPartText to a ChatCompletionContentPartTextParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ChatCompletionContentPartTextParam.Overrides()
func (*ChatCompletionContentPartText) UnmarshalJSON ¶ added in v0.4.0
func (r *ChatCompletionContentPartText) UnmarshalJSON(data []byte) error
type ChatCompletionContentPartTextParam ¶ added in v0.4.0
type ChatCompletionContentPartTextParam struct {
// Any of "text".
Type ChatCompletionContentPartTextType `json:"type,omitzero,required"`
Text param.Opt[string] `json:"text,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (ChatCompletionContentPartTextParam) MarshalJSON ¶ added in v0.4.0
func (r ChatCompletionContentPartTextParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionContentPartTextParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ChatCompletionContentPartTextParam) UnmarshalJSON(data []byte) error
type ChatCompletionContentPartTextType ¶ added in v0.4.0
type ChatCompletionContentPartTextType string
const (
ChatCompletionContentPartTextTypeText ChatCompletionContentPartTextType = "text"
)
type ChatCompletionMessageToolCall ¶ added in v0.4.0
type ChatCompletionMessageToolCall struct {
ID string `json:"id,required"`
Function ChatCompletionMessageToolCallFunction `json:"function,required"`
// Any of "function".
Type ChatCompletionMessageToolCallType `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Function respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionMessageToolCall) RawJSON ¶ added in v0.8.0
func (r ChatCompletionMessageToolCall) RawJSON() string
Returns the unmodified JSON received from the API
func (ChatCompletionMessageToolCall) ToParam ¶ added in v0.8.0
func (r ChatCompletionMessageToolCall) ToParam() ChatCompletionMessageToolCallParam
ToParam converts this ChatCompletionMessageToolCall to a ChatCompletionMessageToolCallParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ChatCompletionMessageToolCallParam.Overrides()
func (*ChatCompletionMessageToolCall) UnmarshalJSON ¶ added in v0.4.0
func (r *ChatCompletionMessageToolCall) UnmarshalJSON(data []byte) error
type ChatCompletionMessageToolCallFunction ¶ added in v0.4.0
type ChatCompletionMessageToolCallFunction struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ChatCompletionMessageToolCallFunction) RawJSON ¶ added in v0.8.0
func (r ChatCompletionMessageToolCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*ChatCompletionMessageToolCallFunction) UnmarshalJSON ¶ added in v0.4.0
func (r *ChatCompletionMessageToolCallFunction) UnmarshalJSON(data []byte) error
type ChatCompletionMessageToolCallFunctionParam ¶ added in v0.4.0
type ChatCompletionMessageToolCallFunctionParam struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
// contains filtered or unexported fields
}
The properties Arguments, Name are required.
func (ChatCompletionMessageToolCallFunctionParam) MarshalJSON ¶ added in v0.4.0
func (r ChatCompletionMessageToolCallFunctionParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionMessageToolCallFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ChatCompletionMessageToolCallFunctionParam) UnmarshalJSON(data []byte) error
type ChatCompletionMessageToolCallParam ¶ added in v0.4.0
type ChatCompletionMessageToolCallParam struct {
ID string `json:"id,required"`
Function ChatCompletionMessageToolCallFunctionParam `json:"function,omitzero,required"`
// Any of "function".
Type ChatCompletionMessageToolCallType `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties ID, Function, Type are required.
func (ChatCompletionMessageToolCallParam) MarshalJSON ¶ added in v0.4.0
func (r ChatCompletionMessageToolCallParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionMessageToolCallParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ChatCompletionMessageToolCallParam) UnmarshalJSON(data []byte) error
type ChatCompletionMessageToolCallType ¶ added in v0.4.0
type ChatCompletionMessageToolCallType string
const (
ChatCompletionMessageToolCallTypeFunction ChatCompletionMessageToolCallType = "function"
)
type CodeBundle ¶ added in v0.4.0
type CodeBundle struct {
BundleID string `json:"bundle_id,required"`
Location CodeBundleLocationUnion `json:"location,required"`
RuntimeContext CodeBundleRuntimeContext `json:"runtime_context,required"`
// A preview of the code
Preview string `json:"preview,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BundleID respjson.Field
Location respjson.Field
RuntimeContext respjson.Field
Preview respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CodeBundle) RawJSON ¶ added in v0.8.0
func (r CodeBundle) RawJSON() string
Returns the unmodified JSON received from the API
func (CodeBundle) ToParam ¶ added in v0.8.0
func (r CodeBundle) ToParam() CodeBundleParam
ToParam converts this CodeBundle to a CodeBundleParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CodeBundleParam.Overrides()
func (*CodeBundle) UnmarshalJSON ¶ added in v0.4.0
func (r *CodeBundle) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperiment ¶ added in v0.4.0
type CodeBundleLocationExperiment struct {
EvalName string `json:"eval_name,required"`
Position CodeBundleLocationExperimentPositionUnion `json:"position,required"`
// Any of "experiment".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EvalName respjson.Field
Position respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CodeBundleLocationExperiment) RawJSON ¶ added in v0.8.0
func (r CodeBundleLocationExperiment) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleLocationExperiment) UnmarshalJSON ¶ added in v0.4.0
func (r *CodeBundleLocationExperiment) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentParam ¶ added in v0.4.0
type CodeBundleLocationExperimentParam struct {
EvalName string `json:"eval_name,required"`
Position CodeBundleLocationExperimentPositionUnionParam `json:"position,omitzero,required"`
// Any of "experiment".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties EvalName, Position, Type are required.
func (CodeBundleLocationExperimentParam) MarshalJSON ¶ added in v0.4.0
func (r CodeBundleLocationExperimentParam) MarshalJSON() (data []byte, err error)
func (*CodeBundleLocationExperimentParam) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleLocationExperimentParam) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentPositionScorer ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorer struct {
Index int64 `json:"index,required"`
// Any of "scorer".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CodeBundleLocationExperimentPositionScorer) RawJSON ¶ added in v0.8.0
func (r CodeBundleLocationExperimentPositionScorer) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleLocationExperimentPositionScorer) UnmarshalJSON ¶ added in v0.5.0
func (r *CodeBundleLocationExperimentPositionScorer) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentPositionScorerParam ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorerParam struct {
Index int64 `json:"index,required"`
// Any of "scorer".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Index, Type are required.
func (CodeBundleLocationExperimentPositionScorerParam) MarshalJSON ¶ added in v0.5.0
func (r CodeBundleLocationExperimentPositionScorerParam) MarshalJSON() (data []byte, err error)
func (*CodeBundleLocationExperimentPositionScorerParam) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleLocationExperimentPositionScorerParam) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentPositionType ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionType struct {
// Any of "task".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CodeBundleLocationExperimentPositionType) RawJSON ¶ added in v0.8.0
func (r CodeBundleLocationExperimentPositionType) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleLocationExperimentPositionType) UnmarshalJSON ¶ added in v0.5.0
func (r *CodeBundleLocationExperimentPositionType) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentPositionTypeParam ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionTypeParam struct {
// Any of "task".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (CodeBundleLocationExperimentPositionTypeParam) MarshalJSON ¶ added in v0.5.0
func (r CodeBundleLocationExperimentPositionTypeParam) MarshalJSON() (data []byte, err error)
func (*CodeBundleLocationExperimentPositionTypeParam) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleLocationExperimentPositionTypeParam) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentPositionUnion ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionUnion struct {
Type string `json:"type"`
// This field is from variant [CodeBundleLocationExperimentPositionScorer].
Index int64 `json:"index"`
JSON struct {
Type respjson.Field
Index respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CodeBundleLocationExperimentPositionUnion contains all possible properties and values from CodeBundleLocationExperimentPositionType, CodeBundleLocationExperimentPositionScorer.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (CodeBundleLocationExperimentPositionUnion) AsCodeBundleLocationExperimentPositionType ¶ added in v0.8.0
func (u CodeBundleLocationExperimentPositionUnion) AsCodeBundleLocationExperimentPositionType() (v CodeBundleLocationExperimentPositionType)
func (CodeBundleLocationExperimentPositionUnion) AsScorer ¶ added in v0.8.0
func (u CodeBundleLocationExperimentPositionUnion) AsScorer() (v CodeBundleLocationExperimentPositionScorer)
func (CodeBundleLocationExperimentPositionUnion) RawJSON ¶ added in v0.8.0
func (u CodeBundleLocationExperimentPositionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleLocationExperimentPositionUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleLocationExperimentPositionUnion) UnmarshalJSON(data []byte) error
type CodeBundleLocationExperimentPositionUnionParam ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionUnionParam struct {
OfCodeBundleLocationExperimentPositionType *CodeBundleLocationExperimentPositionTypeParam `json:",omitzero,inline"`
OfScorer *CodeBundleLocationExperimentPositionScorerParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (CodeBundleLocationExperimentPositionUnionParam) GetIndex ¶ added in v0.8.0
func (u CodeBundleLocationExperimentPositionUnionParam) GetIndex() *int64
Returns a pointer to the underlying variant's property, if present.
func (CodeBundleLocationExperimentPositionUnionParam) GetType ¶ added in v0.8.0
func (u CodeBundleLocationExperimentPositionUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (CodeBundleLocationExperimentPositionUnionParam) MarshalJSON ¶ added in v0.8.0
func (u CodeBundleLocationExperimentPositionUnionParam) MarshalJSON() ([]byte, error)
func (*CodeBundleLocationExperimentPositionUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *CodeBundleLocationExperimentPositionUnionParam) UnmarshalJSON(data []byte) error
type CodeBundleLocationFunction ¶ added in v0.4.0
type CodeBundleLocationFunction struct {
Index int64 `json:"index,required"`
// Any of "function".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Index respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CodeBundleLocationFunction) RawJSON ¶ added in v0.8.0
func (r CodeBundleLocationFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleLocationFunction) UnmarshalJSON ¶ added in v0.4.0
func (r *CodeBundleLocationFunction) UnmarshalJSON(data []byte) error
type CodeBundleLocationFunctionParam ¶ added in v0.4.0
type CodeBundleLocationFunctionParam struct {
Index int64 `json:"index,required"`
// Any of "function".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Index, Type are required.
func (CodeBundleLocationFunctionParam) MarshalJSON ¶ added in v0.4.0
func (r CodeBundleLocationFunctionParam) MarshalJSON() (data []byte, err error)
func (*CodeBundleLocationFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleLocationFunctionParam) UnmarshalJSON(data []byte) error
type CodeBundleLocationUnion ¶ added in v0.4.0
type CodeBundleLocationUnion struct {
// This field is from variant [CodeBundleLocationExperiment].
EvalName string `json:"eval_name"`
// This field is from variant [CodeBundleLocationExperiment].
Position CodeBundleLocationExperimentPositionUnion `json:"position"`
Type string `json:"type"`
// This field is from variant [CodeBundleLocationFunction].
Index int64 `json:"index"`
JSON struct {
EvalName respjson.Field
Position respjson.Field
Type respjson.Field
Index respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CodeBundleLocationUnion contains all possible properties and values from CodeBundleLocationExperiment, CodeBundleLocationFunction.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (CodeBundleLocationUnion) AsExperiment ¶ added in v0.8.0
func (u CodeBundleLocationUnion) AsExperiment() (v CodeBundleLocationExperiment)
func (CodeBundleLocationUnion) AsFunction ¶ added in v0.8.0
func (u CodeBundleLocationUnion) AsFunction() (v CodeBundleLocationFunction)
func (CodeBundleLocationUnion) RawJSON ¶ added in v0.8.0
func (u CodeBundleLocationUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleLocationUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleLocationUnion) UnmarshalJSON(data []byte) error
type CodeBundleLocationUnionParam ¶ added in v0.4.0
type CodeBundleLocationUnionParam struct {
OfExperiment *CodeBundleLocationExperimentParam `json:",omitzero,inline"`
OfFunction *CodeBundleLocationFunctionParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (CodeBundleLocationUnionParam) GetEvalName ¶ added in v0.8.0
func (u CodeBundleLocationUnionParam) GetEvalName() *string
Returns a pointer to the underlying variant's property, if present.
func (CodeBundleLocationUnionParam) GetIndex ¶ added in v0.8.0
func (u CodeBundleLocationUnionParam) GetIndex() *int64
Returns a pointer to the underlying variant's property, if present.
func (CodeBundleLocationUnionParam) GetPosition ¶ added in v0.8.0
func (u CodeBundleLocationUnionParam) GetPosition() *CodeBundleLocationExperimentPositionUnionParam
Returns a pointer to the underlying variant's property, if present.
func (CodeBundleLocationUnionParam) GetType ¶ added in v0.8.0
func (u CodeBundleLocationUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (CodeBundleLocationUnionParam) MarshalJSON ¶ added in v0.8.0
func (u CodeBundleLocationUnionParam) MarshalJSON() ([]byte, error)
func (*CodeBundleLocationUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *CodeBundleLocationUnionParam) UnmarshalJSON(data []byte) error
type CodeBundleParam ¶ added in v0.4.0
type CodeBundleParam struct {
BundleID string `json:"bundle_id,required"`
Location CodeBundleLocationUnionParam `json:"location,omitzero,required"`
RuntimeContext CodeBundleRuntimeContextParam `json:"runtime_context,omitzero,required"`
// A preview of the code
Preview param.Opt[string] `json:"preview,omitzero"`
// contains filtered or unexported fields
}
The properties BundleID, Location, RuntimeContext are required.
func (CodeBundleParam) MarshalJSON ¶ added in v0.4.0
func (r CodeBundleParam) MarshalJSON() (data []byte, err error)
func (*CodeBundleParam) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleParam) UnmarshalJSON(data []byte) error
type CodeBundleRuntimeContext ¶ added in v0.4.0
type CodeBundleRuntimeContext struct {
// Any of "node", "python".
Runtime string `json:"runtime,required"`
Version string `json:"version,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Runtime respjson.Field
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CodeBundleRuntimeContext) RawJSON ¶ added in v0.8.0
func (r CodeBundleRuntimeContext) RawJSON() string
Returns the unmodified JSON received from the API
func (*CodeBundleRuntimeContext) UnmarshalJSON ¶ added in v0.4.0
func (r *CodeBundleRuntimeContext) UnmarshalJSON(data []byte) error
type CodeBundleRuntimeContextParam ¶ added in v0.4.0
type CodeBundleRuntimeContextParam struct {
// Any of "node", "python".
Runtime string `json:"runtime,omitzero,required"`
Version string `json:"version,required"`
// contains filtered or unexported fields
}
The properties Runtime, Version are required.
func (CodeBundleRuntimeContextParam) MarshalJSON ¶ added in v0.4.0
func (r CodeBundleRuntimeContextParam) MarshalJSON() (data []byte, err error)
func (*CodeBundleRuntimeContextParam) UnmarshalJSON ¶ added in v0.8.0
func (r *CodeBundleRuntimeContextParam) UnmarshalJSON(data []byte) error
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Key respjson.Field
Name respjson.Field
PreviewName respjson.Field
Created respjson.Field
OrgID respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CreateAPIKeyOutput) RawJSON ¶ added in v0.8.0
func (r CreateAPIKeyOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreateAPIKeyOutput) UnmarshalJSON ¶
func (r *CreateAPIKeyOutput) UnmarshalJSON(data []byte) error
type DataSummary ¶
type DataSummary struct {
// Total number of records in the dataset
TotalRecords int64 `json:"total_records,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TotalRecords respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Summary of a dataset's data
func (DataSummary) RawJSON ¶ added in v0.8.0
func (r DataSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*DataSummary) UnmarshalJSON ¶
func (r *DataSummary) UnmarshalJSON(data []byte) error
type Dataset ¶
type Dataset struct {
// Unique identifier for the dataset
ID string `json:"id,required" format:"uuid"`
// Name of the dataset. Within a project, dataset names are unique
Name string `json:"name,required"`
// Unique identifier for the project that the dataset belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// Date of dataset creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of dataset deletion, or null if the dataset is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the dataset
Description string `json:"description,nullable"`
// User-controlled metadata about the dataset
Metadata map[string]any `json:"metadata,nullable"`
// Identifies the user who created the dataset
UserID string `json:"user_id,nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ProjectID respjson.Field
Created respjson.Field
DeletedAt respjson.Field
Description respjson.Field
Metadata respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Dataset) UnmarshalJSON ¶
type DatasetEvent ¶
type DatasetEvent struct {
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the dataset (see the `version`
// parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the dataset event was created
Created time.Time `json:"created,required" format:"date-time"`
// Unique identifier for the dataset
DatasetID string `json:"dataset_id,required" format:"uuid"`
// Unique identifier for the project that the dataset belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// A unique identifier for the trace this dataset event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different dataset events together as part of a
// full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected any `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input any `json:"input"`
// Whether this span is a root span
IsRoot bool `json:"is_root,nullable"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata DatasetEventMetadata `json:"metadata,nullable"`
// Indicates the event was copied from another object.
Origin ObjectReference `json:"origin,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
XactID respjson.Field
Created respjson.Field
DatasetID respjson.Field
ProjectID respjson.Field
RootSpanID respjson.Field
SpanID respjson.Field
Expected respjson.Field
Input respjson.Field
IsRoot respjson.Field
Metadata respjson.Field
Origin respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DatasetEvent) RawJSON ¶ added in v0.8.0
func (r DatasetEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*DatasetEvent) UnmarshalJSON ¶
func (r *DatasetEvent) UnmarshalJSON(data []byte) error
type DatasetEventMetadata ¶ added in v0.6.0
type DatasetEventMetadata struct {
// The model used for this example
Model string `json:"model,nullable"`
ExtraFields map[string]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Model respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings
func (DatasetEventMetadata) RawJSON ¶ added in v0.8.0
func (r DatasetEventMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*DatasetEventMetadata) UnmarshalJSON ¶ added in v0.6.0
func (r *DatasetEventMetadata) UnmarshalJSON(data []byte) error
type EnvVar ¶ added in v0.4.0
type EnvVar struct {
// Unique identifier for the environment variable
ID string `json:"id,required" format:"uuid"`
// The name of the environment variable
Name string `json:"name,required"`
// The id of the object the environment variable is scoped for
ObjectID string `json:"object_id,required" format:"uuid"`
// The type of the object the environment variable is scoped for
//
// Any of "organization", "project", "function".
ObjectType EnvVarObjectType `json:"object_type,required"`
// Date of environment variable creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date the environment variable was last used
Used time.Time `json:"used,nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ObjectID respjson.Field
ObjectType respjson.Field
Created respjson.Field
Used respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*EnvVar) UnmarshalJSON ¶ added in v0.4.0
type EnvVarObjectType ¶ added in v0.4.0
type EnvVarObjectType string
The type of the object the environment variable is scoped for
const ( EnvVarObjectTypeOrganization EnvVarObjectType = "organization" EnvVarObjectTypeProject EnvVarObjectType = "project" EnvVarObjectTypeFunction EnvVarObjectType = "function" )
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]any `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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ProjectID respjson.Field
Public respjson.Field
BaseExpID respjson.Field
Commit respjson.Field
Created respjson.Field
DatasetID respjson.Field
DatasetVersion respjson.Field
DeletedAt respjson.Field
Description respjson.Field
Metadata respjson.Field
RepoInfo respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Experiment) RawJSON ¶ added in v0.8.0
func (r Experiment) RawJSON() string
Returns the unmodified JSON received from the API
func (*Experiment) UnmarshalJSON ¶
func (r *Experiment) UnmarshalJSON(data []byte) error
type ExperimentEvent ¶
type ExperimentEvent struct {
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the experiment (see the
// `version` parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the experiment event was created
Created time.Time `json:"created,required" format:"date-time"`
// Unique identifier for the experiment
ExperimentID string `json:"experiment_id,required" format:"uuid"`
// Unique identifier for the project that the experiment belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// A unique identifier for the trace this experiment event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different experiment events together as part of
// a full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context ExperimentEventContext `json:"context,nullable"`
// The error that occurred, if any.
Error any `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 any `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 any `json:"input"`
// Whether this span is a root span
IsRoot bool `json:"is_root,nullable"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata ExperimentEventMetadata `json:"metadata,nullable"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics ExperimentEventMetrics `json:"metrics,nullable"`
// Indicates the event was copied from another object.
Origin ObjectReference `json:"origin,nullable"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output any `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores map[string]float64 `json:"scores,nullable"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes SpanAttributes `json:"span_attributes,nullable"`
// An array of the parent `span_ids` of this experiment event. This should be empty
// for the root span of a trace, and should most often contain just one parent
// element for subspans
SpanParents []string `json:"span_parents,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
XactID respjson.Field
Created respjson.Field
ExperimentID respjson.Field
ProjectID respjson.Field
RootSpanID respjson.Field
SpanID respjson.Field
Context respjson.Field
Error respjson.Field
Expected respjson.Field
Input respjson.Field
IsRoot respjson.Field
Metadata respjson.Field
Metrics respjson.Field
Origin respjson.Field
Output respjson.Field
Scores respjson.Field
SpanAttributes respjson.Field
SpanParents respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ExperimentEvent) RawJSON ¶ added in v0.8.0
func (r ExperimentEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExperimentEvent) UnmarshalJSON ¶
func (r *ExperimentEvent) UnmarshalJSON(data []byte) 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]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallerFilename respjson.Field
CallerFunctionname respjson.Field
CallerLineno respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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) RawJSON ¶ added in v0.8.0
func (r ExperimentEventContext) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExperimentEventContext) UnmarshalJSON ¶
func (r *ExperimentEventContext) UnmarshalJSON(data []byte) error
type ExperimentEventMetadata ¶ added in v0.6.0
type ExperimentEventMetadata struct {
// The model used for this example
Model string `json:"model,nullable"`
ExtraFields map[string]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Model respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings
func (ExperimentEventMetadata) RawJSON ¶ added in v0.8.0
func (r ExperimentEventMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExperimentEventMetadata) UnmarshalJSON ¶ added in v0.6.0
func (r *ExperimentEventMetadata) UnmarshalJSON(data []byte) error
type ExperimentEventMetrics ¶
type ExperimentEventMetrics struct {
// This metric is deprecated
CallerFilename any `json:"caller_filename"`
// This metric is deprecated
CallerFunctionname any `json:"caller_functionname"`
// This metric is deprecated
CallerLineno any `json:"caller_lineno"`
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens int64 `json:"completion_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End float64 `json:"end,nullable"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens int64 `json:"prompt_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start float64 `json:"start,nullable"`
// The total number of tokens in the input and output of the experiment event.
Tokens int64 `json:"tokens,nullable"`
ExtraFields map[string]float64 `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallerFilename respjson.Field
CallerFunctionname respjson.Field
CallerLineno respjson.Field
CompletionTokens respjson.Field
End respjson.Field
PromptTokens respjson.Field
Start respjson.Field
Tokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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) RawJSON ¶ added in v0.8.0
func (r ExperimentEventMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExperimentEventMetrics) UnmarshalJSON ¶
func (r *ExperimentEventMetrics) UnmarshalJSON(data []byte) 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 string `json:"id,required"`
// An optional comment string to log about the dataset event
Comment param.Opt[string] `json:"comment,omitzero"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI. Note, this metadata does
// not correspond to the main event itself, but rather the audit log attached to
// the event.
Metadata map[string]any `json:"metadata,omitzero"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
//
// Any of "app", "api", "external".
Source FeedbackDatasetItemSource `json:"source,omitzero"`
// A list of tags to log
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
The property ID is required.
func (FeedbackDatasetItemParam) MarshalJSON ¶
func (r FeedbackDatasetItemParam) MarshalJSON() (data []byte, err error)
func (*FeedbackDatasetItemParam) UnmarshalJSON ¶ added in v0.8.0
func (r *FeedbackDatasetItemParam) UnmarshalJSON(data []byte) 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" )
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 string `json:"id,required"`
// An optional comment string to log about the experiment event
Comment param.Opt[string] `json:"comment,omitzero"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI. Note, this metadata does
// not correspond to the main event itself, but rather the audit log attached to
// the event.
Metadata map[string]any `json:"metadata,omitzero"`
// 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 map[string]float64 `json:"scores,omitzero"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
//
// Any of "app", "api", "external".
Source FeedbackExperimentItemSource `json:"source,omitzero"`
// A list of tags to log
Tags []string `json:"tags,omitzero"`
// 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 any `json:"expected,omitzero"`
// contains filtered or unexported fields
}
The property ID is required.
func (FeedbackExperimentItemParam) MarshalJSON ¶
func (r FeedbackExperimentItemParam) MarshalJSON() (data []byte, err error)
func (*FeedbackExperimentItemParam) UnmarshalJSON ¶ added in v0.8.0
func (r *FeedbackExperimentItemParam) UnmarshalJSON(data []byte) 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" )
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 string `json:"id,required"`
// An optional comment string to log about the project logs event
Comment param.Opt[string] `json:"comment,omitzero"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI. Note, this metadata does
// not correspond to the main event itself, but rather the audit log attached to
// the event.
Metadata map[string]any `json:"metadata,omitzero"`
// 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 map[string]float64 `json:"scores,omitzero"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
//
// Any of "app", "api", "external".
Source FeedbackProjectLogsItemSource `json:"source,omitzero"`
// A list of tags to log
Tags []string `json:"tags,omitzero"`
// 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 any `json:"expected,omitzero"`
// contains filtered or unexported fields
}
The property ID is required.
func (FeedbackProjectLogsItemParam) MarshalJSON ¶
func (r FeedbackProjectLogsItemParam) MarshalJSON() (data []byte, err error)
func (*FeedbackProjectLogsItemParam) UnmarshalJSON ¶ added in v0.8.0
func (r *FeedbackProjectLogsItemParam) UnmarshalJSON(data []byte) 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" )
type FeedbackResponseSchema ¶ added in v0.4.0
type FeedbackResponseSchema struct {
// Any of "success".
Status FeedbackResponseSchemaStatus `json:"status,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FeedbackResponseSchema) RawJSON ¶ added in v0.8.0
func (r FeedbackResponseSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*FeedbackResponseSchema) UnmarshalJSON ¶ added in v0.4.0
func (r *FeedbackResponseSchema) UnmarshalJSON(data []byte) error
type FeedbackResponseSchemaStatus ¶ added in v0.4.0
type FeedbackResponseSchemaStatus string
const (
FeedbackResponseSchemaStatusSuccess FeedbackResponseSchemaStatus = "success"
)
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Events respjson.Field
Cursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FetchDatasetEventsResponse) RawJSON ¶ added in v0.8.0
func (r FetchDatasetEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FetchDatasetEventsResponse) UnmarshalJSON ¶
func (r *FetchDatasetEventsResponse) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Events respjson.Field
Cursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FetchExperimentEventsResponse) RawJSON ¶ added in v0.8.0
func (r FetchExperimentEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FetchExperimentEventsResponse) UnmarshalJSON ¶
func (r *FetchExperimentEventsResponse) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Events respjson.Field
Cursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FetchProjectLogsEventsResponse) RawJSON ¶ added in v0.8.0
func (r FetchProjectLogsEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FetchProjectLogsEventsResponse) UnmarshalJSON ¶
func (r *FetchProjectLogsEventsResponse) UnmarshalJSON(data []byte) 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 FunctionFunctionDataUnion `json:"function_data,required"`
// A literal 'p' which identifies the object as a project prompt
//
// Any of "p".
LogID FunctionLogID `json:"log_id,required"`
// Name of the prompt
Name string `json:"name,required"`
// Unique identifier for the organization
OrgID string `json:"org_id,required" format:"uuid"`
// Unique identifier for the project that the prompt belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// Unique identifier for the prompt
Slug string `json:"slug,required"`
// Date of prompt creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the prompt
Description string `json:"description,nullable"`
// JSON schema for the function's parameters and return type
FunctionSchema FunctionFunctionSchema `json:"function_schema,nullable"`
// Any of "llm", "scorer", "task", "tool".
FunctionType FunctionFunctionType `json:"function_type,nullable"`
// User-controlled metadata about the prompt
Metadata map[string]any `json:"metadata,nullable"`
Origin FunctionOrigin `json:"origin,nullable"`
// The prompt, model, and its parameters
PromptData PromptData `json:"prompt_data,nullable"`
// A list of tags for the prompt
Tags []string `json:"tags,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
XactID respjson.Field
FunctionData respjson.Field
LogID respjson.Field
Name respjson.Field
OrgID respjson.Field
ProjectID respjson.Field
Slug respjson.Field
Created respjson.Field
Description respjson.Field
FunctionSchema respjson.Field
FunctionType respjson.Field
Metadata respjson.Field
Origin respjson.Field
PromptData respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Function) UnmarshalJSON ¶
type FunctionFunctionDataCode ¶
type FunctionFunctionDataCode struct {
Data FunctionFunctionDataCodeDataUnion `json:"data,required"`
// Any of "code".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FunctionFunctionDataCode) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionDataCode) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataCode) UnmarshalJSON ¶
func (r *FunctionFunctionDataCode) UnmarshalJSON(data []byte) error
type FunctionFunctionDataCodeDataBundle ¶ added in v0.4.0
type FunctionFunctionDataCodeDataBundle struct {
// Any of "bundle".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
CodeBundle
}
func (FunctionFunctionDataCodeDataBundle) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionDataCodeDataBundle) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataCodeDataBundle) UnmarshalJSON ¶ added in v0.4.0
func (r *FunctionFunctionDataCodeDataBundle) UnmarshalJSON(data []byte) error
type FunctionFunctionDataCodeDataInline ¶ added in v0.4.0
type FunctionFunctionDataCodeDataInline struct {
Code string `json:"code,required"`
RuntimeContext FunctionFunctionDataCodeDataInlineRuntimeContext `json:"runtime_context,required"`
// Any of "inline".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
RuntimeContext respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FunctionFunctionDataCodeDataInline) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionDataCodeDataInline) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataCodeDataInline) UnmarshalJSON ¶ added in v0.4.0
func (r *FunctionFunctionDataCodeDataInline) UnmarshalJSON(data []byte) error
type FunctionFunctionDataCodeDataInlineRuntimeContext ¶ added in v0.4.0
type FunctionFunctionDataCodeDataInlineRuntimeContext struct {
// Any of "node", "python".
Runtime string `json:"runtime,required"`
Version string `json:"version,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Runtime respjson.Field
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FunctionFunctionDataCodeDataInlineRuntimeContext) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionDataCodeDataInlineRuntimeContext) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON ¶ added in v0.4.0
func (r *FunctionFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON(data []byte) error
type FunctionFunctionDataCodeDataUnion ¶ added in v0.4.0
type FunctionFunctionDataCodeDataUnion struct {
// This field is from variant [FunctionFunctionDataCodeDataBundle].
BundleID string `json:"bundle_id"`
// This field is from variant [FunctionFunctionDataCodeDataBundle].
Location CodeBundleLocationUnion `json:"location"`
// This field is a union of [CodeBundleRuntimeContext],
// [FunctionFunctionDataCodeDataInlineRuntimeContext]
RuntimeContext FunctionFunctionDataCodeDataUnionRuntimeContext `json:"runtime_context"`
// This field is from variant [FunctionFunctionDataCodeDataBundle].
Preview string `json:"preview"`
Type string `json:"type"`
// This field is from variant [FunctionFunctionDataCodeDataInline].
Code string `json:"code"`
JSON struct {
BundleID respjson.Field
Location respjson.Field
RuntimeContext respjson.Field
Preview respjson.Field
Type respjson.Field
Code respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FunctionFunctionDataCodeDataUnion contains all possible properties and values from FunctionFunctionDataCodeDataBundle, FunctionFunctionDataCodeDataInline.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (FunctionFunctionDataCodeDataUnion) AsBundle ¶ added in v0.8.0
func (u FunctionFunctionDataCodeDataUnion) AsBundle() (v FunctionFunctionDataCodeDataBundle)
func (FunctionFunctionDataCodeDataUnion) AsInline ¶ added in v0.8.0
func (u FunctionFunctionDataCodeDataUnion) AsInline() (v FunctionFunctionDataCodeDataInline)
func (FunctionFunctionDataCodeDataUnion) RawJSON ¶ added in v0.8.0
func (u FunctionFunctionDataCodeDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataCodeDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
type FunctionFunctionDataCodeDataUnionRuntimeContext ¶ added in v0.8.0
type FunctionFunctionDataCodeDataUnionRuntimeContext struct {
Runtime string `json:"runtime"`
Version string `json:"version"`
JSON struct {
Runtime respjson.Field
Version respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FunctionFunctionDataCodeDataUnionRuntimeContext is an implicit subunion of FunctionFunctionDataCodeDataUnion. FunctionFunctionDataCodeDataUnionRuntimeContext provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the FunctionFunctionDataCodeDataUnion.
func (*FunctionFunctionDataCodeDataUnionRuntimeContext) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionFunctionDataCodeDataUnionRuntimeContext) UnmarshalJSON(data []byte) error
type FunctionFunctionDataGlobal ¶
type FunctionFunctionDataGlobal struct {
Name string `json:"name,required"`
// Any of "global".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FunctionFunctionDataGlobal) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionDataGlobal) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataGlobal) UnmarshalJSON ¶
func (r *FunctionFunctionDataGlobal) UnmarshalJSON(data []byte) error
type FunctionFunctionDataPrompt ¶
type FunctionFunctionDataPrompt struct {
// Any of "prompt".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FunctionFunctionDataPrompt) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionDataPrompt) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataPrompt) UnmarshalJSON ¶
func (r *FunctionFunctionDataPrompt) UnmarshalJSON(data []byte) error
type FunctionFunctionDataUnion ¶
type FunctionFunctionDataUnion struct {
Type string `json:"type"`
// This field is from variant [FunctionFunctionDataCode].
Data FunctionFunctionDataCodeDataUnion `json:"data"`
// This field is from variant [FunctionFunctionDataGlobal].
Name string `json:"name"`
JSON struct {
Type respjson.Field
Data respjson.Field
Name respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FunctionFunctionDataUnion contains all possible properties and values from FunctionFunctionDataPrompt, FunctionFunctionDataCode, FunctionFunctionDataGlobal.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (FunctionFunctionDataUnion) AsCode ¶ added in v0.8.0
func (u FunctionFunctionDataUnion) AsCode() (v FunctionFunctionDataCode)
func (FunctionFunctionDataUnion) AsGlobal ¶ added in v0.8.0
func (u FunctionFunctionDataUnion) AsGlobal() (v FunctionFunctionDataGlobal)
func (FunctionFunctionDataUnion) AsPrompt ¶ added in v0.8.0
func (u FunctionFunctionDataUnion) AsPrompt() (v FunctionFunctionDataPrompt)
func (FunctionFunctionDataUnion) RawJSON ¶ added in v0.8.0
func (u FunctionFunctionDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionFunctionDataUnion) UnmarshalJSON(data []byte) error
type FunctionFunctionSchema ¶ added in v0.4.0
type FunctionFunctionSchema struct {
Parameters any `json:"parameters"`
Returns any `json:"returns"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Parameters respjson.Field
Returns respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
JSON schema for the function's parameters and return type
func (FunctionFunctionSchema) RawJSON ¶ added in v0.8.0
func (r FunctionFunctionSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionFunctionSchema) UnmarshalJSON ¶ added in v0.4.0
func (r *FunctionFunctionSchema) UnmarshalJSON(data []byte) error
type FunctionFunctionType ¶ added in v0.4.0
type FunctionFunctionType string
const ( FunctionFunctionTypeLlm FunctionFunctionType = "llm" FunctionFunctionTypeScorer FunctionFunctionType = "scorer" FunctionFunctionTypeTask FunctionFunctionType = "task" FunctionFunctionTypeTool FunctionFunctionType = "tool" )
type FunctionLogID ¶
type FunctionLogID string
A literal 'p' which identifies the object as a project prompt
const (
FunctionLogIDP FunctionLogID = "p"
)
type FunctionOrigin ¶ added in v0.4.0
type FunctionOrigin struct {
// Id of the object the function is originating from
ObjectID string `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
//
// Any of "organization", "project", "experiment", "dataset", "prompt",
// "prompt_session", "group", "role", "org_member", "project_log", "org_project".
ObjectType ACLObjectType `json:"object_type,required"`
// The function exists for internal purposes and should not be displayed in the
// list of functions.
Internal bool `json:"internal,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ObjectID respjson.Field
ObjectType respjson.Field
Internal respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FunctionOrigin) RawJSON ¶ added in v0.8.0
func (r FunctionOrigin) RawJSON() string
Returns the unmodified JSON received from the API
func (*FunctionOrigin) UnmarshalJSON ¶ added in v0.4.0
func (r *FunctionOrigin) UnmarshalJSON(data []byte) error
type Group ¶
type Group struct {
// Unique identifier for the group
ID string `json:"id,required" format:"uuid"`
// Name of the group
Name string `json:"name,required"`
// Unique id for the organization that the group belongs under
//
// It is forbidden to change the org after creating a group
OrgID string `json:"org_id,required" format:"uuid"`
// Date of group creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of group deletion, or null if the group is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the group
Description string `json:"description,nullable"`
// Ids of the groups this group inherits from
//
// An inheriting group has all the users contained in its member groups, as well as
// all of their inherited users
MemberGroups []string `json:"member_groups,nullable" format:"uuid"`
// Ids of users which belong to this group
MemberUsers []string `json:"member_users,nullable" format:"uuid"`
// Identifies the user who created the group
UserID string `json:"user_id,nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrgID respjson.Field
Created respjson.Field
DeletedAt respjson.Field
Description respjson.Field
MemberGroups respjson.Field
MemberUsers respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A group is a collection of users which can be assigned an ACL
Groups can consist of individual users, as well as a set of groups they inherit from
func (*Group) UnmarshalJSON ¶
type InsertDatasetEventMetadataParam ¶ added in v0.6.0
type InsertDatasetEventMetadataParam struct {
// The model used for this example
Model param.Opt[string] `json:"model,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings
func (InsertDatasetEventMetadataParam) MarshalJSON ¶ added in v0.6.0
func (r InsertDatasetEventMetadataParam) MarshalJSON() (data []byte, err error)
func (*InsertDatasetEventMetadataParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertDatasetEventMetadataParam) UnmarshalJSON(data []byte) error
type InsertDatasetEventParam ¶ added in v0.5.0
type InsertDatasetEventParam struct {
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID param.Opt[string] `json:"id,omitzero"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row, if one is found. If no existing row is found,
// the new row is inserted as is.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Opt[bool] `json:"_is_merge,omitzero"`
// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
// will not show up in subsequent fetches for this dataset
ObjectDelete param.Opt[bool] `json:"_object_delete,omitzero"`
// DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support
// for `_parent_id` will be dropped in a future version of Braintrust. Log
// `span_id`, `root_span_id`, and `span_parents` explicitly instead.
//
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// Tracking hierarchical relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
ParentID param.Opt[string] `json:"_parent_id,omitzero"`
// The timestamp the dataset event was created
Created param.Opt[time.Time] `json:"created,omitzero" format:"date-time"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
RootSpanID param.Opt[string] `json:"root_span_id,omitzero"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
SpanID param.Opt[string] `json:"span_id,omitzero"`
// The `_merge_paths` field allows controlling the depth of the merge, when
// `_is_merge=true`. `_merge_paths` is a list of paths, where each path is a list
// of field names. The deep merge will not descend below any of the specified merge
// paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths [][]string `json:"_merge_paths,omitzero"`
// 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 InsertDatasetEventMetadataParam `json:"metadata,omitzero"`
// Indicates the event was copied from another object.
Origin ObjectReferenceParam `json:"origin,omitzero"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
SpanParents []string `json:"span_parents,omitzero"`
// A list of tags to log
Tags []string `json:"tags,omitzero"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected any `json:"expected,omitzero"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input any `json:"input,omitzero"`
// contains filtered or unexported fields
}
A dataset event
func (InsertDatasetEventParam) MarshalJSON ¶ added in v0.5.0
func (r InsertDatasetEventParam) MarshalJSON() (data []byte, err error)
func (*InsertDatasetEventParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertDatasetEventParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
RowIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InsertEventsResponse) RawJSON ¶ added in v0.8.0
func (r InsertEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InsertEventsResponse) UnmarshalJSON ¶
func (r *InsertEventsResponse) UnmarshalJSON(data []byte) error
type InsertExperimentEventContextParam ¶ added in v0.5.0
type InsertExperimentEventContextParam struct {
// Name of the file in code where the experiment event was created
CallerFilename param.Opt[string] `json:"caller_filename,omitzero"`
// The function in code which created the experiment event
CallerFunctionname param.Opt[string] `json:"caller_functionname,omitzero"`
// Line of code where the experiment event was created
CallerLineno param.Opt[int64] `json:"caller_lineno,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (InsertExperimentEventContextParam) MarshalJSON ¶ added in v0.5.0
func (r InsertExperimentEventContextParam) MarshalJSON() (data []byte, err error)
func (*InsertExperimentEventContextParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertExperimentEventContextParam) UnmarshalJSON(data []byte) error
type InsertExperimentEventMetadataParam ¶ added in v0.6.0
type InsertExperimentEventMetadataParam struct {
// The model used for this example
Model param.Opt[string] `json:"model,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings
func (InsertExperimentEventMetadataParam) MarshalJSON ¶ added in v0.6.0
func (r InsertExperimentEventMetadataParam) MarshalJSON() (data []byte, err error)
func (*InsertExperimentEventMetadataParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertExperimentEventMetadataParam) UnmarshalJSON(data []byte) error
type InsertExperimentEventMetricsParam ¶ added in v0.5.0
type InsertExperimentEventMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Opt[int64] `json:"completion_tokens,omitzero"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End param.Opt[float64] `json:"end,omitzero"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens param.Opt[int64] `json:"prompt_tokens,omitzero"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start param.Opt[float64] `json:"start,omitzero"`
// The total number of tokens in the input and output of the experiment event.
Tokens param.Opt[int64] `json:"tokens,omitzero"`
// This metric is deprecated
CallerFilename any `json:"caller_filename,omitzero"`
// This metric is deprecated
CallerFunctionname any `json:"caller_functionname,omitzero"`
// This metric is deprecated
CallerLineno any `json:"caller_lineno,omitzero"`
ExtraFields map[string]float64 `json:"-"`
// contains filtered or unexported fields
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (InsertExperimentEventMetricsParam) MarshalJSON ¶ added in v0.5.0
func (r InsertExperimentEventMetricsParam) MarshalJSON() (data []byte, err error)
func (*InsertExperimentEventMetricsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertExperimentEventMetricsParam) UnmarshalJSON(data []byte) error
type InsertExperimentEventParam ¶ added in v0.5.0
type InsertExperimentEventParam struct {
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Opt[string] `json:"id,omitzero"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row, if one is found. If no existing row is found,
// the new row is inserted as is.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Opt[bool] `json:"_is_merge,omitzero"`
// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
// will not show up in subsequent fetches for this experiment
ObjectDelete param.Opt[bool] `json:"_object_delete,omitzero"`
// DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support
// for `_parent_id` will be dropped in a future version of Braintrust. Log
// `span_id`, `root_span_id`, and `span_parents` explicitly instead.
//
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// Tracking hierarchical relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
ParentID param.Opt[string] `json:"_parent_id,omitzero"`
// The timestamp the experiment event was created
Created param.Opt[time.Time] `json:"created,omitzero" format:"date-time"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
RootSpanID param.Opt[string] `json:"root_span_id,omitzero"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
SpanID param.Opt[string] `json:"span_id,omitzero"`
// The `_merge_paths` field allows controlling the depth of the merge, when
// `_is_merge=true`. `_merge_paths` is a list of paths, where each path is a list
// of field names. The deep merge will not descend below any of the specified merge
// paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths [][]string `json:"_merge_paths,omitzero"`
// 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 InsertExperimentEventContextParam `json:"context,omitzero"`
// 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 InsertExperimentEventMetadataParam `json:"metadata,omitzero"`
// 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 InsertExperimentEventMetricsParam `json:"metrics,omitzero"`
// Indicates the event was copied from another object.
Origin ObjectReferenceParam `json:"origin,omitzero"`
// 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,omitzero"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes SpanAttributesParam `json:"span_attributes,omitzero"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
SpanParents []string `json:"span_parents,omitzero"`
// A list of tags to log
Tags []string `json:"tags,omitzero"`
// The error that occurred, if any.
Error any `json:"error,omitzero"`
// 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 any `json:"expected,omitzero"`
// 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 any `json:"input,omitzero"`
// 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 any `json:"output,omitzero"`
// contains filtered or unexported fields
}
An experiment event
func (InsertExperimentEventParam) MarshalJSON ¶ added in v0.5.0
func (r InsertExperimentEventParam) MarshalJSON() (data []byte, err error)
func (*InsertExperimentEventParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertExperimentEventParam) UnmarshalJSON(data []byte) error
type InsertProjectLogsEventContextParam ¶ added in v0.5.0
type InsertProjectLogsEventContextParam struct {
// Name of the file in code where the project logs event was created
CallerFilename param.Opt[string] `json:"caller_filename,omitzero"`
// The function in code which created the project logs event
CallerFunctionname param.Opt[string] `json:"caller_functionname,omitzero"`
// Line of code where the project logs event was created
CallerLineno param.Opt[int64] `json:"caller_lineno,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (InsertProjectLogsEventContextParam) MarshalJSON ¶ added in v0.5.0
func (r InsertProjectLogsEventContextParam) MarshalJSON() (data []byte, err error)
func (*InsertProjectLogsEventContextParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertProjectLogsEventContextParam) UnmarshalJSON(data []byte) error
type InsertProjectLogsEventMetadataParam ¶ added in v0.6.0
type InsertProjectLogsEventMetadataParam struct {
// The model used for this example
Model param.Opt[string] `json:"model,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings
func (InsertProjectLogsEventMetadataParam) MarshalJSON ¶ added in v0.6.0
func (r InsertProjectLogsEventMetadataParam) MarshalJSON() (data []byte, err error)
func (*InsertProjectLogsEventMetadataParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertProjectLogsEventMetadataParam) UnmarshalJSON(data []byte) error
type InsertProjectLogsEventMetricsParam ¶ added in v0.5.0
type InsertProjectLogsEventMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Opt[int64] `json:"completion_tokens,omitzero"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End param.Opt[float64] `json:"end,omitzero"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens param.Opt[int64] `json:"prompt_tokens,omitzero"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start param.Opt[float64] `json:"start,omitzero"`
// The total number of tokens in the input and output of the project logs event.
Tokens param.Opt[int64] `json:"tokens,omitzero"`
// This metric is deprecated
CallerFilename any `json:"caller_filename,omitzero"`
// This metric is deprecated
CallerFunctionname any `json:"caller_functionname,omitzero"`
// This metric is deprecated
CallerLineno any `json:"caller_lineno,omitzero"`
ExtraFields map[string]float64 `json:"-"`
// contains filtered or unexported fields
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (InsertProjectLogsEventMetricsParam) MarshalJSON ¶ added in v0.5.0
func (r InsertProjectLogsEventMetricsParam) MarshalJSON() (data []byte, err error)
func (*InsertProjectLogsEventMetricsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertProjectLogsEventMetricsParam) UnmarshalJSON(data []byte) error
type InsertProjectLogsEventParam ¶ added in v0.5.0
type InsertProjectLogsEventParam struct {
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Opt[string] `json:"id,omitzero"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row, if one is found. If no existing row is found,
// the new row is inserted as is.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Opt[bool] `json:"_is_merge,omitzero"`
// 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.Opt[bool] `json:"_object_delete,omitzero"`
// DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support
// for `_parent_id` will be dropped in a future version of Braintrust. Log
// `span_id`, `root_span_id`, and `span_parents` explicitly instead.
//
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// Tracking hierarchical relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
ParentID param.Opt[string] `json:"_parent_id,omitzero"`
// The timestamp the project logs event was created
Created param.Opt[time.Time] `json:"created,omitzero" format:"date-time"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
RootSpanID param.Opt[string] `json:"root_span_id,omitzero"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
SpanID param.Opt[string] `json:"span_id,omitzero"`
// The `_merge_paths` field allows controlling the depth of the merge, when
// `_is_merge=true`. `_merge_paths` is a list of paths, where each path is a list
// of field names. The deep merge will not descend below any of the specified merge
// paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths [][]string `json:"_merge_paths,omitzero"`
// 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 InsertProjectLogsEventContextParam `json:"context,omitzero"`
// 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 InsertProjectLogsEventMetadataParam `json:"metadata,omitzero"`
// 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 InsertProjectLogsEventMetricsParam `json:"metrics,omitzero"`
// Indicates the event was copied from another object.
Origin ObjectReferenceParam `json:"origin,omitzero"`
// 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,omitzero"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes SpanAttributesParam `json:"span_attributes,omitzero"`
// Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which
// is now deprecated. The span_id is a unique identifier describing the row's place
// in the a trace, and the root_span_id is a unique identifier for the whole trace.
// See the [guide](https://www.braintrust.dev/docs/guides/tracing) for full
// details.
//
// For example, say we have logged a row
// `{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
//
// If the row is being merged into an existing row, this field will be ignored.
SpanParents []string `json:"span_parents,omitzero"`
// A list of tags to log
Tags []string `json:"tags,omitzero"`
// The error that occurred, if any.
Error any `json:"error,omitzero"`
// 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 any `json:"expected,omitzero"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input any `json:"input,omitzero"`
// 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 any `json:"output,omitzero"`
// contains filtered or unexported fields
}
A project logs event
func (InsertProjectLogsEventParam) MarshalJSON ¶ added in v0.5.0
func (r InsertProjectLogsEventParam) MarshalJSON() (data []byte, err error)
func (*InsertProjectLogsEventParam) UnmarshalJSON ¶ added in v0.8.0
func (r *InsertProjectLogsEventParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Improvements respjson.Field
Metric respjson.Field
Name respjson.Field
Regressions respjson.Field
Unit respjson.Field
Diff respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Summary of a metric's performance
func (MetricSummary) RawJSON ¶ added in v0.8.0
func (r MetricSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricSummary) UnmarshalJSON ¶
func (r *MetricSummary) UnmarshalJSON(data []byte) error
type ObjectReference ¶ added in v0.6.0
type ObjectReference struct {
// ID of the original event.
ID string `json:"id,required"`
// Transaction ID of the original event.
XactID string `json:"_xact_id,required"`
// ID of the object the event is originating from.
ObjectID string `json:"object_id,required" format:"uuid"`
// Type of the object the event is originating from.
//
// Any of "experiment", "dataset", "prompt", "function", "prompt_session",
// "project_logs".
ObjectType ObjectReferenceObjectType `json:"object_type,required"`
// Created timestamp of the original event. Used to help sort in the UI
Created string `json:"created,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
XactID respjson.Field
ObjectID respjson.Field
ObjectType respjson.Field
Created respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Indicates the event was copied from another object.
func (ObjectReference) RawJSON ¶ added in v0.8.0
func (r ObjectReference) RawJSON() string
Returns the unmodified JSON received from the API
func (ObjectReference) ToParam ¶ added in v0.8.0
func (r ObjectReference) ToParam() ObjectReferenceParam
ToParam converts this ObjectReference to a ObjectReferenceParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ObjectReferenceParam.Overrides()
func (*ObjectReference) UnmarshalJSON ¶ added in v0.6.0
func (r *ObjectReference) UnmarshalJSON(data []byte) error
type ObjectReferenceObjectType ¶ added in v0.6.0
type ObjectReferenceObjectType string
Type of the object the event is originating from.
const ( ObjectReferenceObjectTypeExperiment ObjectReferenceObjectType = "experiment" ObjectReferenceObjectTypeDataset ObjectReferenceObjectType = "dataset" ObjectReferenceObjectTypePrompt ObjectReferenceObjectType = "prompt" ObjectReferenceObjectTypeFunction ObjectReferenceObjectType = "function" ObjectReferenceObjectTypePromptSession ObjectReferenceObjectType = "prompt_session" ObjectReferenceObjectTypeProjectLogs ObjectReferenceObjectType = "project_logs" )
type ObjectReferenceParam ¶ added in v0.6.0
type ObjectReferenceParam struct {
// ID of the original event.
ID string `json:"id,required"`
// Transaction ID of the original event.
XactID string `json:"_xact_id,required"`
// ID of the object the event is originating from.
ObjectID string `json:"object_id,required" format:"uuid"`
// Type of the object the event is originating from.
//
// Any of "experiment", "dataset", "prompt", "function", "prompt_session",
// "project_logs".
ObjectType ObjectReferenceObjectType `json:"object_type,omitzero,required"`
// Created timestamp of the original event. Used to help sort in the UI
Created param.Opt[string] `json:"created,omitzero"`
// contains filtered or unexported fields
}
Indicates the event was copied from another object.
The properties ID, XactID, ObjectID, ObjectType are required.
func (ObjectReferenceParam) MarshalJSON ¶ added in v0.6.0
func (r ObjectReferenceParam) MarshalJSON() (data []byte, err error)
func (*ObjectReferenceParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ObjectReferenceParam) UnmarshalJSON(data []byte) error
type OnlineScoreConfig ¶ added in v0.4.0
type OnlineScoreConfig struct {
// The sampling rate for online scoring
SamplingRate float64 `json:"sampling_rate,required"`
// The list of scorers to use for online scoring
Scorers []OnlineScoreConfigScorerUnion `json:"scorers,required"`
// Whether to trigger online scoring on the root span of each trace
ApplyToRootSpan bool `json:"apply_to_root_span,nullable"`
// Trigger online scoring on any spans with a name in this list
ApplyToSpanNames []string `json:"apply_to_span_names,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SamplingRate respjson.Field
Scorers respjson.Field
ApplyToRootSpan respjson.Field
ApplyToSpanNames respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OnlineScoreConfig) RawJSON ¶ added in v0.8.0
func (r OnlineScoreConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (OnlineScoreConfig) ToParam ¶ added in v0.8.0
func (r OnlineScoreConfig) ToParam() OnlineScoreConfigParam
ToParam converts this OnlineScoreConfig to a OnlineScoreConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with OnlineScoreConfigParam.Overrides()
func (*OnlineScoreConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *OnlineScoreConfig) UnmarshalJSON(data []byte) error
type OnlineScoreConfigParam ¶ added in v0.4.0
type OnlineScoreConfigParam struct {
// The sampling rate for online scoring
SamplingRate float64 `json:"sampling_rate,required"`
// The list of scorers to use for online scoring
Scorers []OnlineScoreConfigScorerUnionParam `json:"scorers,omitzero,required"`
// Whether to trigger online scoring on the root span of each trace
ApplyToRootSpan param.Opt[bool] `json:"apply_to_root_span,omitzero"`
// Trigger online scoring on any spans with a name in this list
ApplyToSpanNames []string `json:"apply_to_span_names,omitzero"`
// contains filtered or unexported fields
}
The properties SamplingRate, Scorers are required.
func (OnlineScoreConfigParam) MarshalJSON ¶ added in v0.4.0
func (r OnlineScoreConfigParam) MarshalJSON() (data []byte, err error)
func (*OnlineScoreConfigParam) UnmarshalJSON ¶ added in v0.8.0
func (r *OnlineScoreConfigParam) UnmarshalJSON(data []byte) error
type OnlineScoreConfigScorerFunction ¶ added in v0.8.0
type OnlineScoreConfigScorerFunction struct {
ID string `json:"id,required"`
// Any of "function".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OnlineScoreConfigScorerFunction) RawJSON ¶ added in v0.8.0
func (r OnlineScoreConfigScorerFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*OnlineScoreConfigScorerFunction) UnmarshalJSON ¶ added in v0.8.0
func (r *OnlineScoreConfigScorerFunction) UnmarshalJSON(data []byte) error
type OnlineScoreConfigScorerFunctionParam ¶ added in v0.8.0
type OnlineScoreConfigScorerFunctionParam struct {
ID string `json:"id,required"`
// Any of "function".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties ID, Type are required.
func (OnlineScoreConfigScorerFunctionParam) MarshalJSON ¶ added in v0.8.0
func (r OnlineScoreConfigScorerFunctionParam) MarshalJSON() (data []byte, err error)
func (*OnlineScoreConfigScorerFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *OnlineScoreConfigScorerFunctionParam) UnmarshalJSON(data []byte) error
type OnlineScoreConfigScorerGlobal ¶ added in v0.8.0
type OnlineScoreConfigScorerGlobal struct {
Name string `json:"name,required"`
// Any of "global".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OnlineScoreConfigScorerGlobal) RawJSON ¶ added in v0.8.0
func (r OnlineScoreConfigScorerGlobal) RawJSON() string
Returns the unmodified JSON received from the API
func (*OnlineScoreConfigScorerGlobal) UnmarshalJSON ¶ added in v0.8.0
func (r *OnlineScoreConfigScorerGlobal) UnmarshalJSON(data []byte) error
type OnlineScoreConfigScorerGlobalParam ¶ added in v0.8.0
type OnlineScoreConfigScorerGlobalParam struct {
Name string `json:"name,required"`
// Any of "global".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Name, Type are required.
func (OnlineScoreConfigScorerGlobalParam) MarshalJSON ¶ added in v0.8.0
func (r OnlineScoreConfigScorerGlobalParam) MarshalJSON() (data []byte, err error)
func (*OnlineScoreConfigScorerGlobalParam) UnmarshalJSON ¶ added in v0.8.0
func (r *OnlineScoreConfigScorerGlobalParam) UnmarshalJSON(data []byte) error
type OnlineScoreConfigScorerUnion ¶ added in v0.8.0
type OnlineScoreConfigScorerUnion struct {
// This field is from variant [OnlineScoreConfigScorerFunction].
ID string `json:"id"`
Type string `json:"type"`
// This field is from variant [OnlineScoreConfigScorerGlobal].
Name string `json:"name"`
JSON struct {
ID respjson.Field
Type respjson.Field
Name respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OnlineScoreConfigScorerUnion contains all possible properties and values from OnlineScoreConfigScorerFunction, OnlineScoreConfigScorerGlobal.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (OnlineScoreConfigScorerUnion) AsFunction ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnion) AsFunction() (v OnlineScoreConfigScorerFunction)
func (OnlineScoreConfigScorerUnion) AsGlobal ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnion) AsGlobal() (v OnlineScoreConfigScorerGlobal)
func (OnlineScoreConfigScorerUnion) RawJSON ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*OnlineScoreConfigScorerUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *OnlineScoreConfigScorerUnion) UnmarshalJSON(data []byte) error
type OnlineScoreConfigScorerUnionParam ¶ added in v0.8.0
type OnlineScoreConfigScorerUnionParam struct {
OfFunction *OnlineScoreConfigScorerFunctionParam `json:",omitzero,inline"`
OfGlobal *OnlineScoreConfigScorerGlobalParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (OnlineScoreConfigScorerUnionParam) GetID ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnionParam) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (OnlineScoreConfigScorerUnionParam) GetName ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnionParam) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (OnlineScoreConfigScorerUnionParam) GetType ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (OnlineScoreConfigScorerUnionParam) MarshalJSON ¶ added in v0.8.0
func (u OnlineScoreConfigScorerUnionParam) MarshalJSON() ([]byte, error)
func (*OnlineScoreConfigScorerUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *OnlineScoreConfigScorerUnionParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
APIURL respjson.Field
Created respjson.Field
IsUniversalAPI respjson.Field
ProxyURL respjson.Field
RealtimeURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Organization) RawJSON ¶ added in v0.8.0
func (r Organization) RawJSON() string
Returns the unmodified JSON received from the API
func (*Organization) UnmarshalJSON ¶
func (r *Organization) UnmarshalJSON(data []byte) error
type PatchOrganizationMembersOutput ¶ added in v0.4.0
type PatchOrganizationMembersOutput struct {
// The id of the org that was modified.
OrgID string `json:"org_id,required"`
// Any of "success".
Status PatchOrganizationMembersOutputStatus `json:"status,required"`
// If invite emails failed to send for some reason, the patch operation will still
// complete, but we will return an error message here
SendEmailError string `json:"send_email_error,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
OrgID respjson.Field
Status respjson.Field
SendEmailError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PatchOrganizationMembersOutput) RawJSON ¶ added in v0.8.0
func (r PatchOrganizationMembersOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*PatchOrganizationMembersOutput) UnmarshalJSON ¶ added in v0.4.0
func (r *PatchOrganizationMembersOutput) UnmarshalJSON(data []byte) error
type PatchOrganizationMembersOutputStatus ¶ added in v0.4.0
type PatchOrganizationMembersOutputStatus string
const (
PatchOrganizationMembersOutputStatusSuccess PatchOrganizationMembersOutputStatus = "success"
)
type Permission ¶ added in v0.7.0
type Permission string
Each permission permits a certain type of operation on an object in the system
Permissions can be assigned to to objects on an individual basis, or grouped into roles
const ( PermissionCreate Permission = "create" PermissionRead Permission = "read" PermissionUpdate Permission = "update" PermissionDelete Permission = "delete" PermissionCreateACLs Permission = "create_acls" PermissionReadACLs Permission = "read_acls" PermissionUpdateACLs Permission = "update_acls" PermissionDeleteACLs Permission = "delete_acls" )
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrgID respjson.Field
Created respjson.Field
DeletedAt respjson.Field
Settings respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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
//
// Any of "g".
LogID ProjectLogsEventLogID `json:"log_id,required"`
// Unique id for the organization that the project belongs under
OrgID string `json:"org_id,required" format:"uuid"`
// Unique identifier for the project
ProjectID string `json:"project_id,required" format:"uuid"`
// A unique identifier for the trace this project logs event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different project logs events together as part
// of a full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context ProjectLogsEventContext `json:"context,nullable"`
// The error that occurred, if any.
Error any `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 any `json:"expected"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input any `json:"input"`
// Whether this span is a root span
IsRoot bool `json:"is_root,nullable"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata ProjectLogsEventMetadata `json:"metadata,nullable"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics ProjectLogsEventMetrics `json:"metrics,nullable"`
// Indicates the event was copied from another object.
Origin ObjectReference `json:"origin,nullable"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output any `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores map[string]float64 `json:"scores,nullable"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes SpanAttributes `json:"span_attributes,nullable"`
// An array of the parent `span_ids` of this project logs event. This should be
// empty for the root span of a trace, and should most often contain just one
// parent element for subspans
SpanParents []string `json:"span_parents,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
XactID respjson.Field
Created respjson.Field
LogID respjson.Field
OrgID respjson.Field
ProjectID respjson.Field
RootSpanID respjson.Field
SpanID respjson.Field
Context respjson.Field
Error respjson.Field
Expected respjson.Field
Input respjson.Field
IsRoot respjson.Field
Metadata respjson.Field
Metrics respjson.Field
Origin respjson.Field
Output respjson.Field
Scores respjson.Field
SpanAttributes respjson.Field
SpanParents respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectLogsEvent) RawJSON ¶ added in v0.8.0
func (r ProjectLogsEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectLogsEvent) UnmarshalJSON ¶
func (r *ProjectLogsEvent) UnmarshalJSON(data []byte) 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]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallerFilename respjson.Field
CallerFunctionname respjson.Field
CallerLineno respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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) RawJSON ¶ added in v0.8.0
func (r ProjectLogsEventContext) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectLogsEventContext) UnmarshalJSON ¶
func (r *ProjectLogsEventContext) UnmarshalJSON(data []byte) error
type ProjectLogsEventLogID ¶
type ProjectLogsEventLogID string
A literal 'g' which identifies the log as a project log
const (
ProjectLogsEventLogIDG ProjectLogsEventLogID = "g"
)
type ProjectLogsEventMetadata ¶ added in v0.6.0
type ProjectLogsEventMetadata struct {
// The model used for this example
Model string `json:"model,nullable"`
ExtraFields map[string]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Model respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings
func (ProjectLogsEventMetadata) RawJSON ¶ added in v0.8.0
func (r ProjectLogsEventMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectLogsEventMetadata) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectLogsEventMetadata) UnmarshalJSON(data []byte) error
type ProjectLogsEventMetrics ¶
type ProjectLogsEventMetrics struct {
// This metric is deprecated
CallerFilename any `json:"caller_filename"`
// This metric is deprecated
CallerFunctionname any `json:"caller_functionname"`
// This metric is deprecated
CallerLineno any `json:"caller_lineno"`
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens int64 `json:"completion_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End float64 `json:"end,nullable"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens int64 `json:"prompt_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start float64 `json:"start,nullable"`
// The total number of tokens in the input and output of the project logs event.
Tokens int64 `json:"tokens,nullable"`
ExtraFields map[string]float64 `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CallerFilename respjson.Field
CallerFunctionname respjson.Field
CallerLineno respjson.Field
CompletionTokens respjson.Field
End respjson.Field
PromptTokens respjson.Field
Start respjson.Field
Tokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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) RawJSON ¶ added in v0.8.0
func (r ProjectLogsEventMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectLogsEventMetrics) UnmarshalJSON ¶
func (r *ProjectLogsEventMetrics) UnmarshalJSON(data []byte) error
type ProjectScore ¶
type ProjectScore struct {
// Unique identifier for the project score
ID string `json:"id,required" format:"uuid"`
// Name of the project score
Name string `json:"name,required"`
// Unique identifier for the project that the project score belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// The type of the configured score
//
// Any of "slider", "categorical", "weighted", "minimum", "maximum", "online",
// "free-form".
ScoreType ProjectScoreType `json:"score_type,required"`
UserID string `json:"user_id,required" format:"uuid"`
// For categorical-type project scores, the list of all categories
Categories ProjectScoreCategoriesUnion `json:"categories,nullable"`
Config ProjectScoreConfig `json:"config,nullable"`
// Date of project score creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the project score
Description string `json:"description,nullable"`
// An optional LexoRank-based string that sets the sort position for the score in
// the UI
Position string `json:"position,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ProjectID respjson.Field
ScoreType respjson.Field
UserID respjson.Field
Categories respjson.Field
Config respjson.Field
Created respjson.Field
Description respjson.Field
Position respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A project score is a user-configured score, which can be manually-labeled through the UI
func (ProjectScore) RawJSON ¶ added in v0.8.0
func (r ProjectScore) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectScore) UnmarshalJSON ¶
func (r *ProjectScore) UnmarshalJSON(data []byte) error
type ProjectScoreCategoriesUnion ¶
type ProjectScoreCategoriesUnion struct {
// This field will be present if the value is a [[]ProjectScoreCategory] instead of
// an object.
OfCategorical []ProjectScoreCategory `json:",inline"`
// This field will be present if the value is a [[]string] instead of an object.
OfMinimum []string `json:",inline"`
JSON struct {
OfCategorical respjson.Field
OfMinimum respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ProjectScoreCategoriesUnion contains all possible properties and values from [[]ProjectScoreCategory], [[]string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfCategorical OfMinimum]
func (ProjectScoreCategoriesUnion) AsCategorical ¶ added in v0.8.0
func (u ProjectScoreCategoriesUnion) AsCategorical() (v []ProjectScoreCategory)
func (ProjectScoreCategoriesUnion) AsMinimum ¶ added in v0.8.0
func (u ProjectScoreCategoriesUnion) AsMinimum() (v []string)
func (ProjectScoreCategoriesUnion) RawJSON ¶ added in v0.8.0
func (u ProjectScoreCategoriesUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectScoreCategoriesUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectScoreCategoriesUnion) UnmarshalJSON(data []byte) error
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
For categorical-type project scores, defines a single category
func (ProjectScoreCategory) RawJSON ¶ added in v0.8.0
func (r ProjectScoreCategory) RawJSON() string
Returns the unmodified JSON received from the API
func (ProjectScoreCategory) ToParam ¶ added in v0.8.0
func (r ProjectScoreCategory) ToParam() ProjectScoreCategoryParam
ToParam converts this ProjectScoreCategory to a ProjectScoreCategoryParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ProjectScoreCategoryParam.Overrides()
func (*ProjectScoreCategory) UnmarshalJSON ¶
func (r *ProjectScoreCategory) UnmarshalJSON(data []byte) error
type ProjectScoreCategoryParam ¶
type ProjectScoreCategoryParam 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"`
// contains filtered or unexported fields
}
For categorical-type project scores, defines a single category
The properties Name, Value are required.
func (ProjectScoreCategoryParam) MarshalJSON ¶
func (r ProjectScoreCategoryParam) MarshalJSON() (data []byte, err error)
func (*ProjectScoreCategoryParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectScoreCategoryParam) UnmarshalJSON(data []byte) error
type ProjectScoreConfig ¶
type ProjectScoreConfig struct {
Destination string `json:"destination,nullable"`
MultiSelect bool `json:"multi_select,nullable"`
Online OnlineScoreConfig `json:"online,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Destination respjson.Field
MultiSelect respjson.Field
Online respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectScoreConfig) RawJSON ¶ added in v0.8.0
func (r ProjectScoreConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (ProjectScoreConfig) ToParam ¶ added in v0.8.0
func (r ProjectScoreConfig) ToParam() ProjectScoreConfigParam
ToParam converts this ProjectScoreConfig to a ProjectScoreConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ProjectScoreConfigParam.Overrides()
func (*ProjectScoreConfig) UnmarshalJSON ¶
func (r *ProjectScoreConfig) UnmarshalJSON(data []byte) error
type ProjectScoreConfigParam ¶ added in v0.4.0
type ProjectScoreConfigParam struct {
Destination param.Opt[string] `json:"destination,omitzero"`
MultiSelect param.Opt[bool] `json:"multi_select,omitzero"`
Online OnlineScoreConfigParam `json:"online,omitzero"`
// contains filtered or unexported fields
}
func (ProjectScoreConfigParam) MarshalJSON ¶ added in v0.4.0
func (r ProjectScoreConfigParam) MarshalJSON() (data []byte, err error)
func (*ProjectScoreConfigParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectScoreConfigParam) UnmarshalJSON(data []byte) error
type ProjectScoreType ¶ added in v0.4.0
type ProjectScoreType string
The type of the configured score
const ( ProjectScoreTypeSlider ProjectScoreType = "slider" ProjectScoreTypeCategorical ProjectScoreType = "categorical" ProjectScoreTypeWeighted ProjectScoreType = "weighted" ProjectScoreTypeMinimum ProjectScoreType = "minimum" ProjectScoreTypeMaximum ProjectScoreType = "maximum" ProjectScoreTypeOnline ProjectScoreType = "online" ProjectScoreTypeFreeForm ProjectScoreType = "free-form" )
type ProjectSettings ¶
type ProjectSettings struct {
// The id of the experiment to use as the default baseline for comparisons
BaselineExperimentID string `json:"baseline_experiment_id,nullable" format:"uuid"`
// The key used to join two experiments (defaults to `input`)
ComparisonKey string `json:"comparison_key,nullable"`
// The order of the fields to display in the trace view
SpanFieldOrder []ProjectSettingsSpanFieldOrder `json:"spanFieldOrder,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BaselineExperimentID respjson.Field
ComparisonKey respjson.Field
SpanFieldOrder respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectSettings) RawJSON ¶ added in v0.8.0
func (r ProjectSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (ProjectSettings) ToParam ¶ added in v0.8.0
func (r ProjectSettings) ToParam() ProjectSettingsParam
ToParam converts this ProjectSettings to a ProjectSettingsParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ProjectSettingsParam.Overrides()
func (*ProjectSettings) UnmarshalJSON ¶
func (r *ProjectSettings) UnmarshalJSON(data []byte) error
type ProjectSettingsParam ¶ added in v0.4.0
type ProjectSettingsParam struct {
// The id of the experiment to use as the default baseline for comparisons
BaselineExperimentID param.Opt[string] `json:"baseline_experiment_id,omitzero" format:"uuid"`
// The key used to join two experiments (defaults to `input`)
ComparisonKey param.Opt[string] `json:"comparison_key,omitzero"`
// The order of the fields to display in the trace view
SpanFieldOrder []ProjectSettingsSpanFieldOrderParam `json:"spanFieldOrder,omitzero"`
// contains filtered or unexported fields
}
func (ProjectSettingsParam) MarshalJSON ¶ added in v0.4.0
func (r ProjectSettingsParam) MarshalJSON() (data []byte, err error)
func (*ProjectSettingsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectSettingsParam) UnmarshalJSON(data []byte) error
type ProjectSettingsSpanFieldOrder ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrder struct {
ColumnID string `json:"column_id,required"`
ObjectType string `json:"object_type,required"`
Position string `json:"position,required"`
// Any of "full", "two_column".
Layout ProjectSettingsSpanFieldOrderLayout `json:"layout,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ColumnID respjson.Field
ObjectType respjson.Field
Position respjson.Field
Layout respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectSettingsSpanFieldOrder) RawJSON ¶ added in v0.8.0
func (r ProjectSettingsSpanFieldOrder) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectSettingsSpanFieldOrder) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectSettingsSpanFieldOrder) UnmarshalJSON(data []byte) error
type ProjectSettingsSpanFieldOrderLayout ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrderLayout string
const ( ProjectSettingsSpanFieldOrderLayoutFull ProjectSettingsSpanFieldOrderLayout = "full" ProjectSettingsSpanFieldOrderLayoutTwoColumn ProjectSettingsSpanFieldOrderLayout = "two_column" )
type ProjectSettingsSpanFieldOrderParam ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrderParam struct {
ColumnID string `json:"column_id,required"`
ObjectType string `json:"object_type,required"`
Position string `json:"position,required"`
// Any of "full", "two_column".
Layout ProjectSettingsSpanFieldOrderLayout `json:"layout,omitzero"`
// contains filtered or unexported fields
}
The properties ColumnID, ObjectType, Position are required.
func (ProjectSettingsSpanFieldOrderParam) MarshalJSON ¶ added in v0.6.0
func (r ProjectSettingsSpanFieldOrderParam) MarshalJSON() (data []byte, err error)
func (*ProjectSettingsSpanFieldOrderParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectSettingsSpanFieldOrderParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ProjectID respjson.Field
UserID respjson.Field
Color respjson.Field
Created respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A project tag is a user-configured tag for tracking and filtering your experiments, logs, and other data
func (ProjectTag) RawJSON ¶ added in v0.8.0
func (r ProjectTag) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectTag) UnmarshalJSON ¶
func (r *ProjectTag) UnmarshalJSON(data []byte) 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
//
// Any of "p".
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"`
// Any of "llm", "scorer", "task", "tool".
FunctionType PromptFunctionType `json:"function_type,nullable"`
// User-controlled metadata about the prompt
Metadata map[string]any `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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
XactID respjson.Field
LogID respjson.Field
Name respjson.Field
OrgID respjson.Field
ProjectID respjson.Field
Slug respjson.Field
Created respjson.Field
Description respjson.Field
FunctionType respjson.Field
Metadata respjson.Field
PromptData respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Prompt) UnmarshalJSON ¶
type PromptData ¶
type PromptData struct {
Options PromptOptions `json:"options,nullable"`
Origin PromptDataOrigin `json:"origin,nullable"`
Parser PromptDataParser `json:"parser,nullable"`
Prompt PromptDataPromptUnion `json:"prompt,nullable"`
ToolFunctions []PromptDataToolFunctionUnion `json:"tool_functions,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Options respjson.Field
Origin respjson.Field
Parser respjson.Field
Prompt respjson.Field
ToolFunctions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The prompt, model, and its parameters
func (PromptData) RawJSON ¶ added in v0.8.0
func (r PromptData) RawJSON() string
Returns the unmodified JSON received from the API
func (PromptData) ToParam ¶ added in v0.8.0
func (r PromptData) ToParam() PromptDataParam
ToParam converts this PromptData to a PromptDataParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PromptDataParam.Overrides()
func (*PromptData) UnmarshalJSON ¶
func (r *PromptData) UnmarshalJSON(data []byte) error
type PromptDataOrigin ¶
type PromptDataOrigin struct {
ProjectID string `json:"project_id"`
PromptID string `json:"prompt_id"`
PromptVersion string `json:"prompt_version"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ProjectID respjson.Field
PromptID respjson.Field
PromptVersion respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataOrigin) RawJSON ¶ added in v0.8.0
func (r PromptDataOrigin) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataOrigin) UnmarshalJSON ¶
func (r *PromptDataOrigin) UnmarshalJSON(data []byte) error
type PromptDataOriginParam ¶
type PromptDataOriginParam struct {
ProjectID param.Opt[string] `json:"project_id,omitzero"`
PromptID param.Opt[string] `json:"prompt_id,omitzero"`
PromptVersion param.Opt[string] `json:"prompt_version,omitzero"`
// contains filtered or unexported fields
}
func (PromptDataOriginParam) MarshalJSON ¶
func (r PromptDataOriginParam) MarshalJSON() (data []byte, err error)
func (*PromptDataOriginParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataOriginParam) UnmarshalJSON(data []byte) error
type PromptDataParam ¶
type PromptDataParam struct {
Options PromptOptionsParam `json:"options,omitzero"`
Origin PromptDataOriginParam `json:"origin,omitzero"`
Parser PromptDataParserParam `json:"parser,omitzero"`
Prompt PromptDataPromptUnionParam `json:"prompt,omitzero"`
ToolFunctions []PromptDataToolFunctionUnionParam `json:"tool_functions,omitzero"`
// contains filtered or unexported fields
}
The prompt, model, and its parameters
func (PromptDataParam) MarshalJSON ¶
func (r PromptDataParam) MarshalJSON() (data []byte, err error)
func (*PromptDataParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataParam) UnmarshalJSON(data []byte) error
type PromptDataParser ¶ added in v0.4.0
type PromptDataParser struct {
ChoiceScores map[string]float64 `json:"choice_scores,required"`
// Any of "llm_classifier".
Type string `json:"type,required"`
UseCot bool `json:"use_cot,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChoiceScores respjson.Field
Type respjson.Field
UseCot respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataParser) RawJSON ¶ added in v0.8.0
func (r PromptDataParser) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataParser) UnmarshalJSON ¶ added in v0.4.0
func (r *PromptDataParser) UnmarshalJSON(data []byte) error
type PromptDataParserParam ¶ added in v0.4.0
type PromptDataParserParam struct {
ChoiceScores map[string]float64 `json:"choice_scores,omitzero,required"`
// Any of "llm_classifier".
Type string `json:"type,omitzero,required"`
UseCot bool `json:"use_cot,required"`
// contains filtered or unexported fields
}
The properties ChoiceScores, Type, UseCot are required.
func (PromptDataParserParam) MarshalJSON ¶ added in v0.4.0
func (r PromptDataParserParam) MarshalJSON() (data []byte, err error)
func (*PromptDataParserParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataParserParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChat ¶
type PromptDataPromptChat struct {
Messages []PromptDataPromptChatMessageUnion `json:"messages,required"`
// Any of "chat".
Type string `json:"type,required"`
Tools string `json:"tools"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Messages respjson.Field
Type respjson.Field
Tools respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChat) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChat) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChat) UnmarshalJSON ¶
func (r *PromptDataPromptChat) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageAssistant ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistant struct {
// Any of "assistant".
Role string `json:"role,required"`
Content string `json:"content,nullable"`
FunctionCall PromptDataPromptChatMessageAssistantFunctionCall `json:"function_call,nullable"`
Name string `json:"name,nullable"`
ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
FunctionCall respjson.Field
Name respjson.Field
ToolCalls respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageAssistant) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageAssistant) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageAssistant) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageAssistant) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageAssistantFunctionCall ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistantFunctionCall struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arguments respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageAssistantFunctionCall) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageAssistantFunctionCall) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageAssistantFunctionCall) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageAssistantFunctionCall) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageAssistantFunctionCallParam ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistantFunctionCallParam struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
// contains filtered or unexported fields
}
The properties Arguments, Name are required.
func (PromptDataPromptChatMessageAssistantFunctionCallParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageAssistantFunctionCallParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageAssistantFunctionCallParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageAssistantFunctionCallParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageAssistantParam ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistantParam struct {
// Any of "assistant".
Role string `json:"role,omitzero,required"`
Content param.Opt[string] `json:"content,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
FunctionCall PromptDataPromptChatMessageAssistantFunctionCallParam `json:"function_call,omitzero"`
ToolCalls []ChatCompletionMessageToolCallParam `json:"tool_calls,omitzero"`
// contains filtered or unexported fields
}
The property Role is required.
func (PromptDataPromptChatMessageAssistantParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageAssistantParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageAssistantParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageAssistantParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageFallback ¶ added in v0.8.0
type PromptDataPromptChatMessageFallback struct {
// Any of "model".
Role string `json:"role,required"`
Content string `json:"content,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageFallback) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageFallback) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageFallback) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageFallback) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageFallbackParam ¶ added in v0.8.0
type PromptDataPromptChatMessageFallbackParam struct {
// Any of "model".
Role string `json:"role,omitzero,required"`
Content param.Opt[string] `json:"content,omitzero"`
// contains filtered or unexported fields
}
The property Role is required.
func (PromptDataPromptChatMessageFallbackParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageFallbackParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageFallbackParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageFallbackParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageFunction ¶ added in v0.8.0
type PromptDataPromptChatMessageFunction struct {
Name string `json:"name,required"`
// Any of "function".
Role string `json:"role,required"`
Content string `json:"content"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Role respjson.Field
Content respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageFunction) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageFunction) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageFunction) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageFunctionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageFunctionParam struct {
Name string `json:"name,required"`
// Any of "function".
Role string `json:"role,omitzero,required"`
Content param.Opt[string] `json:"content,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Role are required.
func (PromptDataPromptChatMessageFunctionParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageFunctionParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageFunctionParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageSystem ¶ added in v0.8.0
type PromptDataPromptChatMessageSystem struct {
// Any of "system".
Role string `json:"role,required"`
Content string `json:"content"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageSystem) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageSystem) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageSystem) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageSystem) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageSystemParam ¶ added in v0.8.0
type PromptDataPromptChatMessageSystemParam struct {
// Any of "system".
Role string `json:"role,omitzero,required"`
Content param.Opt[string] `json:"content,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
The property Role is required.
func (PromptDataPromptChatMessageSystemParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageSystemParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageSystemParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageSystemParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageTool ¶ added in v0.8.0
type PromptDataPromptChatMessageTool struct {
// Any of "tool".
Role string `json:"role,required"`
Content string `json:"content"`
ToolCallID string `json:"tool_call_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
ToolCallID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageTool) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageTool) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageTool) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageTool) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageToolParam ¶ added in v0.8.0
type PromptDataPromptChatMessageToolParam struct {
// Any of "tool".
Role string `json:"role,omitzero,required"`
Content param.Opt[string] `json:"content,omitzero"`
ToolCallID param.Opt[string] `json:"tool_call_id,omitzero"`
// contains filtered or unexported fields
}
The property Role is required.
func (PromptDataPromptChatMessageToolParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageToolParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageToolParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageToolParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUnion ¶ added in v0.8.0
type PromptDataPromptChatMessageUnion struct {
Role string `json:"role"`
// This field is a union of [string],
// [PromptDataPromptChatMessageUserContentUnion], [string], [string], [string],
// [string]
Content PromptDataPromptChatMessageUnionContent `json:"content"`
Name string `json:"name"`
// This field is from variant [PromptDataPromptChatMessageAssistant].
FunctionCall PromptDataPromptChatMessageAssistantFunctionCall `json:"function_call"`
// This field is from variant [PromptDataPromptChatMessageAssistant].
ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls"`
// This field is from variant [PromptDataPromptChatMessageTool].
ToolCallID string `json:"tool_call_id"`
JSON struct {
Role respjson.Field
Content respjson.Field
Name respjson.Field
FunctionCall respjson.Field
ToolCalls respjson.Field
ToolCallID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptDataPromptChatMessageUnion contains all possible properties and values from PromptDataPromptChatMessageSystem, PromptDataPromptChatMessageUser, PromptDataPromptChatMessageAssistant, PromptDataPromptChatMessageTool, PromptDataPromptChatMessageFunction, PromptDataPromptChatMessageFallback.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (PromptDataPromptChatMessageUnion) AsAssistant ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) AsAssistant() (v PromptDataPromptChatMessageAssistant)
func (PromptDataPromptChatMessageUnion) AsFallback ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) AsFallback() (v PromptDataPromptChatMessageFallback)
func (PromptDataPromptChatMessageUnion) AsFunction ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) AsFunction() (v PromptDataPromptChatMessageFunction)
func (PromptDataPromptChatMessageUnion) AsSystem ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) AsSystem() (v PromptDataPromptChatMessageSystem)
func (PromptDataPromptChatMessageUnion) AsTool ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) AsTool() (v PromptDataPromptChatMessageTool)
func (PromptDataPromptChatMessageUnion) AsUser ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) AsUser() (v PromptDataPromptChatMessageUser)
func (PromptDataPromptChatMessageUnion) RawJSON ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageUnion) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUnionContent ¶ added in v0.8.0
type PromptDataPromptChatMessageUnionContent struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a
// [[]PromptDataPromptChatMessageUserContentArrayItemUnion] instead of an object.
OfArray []PromptDataPromptChatMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptDataPromptChatMessageUnionContent is an implicit subunion of PromptDataPromptChatMessageUnion. PromptDataPromptChatMessageUnionContent provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the PromptDataPromptChatMessageUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfArray]
func (*PromptDataPromptChatMessageUnionContent) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageUnionContent) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUnionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUnionParam struct {
OfSystem *PromptDataPromptChatMessageSystemParam `json:",omitzero,inline"`
OfUser *PromptDataPromptChatMessageUserParam `json:",omitzero,inline"`
OfAssistant *PromptDataPromptChatMessageAssistantParam `json:",omitzero,inline"`
OfTool *PromptDataPromptChatMessageToolParam `json:",omitzero,inline"`
OfFunction *PromptDataPromptChatMessageFunctionParam `json:",omitzero,inline"`
OfFallback *PromptDataPromptChatMessageFallbackParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptDataPromptChatMessageUnionParam) GetContent ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) GetContent() (res promptDataPromptChatMessageUnionParamContent)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (PromptDataPromptChatMessageUnionParam) GetFunctionCall ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) GetFunctionCall() *PromptDataPromptChatMessageAssistantFunctionCallParam
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUnionParam) GetName ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUnionParam) GetRole ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUnionParam) GetToolCallID ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) GetToolCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUnionParam) GetToolCalls ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) GetToolCalls() []ChatCompletionMessageToolCallParam
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUnionParam) MarshalJSON() ([]byte, error)
func (*PromptDataPromptChatMessageUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptDataPromptChatMessageUnionParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUser ¶ added in v0.8.0
type PromptDataPromptChatMessageUser struct {
// Any of "user".
Role string `json:"role,required"`
Content PromptDataPromptChatMessageUserContentUnion `json:"content"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Role respjson.Field
Content respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptChatMessageUser) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageUser) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageUser) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageUser) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUserContentArrayItemUnion ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentArrayItemUnion struct {
Type string `json:"type"`
// This field is from variant [ChatCompletionContentPartText].
Text string `json:"text"`
// This field is from variant [ChatCompletionContentPartImage].
ImageURL ChatCompletionContentPartImageImageURL `json:"image_url"`
JSON struct {
Type respjson.Field
Text respjson.Field
ImageURL respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptDataPromptChatMessageUserContentArrayItemUnion contains all possible properties and values from ChatCompletionContentPartText, ChatCompletionContentPartImage.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (PromptDataPromptChatMessageUserContentArrayItemUnion) AsImageURL ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnion) AsImageURL() (v ChatCompletionContentPartImage)
func (PromptDataPromptChatMessageUserContentArrayItemUnion) AsText ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnion) AsText() (v ChatCompletionContentPartText)
func (PromptDataPromptChatMessageUserContentArrayItemUnion) RawJSON ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageUserContentArrayItemUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUserContentArrayItemUnionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentArrayItemUnionParam struct {
OfText *ChatCompletionContentPartTextParam `json:",omitzero,inline"`
OfImageURL *ChatCompletionContentPartImageParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetImageURL ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetImageURL() *ChatCompletionContentPartImageImageURLParam
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetText ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetType ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptChatMessageUserContentArrayItemUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentArrayItemUnionParam) MarshalJSON() ([]byte, error)
func (*PromptDataPromptChatMessageUserContentArrayItemUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptDataPromptChatMessageUserContentArrayItemUnionParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUserContentUnion ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentUnion struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a
// [[]PromptDataPromptChatMessageUserContentArrayItemUnion] instead of an object.
OfArray []PromptDataPromptChatMessageUserContentArrayItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptDataPromptChatMessageUserContentUnion contains all possible properties and values from [string], [[]PromptDataPromptChatMessageUserContentArrayItemUnion].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfArray]
func (PromptDataPromptChatMessageUserContentUnion) AsArray ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentUnion) AsArray() (v []PromptDataPromptChatMessageUserContentArrayItemUnion)
func (PromptDataPromptChatMessageUserContentUnion) AsString ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentUnion) AsString() (v string)
func (PromptDataPromptChatMessageUserContentUnion) RawJSON ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptChatMessageUserContentUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageUserContentUnion) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUserContentUnionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfArray []PromptDataPromptChatMessageUserContentArrayItemUnionParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptDataPromptChatMessageUserContentUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptDataPromptChatMessageUserContentUnionParam) MarshalJSON() ([]byte, error)
func (*PromptDataPromptChatMessageUserContentUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptDataPromptChatMessageUserContentUnionParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatMessageUserParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUserParam struct {
// Any of "user".
Role string `json:"role,omitzero,required"`
Name param.Opt[string] `json:"name,omitzero"`
Content PromptDataPromptChatMessageUserContentUnionParam `json:"content,omitzero"`
// contains filtered or unexported fields
}
The property Role is required.
func (PromptDataPromptChatMessageUserParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataPromptChatMessageUserParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatMessageUserParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatMessageUserParam) UnmarshalJSON(data []byte) error
type PromptDataPromptChatParam ¶
type PromptDataPromptChatParam struct {
Messages []PromptDataPromptChatMessageUnionParam `json:"messages,omitzero,required"`
// Any of "chat".
Type string `json:"type,omitzero,required"`
Tools param.Opt[string] `json:"tools,omitzero"`
// contains filtered or unexported fields
}
The properties Messages, Type are required.
func (PromptDataPromptChatParam) MarshalJSON ¶
func (r PromptDataPromptChatParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptChatParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptChatParam) UnmarshalJSON(data []byte) error
type PromptDataPromptCompletion ¶
type PromptDataPromptCompletion struct {
Content string `json:"content,required"`
// Any of "completion".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataPromptCompletion) RawJSON ¶ added in v0.8.0
func (r PromptDataPromptCompletion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptCompletion) UnmarshalJSON ¶
func (r *PromptDataPromptCompletion) UnmarshalJSON(data []byte) error
type PromptDataPromptCompletionParam ¶
type PromptDataPromptCompletionParam struct {
Content string `json:"content,required"`
// Any of "completion".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Content, Type are required.
func (PromptDataPromptCompletionParam) MarshalJSON ¶
func (r PromptDataPromptCompletionParam) MarshalJSON() (data []byte, err error)
func (*PromptDataPromptCompletionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptCompletionParam) UnmarshalJSON(data []byte) error
type PromptDataPromptUnion ¶
type PromptDataPromptUnion struct {
// This field is from variant [PromptDataPromptCompletion].
Content string `json:"content"`
Type string `json:"type"`
// This field is from variant [PromptDataPromptChat].
Messages []PromptDataPromptChatMessageUnion `json:"messages"`
// This field is from variant [PromptDataPromptChat].
Tools string `json:"tools"`
JSON struct {
Content respjson.Field
Type respjson.Field
Messages respjson.Field
Tools respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptDataPromptUnion contains all possible properties and values from PromptDataPromptCompletion, PromptDataPromptChat.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (PromptDataPromptUnion) AsChat ¶ added in v0.8.0
func (u PromptDataPromptUnion) AsChat() (v PromptDataPromptChat)
func (PromptDataPromptUnion) AsCompletion ¶ added in v0.8.0
func (u PromptDataPromptUnion) AsCompletion() (v PromptDataPromptCompletion)
func (PromptDataPromptUnion) RawJSON ¶ added in v0.8.0
func (u PromptDataPromptUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataPromptUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataPromptUnion) UnmarshalJSON(data []byte) error
type PromptDataPromptUnionParam ¶
type PromptDataPromptUnionParam struct {
OfCompletion *PromptDataPromptCompletionParam `json:",omitzero,inline"`
OfChat *PromptDataPromptChatParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptDataPromptUnionParam) GetContent ¶ added in v0.8.0
func (u PromptDataPromptUnionParam) GetContent() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptUnionParam) GetMessages ¶ added in v0.8.0
func (u PromptDataPromptUnionParam) GetMessages() []PromptDataPromptChatMessageUnionParam
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptUnionParam) GetTools ¶ added in v0.8.0
func (u PromptDataPromptUnionParam) GetTools() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptUnionParam) GetType ¶ added in v0.8.0
func (u PromptDataPromptUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataPromptUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptDataPromptUnionParam) MarshalJSON() ([]byte, error)
func (*PromptDataPromptUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptDataPromptUnionParam) UnmarshalJSON(data []byte) error
type PromptDataToolFunctionFunction ¶ added in v0.8.0
type PromptDataToolFunctionFunction struct {
ID string `json:"id,required"`
// Any of "function".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataToolFunctionFunction) RawJSON ¶ added in v0.8.0
func (r PromptDataToolFunctionFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataToolFunctionFunction) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataToolFunctionFunction) UnmarshalJSON(data []byte) error
type PromptDataToolFunctionFunctionParam ¶ added in v0.8.0
type PromptDataToolFunctionFunctionParam struct {
ID string `json:"id,required"`
// Any of "function".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties ID, Type are required.
func (PromptDataToolFunctionFunctionParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataToolFunctionFunctionParam) MarshalJSON() (data []byte, err error)
func (*PromptDataToolFunctionFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataToolFunctionFunctionParam) UnmarshalJSON(data []byte) error
type PromptDataToolFunctionGlobal ¶ added in v0.8.0
type PromptDataToolFunctionGlobal struct {
Name string `json:"name,required"`
// Any of "global".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptDataToolFunctionGlobal) RawJSON ¶ added in v0.8.0
func (r PromptDataToolFunctionGlobal) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataToolFunctionGlobal) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataToolFunctionGlobal) UnmarshalJSON(data []byte) error
type PromptDataToolFunctionGlobalParam ¶ added in v0.8.0
type PromptDataToolFunctionGlobalParam struct {
Name string `json:"name,required"`
// Any of "global".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Name, Type are required.
func (PromptDataToolFunctionGlobalParam) MarshalJSON ¶ added in v0.8.0
func (r PromptDataToolFunctionGlobalParam) MarshalJSON() (data []byte, err error)
func (*PromptDataToolFunctionGlobalParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataToolFunctionGlobalParam) UnmarshalJSON(data []byte) error
type PromptDataToolFunctionUnion ¶ added in v0.8.0
type PromptDataToolFunctionUnion struct {
// This field is from variant [PromptDataToolFunctionFunction].
ID string `json:"id"`
Type string `json:"type"`
// This field is from variant [PromptDataToolFunctionGlobal].
Name string `json:"name"`
JSON struct {
ID respjson.Field
Type respjson.Field
Name respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptDataToolFunctionUnion contains all possible properties and values from PromptDataToolFunctionFunction, PromptDataToolFunctionGlobal.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (PromptDataToolFunctionUnion) AsFunction ¶ added in v0.8.0
func (u PromptDataToolFunctionUnion) AsFunction() (v PromptDataToolFunctionFunction)
func (PromptDataToolFunctionUnion) AsGlobal ¶ added in v0.8.0
func (u PromptDataToolFunctionUnion) AsGlobal() (v PromptDataToolFunctionGlobal)
func (PromptDataToolFunctionUnion) RawJSON ¶ added in v0.8.0
func (u PromptDataToolFunctionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptDataToolFunctionUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptDataToolFunctionUnion) UnmarshalJSON(data []byte) error
type PromptDataToolFunctionUnionParam ¶ added in v0.8.0
type PromptDataToolFunctionUnionParam struct {
OfFunction *PromptDataToolFunctionFunctionParam `json:",omitzero,inline"`
OfGlobal *PromptDataToolFunctionGlobalParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptDataToolFunctionUnionParam) GetID ¶ added in v0.8.0
func (u PromptDataToolFunctionUnionParam) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataToolFunctionUnionParam) GetName ¶ added in v0.8.0
func (u PromptDataToolFunctionUnionParam) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataToolFunctionUnionParam) GetType ¶ added in v0.8.0
func (u PromptDataToolFunctionUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptDataToolFunctionUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptDataToolFunctionUnionParam) MarshalJSON() ([]byte, error)
func (*PromptDataToolFunctionUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptDataToolFunctionUnionParam) UnmarshalJSON(data []byte) error
type PromptFunctionType ¶ added in v0.4.0
type PromptFunctionType string
const ( PromptFunctionTypeLlm PromptFunctionType = "llm" PromptFunctionTypeScorer PromptFunctionType = "scorer" PromptFunctionTypeTask PromptFunctionType = "task" PromptFunctionTypeTool PromptFunctionType = "tool" )
type PromptLogID ¶
type PromptLogID string
A literal 'p' which identifies the object as a project prompt
const (
PromptLogIDP PromptLogID = "p"
)
type PromptOptions ¶ added in v0.5.0
type PromptOptions struct {
Model string `json:"model"`
Params PromptOptionsParamsUnion `json:"params"`
Position string `json:"position"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Model respjson.Field
Params respjson.Field
Position respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptions) RawJSON ¶ added in v0.8.0
func (r PromptOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (PromptOptions) ToParam ¶ added in v0.8.0
func (r PromptOptions) ToParam() PromptOptionsParam
ToParam converts this PromptOptions to a PromptOptionsParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PromptOptionsParam.Overrides()
func (*PromptOptions) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptions) UnmarshalJSON(data []byte) error
type PromptOptionsParam ¶ added in v0.5.0
type PromptOptionsParam struct {
Model param.Opt[string] `json:"model,omitzero"`
Position param.Opt[string] `json:"position,omitzero"`
Params PromptOptionsParamsUnionParam `json:"params,omitzero"`
// contains filtered or unexported fields
}
func (PromptOptionsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsAnthropicModelParams ¶ added in v0.5.0
type PromptOptionsParamsAnthropicModelParams struct {
MaxTokens float64 `json:"max_tokens,required"`
Temperature float64 `json:"temperature,required"`
// This is a legacy parameter that should not be used.
MaxTokensToSample float64 `json:"max_tokens_to_sample"`
StopSequences []string `json:"stop_sequences"`
TopK float64 `json:"top_k"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxTokens respjson.Field
Temperature respjson.Field
MaxTokensToSample respjson.Field
StopSequences respjson.Field
TopK respjson.Field
TopP respjson.Field
UseCache respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsAnthropicModelParams) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsAnthropicModelParams) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsAnthropicModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsAnthropicModelParams) UnmarshalJSON(data []byte) error
type PromptOptionsParamsAnthropicModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsAnthropicModelParamsParam struct {
MaxTokens float64 `json:"max_tokens,required"`
Temperature float64 `json:"temperature,required"`
// This is a legacy parameter that should not be used.
MaxTokensToSample param.Opt[float64] `json:"max_tokens_to_sample,omitzero"`
TopK param.Opt[float64] `json:"top_k,omitzero"`
TopP param.Opt[float64] `json:"top_p,omitzero"`
UseCache param.Opt[bool] `json:"use_cache,omitzero"`
StopSequences []string `json:"stop_sequences,omitzero"`
// contains filtered or unexported fields
}
The properties MaxTokens, Temperature are required.
func (PromptOptionsParamsAnthropicModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsAnthropicModelParamsParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsAnthropicModelParamsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsAnthropicModelParamsParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsGoogleModelParams ¶ added in v0.5.0
type PromptOptionsParamsGoogleModelParams struct {
MaxOutputTokens float64 `json:"maxOutputTokens"`
Temperature float64 `json:"temperature"`
TopK float64 `json:"topK"`
TopP float64 `json:"topP"`
UseCache bool `json:"use_cache"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxOutputTokens respjson.Field
Temperature respjson.Field
TopK respjson.Field
TopP respjson.Field
UseCache respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsGoogleModelParams) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsGoogleModelParams) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsGoogleModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsGoogleModelParams) UnmarshalJSON(data []byte) error
type PromptOptionsParamsGoogleModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsGoogleModelParamsParam struct {
MaxOutputTokens param.Opt[float64] `json:"maxOutputTokens,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
TopK param.Opt[float64] `json:"topK,omitzero"`
TopP param.Opt[float64] `json:"topP,omitzero"`
UseCache param.Opt[bool] `json:"use_cache,omitzero"`
// contains filtered or unexported fields
}
func (PromptOptionsParamsGoogleModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsGoogleModelParamsParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsGoogleModelParamsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsGoogleModelParamsParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsJsCompletionParams ¶ added in v0.5.0
type PromptOptionsParamsJsCompletionParams struct {
UseCache bool `json:"use_cache"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
UseCache respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsJsCompletionParams) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsJsCompletionParams) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsJsCompletionParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsJsCompletionParams) UnmarshalJSON(data []byte) error
type PromptOptionsParamsJsCompletionParamsParam ¶ added in v0.5.0
type PromptOptionsParamsJsCompletionParamsParam struct {
UseCache param.Opt[bool] `json:"use_cache,omitzero"`
// contains filtered or unexported fields
}
func (PromptOptionsParamsJsCompletionParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsJsCompletionParamsParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsJsCompletionParamsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsJsCompletionParamsParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParams ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParams struct {
FrequencyPenalty float64 `json:"frequency_penalty"`
FunctionCall PromptOptionsParamsOpenAIModelParamsFunctionCallUnion `json:"function_call"`
// The successor to max_tokens
MaxCompletionTokens float64 `json:"max_completion_tokens"`
MaxTokens float64 `json:"max_tokens"`
N float64 `json:"n"`
PresencePenalty float64 `json:"presence_penalty"`
// Any of "low", "medium", "high".
ReasoningEffort string `json:"reasoning_effort"`
ResponseFormat PromptOptionsParamsOpenAIModelParamsResponseFormatUnion `json:"response_format,nullable"`
Stop []string `json:"stop"`
Temperature float64 `json:"temperature"`
ToolChoice PromptOptionsParamsOpenAIModelParamsToolChoiceUnion `json:"tool_choice"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FrequencyPenalty respjson.Field
FunctionCall respjson.Field
MaxCompletionTokens respjson.Field
MaxTokens respjson.Field
N respjson.Field
PresencePenalty respjson.Field
ReasoningEffort respjson.Field
ResponseFormat respjson.Field
Stop respjson.Field
Temperature respjson.Field
ToolChoice respjson.Field
TopP respjson.Field
UseCache respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParams) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParams) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParams) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction struct {
Name string `json:"name,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsFunctionCallFunction) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsFunctionCallFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam struct {
Name string `json:"name,required"`
// contains filtered or unexported fields
}
The property Name is required.
func (PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsFunctionCallString ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallString string
const ( PromptOptionsParamsOpenAIModelParamsFunctionCallStringAuto PromptOptionsParamsOpenAIModelParamsFunctionCallString = "auto" PromptOptionsParamsOpenAIModelParamsFunctionCallStringNone PromptOptionsParamsOpenAIModelParamsFunctionCallString = "none" )
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion struct {
// This field will be present if the value is a
// [PromptOptionsParamsOpenAIModelParamsFunctionCallString] instead of an object.
OfPromptOptionssOpenAIModelParamsFunctionCallString PromptOptionsParamsOpenAIModelParamsFunctionCallString `json:",inline"`
// This field is from variant
// [PromptOptionsParamsOpenAIModelParamsFunctionCallFunction].
Name string `json:"name"`
JSON struct {
OfPromptOptionssOpenAIModelParamsFunctionCallString respjson.Field
Name respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptOptionsParamsOpenAIModelParamsFunctionCallUnion contains all possible properties and values from PromptOptionsParamsOpenAIModelParamsFunctionCallString, PromptOptionsParamsOpenAIModelParamsFunctionCallFunction.
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfPromptOptionssOpenAIModelParamsFunctionCallString]
func (PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) AsFunction ¶ added in v0.8.0
func (PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) AsPromptOptionsParamsOpenAIModelParamsFunctionCallString ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) AsPromptOptionsParamsOpenAIModelParamsFunctionCallString() (v PromptOptionsParamsOpenAIModelParamsFunctionCallString)
func (PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) RawJSON ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsFunctionCallUnion) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam struct {
// Check if union is this variant with
// !param.IsOmitted(union.OfPromptOptionssOpenAIModelParamsFunctionCallString)
OfPromptOptionssOpenAIModelParamsFunctionCallString param.Opt[PromptOptionsParamsOpenAIModelParamsFunctionCallString] `json:",omitzero,inline"`
OfFunction *PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam) MarshalJSON() ([]byte, error)
func (*PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsParam struct {
FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
// The successor to max_tokens
MaxCompletionTokens param.Opt[float64] `json:"max_completion_tokens,omitzero"`
MaxTokens param.Opt[float64] `json:"max_tokens,omitzero"`
N param.Opt[float64] `json:"n,omitzero"`
PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
TopP param.Opt[float64] `json:"top_p,omitzero"`
UseCache param.Opt[bool] `json:"use_cache,omitzero"`
ResponseFormat PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam `json:"response_format,omitzero"`
FunctionCall PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam `json:"function_call,omitzero"`
// Any of "low", "medium", "high".
ReasoningEffort string `json:"reasoning_effort,omitzero"`
Stop []string `json:"stop,omitzero"`
ToolChoice PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam `json:"tool_choice,omitzero"`
// contains filtered or unexported fields
}
func (PromptOptionsParamsOpenAIModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject struct {
// Any of "json_object".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam struct {
// Any of "json_object".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema struct {
JsonSchema PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema `json:"json_schema,required"`
// Any of "json_schema".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JsonSchema respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema struct {
Name string `json:"name,required"`
Description string `json:"description"`
Schema string `json:"schema"`
Strict bool `json:"strict,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Description respjson.Field
Schema respjson.Field
Strict respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam struct {
Name string `json:"name,required"`
Strict param.Opt[bool] `json:"strict,omitzero"`
Description param.Opt[string] `json:"description,omitzero"`
Schema string `json:"schema,omitzero"`
// contains filtered or unexported fields
}
The property Name is required.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam struct {
JsonSchema PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam `json:"json_schema,omitzero,required"`
// Any of "json_schema".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties JsonSchema, Type are required.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatText ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatText struct {
// Any of "text".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsResponseFormatText) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatText) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatText) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatText) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam struct {
// Any of "text".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion struct {
Type string `json:"type"`
// This field is from variant
// [PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema].
JsonSchema PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema `json:"json_schema"`
JSON struct {
Type respjson.Field
JsonSchema respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptOptionsParamsOpenAIModelParamsResponseFormatUnion contains all possible properties and values from PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject, PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema, PromptOptionsParamsOpenAIModelParamsResponseFormatText.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsJsonObject ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsJsonObject() (v PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject)
func (PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsJsonSchema ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) AsJsonSchema() (v PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema)
func (PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) RawJSON ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsResponseFormatUnion) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam struct {
OfJsonObject *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam `json:",omitzero,inline"`
OfJsonSchema *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam `json:",omitzero,inline"`
OfText *PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) GetJsonSchema ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) GetJsonSchema() *PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) GetType ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) MarshalJSON() ([]byte, error)
func (*PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction struct {
Function PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction `json:"function,required"`
// Any of "function".
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Function respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunction) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction struct {
Name string `json:"name,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam struct {
Name string `json:"name,required"`
// contains filtered or unexported fields
}
The property Name is required.
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam struct {
Function PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam `json:"function,omitzero,required"`
// Any of "function".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Function, Type are required.
func (PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsToolChoiceString ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceString string
const ( PromptOptionsParamsOpenAIModelParamsToolChoiceStringAuto PromptOptionsParamsOpenAIModelParamsToolChoiceString = "auto" PromptOptionsParamsOpenAIModelParamsToolChoiceStringNone PromptOptionsParamsOpenAIModelParamsToolChoiceString = "none" PromptOptionsParamsOpenAIModelParamsToolChoiceStringRequired PromptOptionsParamsOpenAIModelParamsToolChoiceString = "required" )
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion struct {
// This field will be present if the value is a
// [PromptOptionsParamsOpenAIModelParamsToolChoiceString] instead of an object.
OfPromptOptionssOpenAIModelParamsToolChoiceString PromptOptionsParamsOpenAIModelParamsToolChoiceString `json:",inline"`
// This field is from variant
// [PromptOptionsParamsOpenAIModelParamsToolChoiceFunction].
Function PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction `json:"function"`
// This field is from variant
// [PromptOptionsParamsOpenAIModelParamsToolChoiceFunction].
Type string `json:"type"`
JSON struct {
OfPromptOptionssOpenAIModelParamsToolChoiceString respjson.Field
Function respjson.Field
Type respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptOptionsParamsOpenAIModelParamsToolChoiceUnion contains all possible properties and values from PromptOptionsParamsOpenAIModelParamsToolChoiceString, PromptOptionsParamsOpenAIModelParamsToolChoiceFunction.
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfPromptOptionssOpenAIModelParamsToolChoiceString]
func (PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) AsFunction ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) AsFunction() (v PromptOptionsParamsOpenAIModelParamsToolChoiceFunction)
func (PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) AsPromptOptionsParamsOpenAIModelParamsToolChoiceString ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) AsPromptOptionsParamsOpenAIModelParamsToolChoiceString() (v PromptOptionsParamsOpenAIModelParamsToolChoiceString)
func (PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) RawJSON ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsOpenAIModelParamsToolChoiceUnion) UnmarshalJSON(data []byte) error
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam struct {
// Check if union is this variant with
// !param.IsOmitted(union.OfPromptOptionssOpenAIModelParamsToolChoiceString)
OfPromptOptionssOpenAIModelParamsToolChoiceString param.Opt[PromptOptionsParamsOpenAIModelParamsToolChoiceString] `json:",omitzero,inline"`
OfFunction *PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam) MarshalJSON() ([]byte, error)
func (*PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsUnion ¶ added in v0.5.0
type PromptOptionsParamsUnion struct {
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
FrequencyPenalty float64 `json:"frequency_penalty"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
FunctionCall PromptOptionsParamsOpenAIModelParamsFunctionCallUnion `json:"function_call"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
MaxCompletionTokens float64 `json:"max_completion_tokens"`
MaxTokens float64 `json:"max_tokens"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
N float64 `json:"n"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
PresencePenalty float64 `json:"presence_penalty"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
ReasoningEffort string `json:"reasoning_effort"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
ResponseFormat PromptOptionsParamsOpenAIModelParamsResponseFormatUnion `json:"response_format"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
Stop []string `json:"stop"`
Temperature float64 `json:"temperature"`
// This field is from variant [PromptOptionsParamsOpenAIModelParams].
ToolChoice PromptOptionsParamsOpenAIModelParamsToolChoiceUnion `json:"tool_choice"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
// This field is from variant [PromptOptionsParamsAnthropicModelParams].
MaxTokensToSample float64 `json:"max_tokens_to_sample"`
// This field is from variant [PromptOptionsParamsAnthropicModelParams].
StopSequences []string `json:"stop_sequences"`
TopK float64 `json:"top_k"`
// This field is from variant [PromptOptionsParamsGoogleModelParams].
MaxOutputTokens float64 `json:"maxOutputTokens"`
JSON struct {
FrequencyPenalty respjson.Field
FunctionCall respjson.Field
MaxCompletionTokens respjson.Field
MaxTokens respjson.Field
N respjson.Field
PresencePenalty respjson.Field
ReasoningEffort respjson.Field
ResponseFormat respjson.Field
Stop respjson.Field
Temperature respjson.Field
ToolChoice respjson.Field
TopP respjson.Field
UseCache respjson.Field
MaxTokensToSample respjson.Field
StopSequences respjson.Field
TopK respjson.Field
MaxOutputTokens respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PromptOptionsParamsUnion contains all possible properties and values from PromptOptionsParamsOpenAIModelParams, PromptOptionsParamsAnthropicModelParams, PromptOptionsParamsGoogleModelParams, PromptOptionsParamsWindowAIModelParams, PromptOptionsParamsJsCompletionParams.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (PromptOptionsParamsUnion) AsAnthropicModelParams ¶ added in v0.8.0
func (u PromptOptionsParamsUnion) AsAnthropicModelParams() (v PromptOptionsParamsAnthropicModelParams)
func (PromptOptionsParamsUnion) AsGoogleModelParams ¶ added in v0.8.0
func (u PromptOptionsParamsUnion) AsGoogleModelParams() (v PromptOptionsParamsGoogleModelParams)
func (PromptOptionsParamsUnion) AsJsCompletionParams ¶ added in v0.8.0
func (u PromptOptionsParamsUnion) AsJsCompletionParams() (v PromptOptionsParamsJsCompletionParams)
func (PromptOptionsParamsUnion) AsOpenAIModelParams ¶ added in v0.8.0
func (u PromptOptionsParamsUnion) AsOpenAIModelParams() (v PromptOptionsParamsOpenAIModelParams)
func (PromptOptionsParamsUnion) AsWindowAIModelParams ¶ added in v0.8.0
func (u PromptOptionsParamsUnion) AsWindowAIModelParams() (v PromptOptionsParamsWindowAIModelParams)
func (PromptOptionsParamsUnion) RawJSON ¶ added in v0.8.0
func (u PromptOptionsParamsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsUnion) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsUnion) UnmarshalJSON(data []byte) error
type PromptOptionsParamsUnionParam ¶ added in v0.5.0
type PromptOptionsParamsUnionParam struct {
OfOpenAIModels *PromptOptionsParamsOpenAIModelParamsParam `json:",omitzero,inline"`
OfAnthropicModels *PromptOptionsParamsAnthropicModelParamsParam `json:",omitzero,inline"`
OfGoogleModels *PromptOptionsParamsGoogleModelParamsParam `json:",omitzero,inline"`
OfWindowAIModels *PromptOptionsParamsWindowAIModelParamsParam `json:",omitzero,inline"`
OfJsCompletions *PromptOptionsParamsJsCompletionParamsParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PromptOptionsParamsUnionParam) GetFrequencyPenalty ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetFrequencyPenalty() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetFunctionCall ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetFunctionCall() *PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetMaxCompletionTokens ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetMaxCompletionTokens() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetMaxOutputTokens ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetMaxOutputTokens() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetMaxTokens ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetMaxTokens() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetMaxTokensToSample ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetMaxTokensToSample() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetN ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetN() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetPresencePenalty ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetPresencePenalty() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetReasoningEffort ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetReasoningEffort() *string
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetResponseFormat ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetResponseFormat() *PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetStop ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetStop() []string
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetStopSequences ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetStopSequences() []string
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetTemperature ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetTemperature() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetToolChoice ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetToolChoice() *PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetTopK ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetTopK() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetTopP ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetTopP() *float64
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) GetUseCache ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) GetUseCache() *bool
Returns a pointer to the underlying variant's property, if present.
func (PromptOptionsParamsUnionParam) MarshalJSON ¶ added in v0.8.0
func (u PromptOptionsParamsUnionParam) MarshalJSON() ([]byte, error)
func (*PromptOptionsParamsUnionParam) UnmarshalJSON ¶ added in v0.8.0
func (u *PromptOptionsParamsUnionParam) UnmarshalJSON(data []byte) error
type PromptOptionsParamsWindowAIModelParams ¶ added in v0.5.0
type PromptOptionsParamsWindowAIModelParams struct {
Temperature float64 `json:"temperature"`
TopK float64 `json:"topK"`
UseCache bool `json:"use_cache"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Temperature respjson.Field
TopK respjson.Field
UseCache respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PromptOptionsParamsWindowAIModelParams) RawJSON ¶ added in v0.8.0
func (r PromptOptionsParamsWindowAIModelParams) RawJSON() string
Returns the unmodified JSON received from the API
func (*PromptOptionsParamsWindowAIModelParams) UnmarshalJSON ¶ added in v0.5.0
func (r *PromptOptionsParamsWindowAIModelParams) UnmarshalJSON(data []byte) error
type PromptOptionsParamsWindowAIModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsWindowAIModelParamsParam struct {
Temperature param.Opt[float64] `json:"temperature,omitzero"`
TopK param.Opt[float64] `json:"topK,omitzero"`
UseCache param.Opt[bool] `json:"use_cache,omitzero"`
// contains filtered or unexported fields
}
func (PromptOptionsParamsWindowAIModelParamsParam) MarshalJSON ¶ added in v0.5.0
func (r PromptOptionsParamsWindowAIModelParamsParam) MarshalJSON() (data []byte, err error)
func (*PromptOptionsParamsWindowAIModelParamsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptOptionsParamsWindowAIModelParamsParam) UnmarshalJSON(data []byte) error
type RepoInfo ¶
type RepoInfo struct {
// Email of the author of the most recent commit
AuthorEmail string `json:"author_email,nullable"`
// Name of the author of the most recent commit
AuthorName string `json:"author_name,nullable"`
// Name of the branch the most recent commit belongs to
Branch string `json:"branch,nullable"`
// SHA of most recent commit
Commit string `json:"commit,nullable"`
// Most recent commit message
CommitMessage string `json:"commit_message,nullable"`
// Time of the most recent commit
CommitTime string `json:"commit_time,nullable"`
// Whether or not the repo had uncommitted changes when snapshotted
Dirty bool `json:"dirty,nullable"`
// If the repo was dirty when run, this includes the diff between the current state
// of the repo and the most recent commit.
GitDiff string `json:"git_diff,nullable"`
// Name of the tag on the most recent commit
Tag string `json:"tag,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AuthorEmail respjson.Field
AuthorName respjson.Field
Branch respjson.Field
Commit respjson.Field
CommitMessage respjson.Field
CommitTime respjson.Field
Dirty respjson.Field
GitDiff respjson.Field
Tag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metadata about the state of the repo when the experiment was created
func (RepoInfo) ToParam ¶ added in v0.8.0
func (r RepoInfo) ToParam() RepoInfoParam
ToParam converts this RepoInfo to a RepoInfoParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RepoInfoParam.Overrides()
func (*RepoInfo) UnmarshalJSON ¶
type RepoInfoParam ¶
type RepoInfoParam struct {
// Email of the author of the most recent commit
AuthorEmail param.Opt[string] `json:"author_email,omitzero"`
// Name of the author of the most recent commit
AuthorName param.Opt[string] `json:"author_name,omitzero"`
// Name of the branch the most recent commit belongs to
Branch param.Opt[string] `json:"branch,omitzero"`
// SHA of most recent commit
Commit param.Opt[string] `json:"commit,omitzero"`
// Most recent commit message
CommitMessage param.Opt[string] `json:"commit_message,omitzero"`
// Time of the most recent commit
CommitTime param.Opt[string] `json:"commit_time,omitzero"`
// Whether or not the repo had uncommitted changes when snapshotted
Dirty param.Opt[bool] `json:"dirty,omitzero"`
// 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.Opt[string] `json:"git_diff,omitzero"`
// Name of the tag on the most recent commit
Tag param.Opt[string] `json:"tag,omitzero"`
// contains filtered or unexported fields
}
Metadata about the state of the repo when the experiment was created
func (RepoInfoParam) MarshalJSON ¶
func (r RepoInfoParam) MarshalJSON() (data []byte, err error)
func (*RepoInfoParam) UnmarshalJSON ¶ added in v0.8.0
func (r *RepoInfoParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
Created respjson.Field
DeletedAt respjson.Field
Description respjson.Field
MemberPermissions respjson.Field
MemberRoles respjson.Field
OrgID respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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
//
// Any of "create", "read", "update", "delete", "create_acls", "read_acls",
// "update_acls", "delete_acls".
Permission Permission `json:"permission,required"`
// The object type that the ACL applies to
//
// Any of "organization", "project", "experiment", "dataset", "prompt",
// "prompt_session", "group", "role", "org_member", "project_log", "org_project".
RestrictObjectType ACLObjectType `json:"restrict_object_type,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Permission respjson.Field
RestrictObjectType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RoleMemberPermission) RawJSON ¶ added in v0.8.0
func (r RoleMemberPermission) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoleMemberPermission) UnmarshalJSON ¶
func (r *RoleMemberPermission) UnmarshalJSON(data []byte) error
type ScoreSummary ¶
type ScoreSummary struct {
// Number of improvements in the score
Improvements int64 `json:"improvements,required"`
// Name of the score
Name string `json:"name,required"`
// Number of regressions in the score
Regressions int64 `json:"regressions,required"`
// Average score across all examples
Score float64 `json:"score,required"`
// Difference in score between the current and comparison experiment
Diff float64 `json:"diff"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Improvements respjson.Field
Name respjson.Field
Regressions respjson.Field
Score respjson.Field
Diff respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Summary of a score's performance
func (ScoreSummary) RawJSON ¶ added in v0.8.0
func (r ScoreSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*ScoreSummary) UnmarshalJSON ¶
func (r *ScoreSummary) UnmarshalJSON(data []byte) error
type SpanAttributes ¶ added in v0.5.0
type SpanAttributes struct {
// Name of the span, for display purposes only
Name string `json:"name,nullable"`
// Type of the span, for display purposes only
//
// Any of "llm", "score", "function", "eval", "task", "tool".
Type SpanType `json:"type,nullable"`
ExtraFields map[string]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (SpanAttributes) RawJSON ¶ added in v0.8.0
func (r SpanAttributes) RawJSON() string
Returns the unmodified JSON received from the API
func (SpanAttributes) ToParam ¶ added in v0.8.0
func (r SpanAttributes) ToParam() SpanAttributesParam
ToParam converts this SpanAttributes to a SpanAttributesParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with SpanAttributesParam.Overrides()
func (*SpanAttributes) UnmarshalJSON ¶ added in v0.5.0
func (r *SpanAttributes) UnmarshalJSON(data []byte) error
type SpanAttributesParam ¶ added in v0.5.0
type SpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Opt[string] `json:"name,omitzero"`
// Type of the span, for display purposes only
//
// Any of "llm", "score", "function", "eval", "task", "tool".
Type SpanType `json:"type,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
Human-identifying attributes of the span, such as name, type, etc.
func (SpanAttributesParam) MarshalJSON ¶ added in v0.5.0
func (r SpanAttributesParam) MarshalJSON() (data []byte, err error)
func (*SpanAttributesParam) UnmarshalJSON ¶ added in v0.8.0
func (r *SpanAttributesParam) UnmarshalJSON(data []byte) error
type SpanIFrame ¶ added in v0.5.0
type SpanIFrame struct {
// Unique identifier for the span iframe
ID string `json:"id,required" format:"uuid"`
// Name of the span iframe
Name string `json:"name,required"`
// Unique identifier for the project that the span iframe belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// URL to embed the project viewer in an iframe
URL string `json:"url,required"`
// Date of span iframe creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of span iframe deletion, or null if the span iframe is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the span iframe
Description string `json:"description,nullable"`
// Whether to post messages to the iframe containing the span's data. This is
// useful when you want to render more data than fits in the URL.
PostMessage bool `json:"post_message,nullable"`
// Identifies the user who created the span iframe
UserID string `json:"user_id,nullable" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ProjectID respjson.Field
URL respjson.Field
Created respjson.Field
DeletedAt respjson.Field
Description respjson.Field
PostMessage respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SpanIFrame) RawJSON ¶ added in v0.8.0
func (r SpanIFrame) RawJSON() string
Returns the unmodified JSON received from the API
func (*SpanIFrame) UnmarshalJSON ¶ added in v0.5.0
func (r *SpanIFrame) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DatasetName respjson.Field
DatasetURL respjson.Field
ProjectName respjson.Field
ProjectURL respjson.Field
DataSummary respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Summary of a dataset
func (SummarizeDatasetResponse) RawJSON ¶ added in v0.8.0
func (r SummarizeDatasetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SummarizeDatasetResponse) UnmarshalJSON ¶
func (r *SummarizeDatasetResponse) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExperimentName respjson.Field
ExperimentURL respjson.Field
ProjectName respjson.Field
ProjectURL respjson.Field
ComparisonExperimentName respjson.Field
Metrics respjson.Field
Scores respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Summary of an experiment
func (SummarizeExperimentResponse) RawJSON ¶ added in v0.8.0
func (r SummarizeExperimentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SummarizeExperimentResponse) UnmarshalJSON ¶
func (r *SummarizeExperimentResponse) UnmarshalJSON(data []byte) error
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AvatarURL respjson.Field
Created respjson.Field
Email respjson.Field
FamilyName respjson.Field
GivenName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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
//
// Any of "organization", "project", "experiment", "dataset", "prompt",
// "prompt_session", "group", "role", "org_member", "project_log", "org_project".
ObjectType ACLObjectType `json:"object_type,required"`
// Type of table that the view corresponds to.
//
// Any of "projects", "experiments", "experiment", "playgrounds", "playground",
// "datasets", "dataset", "prompts", "tools", "scorers", "logs".
ViewType ViewViewType `json:"view_type,required"`
// 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ObjectID respjson.Field
ObjectType respjson.Field
ViewType respjson.Field
Created respjson.Field
DeletedAt respjson.Field
Options respjson.Field
UserID respjson.Field
ViewData respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*View) UnmarshalJSON ¶
type ViewData ¶
type ViewData struct {
Search ViewDataSearch `json:"search,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Search respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The view definition
func (ViewData) ToParam ¶ added in v0.8.0
func (r ViewData) ToParam() ViewDataParam
ToParam converts this ViewData to a ViewDataParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewDataParam.Overrides()
func (*ViewData) UnmarshalJSON ¶
type ViewDataParam ¶
type ViewDataParam struct {
Search ViewDataSearchParam `json:"search,omitzero"`
// contains filtered or unexported fields
}
The view definition
func (ViewDataParam) MarshalJSON ¶
func (r ViewDataParam) MarshalJSON() (data []byte, err error)
func (*ViewDataParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewDataParam) UnmarshalJSON(data []byte) error
type ViewDataSearch ¶
type ViewDataSearch struct {
Filter []any `json:"filter,nullable"`
Match []any `json:"match,nullable"`
Sort []any `json:"sort,nullable"`
Tag []any `json:"tag,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Filter respjson.Field
Match respjson.Field
Sort respjson.Field
Tag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ViewDataSearch) RawJSON ¶ added in v0.8.0
func (r ViewDataSearch) RawJSON() string
Returns the unmodified JSON received from the API
func (ViewDataSearch) ToParam ¶ added in v0.8.0
func (r ViewDataSearch) ToParam() ViewDataSearchParam
ToParam converts this ViewDataSearch to a ViewDataSearchParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewDataSearchParam.Overrides()
func (*ViewDataSearch) UnmarshalJSON ¶
func (r *ViewDataSearch) UnmarshalJSON(data []byte) error
type ViewDataSearchParam ¶
type ViewDataSearchParam struct {
Filter []any `json:"filter,omitzero"`
Match []any `json:"match,omitzero"`
Sort []any `json:"sort,omitzero"`
Tag []any `json:"tag,omitzero"`
// contains filtered or unexported fields
}
func (ViewDataSearchParam) MarshalJSON ¶
func (r ViewDataSearchParam) MarshalJSON() (data []byte, err error)
func (*ViewDataSearchParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewDataSearchParam) UnmarshalJSON(data []byte) error
type ViewOptions ¶
type ViewOptions struct {
ColumnOrder []string `json:"columnOrder,nullable"`
ColumnSizing map[string]float64 `json:"columnSizing,nullable"`
ColumnVisibility map[string]bool `json:"columnVisibility,nullable"`
Grouping string `json:"grouping,nullable"`
Layout string `json:"layout,nullable"`
RowHeight string `json:"rowHeight,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ColumnOrder respjson.Field
ColumnSizing respjson.Field
ColumnVisibility respjson.Field
Grouping respjson.Field
Layout respjson.Field
RowHeight respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Options for the view in the app
func (ViewOptions) RawJSON ¶ added in v0.8.0
func (r ViewOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (ViewOptions) ToParam ¶ added in v0.8.0
func (r ViewOptions) ToParam() ViewOptionsParam
ToParam converts this ViewOptions to a ViewOptionsParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewOptionsParam.Overrides()
func (*ViewOptions) UnmarshalJSON ¶
func (r *ViewOptions) UnmarshalJSON(data []byte) error
type ViewOptionsParam ¶
type ViewOptionsParam struct {
Grouping param.Opt[string] `json:"grouping,omitzero"`
Layout param.Opt[string] `json:"layout,omitzero"`
RowHeight param.Opt[string] `json:"rowHeight,omitzero"`
ColumnOrder []string `json:"columnOrder,omitzero"`
ColumnSizing map[string]float64 `json:"columnSizing,omitzero"`
ColumnVisibility map[string]bool `json:"columnVisibility,omitzero"`
// contains filtered or unexported fields
}
Options for the view in the app
func (ViewOptionsParam) MarshalJSON ¶
func (r ViewOptionsParam) MarshalJSON() (data []byte, err error)
func (*ViewOptionsParam) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewOptionsParam) UnmarshalJSON(data []byte) error
type ViewType ¶ added in v0.7.0
type ViewType string
Type of table that the view corresponds to.
const ( ViewTypeProjects ViewType = "projects" ViewTypeExperiments ViewType = "experiments" ViewTypeExperiment ViewType = "experiment" ViewTypePlaygrounds ViewType = "playgrounds" ViewTypePlayground ViewType = "playground" ViewTypeDatasets ViewType = "datasets" ViewTypeDataset ViewType = "dataset" ViewTypePrompts ViewType = "prompts" ViewTypeTools ViewType = "tools" ViewTypeScorers ViewType = "scorers" ViewTypeLogs ViewType = "logs" )
type ViewViewType ¶
type ViewViewType string
Type of table that the view corresponds to.
const ( ViewViewTypeProjects ViewViewType = "projects" ViewViewTypeExperiments ViewViewType = "experiments" ViewViewTypeExperiment ViewViewType = "experiment" ViewViewTypePlaygrounds ViewViewType = "playgrounds" ViewViewTypePlayground ViewViewType = "playground" ViewViewTypeDatasets ViewViewType = "datasets" ViewViewTypeDataset ViewViewType = "dataset" ViewViewTypePrompts ViewViewType = "prompts" ViewViewTypeTools ViewViewType = "tools" ViewViewTypeScorers ViewViewType = "scorers" ViewViewTypeLogs ViewViewType = "logs" )