Documentation
¶
Index ¶
- type ACL
- type ACLObjectType
- type ACLPermission
- type ACLRestrictObjectType
- type APIKey
- type CreateAPIKeyOutput
- type DataSummary
- type Dataset
- type DatasetEvent
- type Experiment
- type ExperimentEvent
- type ExperimentEventContext
- type ExperimentEventMetrics
- type ExperimentEventSpanAttributes
- type ExperimentEventSpanAttributesType
- type FeedbackDatasetItemParam
- type FeedbackDatasetItemSource
- type FeedbackExperimentItemParam
- type FeedbackExperimentItemSource
- type FeedbackProjectLogsItemParam
- type FeedbackProjectLogsItemSource
- type FetchDatasetEventsResponse
- type FetchExperimentEventsResponse
- type FetchProjectLogsEventsResponse
- type Function
- type FunctionFunctionData
- type FunctionFunctionDataCode
- type FunctionFunctionDataCodeData
- type FunctionFunctionDataCodeDataLocation
- type FunctionFunctionDataCodeDataLocationPositionScore
- type FunctionFunctionDataCodeDataLocationPositionTask
- type FunctionFunctionDataCodeDataLocationPositionUnion
- type FunctionFunctionDataCodeDataLocationType
- type FunctionFunctionDataCodeDataRuntimeContext
- type FunctionFunctionDataCodeDataRuntimeContextRuntime
- type FunctionFunctionDataCodeType
- type FunctionFunctionDataGlobal
- type FunctionFunctionDataGlobalType
- type FunctionFunctionDataPrompt
- type FunctionFunctionDataPromptType
- type FunctionFunctionDataType
- type FunctionFunctionDataUnion
- type FunctionLogID
- type Group
- type InsertDatasetEventMergeParam
- type InsertDatasetEventReplaceParam
- type InsertEventsResponse
- type InsertExperimentEventMergeContextParam
- type InsertExperimentEventMergeMetricsParam
- type InsertExperimentEventMergeParam
- type InsertExperimentEventMergeSpanAttributesParam
- type InsertExperimentEventMergeSpanAttributesType
- type InsertExperimentEventReplaceContextParam
- type InsertExperimentEventReplaceMetricsParam
- type InsertExperimentEventReplaceParam
- type InsertExperimentEventReplaceSpanAttributesParam
- type InsertExperimentEventReplaceSpanAttributesType
- type InsertProjectLogsEventMergeContextParam
- type InsertProjectLogsEventMergeMetricsParam
- type InsertProjectLogsEventMergeParam
- type InsertProjectLogsEventMergeSpanAttributesParam
- type InsertProjectLogsEventMergeSpanAttributesType
- type InsertProjectLogsEventReplaceContextParam
- type InsertProjectLogsEventReplaceMetricsParam
- type InsertProjectLogsEventReplaceParam
- type InsertProjectLogsEventReplaceSpanAttributesParam
- type InsertProjectLogsEventReplaceSpanAttributesType
- type MetricSummary
- type Organization
- type PathLookupFilterParam
- type PathLookupFilterType
- type Project
- type ProjectLogsEvent
- type ProjectLogsEventContext
- type ProjectLogsEventLogID
- type ProjectLogsEventMetrics
- type ProjectLogsEventSpanAttributes
- type ProjectLogsEventSpanAttributesType
- type ProjectScore
- type ProjectScoreCategoriesCategorical
- type ProjectScoreCategoriesMinimum
- type ProjectScoreCategoriesNullableVariant
- type ProjectScoreCategoriesUnion
- type ProjectScoreCategory
- type ProjectScoreCategoryParam
- type ProjectScoreConfig
- type ProjectScoreConfigDestination
- type ProjectScoreScoreType
- type ProjectSettings
- type ProjectTag
- type Prompt
- type PromptData
- type PromptDataOptions
- type PromptDataOptionsParam
- type PromptDataOptionsParamsAnthropicModelParams
- type PromptDataOptionsParamsAnthropicModelParamsParam
- type PromptDataOptionsParamsGoogleModelParams
- type PromptDataOptionsParamsGoogleModelParamsParam
- type PromptDataOptionsParamsJsCompletionParams
- type PromptDataOptionsParamsJsCompletionParamsParam
- type PromptDataOptionsParamsOpenAIModelParams
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion
- type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam
- type PromptDataOptionsParamsOpenAIModelParamsParam
- type PromptDataOptionsParamsOpenAIModelParamsResponseFormat
- type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam
- type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion
- type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam
- type PromptDataOptionsParamsUnion
- type PromptDataOptionsParamsUnionParam
- type PromptDataOptionsParamsWindowAIModelParams
- type PromptDataOptionsParamsWindowAIModelParamsParam
- type PromptDataOrigin
- type PromptDataOriginParam
- type PromptDataParam
- type PromptDataPrompt
- type PromptDataPromptChat
- type PromptDataPromptChatMessage
- type PromptDataPromptChatMessageParam
- type PromptDataPromptChatMessagesAssistant
- type PromptDataPromptChatMessagesAssistantFunctionCall
- type PromptDataPromptChatMessagesAssistantFunctionCallParam
- type PromptDataPromptChatMessagesAssistantParam
- type PromptDataPromptChatMessagesAssistantRole
- type PromptDataPromptChatMessagesAssistantToolCall
- type PromptDataPromptChatMessagesAssistantToolCallParam
- type PromptDataPromptChatMessagesAssistantToolCallsFunction
- type PromptDataPromptChatMessagesAssistantToolCallsFunctionParam
- type PromptDataPromptChatMessagesAssistantToolCallsType
- type PromptDataPromptChatMessagesFallback
- type PromptDataPromptChatMessagesFallbackParam
- type PromptDataPromptChatMessagesFallbackRole
- type PromptDataPromptChatMessagesFunction
- type PromptDataPromptChatMessagesFunctionParam
- type PromptDataPromptChatMessagesFunctionRole
- type PromptDataPromptChatMessagesRole
- type PromptDataPromptChatMessagesSystem
- type PromptDataPromptChatMessagesSystemParam
- type PromptDataPromptChatMessagesSystemRole
- type PromptDataPromptChatMessagesTool
- type PromptDataPromptChatMessagesToolParam
- type PromptDataPromptChatMessagesToolRole
- type PromptDataPromptChatMessagesUnion
- type PromptDataPromptChatMessagesUnionParam
- type PromptDataPromptChatMessagesUser
- type PromptDataPromptChatMessagesUserContentArray
- type PromptDataPromptChatMessagesUserContentArrayImageURL
- type PromptDataPromptChatMessagesUserContentArrayImageURLImageURL
- type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail
- type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam
- type PromptDataPromptChatMessagesUserContentArrayImageURLParam
- type PromptDataPromptChatMessagesUserContentArrayImageURLType
- type PromptDataPromptChatMessagesUserContentArrayItem
- type PromptDataPromptChatMessagesUserContentArrayItemParam
- type PromptDataPromptChatMessagesUserContentArrayParam
- type PromptDataPromptChatMessagesUserContentArrayText
- type PromptDataPromptChatMessagesUserContentArrayTextParam
- type PromptDataPromptChatMessagesUserContentArrayTextType
- type PromptDataPromptChatMessagesUserContentArrayType
- type PromptDataPromptChatMessagesUserContentArrayUnionItem
- type PromptDataPromptChatMessagesUserContentArrayUnionItemParam
- type PromptDataPromptChatMessagesUserContentUnion
- type PromptDataPromptChatMessagesUserContentUnionParam
- type PromptDataPromptChatMessagesUserParam
- type PromptDataPromptChatMessagesUserRole
- type PromptDataPromptChatParam
- type PromptDataPromptChatType
- type PromptDataPromptCompletion
- type PromptDataPromptCompletionParam
- type PromptDataPromptCompletionType
- type PromptDataPromptNullableVariant
- type PromptDataPromptNullableVariantParam
- type PromptDataPromptParam
- type PromptDataPromptType
- type PromptDataPromptUnion
- type PromptDataPromptUnionParam
- type PromptLogID
- type RepoInfo
- type RepoInfoParam
- type Role
- type RoleMemberPermission
- type RoleMemberPermissionsPermission
- type RoleMemberPermissionsRestrictObjectType
- type ScoreSummary
- type SummarizeDatasetResponse
- type SummarizeExperimentResponse
- type UnionString
- func (UnionString) ImplementsACLListParamsIDsUnion()
- func (UnionString) ImplementsAPIKeyListParamsIDsUnion()
- func (UnionString) ImplementsDatasetListParamsIDsUnion()
- func (UnionString) ImplementsExperimentListParamsIDsUnion()
- func (UnionString) ImplementsFunctionListParamsIDsUnion()
- func (UnionString) ImplementsGroupListParamsIDsUnion()
- func (UnionString) ImplementsOrganizationListParamsIDsUnion()
- func (UnionString) ImplementsProjectListParamsIDsUnion()
- func (UnionString) ImplementsProjectScoreListParamsIDsUnion()
- func (UnionString) ImplementsProjectTagListParamsIDsUnion()
- func (UnionString) ImplementsPromptListParamsIDsUnion()
- func (UnionString) ImplementsRoleListParamsIDsUnion()
- func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
- func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
- func (UnionString) ImplementsUserListParamsEmailUnion()
- func (UnionString) ImplementsUserListParamsFamilyNameUnion()
- func (UnionString) ImplementsUserListParamsGivenNameUnion()
- func (UnionString) ImplementsUserListParamsIDsUnion()
- func (UnionString) ImplementsViewListParamsIDsUnion()
- type User
- type View
- type ViewData
- type ViewDataParam
- type ViewDataSearch
- type ViewDataSearchParam
- type ViewObjectType
- type ViewOptions
- type ViewOptionsParam
- type ViewViewType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct {
// Unique identifier for the acl
ID string `json:"id,required" format:"uuid"`
// The organization the ACL's referred object belongs to
ObjectOrgID string `json:"_object_org_id,required" format:"uuid"`
// The id of the object the ACL applies to
ObjectID string `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType ACLObjectType `json:"object_type,required,nullable"`
// Date of acl creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
GroupID string `json:"group_id,nullable" format:"uuid"`
// Permission the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
Permission ACLPermission `json:"permission,nullable"`
// When setting a permission directly, optionally restricts the permission grant to
// just the specified object type. Cannot be set alongside a `role_id`.
RestrictObjectType ACLRestrictObjectType `json:"restrict_object_type,nullable"`
// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be
// provided
RoleID string `json:"role_id,nullable" format:"uuid"`
// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will
// be provided
UserID string `json:"user_id,nullable" format:"uuid"`
JSON aclJSON `json:"-"`
}
An ACL grants a certain permission or role to a certain user or group on an object.
ACLs are inherited across the object hierarchy. So for example, if a user has read permissions on a project, they will also have read permissions on any experiment, dataset, etc. created within that project.
To restrict a grant to a particular sub-object, you may specify `restrict_object_type` in the ACL, as part of a direct permission grant or as part of a role.
func (*ACL) UnmarshalJSON ¶
type ACLObjectType ¶
type ACLObjectType string
The object type that the ACL applies to
const ( ACLObjectTypeOrganization ACLObjectType = "organization" ACLObjectTypeProject ACLObjectType = "project" ACLObjectTypeExperiment ACLObjectType = "experiment" ACLObjectTypeDataset ACLObjectType = "dataset" ACLObjectTypePrompt ACLObjectType = "prompt" ACLObjectTypePromptSession ACLObjectType = "prompt_session" ACLObjectTypeGroup ACLObjectType = "group" ACLObjectTypeRole ACLObjectType = "role" ACLObjectTypeOrgMember ACLObjectType = "org_member" ACLObjectTypeProjectLog ACLObjectType = "project_log" ACLObjectTypeOrgProject ACLObjectType = "org_project" )
func (ACLObjectType) IsKnown ¶
func (r ACLObjectType) IsKnown() bool
type ACLPermission ¶
type ACLPermission string
Permission the ACL grants. Exactly one of `permission` and `role_id` will be provided
const ( ACLPermissionCreate ACLPermission = "create" ACLPermissionRead ACLPermission = "read" ACLPermissionUpdate ACLPermission = "update" ACLPermissionDelete ACLPermission = "delete" ACLPermissionCreateACLs ACLPermission = "create_acls" ACLPermissionReadACLs ACLPermission = "read_acls" ACLPermissionUpdateACLs ACLPermission = "update_acls" ACLPermissionDeleteACLs ACLPermission = "delete_acls" )
func (ACLPermission) IsKnown ¶
func (r ACLPermission) IsKnown() bool
type ACLRestrictObjectType ¶
type ACLRestrictObjectType string
When setting a permission directly, optionally restricts the permission grant to just the specified object type. Cannot be set alongside a `role_id`.
const ( ACLRestrictObjectTypeOrganization ACLRestrictObjectType = "organization" ACLRestrictObjectTypeProject ACLRestrictObjectType = "project" ACLRestrictObjectTypeExperiment ACLRestrictObjectType = "experiment" ACLRestrictObjectTypeDataset ACLRestrictObjectType = "dataset" ACLRestrictObjectTypePrompt ACLRestrictObjectType = "prompt" ACLRestrictObjectTypePromptSession ACLRestrictObjectType = "prompt_session" ACLRestrictObjectTypeGroup ACLRestrictObjectType = "group" ACLRestrictObjectTypeRole ACLRestrictObjectType = "role" ACLRestrictObjectTypeOrgMember ACLRestrictObjectType = "org_member" ACLRestrictObjectTypeProjectLog ACLRestrictObjectType = "project_log" ACLRestrictObjectTypeOrgProject ACLRestrictObjectType = "org_project" )
func (ACLRestrictObjectType) IsKnown ¶
func (r ACLRestrictObjectType) IsKnown() bool
type APIKey ¶
type APIKey struct {
// Unique identifier for the api key
ID string `json:"id,required" format:"uuid"`
// Name of the api key
Name string `json:"name,required"`
PreviewName string `json:"preview_name,required"`
// Date of api key creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Unique identifier for the organization
OrgID string `json:"org_id,nullable" format:"uuid"`
// Unique identifier for the user
UserID string `json:"user_id,nullable" format:"uuid"`
JSON apiKeyJSON `json:"-"`
}
func (*APIKey) UnmarshalJSON ¶
type CreateAPIKeyOutput ¶
type CreateAPIKeyOutput struct {
// Unique identifier for the api key
ID string `json:"id,required" format:"uuid"`
// The raw API key. It will only be exposed this one time
Key string `json:"key,required"`
// Name of the api key
Name string `json:"name,required"`
PreviewName string `json:"preview_name,required"`
// Date of api key creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Unique identifier for the organization
OrgID string `json:"org_id,nullable" format:"uuid"`
// Unique identifier for the user
UserID string `json:"user_id,nullable" format:"uuid"`
JSON createAPIKeyOutputJSON `json:"-"`
}
func (*CreateAPIKeyOutput) UnmarshalJSON ¶
func (r *CreateAPIKeyOutput) UnmarshalJSON(data []byte) (err error)
type DataSummary ¶
type DataSummary struct {
// Total number of records in the dataset
TotalRecords int64 `json:"total_records,required"`
JSON dataSummaryJSON `json:"-"`
}
Summary of a dataset's data
func (*DataSummary) UnmarshalJSON ¶
func (r *DataSummary) UnmarshalJSON(data []byte) (err error)
type Dataset ¶
type Dataset struct {
// Unique identifier for the dataset
ID string `json:"id,required" format:"uuid"`
// Name of the dataset. Within a project, dataset names are unique
Name string `json:"name,required"`
// Date of dataset creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of dataset deletion, or null if the dataset is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the dataset
Description string `json:"description,nullable"`
// User-controlled metadata about the dataset
Metadata map[string]interface{} `json:"metadata,nullable"`
// Unique identifier for the project that the dataset belongs under
ProjectID string `json:"project_id,nullable" format:"uuid"`
// Identifies the user who created the dataset
UserID string `json:"user_id,nullable" format:"uuid"`
JSON datasetJSON `json:"-"`
}
func (*Dataset) UnmarshalJSON ¶
type DatasetEvent ¶
type DatasetEvent struct {
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the dataset (see the `version`
// parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the dataset event was created
Created time.Time `json:"created,required" format:"date-time"`
// Unique identifier for the dataset
DatasetID string `json:"dataset_id,required" format:"uuid"`
// The `span_id` of the root of the trace this dataset event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different dataset events together as part of a
// full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected interface{} `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input interface{} `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata map[string]interface{} `json:"metadata,nullable"`
// Unique identifier for the project that the dataset belongs under
ProjectID string `json:"project_id,nullable" format:"uuid"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
JSON datasetEventJSON `json:"-"`
}
func (*DatasetEvent) UnmarshalJSON ¶
func (r *DatasetEvent) UnmarshalJSON(data []byte) (err error)
type Experiment ¶
type Experiment struct {
// Unique identifier for the experiment
ID string `json:"id,required" format:"uuid"`
// Name of the experiment. Within a project, experiment names are unique
Name string `json:"name,required"`
// Unique identifier for the project that the experiment belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// Whether or not the experiment is public. Public experiments can be viewed by
// anybody inside or outside the organization
Public bool `json:"public,required"`
// Id of default base experiment to compare against when viewing this experiment
BaseExpID string `json:"base_exp_id,nullable" format:"uuid"`
// Commit, taken directly from `repo_info.commit`
Commit string `json:"commit,nullable"`
// Date of experiment creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Identifier of the linked dataset, or null if the experiment is not linked to a
// dataset
DatasetID string `json:"dataset_id,nullable" format:"uuid"`
// Version number of the linked dataset the experiment was run against. This can be
// used to reproduce the experiment after the dataset has been modified.
DatasetVersion string `json:"dataset_version,nullable"`
// Date of experiment deletion, or null if the experiment is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the experiment
Description string `json:"description,nullable"`
// User-controlled metadata about the experiment
Metadata map[string]interface{} `json:"metadata,nullable"`
// Metadata about the state of the repo when the experiment was created
RepoInfo RepoInfo `json:"repo_info,nullable"`
// Identifies the user who created the experiment
UserID string `json:"user_id,nullable" format:"uuid"`
JSON experimentJSON `json:"-"`
}
func (*Experiment) UnmarshalJSON ¶
func (r *Experiment) UnmarshalJSON(data []byte) (err error)
type ExperimentEvent ¶
type ExperimentEvent struct {
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the experiment (see the
// `version` parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the experiment event was created
Created time.Time `json:"created,required" format:"date-time"`
// Unique identifier for the experiment
ExperimentID string `json:"experiment_id,required" format:"uuid"`
// Unique identifier for the project that the experiment belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// The `span_id` of the root of the trace this experiment event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different experiment events together as part of
// a full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context ExperimentEventContext `json:"context,nullable"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID string `json:"dataset_record_id,nullable"`
// The error that occurred, if any.
Error interface{} `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate your experiments while digging into analyses.
// However, we may later use these values to re-score outputs or fine-tune your
// models
Expected interface{} `json:"expected"`
// The arguments that uniquely define a test case (an arbitrary, JSON serializable
// object). Later on, Braintrust will use the `input` to know whether two test
// cases are the same between experiments, so they should not contain
// experiment-specific state. A simple rule of thumb is that if you run the same
// experiment twice, the `input` should be identical
Input interface{} `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata map[string]interface{} `json:"metadata,nullable"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics ExperimentEventMetrics `json:"metrics,nullable"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output interface{} `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores map[string]float64 `json:"scores,nullable"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes ExperimentEventSpanAttributes `json:"span_attributes,nullable"`
// An array of the parent `span_ids` of this experiment event. This should be empty
// for the root span of a trace, and should most often contain just one parent
// element for subspans
SpanParents []string `json:"span_parents,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
JSON experimentEventJSON `json:"-"`
}
func (*ExperimentEvent) UnmarshalJSON ¶
func (r *ExperimentEvent) UnmarshalJSON(data []byte) (err error)
type ExperimentEventContext ¶
type ExperimentEventContext struct {
// Name of the file in code where the experiment event was created
CallerFilename string `json:"caller_filename,nullable"`
// The function in code which created the experiment event
CallerFunctionname string `json:"caller_functionname,nullable"`
// Line of code where the experiment event was created
CallerLineno int64 `json:"caller_lineno,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON experimentEventContextJSON `json:"-"`
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (*ExperimentEventContext) UnmarshalJSON ¶
func (r *ExperimentEventContext) UnmarshalJSON(data []byte) (err error)
type ExperimentEventMetrics ¶
type ExperimentEventMetrics struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens int64 `json:"completion_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End float64 `json:"end,nullable"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens int64 `json:"prompt_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start float64 `json:"start,nullable"`
// The total number of tokens in the input and output of the experiment event.
Tokens int64 `json:"tokens,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON experimentEventMetricsJSON `json:"-"`
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (*ExperimentEventMetrics) UnmarshalJSON ¶
func (r *ExperimentEventMetrics) UnmarshalJSON(data []byte) (err error)
type ExperimentEventSpanAttributes ¶
type ExperimentEventSpanAttributes struct {
// Name of the span, for display purposes only
Name string `json:"name,nullable"`
// Type of the span, for display purposes only
Type ExperimentEventSpanAttributesType `json:"type,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON experimentEventSpanAttributesJSON `json:"-"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (*ExperimentEventSpanAttributes) UnmarshalJSON ¶
func (r *ExperimentEventSpanAttributes) UnmarshalJSON(data []byte) (err error)
type ExperimentEventSpanAttributesType ¶
type ExperimentEventSpanAttributesType string
Type of the span, for display purposes only
const ( ExperimentEventSpanAttributesTypeLlm ExperimentEventSpanAttributesType = "llm" ExperimentEventSpanAttributesTypeScore ExperimentEventSpanAttributesType = "score" ExperimentEventSpanAttributesTypeFunction ExperimentEventSpanAttributesType = "function" ExperimentEventSpanAttributesTypeEval ExperimentEventSpanAttributesType = "eval" ExperimentEventSpanAttributesTypeTask ExperimentEventSpanAttributesType = "task" ExperimentEventSpanAttributesTypeTool ExperimentEventSpanAttributesType = "tool" )
func (ExperimentEventSpanAttributesType) IsKnown ¶
func (r ExperimentEventSpanAttributesType) IsKnown() bool
type FeedbackDatasetItemParam ¶
type FeedbackDatasetItemParam struct {
// The id of the dataset event to log feedback for. This is the row `id` returned
// by `POST /v1/dataset/{dataset_id}/insert`
ID param.Field[string] `json:"id,required"`
// An optional comment string to log about the dataset event
Comment param.Field[string] `json:"comment"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI.
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
Source param.Field[FeedbackDatasetItemSource] `json:"source"`
}
func (FeedbackDatasetItemParam) MarshalJSON ¶
func (r FeedbackDatasetItemParam) MarshalJSON() (data []byte, err error)
type FeedbackDatasetItemSource ¶
type FeedbackDatasetItemSource string
The source of the feedback. Must be one of "external" (default), "app", or "api"
const ( FeedbackDatasetItemSourceApp FeedbackDatasetItemSource = "app" FeedbackDatasetItemSourceAPI FeedbackDatasetItemSource = "api" FeedbackDatasetItemSourceExternal FeedbackDatasetItemSource = "external" )
func (FeedbackDatasetItemSource) IsKnown ¶
func (r FeedbackDatasetItemSource) IsKnown() bool
type FeedbackExperimentItemParam ¶
type FeedbackExperimentItemParam struct {
// The id of the experiment event to log feedback for. This is the row `id`
// returned by `POST /v1/experiment/{experiment_id}/insert`
ID param.Field[string] `json:"id,required"`
// An optional comment string to log about the experiment event
Comment param.Field[string] `json:"comment"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not
Expected param.Field[interface{}] `json:"expected"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI.
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A dictionary of numeric values (between 0 and 1) to log. These scores will be
// merged into the existing scores for the experiment event
Scores param.Field[map[string]float64] `json:"scores"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
Source param.Field[FeedbackExperimentItemSource] `json:"source"`
}
func (FeedbackExperimentItemParam) MarshalJSON ¶
func (r FeedbackExperimentItemParam) MarshalJSON() (data []byte, err error)
type FeedbackExperimentItemSource ¶
type FeedbackExperimentItemSource string
The source of the feedback. Must be one of "external" (default), "app", or "api"
const ( FeedbackExperimentItemSourceApp FeedbackExperimentItemSource = "app" FeedbackExperimentItemSourceAPI FeedbackExperimentItemSource = "api" FeedbackExperimentItemSourceExternal FeedbackExperimentItemSource = "external" )
func (FeedbackExperimentItemSource) IsKnown ¶
func (r FeedbackExperimentItemSource) IsKnown() bool
type FeedbackProjectLogsItemParam ¶
type FeedbackProjectLogsItemParam struct {
// The id of the project logs event to log feedback for. This is the row `id`
// returned by `POST /v1/project_logs/{project_id}/insert`
ID param.Field[string] `json:"id,required"`
// An optional comment string to log about the project logs event
Comment param.Field[string] `json:"comment"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not
Expected param.Field[interface{}] `json:"expected"`
// A dictionary with additional data about the feedback. If you have a `user_id`,
// you can log it here and access it in the Braintrust UI.
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A dictionary of numeric values (between 0 and 1) to log. These scores will be
// merged into the existing scores for the project logs event
Scores param.Field[map[string]float64] `json:"scores"`
// The source of the feedback. Must be one of "external" (default), "app", or "api"
Source param.Field[FeedbackProjectLogsItemSource] `json:"source"`
}
func (FeedbackProjectLogsItemParam) MarshalJSON ¶
func (r FeedbackProjectLogsItemParam) MarshalJSON() (data []byte, err error)
type FeedbackProjectLogsItemSource ¶
type FeedbackProjectLogsItemSource string
The source of the feedback. Must be one of "external" (default), "app", or "api"
const ( FeedbackProjectLogsItemSourceApp FeedbackProjectLogsItemSource = "app" FeedbackProjectLogsItemSourceAPI FeedbackProjectLogsItemSource = "api" FeedbackProjectLogsItemSourceExternal FeedbackProjectLogsItemSource = "external" )
func (FeedbackProjectLogsItemSource) IsKnown ¶
func (r FeedbackProjectLogsItemSource) IsKnown() bool
type FetchDatasetEventsResponse ¶
type FetchDatasetEventsResponse struct {
// A list of fetched events
Events []DatasetEvent `json:"events,required"`
// Pagination cursor
//
// Pass this string directly as the `cursor` param to your next fetch request to
// get the next page of results. Not provided if the returned result set is empty.
Cursor string `json:"cursor,nullable"`
JSON fetchDatasetEventsResponseJSON `json:"-"`
}
func (*FetchDatasetEventsResponse) UnmarshalJSON ¶
func (r *FetchDatasetEventsResponse) UnmarshalJSON(data []byte) (err error)
type FetchExperimentEventsResponse ¶
type FetchExperimentEventsResponse struct {
// A list of fetched events
Events []ExperimentEvent `json:"events,required"`
// Pagination cursor
//
// Pass this string directly as the `cursor` param to your next fetch request to
// get the next page of results. Not provided if the returned result set is empty.
Cursor string `json:"cursor,nullable"`
JSON fetchExperimentEventsResponseJSON `json:"-"`
}
func (*FetchExperimentEventsResponse) UnmarshalJSON ¶
func (r *FetchExperimentEventsResponse) UnmarshalJSON(data []byte) (err error)
type FetchProjectLogsEventsResponse ¶
type FetchProjectLogsEventsResponse struct {
// A list of fetched events
Events []ProjectLogsEvent `json:"events,required"`
// Pagination cursor
//
// Pass this string directly as the `cursor` param to your next fetch request to
// get the next page of results. Not provided if the returned result set is empty.
Cursor string `json:"cursor,nullable"`
JSON fetchProjectLogsEventsResponseJSON `json:"-"`
}
func (*FetchProjectLogsEventsResponse) UnmarshalJSON ¶
func (r *FetchProjectLogsEventsResponse) UnmarshalJSON(data []byte) (err error)
type Function ¶
type Function struct {
// Unique identifier for the prompt
ID string `json:"id,required" format:"uuid"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the prompt (see the `version`
// parameter)
XactID string `json:"_xact_id,required"`
FunctionData FunctionFunctionData `json:"function_data,required"`
// A literal 'p' which identifies the object as a project prompt
LogID FunctionLogID `json:"log_id,required"`
// Name of the prompt
Name string `json:"name,required"`
// Unique identifier for the organization
OrgID string `json:"org_id,required" format:"uuid"`
// Unique identifier for the project that the prompt belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// Unique identifier for the prompt
Slug string `json:"slug,required"`
// Date of prompt creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the prompt
Description string `json:"description,nullable"`
// User-controlled metadata about the prompt
Metadata map[string]interface{} `json:"metadata,nullable"`
// The prompt, model, and its parameters
PromptData PromptData `json:"prompt_data,nullable"`
// A list of tags for the prompt
Tags []string `json:"tags,nullable"`
JSON functionJSON `json:"-"`
}
func (*Function) UnmarshalJSON ¶
type FunctionFunctionData ¶
type FunctionFunctionData struct {
Type FunctionFunctionDataType `json:"type,required"`
// This field can have the runtime type of [FunctionFunctionDataCodeData].
Data interface{} `json:"data,required"`
Name string `json:"name"`
JSON functionFunctionDataJSON `json:"-"`
// contains filtered or unexported fields
}
func (FunctionFunctionData) AsUnion ¶
func (r FunctionFunctionData) AsUnion() FunctionFunctionDataUnion
AsUnion returns a FunctionFunctionDataUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.FunctionFunctionDataPrompt, shared.FunctionFunctionDataCode, shared.FunctionFunctionDataGlobal.
func (*FunctionFunctionData) UnmarshalJSON ¶
func (r *FunctionFunctionData) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCode ¶
type FunctionFunctionDataCode struct {
Data FunctionFunctionDataCodeData `json:"data,required"`
Type FunctionFunctionDataCodeType `json:"type,required"`
JSON functionFunctionDataCodeJSON `json:"-"`
}
func (*FunctionFunctionDataCode) UnmarshalJSON ¶
func (r *FunctionFunctionDataCode) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeData ¶
type FunctionFunctionDataCodeData struct {
BundleID string `json:"bundle_id,required"`
Location FunctionFunctionDataCodeDataLocation `json:"location,required"`
RuntimeContext FunctionFunctionDataCodeDataRuntimeContext `json:"runtime_context,required"`
JSON functionFunctionDataCodeDataJSON `json:"-"`
}
func (*FunctionFunctionDataCodeData) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeData) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataLocation ¶
type FunctionFunctionDataCodeDataLocation struct {
EvalName string `json:"eval_name,required"`
Position FunctionFunctionDataCodeDataLocationPositionUnion `json:"position,required"`
Type FunctionFunctionDataCodeDataLocationType `json:"type,required"`
JSON functionFunctionDataCodeDataLocationJSON `json:"-"`
}
func (*FunctionFunctionDataCodeDataLocation) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeDataLocation) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataLocationPositionScore ¶
type FunctionFunctionDataCodeDataLocationPositionScore struct {
Score float64 `json:"score,required"`
JSON functionFunctionDataCodeDataLocationPositionScoreJSON `json:"-"`
}
func (*FunctionFunctionDataCodeDataLocationPositionScore) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeDataLocationPositionScore) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataLocationPositionTask ¶
type FunctionFunctionDataCodeDataLocationPositionTask string
const (
FunctionFunctionDataCodeDataLocationPositionTaskTask FunctionFunctionDataCodeDataLocationPositionTask = "task"
)
func (FunctionFunctionDataCodeDataLocationPositionTask) IsKnown ¶
func (r FunctionFunctionDataCodeDataLocationPositionTask) IsKnown() bool
type FunctionFunctionDataCodeDataLocationPositionUnion ¶
type FunctionFunctionDataCodeDataLocationPositionUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.FunctionFunctionDataCodeDataLocationPositionTask or shared.FunctionFunctionDataCodeDataLocationPositionScore.
type FunctionFunctionDataCodeDataLocationType ¶
type FunctionFunctionDataCodeDataLocationType string
const (
FunctionFunctionDataCodeDataLocationTypeExperiment FunctionFunctionDataCodeDataLocationType = "experiment"
)
func (FunctionFunctionDataCodeDataLocationType) IsKnown ¶
func (r FunctionFunctionDataCodeDataLocationType) IsKnown() bool
type FunctionFunctionDataCodeDataRuntimeContext ¶
type FunctionFunctionDataCodeDataRuntimeContext struct {
Runtime FunctionFunctionDataCodeDataRuntimeContextRuntime `json:"runtime,required"`
Version string `json:"version,required"`
JSON functionFunctionDataCodeDataRuntimeContextJSON `json:"-"`
}
func (*FunctionFunctionDataCodeDataRuntimeContext) UnmarshalJSON ¶
func (r *FunctionFunctionDataCodeDataRuntimeContext) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataCodeDataRuntimeContextRuntime ¶
type FunctionFunctionDataCodeDataRuntimeContextRuntime string
const (
FunctionFunctionDataCodeDataRuntimeContextRuntimeNode FunctionFunctionDataCodeDataRuntimeContextRuntime = "node"
)
func (FunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown ¶
func (r FunctionFunctionDataCodeDataRuntimeContextRuntime) IsKnown() bool
type FunctionFunctionDataCodeType ¶
type FunctionFunctionDataCodeType string
const (
FunctionFunctionDataCodeTypeCode FunctionFunctionDataCodeType = "code"
)
func (FunctionFunctionDataCodeType) IsKnown ¶
func (r FunctionFunctionDataCodeType) IsKnown() bool
type FunctionFunctionDataGlobal ¶
type FunctionFunctionDataGlobal struct {
Name string `json:"name,required"`
Type FunctionFunctionDataGlobalType `json:"type,required"`
JSON functionFunctionDataGlobalJSON `json:"-"`
}
func (*FunctionFunctionDataGlobal) UnmarshalJSON ¶
func (r *FunctionFunctionDataGlobal) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataGlobalType ¶
type FunctionFunctionDataGlobalType string
const (
FunctionFunctionDataGlobalTypeGlobal FunctionFunctionDataGlobalType = "global"
)
func (FunctionFunctionDataGlobalType) IsKnown ¶
func (r FunctionFunctionDataGlobalType) IsKnown() bool
type FunctionFunctionDataPrompt ¶
type FunctionFunctionDataPrompt struct {
Type FunctionFunctionDataPromptType `json:"type,required"`
JSON functionFunctionDataPromptJSON `json:"-"`
}
func (*FunctionFunctionDataPrompt) UnmarshalJSON ¶
func (r *FunctionFunctionDataPrompt) UnmarshalJSON(data []byte) (err error)
type FunctionFunctionDataPromptType ¶
type FunctionFunctionDataPromptType string
const (
FunctionFunctionDataPromptTypePrompt FunctionFunctionDataPromptType = "prompt"
)
func (FunctionFunctionDataPromptType) IsKnown ¶
func (r FunctionFunctionDataPromptType) IsKnown() bool
type FunctionFunctionDataType ¶
type FunctionFunctionDataType string
const ( FunctionFunctionDataTypePrompt FunctionFunctionDataType = "prompt" FunctionFunctionDataTypeCode FunctionFunctionDataType = "code" FunctionFunctionDataTypeGlobal FunctionFunctionDataType = "global" )
func (FunctionFunctionDataType) IsKnown ¶
func (r FunctionFunctionDataType) IsKnown() bool
type FunctionFunctionDataUnion ¶
type FunctionFunctionDataUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.FunctionFunctionDataPrompt, shared.FunctionFunctionDataCode or shared.FunctionFunctionDataGlobal.
type FunctionLogID ¶
type FunctionLogID string
A literal 'p' which identifies the object as a project prompt
const (
FunctionLogIDP FunctionLogID = "p"
)
func (FunctionLogID) IsKnown ¶
func (r FunctionLogID) IsKnown() bool
type Group ¶
type Group struct {
// Unique identifier for the group
ID string `json:"id,required" format:"uuid"`
// Name of the group
Name string `json:"name,required"`
// Unique id for the organization that the group belongs under
//
// It is forbidden to change the org after creating a group
OrgID string `json:"org_id,required" format:"uuid"`
// Date of group creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of group deletion, or null if the group is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the group
Description string `json:"description,nullable"`
// Ids of the groups this group inherits from
//
// An inheriting group has all the users contained in its member groups, as well as
// all of their inherited users
MemberGroups []string `json:"member_groups,nullable" format:"uuid"`
// Ids of users which belong to this group
MemberUsers []string `json:"member_users,nullable" format:"uuid"`
// Identifies the user who created the group
UserID string `json:"user_id,nullable" format:"uuid"`
JSON groupJSON `json:"-"`
}
A group is a collection of users which can be assigned an ACL
Groups can consist of individual users, as well as a set of groups they inherit from
func (*Group) UnmarshalJSON ¶
type InsertDatasetEventMergeParam ¶
type InsertDatasetEventMergeParam struct {
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge,required"`
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID param.Field[string] `json:"id"`
// The `_merge_paths` field allows controlling the depth of the merge. It can only
// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
// where each path is a list of field names. The deep merge will not descend below
// any of the specified merge paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths param.Field[[][]string] `json:"_merge_paths"`
// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
// will not show up in subsequent fetches for this dataset
ObjectDelete param.Field[bool] `json:"_object_delete"`
// The timestamp the dataset event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected param.Field[interface{}] `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertDatasetEventMergeParam) ImplementsDatasetInsertParamsEventUnion ¶ added in v0.3.0
func (r InsertDatasetEventMergeParam) ImplementsDatasetInsertParamsEventUnion()
func (InsertDatasetEventMergeParam) MarshalJSON ¶
func (r InsertDatasetEventMergeParam) MarshalJSON() (data []byte, err error)
type InsertDatasetEventReplaceParam ¶
type InsertDatasetEventReplaceParam struct {
// A unique identifier for the dataset event. If you don't provide one, BrainTrust
// will generate one for you
ID param.Field[string] `json:"id"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Pass `_object_delete=true` to mark the dataset event deleted. Deleted events
// will not show up in subsequent fetches for this dataset
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
// The timestamp the dataset event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object)
Expected param.Field[interface{}] `json:"expected"`
// The argument that uniquely define an input case (an arbitrary, JSON serializable
// object)
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertDatasetEventReplaceParam) ImplementsDatasetInsertParamsEventUnion ¶ added in v0.3.0
func (r InsertDatasetEventReplaceParam) ImplementsDatasetInsertParamsEventUnion()
func (InsertDatasetEventReplaceParam) MarshalJSON ¶
func (r InsertDatasetEventReplaceParam) MarshalJSON() (data []byte, err error)
type InsertEventsResponse ¶
type InsertEventsResponse struct {
// The ids of all rows that were inserted, aligning one-to-one with the rows
// provided as input
RowIDs []string `json:"row_ids,required"`
JSON insertEventsResponseJSON `json:"-"`
}
func (*InsertEventsResponse) UnmarshalJSON ¶
func (r *InsertEventsResponse) UnmarshalJSON(data []byte) (err error)
type InsertExperimentEventMergeContextParam ¶
type InsertExperimentEventMergeContextParam struct {
// Name of the file in code where the experiment event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the experiment event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the experiment event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (InsertExperimentEventMergeContextParam) MarshalJSON ¶
func (r InsertExperimentEventMergeContextParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeMetricsParam ¶
type InsertExperimentEventMergeMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the experiment event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (InsertExperimentEventMergeMetricsParam) MarshalJSON ¶
func (r InsertExperimentEventMergeMetricsParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeParam ¶
type InsertExperimentEventMergeParam struct {
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge,required"`
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_merge_paths` field allows controlling the depth of the merge. It can only
// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
// where each path is a list of field names. The deep merge will not descend below
// any of the specified merge paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths param.Field[[][]string] `json:"_merge_paths"`
// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
// will not show up in subsequent fetches for this experiment
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context param.Field[InsertExperimentEventMergeContextParam] `json:"context"`
// The timestamp the experiment event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID param.Field[string] `json:"dataset_record_id"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate your experiments while digging into analyses.
// However, we may later use these values to re-score outputs or fine-tune your
// models
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a test case (an arbitrary, JSON serializable
// object). Later on, Braintrust will use the `input` to know whether two test
// cases are the same between experiments, so they should not contain
// experiment-specific state. A simple rule of thumb is that if you run the same
// experiment twice, the `input` should be identical
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics param.Field[InsertExperimentEventMergeMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertExperimentEventMergeSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertExperimentEventMergeParam) ImplementsExperimentInsertParamsEventUnion ¶ added in v0.3.0
func (r InsertExperimentEventMergeParam) ImplementsExperimentInsertParamsEventUnion()
func (InsertExperimentEventMergeParam) MarshalJSON ¶
func (r InsertExperimentEventMergeParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeSpanAttributesParam ¶
type InsertExperimentEventMergeSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertExperimentEventMergeSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertExperimentEventMergeSpanAttributesParam) MarshalJSON ¶
func (r InsertExperimentEventMergeSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventMergeSpanAttributesType ¶
type InsertExperimentEventMergeSpanAttributesType string
Type of the span, for display purposes only
const ( InsertExperimentEventMergeSpanAttributesTypeLlm InsertExperimentEventMergeSpanAttributesType = "llm" InsertExperimentEventMergeSpanAttributesTypeScore InsertExperimentEventMergeSpanAttributesType = "score" InsertExperimentEventMergeSpanAttributesTypeFunction InsertExperimentEventMergeSpanAttributesType = "function" InsertExperimentEventMergeSpanAttributesTypeEval InsertExperimentEventMergeSpanAttributesType = "eval" InsertExperimentEventMergeSpanAttributesTypeTask InsertExperimentEventMergeSpanAttributesType = "task" InsertExperimentEventMergeSpanAttributesTypeTool InsertExperimentEventMergeSpanAttributesType = "tool" )
func (InsertExperimentEventMergeSpanAttributesType) IsKnown ¶
func (r InsertExperimentEventMergeSpanAttributesType) IsKnown() bool
type InsertExperimentEventReplaceContextParam ¶
type InsertExperimentEventReplaceContextParam struct {
// Name of the file in code where the experiment event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the experiment event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the experiment event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event
func (InsertExperimentEventReplaceContextParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceContextParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceMetricsParam ¶
type InsertExperimentEventReplaceMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the experiment event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the
// experiment event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the experiment event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use "start" and "end" to track the time span over which the experiment event was produced
func (InsertExperimentEventReplaceMetricsParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceMetricsParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceParam ¶
type InsertExperimentEventReplaceParam struct {
// A unique identifier for the experiment event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Pass `_object_delete=true` to mark the experiment event deleted. Deleted events
// will not show up in subsequent fetches for this experiment
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
// Context is additional information about the code that produced the experiment
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the
// experiment event
Context param.Field[InsertExperimentEventReplaceContextParam] `json:"context"`
// The timestamp the experiment event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// If the experiment is associated to a dataset, this is the event-level dataset id
// this experiment event is tied to
DatasetRecordID param.Field[string] `json:"dataset_record_id"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate your experiments while digging into analyses.
// However, we may later use these values to re-score outputs or fine-tune your
// models
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a test case (an arbitrary, JSON serializable
// object). Later on, Braintrust will use the `input` to know whether two test
// cases are the same between experiments, so they should not contain
// experiment-specific state. A simple rule of thumb is that if you run the same
// experiment twice, the `input` should be identical
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the experiment event. Use "start" and "end" to track the time span over
// which the experiment event was produced
Metrics param.Field[InsertExperimentEventReplaceMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare experiments
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertExperimentEventReplaceSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertExperimentEventReplaceParam) ImplementsExperimentInsertParamsEventUnion ¶ added in v0.3.0
func (r InsertExperimentEventReplaceParam) ImplementsExperimentInsertParamsEventUnion()
func (InsertExperimentEventReplaceParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceSpanAttributesParam ¶
type InsertExperimentEventReplaceSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertExperimentEventReplaceSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertExperimentEventReplaceSpanAttributesParam) MarshalJSON ¶
func (r InsertExperimentEventReplaceSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertExperimentEventReplaceSpanAttributesType ¶
type InsertExperimentEventReplaceSpanAttributesType string
Type of the span, for display purposes only
const ( InsertExperimentEventReplaceSpanAttributesTypeLlm InsertExperimentEventReplaceSpanAttributesType = "llm" InsertExperimentEventReplaceSpanAttributesTypeScore InsertExperimentEventReplaceSpanAttributesType = "score" InsertExperimentEventReplaceSpanAttributesTypeFunction InsertExperimentEventReplaceSpanAttributesType = "function" InsertExperimentEventReplaceSpanAttributesTypeEval InsertExperimentEventReplaceSpanAttributesType = "eval" InsertExperimentEventReplaceSpanAttributesTypeTask InsertExperimentEventReplaceSpanAttributesType = "task" InsertExperimentEventReplaceSpanAttributesTypeTool InsertExperimentEventReplaceSpanAttributesType = "tool" )
func (InsertExperimentEventReplaceSpanAttributesType) IsKnown ¶
func (r InsertExperimentEventReplaceSpanAttributesType) IsKnown() bool
type InsertProjectLogsEventMergeContextParam ¶
type InsertProjectLogsEventMergeContextParam struct {
// Name of the file in code where the project logs event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the project logs event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the project logs event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (InsertProjectLogsEventMergeContextParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeContextParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeMetricsParam ¶
type InsertProjectLogsEventMergeMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the project logs event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (InsertProjectLogsEventMergeMetricsParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeMetricsParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeParam ¶
type InsertProjectLogsEventMergeParam struct {
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge,required"`
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_merge_paths` field allows controlling the depth of the merge. It can only
// be specified alongside `_is_merge=true`. `_merge_paths` is a list of paths,
// where each path is a list of field names. The deep merge will not descend below
// any of the specified merge paths.
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}`.
// If we merge a new row as
// `{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}`,
// the new row will be
// `{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}`.
// In this case, due to the merge paths, we have replaced `input.a` and `output`,
// but have still deep-merged `input` and `input.c`.
MergePaths param.Field[[][]string] `json:"_merge_paths"`
// Pass `_object_delete=true` to mark the project logs event deleted. Deleted
// events will not show up in subsequent fetches for this project logs
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context param.Field[InsertProjectLogsEventMergeContextParam] `json:"context"`
// The timestamp the project logs event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate while digging into analyses. However, we may
// later use these values to re-score outputs or fine-tune your models.
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics param.Field[InsertProjectLogsEventMergeMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertProjectLogsEventMergeSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertProjectLogsEventMergeParam) ImplementsProjectLogInsertParamsEventUnion ¶ added in v0.3.0
func (r InsertProjectLogsEventMergeParam) ImplementsProjectLogInsertParamsEventUnion()
func (InsertProjectLogsEventMergeParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeSpanAttributesParam ¶
type InsertProjectLogsEventMergeSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertProjectLogsEventMergeSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertProjectLogsEventMergeSpanAttributesParam) MarshalJSON ¶
func (r InsertProjectLogsEventMergeSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventMergeSpanAttributesType ¶
type InsertProjectLogsEventMergeSpanAttributesType string
Type of the span, for display purposes only
const ( InsertProjectLogsEventMergeSpanAttributesTypeLlm InsertProjectLogsEventMergeSpanAttributesType = "llm" InsertProjectLogsEventMergeSpanAttributesTypeScore InsertProjectLogsEventMergeSpanAttributesType = "score" InsertProjectLogsEventMergeSpanAttributesTypeFunction InsertProjectLogsEventMergeSpanAttributesType = "function" InsertProjectLogsEventMergeSpanAttributesTypeEval InsertProjectLogsEventMergeSpanAttributesType = "eval" InsertProjectLogsEventMergeSpanAttributesTypeTask InsertProjectLogsEventMergeSpanAttributesType = "task" InsertProjectLogsEventMergeSpanAttributesTypeTool InsertProjectLogsEventMergeSpanAttributesType = "tool" )
func (InsertProjectLogsEventMergeSpanAttributesType) IsKnown ¶
func (r InsertProjectLogsEventMergeSpanAttributesType) IsKnown() bool
type InsertProjectLogsEventReplaceContextParam ¶
type InsertProjectLogsEventReplaceContextParam struct {
// Name of the file in code where the project logs event was created
CallerFilename param.Field[string] `json:"caller_filename"`
// The function in code which created the project logs event
CallerFunctionname param.Field[string] `json:"caller_functionname"`
// Line of code where the project logs event was created
CallerLineno param.Field[int64] `json:"caller_lineno"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (InsertProjectLogsEventReplaceContextParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceContextParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceMetricsParam ¶
type InsertProjectLogsEventReplaceMetricsParam struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens param.Field[int64] `json:"completion_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End param.Field[float64] `json:"end"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens param.Field[int64] `json:"prompt_tokens"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start param.Field[float64] `json:"start"`
// The total number of tokens in the input and output of the project logs event.
Tokens param.Field[int64] `json:"tokens"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (InsertProjectLogsEventReplaceMetricsParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceMetricsParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceParam ¶
type InsertProjectLogsEventReplaceParam struct {
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID param.Field[string] `json:"id"`
// The `_is_merge` field controls how the row is merged with any existing row with
// the same id in the DB. By default (or when set to `false`), the existing row is
// completely replaced by the new row. When set to `true`, the new row is
// deep-merged into the existing row
//
// For example, say there is an existing row in the DB
// `{"id": "foo", "input": {"a": 5, "b": 10}}`. If we merge a new row as
// `{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}`, the new row
// will be `{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}`. If we replace the
// new row as `{"id": "foo", "input": {"b": 11, "c": 20}}`, the new row will be
// `{"id": "foo", "input": {"b": 11, "c": 20}}`
IsMerge param.Field[bool] `json:"_is_merge"`
// Pass `_object_delete=true` to mark the project logs event deleted. Deleted
// events will not show up in subsequent fetches for this project logs
ObjectDelete param.Field[bool] `json:"_object_delete"`
// Use the `_parent_id` field to create this row as a subspan of an existing row.
// It cannot be specified alongside `_is_merge=true`. Tracking hierarchical
// relationships are important for tracing (see the
// [guide](https://www.braintrust.dev/docs/guides/tracing) for full details).
//
// For example, say we have logged a row
// `{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}`.
// We can create a sub-span of the parent row by logging
// `{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}`.
// In the webapp, only the root span row `"abc"` will show up in the summary view.
// You can view the full trace hierarchy (in this case, the `"llm_call"` row) by
// clicking on the "abc" row.
ParentID param.Field[string] `json:"_parent_id"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context param.Field[InsertProjectLogsEventReplaceContextParam] `json:"context"`
// The timestamp the project logs event was created
Created param.Field[time.Time] `json:"created" format:"date-time"`
// The error that occurred, if any.
Error param.Field[interface{}] `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate while digging into analyses. However, we may
// later use these values to re-score outputs or fine-tune your models.
Expected param.Field[interface{}] `json:"expected"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input param.Field[interface{}] `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata param.Field[map[string]interface{}] `json:"metadata"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics param.Field[InsertProjectLogsEventReplaceMetricsParam] `json:"metrics"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output param.Field[interface{}] `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores param.Field[map[string]float64] `json:"scores"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes param.Field[InsertProjectLogsEventReplaceSpanAttributesParam] `json:"span_attributes"`
// A list of tags to log
Tags param.Field[[]string] `json:"tags"`
}
func (InsertProjectLogsEventReplaceParam) ImplementsProjectLogInsertParamsEventUnion ¶ added in v0.3.0
func (r InsertProjectLogsEventReplaceParam) ImplementsProjectLogInsertParamsEventUnion()
func (InsertProjectLogsEventReplaceParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceSpanAttributesParam ¶
type InsertProjectLogsEventReplaceSpanAttributesParam struct {
// Name of the span, for display purposes only
Name param.Field[string] `json:"name"`
// Type of the span, for display purposes only
Type param.Field[InsertProjectLogsEventReplaceSpanAttributesType] `json:"type"`
ExtraFields map[string]interface{} `json:"-,extras"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (InsertProjectLogsEventReplaceSpanAttributesParam) MarshalJSON ¶
func (r InsertProjectLogsEventReplaceSpanAttributesParam) MarshalJSON() (data []byte, err error)
type InsertProjectLogsEventReplaceSpanAttributesType ¶
type InsertProjectLogsEventReplaceSpanAttributesType string
Type of the span, for display purposes only
const ( InsertProjectLogsEventReplaceSpanAttributesTypeLlm InsertProjectLogsEventReplaceSpanAttributesType = "llm" InsertProjectLogsEventReplaceSpanAttributesTypeScore InsertProjectLogsEventReplaceSpanAttributesType = "score" InsertProjectLogsEventReplaceSpanAttributesTypeFunction InsertProjectLogsEventReplaceSpanAttributesType = "function" InsertProjectLogsEventReplaceSpanAttributesTypeEval InsertProjectLogsEventReplaceSpanAttributesType = "eval" InsertProjectLogsEventReplaceSpanAttributesTypeTask InsertProjectLogsEventReplaceSpanAttributesType = "task" InsertProjectLogsEventReplaceSpanAttributesTypeTool InsertProjectLogsEventReplaceSpanAttributesType = "tool" )
func (InsertProjectLogsEventReplaceSpanAttributesType) IsKnown ¶
func (r InsertProjectLogsEventReplaceSpanAttributesType) IsKnown() bool
type MetricSummary ¶
type MetricSummary struct {
// Number of improvements in the metric
Improvements int64 `json:"improvements,required"`
// Average metric across all examples
Metric float64 `json:"metric,required"`
// Name of the metric
Name string `json:"name,required"`
// Number of regressions in the metric
Regressions int64 `json:"regressions,required"`
// Unit label for the metric
Unit string `json:"unit,required"`
// Difference in metric between the current and comparison experiment
Diff float64 `json:"diff"`
JSON metricSummaryJSON `json:"-"`
}
Summary of a metric's performance
func (*MetricSummary) UnmarshalJSON ¶
func (r *MetricSummary) UnmarshalJSON(data []byte) (err error)
type Organization ¶
type Organization struct {
// Unique identifier for the organization
ID string `json:"id,required" format:"uuid"`
// Name of the organization
Name string `json:"name,required"`
APIURL string `json:"api_url,nullable"`
// Date of organization creation
Created time.Time `json:"created,nullable" format:"date-time"`
IsUniversalAPI bool `json:"is_universal_api,nullable"`
ProxyURL string `json:"proxy_url,nullable"`
RealtimeURL string `json:"realtime_url,nullable"`
JSON organizationJSON `json:"-"`
}
func (*Organization) UnmarshalJSON ¶
func (r *Organization) UnmarshalJSON(data []byte) (err error)
type PathLookupFilterParam ¶
type PathLookupFilterParam struct {
// List of fields describing the path to the value to be checked against. For
// instance, if you wish to filter on the value of `c` in
// `{"input": {"a": {"b": {"c": "hello"}}}}`, pass `path=["input", "a", "b", "c"]`
Path param.Field[[]string] `json:"path,required"`
// Denotes the type of filter as a path-lookup filter
Type param.Field[PathLookupFilterType] `json:"type,required"`
// The value to compare equality-wise against the event value at the specified
// `path`. The value must be a "primitive", that is, any JSON-serializable object
// except for objects and arrays. For instance, if you wish to filter on the value
// of "input.a.b.c" in the object `{"input": {"a": {"b": {"c": "hello"}}}}`, pass
// `value="hello"`
Value param.Field[interface{}] `json:"value"`
}
A path-lookup filter describes an equality comparison against a specific sub-field in the event row. For instance, if you wish to filter on the value of `c` in `{"input": {"a": {"b": {"c": "hello"}}}}`, pass `path=["input", "a", "b", "c"]` and `value="hello"`
func (PathLookupFilterParam) MarshalJSON ¶
func (r PathLookupFilterParam) MarshalJSON() (data []byte, err error)
type PathLookupFilterType ¶
type PathLookupFilterType string
Denotes the type of filter as a path-lookup filter
const (
PathLookupFilterTypePathLookup PathLookupFilterType = "path_lookup"
)
func (PathLookupFilterType) IsKnown ¶
func (r PathLookupFilterType) IsKnown() bool
type Project ¶
type Project struct {
// Unique identifier for the project
ID string `json:"id,required" format:"uuid"`
// Name of the project
Name string `json:"name,required"`
// Unique id for the organization that the project belongs under
OrgID string `json:"org_id,required" format:"uuid"`
// Date of project creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of project deletion, or null if the project is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
Settings ProjectSettings `json:"settings,nullable"`
// Identifies the user who created the project
UserID string `json:"user_id,nullable" format:"uuid"`
JSON projectJSON `json:"-"`
}
func (*Project) UnmarshalJSON ¶
type ProjectLogsEvent ¶
type ProjectLogsEvent struct {
// A unique identifier for the project logs event. If you don't provide one,
// BrainTrust will generate one for you
ID string `json:"id,required"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the project logs (see the
// `version` parameter)
XactID string `json:"_xact_id,required"`
// The timestamp the project logs event was created
Created time.Time `json:"created,required" format:"date-time"`
// A literal 'g' which identifies the log as a project log
LogID ProjectLogsEventLogID `json:"log_id,required"`
// Unique id for the organization that the project belongs under
OrgID string `json:"org_id,required" format:"uuid"`
// Unique identifier for the project
ProjectID string `json:"project_id,required" format:"uuid"`
// The `span_id` of the root of the trace this project logs event belongs to
RootSpanID string `json:"root_span_id,required"`
// A unique identifier used to link different project logs events together as part
// of a full trace. See the
// [tracing guide](https://www.braintrust.dev/docs/guides/tracing) for full details
// on tracing
SpanID string `json:"span_id,required"`
// Context is additional information about the code that produced the project logs
// event. It is essentially the textual counterpart to `metrics`. Use the
// `caller_*` attributes to track the location in code which produced the project
// logs event
Context ProjectLogsEventContext `json:"context,nullable"`
// The error that occurred, if any.
Error interface{} `json:"error"`
// The ground truth value (an arbitrary, JSON serializable object) that you'd
// compare to `output` to determine if your `output` value is correct or not.
// Braintrust currently does not compare `output` to `expected` for you, since
// there are so many different ways to do that correctly. Instead, these values are
// just used to help you navigate while digging into analyses. However, we may
// later use these values to re-score outputs or fine-tune your models.
Expected interface{} `json:"expected"`
// The arguments that uniquely define a user input (an arbitrary, JSON serializable
// object).
Input interface{} `json:"input"`
// A dictionary with additional data about the test example, model outputs, or just
// about anything else that's relevant, that you can use to help find and analyze
// examples later. For example, you could log the `prompt`, example's `id`, or
// anything else that would be useful to slice/dice later. The values in `metadata`
// can be any JSON-serializable type, but its keys must be strings
Metadata map[string]interface{} `json:"metadata,nullable"`
// Metrics are numerical measurements tracking the execution of the code that
// produced the project logs event. Use "start" and "end" to track the time span
// over which the project logs event was produced
Metrics ProjectLogsEventMetrics `json:"metrics,nullable"`
// The output of your application, including post-processing (an arbitrary, JSON
// serializable object), that allows you to determine whether the result is correct
// or not. For example, in an app that generates SQL queries, the `output` should
// be the _result_ of the SQL query generated by the model, not the query itself,
// because there may be multiple valid queries that answer a single question.
Output interface{} `json:"output"`
// A dictionary of numeric values (between 0 and 1) to log. The scores should give
// you a variety of signals that help you determine how accurate the outputs are
// compared to what you expect and diagnose failures. For example, a summarization
// app might have one score that tells you how accurate the summary is, and another
// that measures the word similarity between the generated and grouth truth
// summary. The word similarity score could help you determine whether the
// summarization was covering similar concepts or not. You can use these scores to
// help you sort, filter, and compare logs.
Scores map[string]float64 `json:"scores,nullable"`
// Human-identifying attributes of the span, such as name, type, etc.
SpanAttributes ProjectLogsEventSpanAttributes `json:"span_attributes,nullable"`
// An array of the parent `span_ids` of this project logs event. This should be
// empty for the root span of a trace, and should most often contain just one
// parent element for subspans
SpanParents []string `json:"span_parents,nullable"`
// A list of tags to log
Tags []string `json:"tags,nullable"`
JSON projectLogsEventJSON `json:"-"`
}
func (*ProjectLogsEvent) UnmarshalJSON ¶
func (r *ProjectLogsEvent) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventContext ¶
type ProjectLogsEventContext struct {
// Name of the file in code where the project logs event was created
CallerFilename string `json:"caller_filename,nullable"`
// The function in code which created the project logs event
CallerFunctionname string `json:"caller_functionname,nullable"`
// Line of code where the project logs event was created
CallerLineno int64 `json:"caller_lineno,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON projectLogsEventContextJSON `json:"-"`
}
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event
func (*ProjectLogsEventContext) UnmarshalJSON ¶
func (r *ProjectLogsEventContext) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventLogID ¶
type ProjectLogsEventLogID string
A literal 'g' which identifies the log as a project log
const (
ProjectLogsEventLogIDG ProjectLogsEventLogID = "g"
)
func (ProjectLogsEventLogID) IsKnown ¶
func (r ProjectLogsEventLogID) IsKnown() bool
type ProjectLogsEventMetrics ¶
type ProjectLogsEventMetrics struct {
// The number of tokens in the completion generated by the model (only set if this
// is an LLM span)
CompletionTokens int64 `json:"completion_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the project
// logs event finished
End float64 `json:"end,nullable"`
// The number of tokens in the prompt used to generate the project logs event (only
// set if this is an LLM span)
PromptTokens int64 `json:"prompt_tokens,nullable"`
// A unix timestamp recording when the section of code which produced the project
// logs event started
Start float64 `json:"start,nullable"`
// The total number of tokens in the input and output of the project logs event.
Tokens int64 `json:"tokens,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON projectLogsEventMetricsJSON `json:"-"`
}
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
func (*ProjectLogsEventMetrics) UnmarshalJSON ¶
func (r *ProjectLogsEventMetrics) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventSpanAttributes ¶
type ProjectLogsEventSpanAttributes struct {
// Name of the span, for display purposes only
Name string `json:"name,nullable"`
// Type of the span, for display purposes only
Type ProjectLogsEventSpanAttributesType `json:"type,nullable"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON projectLogsEventSpanAttributesJSON `json:"-"`
}
Human-identifying attributes of the span, such as name, type, etc.
func (*ProjectLogsEventSpanAttributes) UnmarshalJSON ¶
func (r *ProjectLogsEventSpanAttributes) UnmarshalJSON(data []byte) (err error)
type ProjectLogsEventSpanAttributesType ¶
type ProjectLogsEventSpanAttributesType string
Type of the span, for display purposes only
const ( ProjectLogsEventSpanAttributesTypeLlm ProjectLogsEventSpanAttributesType = "llm" ProjectLogsEventSpanAttributesTypeScore ProjectLogsEventSpanAttributesType = "score" ProjectLogsEventSpanAttributesTypeFunction ProjectLogsEventSpanAttributesType = "function" ProjectLogsEventSpanAttributesTypeEval ProjectLogsEventSpanAttributesType = "eval" ProjectLogsEventSpanAttributesTypeTask ProjectLogsEventSpanAttributesType = "task" ProjectLogsEventSpanAttributesTypeTool ProjectLogsEventSpanAttributesType = "tool" )
func (ProjectLogsEventSpanAttributesType) IsKnown ¶
func (r ProjectLogsEventSpanAttributesType) IsKnown() bool
type ProjectScore ¶
type ProjectScore struct {
// Unique identifier for the project score
ID string `json:"id,required" format:"uuid"`
// Name of the project score
Name string `json:"name,required"`
// Unique identifier for the project that the project score belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// The type of the configured score
ScoreType ProjectScoreScoreType `json:"score_type,required,nullable"`
UserID string `json:"user_id,required" format:"uuid"`
// For categorical-type project scores, the list of all categories
Categories ProjectScoreCategoriesUnion `json:"categories"`
Config ProjectScoreConfig `json:"config,nullable"`
// Date of project score creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the project score
Description string `json:"description,nullable"`
// An optional LexoRank-based string that sets the sort position for the score in
// the UI
Position string `json:"position,nullable"`
JSON projectScoreJSON `json:"-"`
}
A project score is a user-configured score, which can be manually-labeled through the UI
func (*ProjectScore) UnmarshalJSON ¶
func (r *ProjectScore) UnmarshalJSON(data []byte) (err error)
type ProjectScoreCategoriesCategorical ¶
type ProjectScoreCategoriesCategorical []ProjectScoreCategory
type ProjectScoreCategoriesMinimum ¶
type ProjectScoreCategoriesMinimum []string
type ProjectScoreCategoriesNullableVariant ¶
type ProjectScoreCategoriesNullableVariant struct {
JSON projectScoreCategoriesNullableVariantJSON `json:"-"`
}
func (*ProjectScoreCategoriesNullableVariant) UnmarshalJSON ¶
func (r *ProjectScoreCategoriesNullableVariant) UnmarshalJSON(data []byte) (err error)
type ProjectScoreCategoriesUnion ¶
type ProjectScoreCategoriesUnion interface {
// contains filtered or unexported methods
}
For categorical-type project scores, the list of all categories
Union satisfied by shared.ProjectScoreCategoriesCategorical, shared.ProjectScoreCategoriesMinimum or shared.ProjectScoreCategoriesNullableVariant.
type ProjectScoreCategory ¶
type ProjectScoreCategory struct {
// Name of the category
Name string `json:"name,required"`
// Numerical value of the category. Must be between 0 and 1, inclusive
Value float64 `json:"value,required"`
JSON projectScoreCategoryJSON `json:"-"`
}
For categorical-type project scores, defines a single category
func (*ProjectScoreCategory) UnmarshalJSON ¶
func (r *ProjectScoreCategory) UnmarshalJSON(data []byte) (err error)
type ProjectScoreCategoryParam ¶
type ProjectScoreCategoryParam struct {
// Name of the category
Name param.Field[string] `json:"name,required"`
// Numerical value of the category. Must be between 0 and 1, inclusive
Value param.Field[float64] `json:"value,required"`
}
For categorical-type project scores, defines a single category
func (ProjectScoreCategoryParam) MarshalJSON ¶
func (r ProjectScoreCategoryParam) MarshalJSON() (data []byte, err error)
type ProjectScoreConfig ¶
type ProjectScoreConfig struct {
Destination ProjectScoreConfigDestination `json:"destination,nullable"`
MultiSelect bool `json:"multi_select,nullable"`
JSON projectScoreConfigJSON `json:"-"`
}
func (*ProjectScoreConfig) UnmarshalJSON ¶
func (r *ProjectScoreConfig) UnmarshalJSON(data []byte) (err error)
type ProjectScoreConfigDestination ¶
type ProjectScoreConfigDestination string
const (
ProjectScoreConfigDestinationExpected ProjectScoreConfigDestination = "expected"
)
func (ProjectScoreConfigDestination) IsKnown ¶
func (r ProjectScoreConfigDestination) IsKnown() bool
type ProjectScoreScoreType ¶
type ProjectScoreScoreType string
The type of the configured score
const ( ProjectScoreScoreTypeSlider ProjectScoreScoreType = "slider" ProjectScoreScoreTypeCategorical ProjectScoreScoreType = "categorical" ProjectScoreScoreTypeWeighted ProjectScoreScoreType = "weighted" ProjectScoreScoreTypeMinimum ProjectScoreScoreType = "minimum" )
func (ProjectScoreScoreType) IsKnown ¶
func (r ProjectScoreScoreType) IsKnown() bool
type ProjectSettings ¶
type ProjectSettings struct {
// The key used to join two experiments (defaults to `input`).
ComparisonKey string `json:"comparison_key,nullable"`
JSON projectSettingsJSON `json:"-"`
}
func (*ProjectSettings) UnmarshalJSON ¶
func (r *ProjectSettings) UnmarshalJSON(data []byte) (err error)
type ProjectTag ¶
type ProjectTag struct {
// Unique identifier for the project tag
ID string `json:"id,required" format:"uuid"`
// Name of the project tag
Name string `json:"name,required"`
// Unique identifier for the project that the project tag belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
UserID string `json:"user_id,required" format:"uuid"`
// Color of the tag for the UI
Color string `json:"color,nullable"`
// Date of project tag creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the project tag
Description string `json:"description,nullable"`
JSON projectTagJSON `json:"-"`
}
A project tag is a user-configured tag for tracking and filtering your experiments, logs, and other data
func (*ProjectTag) UnmarshalJSON ¶
func (r *ProjectTag) UnmarshalJSON(data []byte) (err error)
type Prompt ¶
type Prompt struct {
// Unique identifier for the prompt
ID string `json:"id,required" format:"uuid"`
// The transaction id of an event is unique to the network operation that processed
// the event insertion. Transaction ids are monotonically increasing over time and
// can be used to retrieve a versioned snapshot of the prompt (see the `version`
// parameter)
XactID string `json:"_xact_id,required"`
// A literal 'p' which identifies the object as a project prompt
LogID PromptLogID `json:"log_id,required"`
// Name of the prompt
Name string `json:"name,required"`
// Unique identifier for the organization
OrgID string `json:"org_id,required" format:"uuid"`
// Unique identifier for the project that the prompt belongs under
ProjectID string `json:"project_id,required" format:"uuid"`
// Unique identifier for the prompt
Slug string `json:"slug,required"`
// Date of prompt creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Textual description of the prompt
Description string `json:"description,nullable"`
// User-controlled metadata about the prompt
Metadata map[string]interface{} `json:"metadata,nullable"`
// The prompt, model, and its parameters
PromptData PromptData `json:"prompt_data,nullable"`
// A list of tags for the prompt
Tags []string `json:"tags,nullable"`
JSON promptJSON `json:"-"`
}
func (*Prompt) UnmarshalJSON ¶
type PromptData ¶
type PromptData struct {
Options PromptDataOptions `json:"options,nullable"`
Origin PromptDataOrigin `json:"origin,nullable"`
Prompt PromptDataPrompt `json:"prompt"`
JSON promptDataJSON `json:"-"`
}
The prompt, model, and its parameters
func (*PromptData) UnmarshalJSON ¶
func (r *PromptData) UnmarshalJSON(data []byte) (err error)
type PromptDataOptions ¶
type PromptDataOptions struct {
Model string `json:"model"`
Params PromptDataOptionsParamsUnion `json:"params"`
Position string `json:"position"`
JSON promptDataOptionsJSON `json:"-"`
}
func (*PromptDataOptions) UnmarshalJSON ¶
func (r *PromptDataOptions) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParam ¶
type PromptDataOptionsParam struct {
Model param.Field[string] `json:"model"`
Params param.Field[PromptDataOptionsParamsUnionParam] `json:"params"`
Position param.Field[string] `json:"position"`
}
func (PromptDataOptionsParam) MarshalJSON ¶
func (r PromptDataOptionsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsAnthropicModelParams ¶
type PromptDataOptionsParamsAnthropicModelParams struct {
MaxTokens float64 `json:"max_tokens,required"`
Temperature float64 `json:"temperature,required"`
// This is a legacy parameter that should not be used.
MaxTokensToSample float64 `json:"max_tokens_to_sample"`
StopSequences []string `json:"stop_sequences"`
TopK float64 `json:"top_k"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsAnthropicModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsAnthropicModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsAnthropicModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsAnthropicModelParamsParam ¶
type PromptDataOptionsParamsAnthropicModelParamsParam struct {
MaxTokens param.Field[float64] `json:"max_tokens,required"`
Temperature param.Field[float64] `json:"temperature,required"`
// This is a legacy parameter that should not be used.
MaxTokensToSample param.Field[float64] `json:"max_tokens_to_sample"`
StopSequences param.Field[[]string] `json:"stop_sequences"`
TopK param.Field[float64] `json:"top_k"`
TopP param.Field[float64] `json:"top_p"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsAnthropicModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsAnthropicModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsGoogleModelParams ¶
type PromptDataOptionsParamsGoogleModelParams struct {
MaxOutputTokens float64 `json:"maxOutputTokens"`
Temperature float64 `json:"temperature"`
TopK float64 `json:"topK"`
TopP float64 `json:"topP"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsGoogleModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsGoogleModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsGoogleModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsGoogleModelParamsParam ¶
type PromptDataOptionsParamsGoogleModelParamsParam struct {
MaxOutputTokens param.Field[float64] `json:"maxOutputTokens"`
Temperature param.Field[float64] `json:"temperature"`
TopK param.Field[float64] `json:"topK"`
TopP param.Field[float64] `json:"topP"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsGoogleModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsGoogleModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsJsCompletionParams ¶
type PromptDataOptionsParamsJsCompletionParams struct {
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsJsCompletionParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsJsCompletionParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsJsCompletionParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsJsCompletionParamsParam ¶
type PromptDataOptionsParamsJsCompletionParamsParam struct {
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsJsCompletionParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsJsCompletionParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParams ¶
type PromptDataOptionsParamsOpenAIModelParams struct {
FrequencyPenalty float64 `json:"frequency_penalty"`
FunctionCall PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion `json:"function_call"`
MaxTokens float64 `json:"max_tokens"`
N float64 `json:"n"`
PresencePenalty float64 `json:"presence_penalty"`
ResponseFormat PromptDataOptionsParamsOpenAIModelParamsResponseFormat `json:"response_format,nullable"`
Stop []string `json:"stop"`
Temperature float64 `json:"temperature"`
ToolChoice PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion `json:"tool_choice"`
TopP float64 `json:"top_p"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsOpenAIModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto string
const (
PromptDataOptionsParamsOpenAIModelParamsFunctionCallAutoAuto PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto = "auto"
)
func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction struct {
Name string `json:"name,required"`
JSON promptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam struct {
Name param.Field[string] `json:"name,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone string
const (
PromptDataOptionsParamsOpenAIModelParamsFunctionCallNoneNone PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone = "none"
)
func (PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto, shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone or shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunction.
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallAuto, shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallNone, shared.PromptDataOptionsParamsOpenAIModelParamsFunctionCallFunctionParam.
type PromptDataOptionsParamsOpenAIModelParamsParam ¶
type PromptDataOptionsParamsOpenAIModelParamsParam struct {
FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
FunctionCall param.Field[PromptDataOptionsParamsOpenAIModelParamsFunctionCallUnionParam] `json:"function_call"`
MaxTokens param.Field[float64] `json:"max_tokens"`
N param.Field[float64] `json:"n"`
PresencePenalty param.Field[float64] `json:"presence_penalty"`
ResponseFormat param.Field[PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam] `json:"response_format"`
Stop param.Field[[]string] `json:"stop"`
Temperature param.Field[float64] `json:"temperature"`
ToolChoice param.Field[PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam] `json:"tool_choice"`
TopP param.Field[float64] `json:"top_p"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsOpenAIModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsResponseFormat ¶
type PromptDataOptionsParamsOpenAIModelParamsResponseFormat struct {
Type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType `json:"type,required"`
JSON promptDataOptionsParamsOpenAIModelParamsResponseFormatJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsResponseFormat) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam ¶
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam struct {
Type param.Field[PromptDataOptionsParamsOpenAIModelParamsResponseFormatType] `json:"type,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsResponseFormatParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType ¶
type PromptDataOptionsParamsOpenAIModelParamsResponseFormatType string
const (
PromptDataOptionsParamsOpenAIModelParamsResponseFormatTypeJsonObject PromptDataOptionsParamsOpenAIModelParamsResponseFormatType = "json_object"
)
func (PromptDataOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsResponseFormatType) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto string
const (
PromptDataOptionsParamsOpenAIModelParamsToolChoiceAutoAuto PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto = "auto"
)
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction struct {
Function PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction `json:"function,required"`
Type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType `json:"type,required"`
JSON promptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction struct {
Name string `json:"name,required"`
JSON promptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionJSON `json:"-"`
}
func (*PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam struct {
Name param.Field[string] `json:"name,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam struct {
Function param.Field[PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam] `json:"function,required"`
Type param.Field[PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType] `json:"type,required"`
}
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType string
const (
PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionTypeFunction PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType = "function"
)
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionType) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone string
const (
PromptDataOptionsParamsOpenAIModelParamsToolChoiceNoneNone PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone = "none"
)
func (PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone) IsKnown ¶
func (r PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone) IsKnown() bool
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto, shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone or shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunction.
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam ¶
type PromptDataOptionsParamsOpenAIModelParamsToolChoiceUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceAuto, shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceNone, shared.PromptDataOptionsParamsOpenAIModelParamsToolChoiceFunctionParam.
type PromptDataOptionsParamsUnion ¶
type PromptDataOptionsParamsUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataOptionsParamsOpenAIModelParams, shared.PromptDataOptionsParamsAnthropicModelParams, shared.PromptDataOptionsParamsGoogleModelParams, shared.PromptDataOptionsParamsWindowAIModelParams or shared.PromptDataOptionsParamsJsCompletionParams.
type PromptDataOptionsParamsUnionParam ¶
type PromptDataOptionsParamsUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataOptionsParamsOpenAIModelParamsParam, shared.PromptDataOptionsParamsAnthropicModelParamsParam, shared.PromptDataOptionsParamsGoogleModelParamsParam, shared.PromptDataOptionsParamsWindowAIModelParamsParam, shared.PromptDataOptionsParamsJsCompletionParamsParam.
type PromptDataOptionsParamsWindowAIModelParams ¶
type PromptDataOptionsParamsWindowAIModelParams struct {
Temperature float64 `json:"temperature"`
TopK float64 `json:"topK"`
UseCache bool `json:"use_cache"`
JSON promptDataOptionsParamsWindowAIModelParamsJSON `json:"-"`
}
func (*PromptDataOptionsParamsWindowAIModelParams) UnmarshalJSON ¶
func (r *PromptDataOptionsParamsWindowAIModelParams) UnmarshalJSON(data []byte) (err error)
type PromptDataOptionsParamsWindowAIModelParamsParam ¶
type PromptDataOptionsParamsWindowAIModelParamsParam struct {
Temperature param.Field[float64] `json:"temperature"`
TopK param.Field[float64] `json:"topK"`
UseCache param.Field[bool] `json:"use_cache"`
}
func (PromptDataOptionsParamsWindowAIModelParamsParam) MarshalJSON ¶
func (r PromptDataOptionsParamsWindowAIModelParamsParam) MarshalJSON() (data []byte, err error)
type PromptDataOrigin ¶
type PromptDataOrigin struct {
ProjectID string `json:"project_id"`
PromptID string `json:"prompt_id"`
PromptVersion string `json:"prompt_version"`
JSON promptDataOriginJSON `json:"-"`
}
func (*PromptDataOrigin) UnmarshalJSON ¶
func (r *PromptDataOrigin) UnmarshalJSON(data []byte) (err error)
type PromptDataOriginParam ¶
type PromptDataOriginParam struct {
ProjectID param.Field[string] `json:"project_id"`
PromptID param.Field[string] `json:"prompt_id"`
PromptVersion param.Field[string] `json:"prompt_version"`
}
func (PromptDataOriginParam) MarshalJSON ¶
func (r PromptDataOriginParam) MarshalJSON() (data []byte, err error)
type PromptDataParam ¶
type PromptDataParam struct {
Options param.Field[PromptDataOptionsParam] `json:"options"`
Origin param.Field[PromptDataOriginParam] `json:"origin"`
Prompt param.Field[PromptDataPromptUnionParam] `json:"prompt"`
}
The prompt, model, and its parameters
func (PromptDataParam) MarshalJSON ¶
func (r PromptDataParam) MarshalJSON() (data []byte, err error)
type PromptDataPrompt ¶
type PromptDataPrompt struct {
Type PromptDataPromptType `json:"type"`
Content string `json:"content"`
// This field can have the runtime type of [[]PromptDataPromptChatMessage].
Messages interface{} `json:"messages,required"`
Tools string `json:"tools"`
JSON promptDataPromptJSON `json:"-"`
// contains filtered or unexported fields
}
func (PromptDataPrompt) AsUnion ¶
func (r PromptDataPrompt) AsUnion() PromptDataPromptUnion
AsUnion returns a PromptDataPromptUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.PromptDataPromptCompletion, shared.PromptDataPromptChat, shared.PromptDataPromptNullableVariant.
func (*PromptDataPrompt) UnmarshalJSON ¶
func (r *PromptDataPrompt) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChat ¶
type PromptDataPromptChat struct {
Messages []PromptDataPromptChatMessage `json:"messages,required"`
Type PromptDataPromptChatType `json:"type,required"`
Tools string `json:"tools"`
JSON promptDataPromptChatJSON `json:"-"`
}
func (*PromptDataPromptChat) UnmarshalJSON ¶
func (r *PromptDataPromptChat) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessage ¶
type PromptDataPromptChatMessage struct {
// This field can have the runtime type of [string],
// [PromptDataPromptChatMessagesUserContentUnion].
Content interface{} `json:"content,required"`
Role PromptDataPromptChatMessagesRole `json:"role,required"`
Name string `json:"name"`
// This field can have the runtime type of
// [PromptDataPromptChatMessagesAssistantFunctionCall].
FunctionCall interface{} `json:"function_call,required"`
// This field can have the runtime type of
// [[]PromptDataPromptChatMessagesAssistantToolCall].
ToolCalls interface{} `json:"tool_calls,required"`
ToolCallID string `json:"tool_call_id"`
JSON promptDataPromptChatMessageJSON `json:"-"`
// contains filtered or unexported fields
}
func (PromptDataPromptChatMessage) AsUnion ¶
func (r PromptDataPromptChatMessage) AsUnion() PromptDataPromptChatMessagesUnion
AsUnion returns a PromptDataPromptChatMessagesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.PromptDataPromptChatMessagesSystem, shared.PromptDataPromptChatMessagesUser, shared.PromptDataPromptChatMessagesAssistant, shared.PromptDataPromptChatMessagesTool, shared.PromptDataPromptChatMessagesFunction, shared.PromptDataPromptChatMessagesFallback.
func (*PromptDataPromptChatMessage) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessage) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessageParam ¶
type PromptDataPromptChatMessageParam struct {
Content param.Field[interface{}] `json:"content,required"`
Role param.Field[PromptDataPromptChatMessagesRole] `json:"role,required"`
Name param.Field[string] `json:"name"`
FunctionCall param.Field[interface{}] `json:"function_call,required"`
ToolCalls param.Field[interface{}] `json:"tool_calls,required"`
ToolCallID param.Field[string] `json:"tool_call_id"`
}
func (PromptDataPromptChatMessageParam) MarshalJSON ¶
func (r PromptDataPromptChatMessageParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistant ¶
type PromptDataPromptChatMessagesAssistant struct {
Role PromptDataPromptChatMessagesAssistantRole `json:"role,required"`
Content string `json:"content,nullable"`
FunctionCall PromptDataPromptChatMessagesAssistantFunctionCall `json:"function_call,nullable"`
Name string `json:"name,nullable"`
ToolCalls []PromptDataPromptChatMessagesAssistantToolCall `json:"tool_calls,nullable"`
JSON promptDataPromptChatMessagesAssistantJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesAssistant) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesAssistant) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesAssistantFunctionCall ¶
type PromptDataPromptChatMessagesAssistantFunctionCall struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
JSON promptDataPromptChatMessagesAssistantFunctionCallJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesAssistantFunctionCall) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesAssistantFunctionCall) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesAssistantFunctionCallParam ¶
type PromptDataPromptChatMessagesAssistantFunctionCallParam struct {
Arguments param.Field[string] `json:"arguments,required"`
Name param.Field[string] `json:"name,required"`
}
func (PromptDataPromptChatMessagesAssistantFunctionCallParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesAssistantFunctionCallParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistantParam ¶
type PromptDataPromptChatMessagesAssistantParam struct {
Role param.Field[PromptDataPromptChatMessagesAssistantRole] `json:"role,required"`
Content param.Field[string] `json:"content"`
FunctionCall param.Field[PromptDataPromptChatMessagesAssistantFunctionCallParam] `json:"function_call"`
Name param.Field[string] `json:"name"`
ToolCalls param.Field[[]PromptDataPromptChatMessagesAssistantToolCallParam] `json:"tool_calls"`
}
func (PromptDataPromptChatMessagesAssistantParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesAssistantParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistantRole ¶
type PromptDataPromptChatMessagesAssistantRole string
const (
PromptDataPromptChatMessagesAssistantRoleAssistant PromptDataPromptChatMessagesAssistantRole = "assistant"
)
func (PromptDataPromptChatMessagesAssistantRole) IsKnown ¶
func (r PromptDataPromptChatMessagesAssistantRole) IsKnown() bool
type PromptDataPromptChatMessagesAssistantToolCall ¶
type PromptDataPromptChatMessagesAssistantToolCall struct {
ID string `json:"id,required"`
Function PromptDataPromptChatMessagesAssistantToolCallsFunction `json:"function,required"`
Type PromptDataPromptChatMessagesAssistantToolCallsType `json:"type,required"`
JSON promptDataPromptChatMessagesAssistantToolCallJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesAssistantToolCall) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesAssistantToolCall) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesAssistantToolCallParam ¶
type PromptDataPromptChatMessagesAssistantToolCallParam struct {
ID param.Field[string] `json:"id,required"`
Function param.Field[PromptDataPromptChatMessagesAssistantToolCallsFunctionParam] `json:"function,required"`
Type param.Field[PromptDataPromptChatMessagesAssistantToolCallsType] `json:"type,required"`
}
func (PromptDataPromptChatMessagesAssistantToolCallParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesAssistantToolCallParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistantToolCallsFunction ¶
type PromptDataPromptChatMessagesAssistantToolCallsFunction struct {
Arguments string `json:"arguments,required"`
Name string `json:"name,required"`
JSON promptDataPromptChatMessagesAssistantToolCallsFunctionJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesAssistantToolCallsFunction) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesAssistantToolCallsFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesAssistantToolCallsFunctionParam ¶
type PromptDataPromptChatMessagesAssistantToolCallsFunctionParam struct {
Arguments param.Field[string] `json:"arguments,required"`
Name param.Field[string] `json:"name,required"`
}
func (PromptDataPromptChatMessagesAssistantToolCallsFunctionParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesAssistantToolCallsFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesAssistantToolCallsType ¶
type PromptDataPromptChatMessagesAssistantToolCallsType string
const (
PromptDataPromptChatMessagesAssistantToolCallsTypeFunction PromptDataPromptChatMessagesAssistantToolCallsType = "function"
)
func (PromptDataPromptChatMessagesAssistantToolCallsType) IsKnown ¶
func (r PromptDataPromptChatMessagesAssistantToolCallsType) IsKnown() bool
type PromptDataPromptChatMessagesFallback ¶
type PromptDataPromptChatMessagesFallback struct {
Role PromptDataPromptChatMessagesFallbackRole `json:"role,required"`
Content string `json:"content,nullable"`
JSON promptDataPromptChatMessagesFallbackJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesFallback) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesFallback) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesFallbackParam ¶
type PromptDataPromptChatMessagesFallbackParam struct {
Role param.Field[PromptDataPromptChatMessagesFallbackRole] `json:"role,required"`
Content param.Field[string] `json:"content"`
}
func (PromptDataPromptChatMessagesFallbackParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesFallbackParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesFallbackRole ¶
type PromptDataPromptChatMessagesFallbackRole string
const (
PromptDataPromptChatMessagesFallbackRoleModel PromptDataPromptChatMessagesFallbackRole = "model"
)
func (PromptDataPromptChatMessagesFallbackRole) IsKnown ¶
func (r PromptDataPromptChatMessagesFallbackRole) IsKnown() bool
type PromptDataPromptChatMessagesFunction ¶
type PromptDataPromptChatMessagesFunction struct {
Name string `json:"name,required"`
Role PromptDataPromptChatMessagesFunctionRole `json:"role,required"`
Content string `json:"content"`
JSON promptDataPromptChatMessagesFunctionJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesFunction) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesFunction) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesFunctionParam ¶
type PromptDataPromptChatMessagesFunctionParam struct {
Name param.Field[string] `json:"name,required"`
Role param.Field[PromptDataPromptChatMessagesFunctionRole] `json:"role,required"`
Content param.Field[string] `json:"content"`
}
func (PromptDataPromptChatMessagesFunctionParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesFunctionParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesFunctionRole ¶
type PromptDataPromptChatMessagesFunctionRole string
const (
PromptDataPromptChatMessagesFunctionRoleFunction PromptDataPromptChatMessagesFunctionRole = "function"
)
func (PromptDataPromptChatMessagesFunctionRole) IsKnown ¶
func (r PromptDataPromptChatMessagesFunctionRole) IsKnown() bool
type PromptDataPromptChatMessagesRole ¶
type PromptDataPromptChatMessagesRole string
const ( PromptDataPromptChatMessagesRoleSystem PromptDataPromptChatMessagesRole = "system" PromptDataPromptChatMessagesRoleUser PromptDataPromptChatMessagesRole = "user" PromptDataPromptChatMessagesRoleAssistant PromptDataPromptChatMessagesRole = "assistant" PromptDataPromptChatMessagesRoleTool PromptDataPromptChatMessagesRole = "tool" PromptDataPromptChatMessagesRoleFunction PromptDataPromptChatMessagesRole = "function" PromptDataPromptChatMessagesRoleModel PromptDataPromptChatMessagesRole = "model" )
func (PromptDataPromptChatMessagesRole) IsKnown ¶
func (r PromptDataPromptChatMessagesRole) IsKnown() bool
type PromptDataPromptChatMessagesSystem ¶
type PromptDataPromptChatMessagesSystem struct {
Role PromptDataPromptChatMessagesSystemRole `json:"role,required"`
Content string `json:"content"`
Name string `json:"name"`
JSON promptDataPromptChatMessagesSystemJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesSystem) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesSystem) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesSystemParam ¶
type PromptDataPromptChatMessagesSystemParam struct {
Role param.Field[PromptDataPromptChatMessagesSystemRole] `json:"role,required"`
Content param.Field[string] `json:"content"`
Name param.Field[string] `json:"name"`
}
func (PromptDataPromptChatMessagesSystemParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesSystemParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesSystemRole ¶
type PromptDataPromptChatMessagesSystemRole string
const (
PromptDataPromptChatMessagesSystemRoleSystem PromptDataPromptChatMessagesSystemRole = "system"
)
func (PromptDataPromptChatMessagesSystemRole) IsKnown ¶
func (r PromptDataPromptChatMessagesSystemRole) IsKnown() bool
type PromptDataPromptChatMessagesTool ¶
type PromptDataPromptChatMessagesTool struct {
Role PromptDataPromptChatMessagesToolRole `json:"role,required"`
Content string `json:"content"`
ToolCallID string `json:"tool_call_id"`
JSON promptDataPromptChatMessagesToolJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesTool) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesTool) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesToolParam ¶
type PromptDataPromptChatMessagesToolParam struct {
Role param.Field[PromptDataPromptChatMessagesToolRole] `json:"role,required"`
Content param.Field[string] `json:"content"`
ToolCallID param.Field[string] `json:"tool_call_id"`
}
func (PromptDataPromptChatMessagesToolParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesToolParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesToolRole ¶
type PromptDataPromptChatMessagesToolRole string
const (
PromptDataPromptChatMessagesToolRoleTool PromptDataPromptChatMessagesToolRole = "tool"
)
func (PromptDataPromptChatMessagesToolRole) IsKnown ¶
func (r PromptDataPromptChatMessagesToolRole) IsKnown() bool
type PromptDataPromptChatMessagesUnion ¶
type PromptDataPromptChatMessagesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataPromptChatMessagesSystem, shared.PromptDataPromptChatMessagesUser, shared.PromptDataPromptChatMessagesAssistant, shared.PromptDataPromptChatMessagesTool, shared.PromptDataPromptChatMessagesFunction or shared.PromptDataPromptChatMessagesFallback.
type PromptDataPromptChatMessagesUnionParam ¶
type PromptDataPromptChatMessagesUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptChatMessagesSystemParam, shared.PromptDataPromptChatMessagesUserParam, shared.PromptDataPromptChatMessagesAssistantParam, shared.PromptDataPromptChatMessagesToolParam, shared.PromptDataPromptChatMessagesFunctionParam, shared.PromptDataPromptChatMessagesFallbackParam, PromptDataPromptChatMessageParam.
type PromptDataPromptChatMessagesUser ¶
type PromptDataPromptChatMessagesUser struct {
Role PromptDataPromptChatMessagesUserRole `json:"role,required"`
Content PromptDataPromptChatMessagesUserContentUnion `json:"content"`
Name string `json:"name"`
JSON promptDataPromptChatMessagesUserJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUser) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUser) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArray ¶
type PromptDataPromptChatMessagesUserContentArray []PromptDataPromptChatMessagesUserContentArrayItem
func (PromptDataPromptChatMessagesUserContentArray) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion ¶
func (r PromptDataPromptChatMessagesUserContentArray) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
type PromptDataPromptChatMessagesUserContentArrayImageURL ¶
type PromptDataPromptChatMessagesUserContentArrayImageURL struct {
ImageURL PromptDataPromptChatMessagesUserContentArrayImageURLImageURL `json:"image_url,required"`
Type PromptDataPromptChatMessagesUserContentArrayImageURLType `json:"type,required"`
JSON promptDataPromptChatMessagesUserContentArrayImageURLJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUserContentArrayImageURL) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayImageURL) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURL ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURL struct {
URL string `json:"url,required"`
Detail PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail `json:"detail"`
JSON promptDataPromptChatMessagesUserContentArrayImageURLImageURLJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUserContentArrayImageURLImageURL) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayImageURLImageURL) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail string
const ( PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetailAuto PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail = "auto" PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetailLow PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail = "low" PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetailHigh PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail = "high" )
func (PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam struct {
URL param.Field[string] `json:"url,required"`
Detail param.Field[PromptDataPromptChatMessagesUserContentArrayImageURLImageURLDetail] `json:"detail"`
}
func (PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLParam ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLParam struct {
ImageURL param.Field[PromptDataPromptChatMessagesUserContentArrayImageURLImageURLParam] `json:"image_url,required"`
Type param.Field[PromptDataPromptChatMessagesUserContentArrayImageURLType] `json:"type,required"`
}
func (PromptDataPromptChatMessagesUserContentArrayImageURLParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayImageURLType ¶
type PromptDataPromptChatMessagesUserContentArrayImageURLType string
const (
PromptDataPromptChatMessagesUserContentArrayImageURLTypeImageURL PromptDataPromptChatMessagesUserContentArrayImageURLType = "image_url"
)
func (PromptDataPromptChatMessagesUserContentArrayImageURLType) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayImageURLType) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayItem ¶
type PromptDataPromptChatMessagesUserContentArrayItem struct {
Text string `json:"text"`
Type PromptDataPromptChatMessagesUserContentArrayType `json:"type,required"`
// This field can have the runtime type of
// [PromptDataPromptChatMessagesUserContentArrayImageURLImageURL].
ImageURL interface{} `json:"image_url,required"`
JSON promptDataPromptChatMessagesUserContentArrayItemJSON `json:"-"`
// contains filtered or unexported fields
}
func (PromptDataPromptChatMessagesUserContentArrayItem) AsUnion ¶
func (r PromptDataPromptChatMessagesUserContentArrayItem) AsUnion() PromptDataPromptChatMessagesUserContentArrayUnionItem
AsUnion returns a PromptDataPromptChatMessagesUserContentArrayUnionItem interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.PromptDataPromptChatMessagesUserContentArrayText, shared.PromptDataPromptChatMessagesUserContentArrayImageURL.
func (*PromptDataPromptChatMessagesUserContentArrayItem) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayItem) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayItemParam ¶
type PromptDataPromptChatMessagesUserContentArrayItemParam struct {
Text param.Field[string] `json:"text"`
Type param.Field[PromptDataPromptChatMessagesUserContentArrayType] `json:"type,required"`
ImageURL param.Field[interface{}] `json:"image_url,required"`
}
func (PromptDataPromptChatMessagesUserContentArrayItemParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayItemParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayParam ¶
type PromptDataPromptChatMessagesUserContentArrayParam []PromptDataPromptChatMessagesUserContentArrayUnionItemParam
func (PromptDataPromptChatMessagesUserContentArrayParam) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam ¶
func (r PromptDataPromptChatMessagesUserContentArrayParam) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
type PromptDataPromptChatMessagesUserContentArrayText ¶
type PromptDataPromptChatMessagesUserContentArrayText struct {
Type PromptDataPromptChatMessagesUserContentArrayTextType `json:"type,required"`
Text string `json:"text"`
JSON promptDataPromptChatMessagesUserContentArrayTextJSON `json:"-"`
}
func (*PromptDataPromptChatMessagesUserContentArrayText) UnmarshalJSON ¶
func (r *PromptDataPromptChatMessagesUserContentArrayText) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptChatMessagesUserContentArrayTextParam ¶
type PromptDataPromptChatMessagesUserContentArrayTextParam struct {
Type param.Field[PromptDataPromptChatMessagesUserContentArrayTextType] `json:"type,required"`
Text param.Field[string] `json:"text"`
}
func (PromptDataPromptChatMessagesUserContentArrayTextParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserContentArrayTextParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserContentArrayTextType ¶
type PromptDataPromptChatMessagesUserContentArrayTextType string
const (
PromptDataPromptChatMessagesUserContentArrayTextTypeText PromptDataPromptChatMessagesUserContentArrayTextType = "text"
)
func (PromptDataPromptChatMessagesUserContentArrayTextType) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayTextType) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayType ¶
type PromptDataPromptChatMessagesUserContentArrayType string
const ( PromptDataPromptChatMessagesUserContentArrayTypeText PromptDataPromptChatMessagesUserContentArrayType = "text" PromptDataPromptChatMessagesUserContentArrayTypeImageURL PromptDataPromptChatMessagesUserContentArrayType = "image_url" )
func (PromptDataPromptChatMessagesUserContentArrayType) IsKnown ¶
func (r PromptDataPromptChatMessagesUserContentArrayType) IsKnown() bool
type PromptDataPromptChatMessagesUserContentArrayUnionItem ¶
type PromptDataPromptChatMessagesUserContentArrayUnionItem interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataPromptChatMessagesUserContentArrayText or shared.PromptDataPromptChatMessagesUserContentArrayImageURL.
type PromptDataPromptChatMessagesUserContentArrayUnionItemParam ¶
type PromptDataPromptChatMessagesUserContentArrayUnionItemParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptChatMessagesUserContentArrayTextParam, shared.PromptDataPromptChatMessagesUserContentArrayImageURLParam, PromptDataPromptChatMessagesUserContentArrayItemParam.
type PromptDataPromptChatMessagesUserContentUnion ¶
type PromptDataPromptChatMessagesUserContentUnion interface {
}
Union satisfied by shared.UnionString or shared.PromptDataPromptChatMessagesUserContentArray.
type PromptDataPromptChatMessagesUserContentUnionParam ¶
type PromptDataPromptChatMessagesUserContentUnionParam interface {
}
Satisfied by shared.UnionString, shared.PromptDataPromptChatMessagesUserContentArrayParam.
type PromptDataPromptChatMessagesUserParam ¶
type PromptDataPromptChatMessagesUserParam struct {
Role param.Field[PromptDataPromptChatMessagesUserRole] `json:"role,required"`
Content param.Field[PromptDataPromptChatMessagesUserContentUnionParam] `json:"content"`
Name param.Field[string] `json:"name"`
}
func (PromptDataPromptChatMessagesUserParam) MarshalJSON ¶
func (r PromptDataPromptChatMessagesUserParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatMessagesUserRole ¶
type PromptDataPromptChatMessagesUserRole string
const (
PromptDataPromptChatMessagesUserRoleUser PromptDataPromptChatMessagesUserRole = "user"
)
func (PromptDataPromptChatMessagesUserRole) IsKnown ¶
func (r PromptDataPromptChatMessagesUserRole) IsKnown() bool
type PromptDataPromptChatParam ¶
type PromptDataPromptChatParam struct {
Messages param.Field[[]PromptDataPromptChatMessagesUnionParam] `json:"messages,required"`
Type param.Field[PromptDataPromptChatType] `json:"type,required"`
Tools param.Field[string] `json:"tools"`
}
func (PromptDataPromptChatParam) MarshalJSON ¶
func (r PromptDataPromptChatParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptChatType ¶
type PromptDataPromptChatType string
const (
PromptDataPromptChatTypeChat PromptDataPromptChatType = "chat"
)
func (PromptDataPromptChatType) IsKnown ¶
func (r PromptDataPromptChatType) IsKnown() bool
type PromptDataPromptCompletion ¶
type PromptDataPromptCompletion struct {
Content string `json:"content,required"`
Type PromptDataPromptCompletionType `json:"type,required"`
JSON promptDataPromptCompletionJSON `json:"-"`
}
func (*PromptDataPromptCompletion) UnmarshalJSON ¶
func (r *PromptDataPromptCompletion) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptCompletionParam ¶
type PromptDataPromptCompletionParam struct {
Content param.Field[string] `json:"content,required"`
Type param.Field[PromptDataPromptCompletionType] `json:"type,required"`
}
func (PromptDataPromptCompletionParam) MarshalJSON ¶
func (r PromptDataPromptCompletionParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptCompletionType ¶
type PromptDataPromptCompletionType string
const (
PromptDataPromptCompletionTypeCompletion PromptDataPromptCompletionType = "completion"
)
func (PromptDataPromptCompletionType) IsKnown ¶
func (r PromptDataPromptCompletionType) IsKnown() bool
type PromptDataPromptNullableVariant ¶
type PromptDataPromptNullableVariant struct {
JSON promptDataPromptNullableVariantJSON `json:"-"`
}
func (*PromptDataPromptNullableVariant) UnmarshalJSON ¶
func (r *PromptDataPromptNullableVariant) UnmarshalJSON(data []byte) (err error)
type PromptDataPromptNullableVariantParam ¶
type PromptDataPromptNullableVariantParam struct {
}
func (PromptDataPromptNullableVariantParam) MarshalJSON ¶
func (r PromptDataPromptNullableVariantParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptParam ¶
type PromptDataPromptParam struct {
Type param.Field[PromptDataPromptType] `json:"type"`
Content param.Field[string] `json:"content"`
Messages param.Field[interface{}] `json:"messages,required"`
Tools param.Field[string] `json:"tools"`
}
func (PromptDataPromptParam) MarshalJSON ¶
func (r PromptDataPromptParam) MarshalJSON() (data []byte, err error)
type PromptDataPromptType ¶
type PromptDataPromptType string
const ( PromptDataPromptTypeCompletion PromptDataPromptType = "completion" PromptDataPromptTypeChat PromptDataPromptType = "chat" )
func (PromptDataPromptType) IsKnown ¶
func (r PromptDataPromptType) IsKnown() bool
type PromptDataPromptUnion ¶
type PromptDataPromptUnion interface {
// contains filtered or unexported methods
}
Union satisfied by shared.PromptDataPromptCompletion, shared.PromptDataPromptChat or shared.PromptDataPromptNullableVariant.
type PromptDataPromptUnionParam ¶
type PromptDataPromptUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by shared.PromptDataPromptCompletionParam, shared.PromptDataPromptChatParam, shared.PromptDataPromptNullableVariantParam, PromptDataPromptParam.
type PromptLogID ¶
type PromptLogID string
A literal 'p' which identifies the object as a project prompt
const (
PromptLogIDP PromptLogID = "p"
)
func (PromptLogID) IsKnown ¶
func (r PromptLogID) IsKnown() bool
type RepoInfo ¶
type RepoInfo struct {
// Email of the author of the most recent commit
AuthorEmail string `json:"author_email,nullable"`
// Name of the author of the most recent commit
AuthorName string `json:"author_name,nullable"`
// Name of the branch the most recent commit belongs to
Branch string `json:"branch,nullable"`
// SHA of most recent commit
Commit string `json:"commit,nullable"`
// Most recent commit message
CommitMessage string `json:"commit_message,nullable"`
// Time of the most recent commit
CommitTime string `json:"commit_time,nullable"`
// Whether or not the repo had uncommitted changes when snapshotted
Dirty bool `json:"dirty,nullable"`
// If the repo was dirty when run, this includes the diff between the current state
// of the repo and the most recent commit.
GitDiff string `json:"git_diff,nullable"`
// Name of the tag on the most recent commit
Tag string `json:"tag,nullable"`
JSON repoInfoJSON `json:"-"`
}
Metadata about the state of the repo when the experiment was created
func (*RepoInfo) UnmarshalJSON ¶
type RepoInfoParam ¶
type RepoInfoParam struct {
// Email of the author of the most recent commit
AuthorEmail param.Field[string] `json:"author_email"`
// Name of the author of the most recent commit
AuthorName param.Field[string] `json:"author_name"`
// Name of the branch the most recent commit belongs to
Branch param.Field[string] `json:"branch"`
// SHA of most recent commit
Commit param.Field[string] `json:"commit"`
// Most recent commit message
CommitMessage param.Field[string] `json:"commit_message"`
// Time of the most recent commit
CommitTime param.Field[string] `json:"commit_time"`
// Whether or not the repo had uncommitted changes when snapshotted
Dirty param.Field[bool] `json:"dirty"`
// If the repo was dirty when run, this includes the diff between the current state
// of the repo and the most recent commit.
GitDiff param.Field[string] `json:"git_diff"`
// Name of the tag on the most recent commit
Tag param.Field[string] `json:"tag"`
}
Metadata about the state of the repo when the experiment was created
func (RepoInfoParam) MarshalJSON ¶
func (r RepoInfoParam) MarshalJSON() (data []byte, err error)
type Role ¶
type Role struct {
// Unique identifier for the role
ID string `json:"id,required" format:"uuid"`
// Name of the role
Name string `json:"name,required"`
// Date of role creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of role deletion, or null if the role is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Textual description of the role
Description string `json:"description,nullable"`
// (permission, restrict_object_type) tuples which belong to this role
MemberPermissions []RoleMemberPermission `json:"member_permissions,nullable"`
// Ids of the roles this role inherits from
//
// An inheriting role has all the permissions contained in its member roles, as
// well as all of their inherited permissions
MemberRoles []string `json:"member_roles,nullable" format:"uuid"`
// Unique id for the organization that the role belongs under
//
// A null org_id indicates a system role, which may be assigned to anybody and
// inherited by any other role, but cannot be edited.
//
// It is forbidden to change the org after creating a role
OrgID string `json:"org_id,nullable" format:"uuid"`
// Identifies the user who created the role
UserID string `json:"user_id,nullable" format:"uuid"`
JSON roleJSON `json:"-"`
}
A role is a collection of permissions which can be granted as part of an ACL
Roles can consist of individual permissions, as well as a set of roles they inherit from
func (*Role) UnmarshalJSON ¶
type RoleMemberPermission ¶
type RoleMemberPermission struct {
// Each permission permits a certain type of operation on an object in the system
//
// Permissions can be assigned to to objects on an individual basis, or grouped
// into roles
Permission RoleMemberPermissionsPermission `json:"permission,required,nullable"`
// The object type that the ACL applies to
RestrictObjectType RoleMemberPermissionsRestrictObjectType `json:"restrict_object_type,nullable"`
JSON roleMemberPermissionJSON `json:"-"`
}
func (*RoleMemberPermission) UnmarshalJSON ¶
func (r *RoleMemberPermission) UnmarshalJSON(data []byte) (err error)
type RoleMemberPermissionsPermission ¶
type RoleMemberPermissionsPermission string
Each permission permits a certain type of operation on an object in the system
Permissions can be assigned to to objects on an individual basis, or grouped into roles
const ( RoleMemberPermissionsPermissionCreate RoleMemberPermissionsPermission = "create" RoleMemberPermissionsPermissionRead RoleMemberPermissionsPermission = "read" RoleMemberPermissionsPermissionUpdate RoleMemberPermissionsPermission = "update" RoleMemberPermissionsPermissionDelete RoleMemberPermissionsPermission = "delete" RoleMemberPermissionsPermissionCreateACLs RoleMemberPermissionsPermission = "create_acls" RoleMemberPermissionsPermissionReadACLs RoleMemberPermissionsPermission = "read_acls" RoleMemberPermissionsPermissionUpdateACLs RoleMemberPermissionsPermission = "update_acls" RoleMemberPermissionsPermissionDeleteACLs RoleMemberPermissionsPermission = "delete_acls" )
func (RoleMemberPermissionsPermission) IsKnown ¶
func (r RoleMemberPermissionsPermission) IsKnown() bool
type RoleMemberPermissionsRestrictObjectType ¶
type RoleMemberPermissionsRestrictObjectType string
The object type that the ACL applies to
const ( RoleMemberPermissionsRestrictObjectTypeOrganization RoleMemberPermissionsRestrictObjectType = "organization" RoleMemberPermissionsRestrictObjectTypeProject RoleMemberPermissionsRestrictObjectType = "project" RoleMemberPermissionsRestrictObjectTypeExperiment RoleMemberPermissionsRestrictObjectType = "experiment" RoleMemberPermissionsRestrictObjectTypeDataset RoleMemberPermissionsRestrictObjectType = "dataset" RoleMemberPermissionsRestrictObjectTypePrompt RoleMemberPermissionsRestrictObjectType = "prompt" RoleMemberPermissionsRestrictObjectTypePromptSession RoleMemberPermissionsRestrictObjectType = "prompt_session" RoleMemberPermissionsRestrictObjectTypeGroup RoleMemberPermissionsRestrictObjectType = "group" RoleMemberPermissionsRestrictObjectTypeRole RoleMemberPermissionsRestrictObjectType = "role" RoleMemberPermissionsRestrictObjectTypeOrgMember RoleMemberPermissionsRestrictObjectType = "org_member" RoleMemberPermissionsRestrictObjectTypeProjectLog RoleMemberPermissionsRestrictObjectType = "project_log" RoleMemberPermissionsRestrictObjectTypeOrgProject RoleMemberPermissionsRestrictObjectType = "org_project" )
func (RoleMemberPermissionsRestrictObjectType) IsKnown ¶
func (r RoleMemberPermissionsRestrictObjectType) IsKnown() bool
type ScoreSummary ¶
type ScoreSummary struct {
// Number of improvements in the score
Improvements int64 `json:"improvements,required"`
// Name of the score
Name string `json:"name,required"`
// Number of regressions in the score
Regressions int64 `json:"regressions,required"`
// Average score across all examples
Score float64 `json:"score,required"`
// Difference in score between the current and comparison experiment
Diff float64 `json:"diff"`
JSON scoreSummaryJSON `json:"-"`
}
Summary of a score's performance
func (*ScoreSummary) UnmarshalJSON ¶
func (r *ScoreSummary) UnmarshalJSON(data []byte) (err error)
type SummarizeDatasetResponse ¶
type SummarizeDatasetResponse struct {
// Name of the dataset
DatasetName string `json:"dataset_name,required"`
// URL to the dataset's page in the Braintrust app
DatasetURL string `json:"dataset_url,required" format:"uri"`
// Name of the project that the dataset belongs to
ProjectName string `json:"project_name,required"`
// URL to the project's page in the Braintrust app
ProjectURL string `json:"project_url,required" format:"uri"`
// Summary of a dataset's data
DataSummary DataSummary `json:"data_summary,nullable"`
JSON summarizeDatasetResponseJSON `json:"-"`
}
Summary of a dataset
func (*SummarizeDatasetResponse) UnmarshalJSON ¶
func (r *SummarizeDatasetResponse) UnmarshalJSON(data []byte) (err error)
type SummarizeExperimentResponse ¶
type SummarizeExperimentResponse struct {
// Name of the experiment
ExperimentName string `json:"experiment_name,required"`
// URL to the experiment's page in the Braintrust app
ExperimentURL string `json:"experiment_url,required" format:"uri"`
// Name of the project that the experiment belongs to
ProjectName string `json:"project_name,required"`
// URL to the project's page in the Braintrust app
ProjectURL string `json:"project_url,required" format:"uri"`
// The experiment which scores are baselined against
ComparisonExperimentName string `json:"comparison_experiment_name,nullable"`
// Summary of the experiment's metrics
Metrics map[string]MetricSummary `json:"metrics,nullable"`
// Summary of the experiment's scores
Scores map[string]ScoreSummary `json:"scores,nullable"`
JSON summarizeExperimentResponseJSON `json:"-"`
}
Summary of an experiment
func (*SummarizeExperimentResponse) UnmarshalJSON ¶
func (r *SummarizeExperimentResponse) UnmarshalJSON(data []byte) (err error)
type UnionString ¶
type UnionString string
func (UnionString) ImplementsACLListParamsIDsUnion ¶
func (UnionString) ImplementsACLListParamsIDsUnion()
func (UnionString) ImplementsAPIKeyListParamsIDsUnion ¶
func (UnionString) ImplementsAPIKeyListParamsIDsUnion()
func (UnionString) ImplementsDatasetListParamsIDsUnion ¶
func (UnionString) ImplementsDatasetListParamsIDsUnion()
func (UnionString) ImplementsExperimentListParamsIDsUnion ¶
func (UnionString) ImplementsExperimentListParamsIDsUnion()
func (UnionString) ImplementsFunctionListParamsIDsUnion ¶
func (UnionString) ImplementsFunctionListParamsIDsUnion()
func (UnionString) ImplementsGroupListParamsIDsUnion ¶
func (UnionString) ImplementsGroupListParamsIDsUnion()
func (UnionString) ImplementsOrganizationListParamsIDsUnion ¶
func (UnionString) ImplementsOrganizationListParamsIDsUnion()
func (UnionString) ImplementsProjectListParamsIDsUnion ¶
func (UnionString) ImplementsProjectListParamsIDsUnion()
func (UnionString) ImplementsProjectScoreListParamsIDsUnion ¶
func (UnionString) ImplementsProjectScoreListParamsIDsUnion()
func (UnionString) ImplementsProjectTagListParamsIDsUnion ¶
func (UnionString) ImplementsProjectTagListParamsIDsUnion()
func (UnionString) ImplementsPromptListParamsIDsUnion ¶
func (UnionString) ImplementsPromptListParamsIDsUnion()
func (UnionString) ImplementsRoleListParamsIDsUnion ¶
func (UnionString) ImplementsRoleListParamsIDsUnion()
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion ¶
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnion()
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam ¶
func (UnionString) ImplementsSharedPromptDataPromptChatMessagesUserContentUnionParam()
func (UnionString) ImplementsUserListParamsEmailUnion ¶
func (UnionString) ImplementsUserListParamsEmailUnion()
func (UnionString) ImplementsUserListParamsFamilyNameUnion ¶
func (UnionString) ImplementsUserListParamsFamilyNameUnion()
func (UnionString) ImplementsUserListParamsGivenNameUnion ¶
func (UnionString) ImplementsUserListParamsGivenNameUnion()
func (UnionString) ImplementsUserListParamsIDsUnion ¶
func (UnionString) ImplementsUserListParamsIDsUnion()
func (UnionString) ImplementsViewListParamsIDsUnion ¶
func (UnionString) ImplementsViewListParamsIDsUnion()
type User ¶
type User struct {
// Unique identifier for the user
ID string `json:"id,required" format:"uuid"`
// URL of the user's Avatar image
AvatarURL string `json:"avatar_url,nullable"`
// Date of user creation
Created time.Time `json:"created,nullable" format:"date-time"`
// The user's email
Email string `json:"email,nullable"`
// Family name of the user
FamilyName string `json:"family_name,nullable"`
// Given name of the user
GivenName string `json:"given_name,nullable"`
JSON userJSON `json:"-"`
}
func (*User) UnmarshalJSON ¶
type View ¶
type View struct {
// Unique identifier for the view
ID string `json:"id,required" format:"uuid"`
// Name of the view
Name string `json:"name,required"`
// The id of the object the view applies to
ObjectID string `json:"object_id,required" format:"uuid"`
// The object type that the ACL applies to
ObjectType ViewObjectType `json:"object_type,required,nullable"`
// Type of table that the view corresponds to.
ViewType ViewViewType `json:"view_type,required,nullable"`
// Date of view creation
Created time.Time `json:"created,nullable" format:"date-time"`
// Date of role deletion, or null if the role is still active
DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"`
// Options for the view in the app
Options ViewOptions `json:"options,nullable"`
// Identifies the user who created the view
UserID string `json:"user_id,nullable" format:"uuid"`
// The view definition
ViewData ViewData `json:"view_data,nullable"`
JSON viewJSON `json:"-"`
}
func (*View) UnmarshalJSON ¶
type ViewData ¶
type ViewData struct {
Search ViewDataSearch `json:"search,nullable"`
JSON viewDataJSON `json:"-"`
}
The view definition
func (*ViewData) UnmarshalJSON ¶
type ViewDataParam ¶
type ViewDataParam struct {
Search param.Field[ViewDataSearchParam] `json:"search"`
}
The view definition
func (ViewDataParam) MarshalJSON ¶
func (r ViewDataParam) MarshalJSON() (data []byte, err error)
type ViewDataSearch ¶
type ViewDataSearch struct {
Filter []interface{} `json:"filter,nullable"`
Match []interface{} `json:"match,nullable"`
Sort []interface{} `json:"sort,nullable"`
Tag []interface{} `json:"tag,nullable"`
JSON viewDataSearchJSON `json:"-"`
}
func (*ViewDataSearch) UnmarshalJSON ¶
func (r *ViewDataSearch) UnmarshalJSON(data []byte) (err error)
type ViewDataSearchParam ¶
type ViewDataSearchParam struct {
Filter param.Field[[]interface{}] `json:"filter"`
Match param.Field[[]interface{}] `json:"match"`
Sort param.Field[[]interface{}] `json:"sort"`
Tag param.Field[[]interface{}] `json:"tag"`
}
func (ViewDataSearchParam) MarshalJSON ¶
func (r ViewDataSearchParam) MarshalJSON() (data []byte, err error)
type ViewObjectType ¶
type ViewObjectType string
The object type that the ACL applies to
const ( ViewObjectTypeOrganization ViewObjectType = "organization" ViewObjectTypeProject ViewObjectType = "project" ViewObjectTypeExperiment ViewObjectType = "experiment" ViewObjectTypeDataset ViewObjectType = "dataset" ViewObjectTypePrompt ViewObjectType = "prompt" ViewObjectTypePromptSession ViewObjectType = "prompt_session" ViewObjectTypeGroup ViewObjectType = "group" ViewObjectTypeRole ViewObjectType = "role" ViewObjectTypeOrgMember ViewObjectType = "org_member" ViewObjectTypeProjectLog ViewObjectType = "project_log" ViewObjectTypeOrgProject ViewObjectType = "org_project" )
func (ViewObjectType) IsKnown ¶
func (r ViewObjectType) IsKnown() bool
type ViewOptions ¶
type ViewOptions struct {
ColumnOrder []string `json:"columnOrder,nullable"`
ColumnSizing map[string]float64 `json:"columnSizing,nullable"`
ColumnVisibility map[string]bool `json:"columnVisibility,nullable"`
JSON viewOptionsJSON `json:"-"`
}
Options for the view in the app
func (*ViewOptions) UnmarshalJSON ¶
func (r *ViewOptions) UnmarshalJSON(data []byte) (err error)
type ViewOptionsParam ¶
type ViewOptionsParam struct {
ColumnOrder param.Field[[]string] `json:"columnOrder"`
ColumnSizing param.Field[map[string]float64] `json:"columnSizing"`
ColumnVisibility param.Field[map[string]bool] `json:"columnVisibility"`
}
Options for the view in the app
func (ViewOptionsParam) MarshalJSON ¶
func (r ViewOptionsParam) MarshalJSON() (data []byte, err error)
type ViewViewType ¶
type ViewViewType string
Type of table that the view corresponds to.
const ( ViewViewTypeProjects ViewViewType = "projects" ViewViewTypeLogs ViewViewType = "logs" ViewViewTypeExperiments ViewViewType = "experiments" ViewViewTypeDatasets ViewViewType = "datasets" ViewViewTypePrompts ViewViewType = "prompts" ViewViewTypePlaygrounds ViewViewType = "playgrounds" ViewViewTypeExperiment ViewViewType = "experiment" ViewViewTypeDataset ViewViewType = "dataset" )
func (ViewViewType) IsKnown ¶
func (r ViewViewType) IsKnown() bool