Documentation
¶
Index ¶
- Constants
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type ACL
- type ACLBatchUpdateParams
- type ACLBatchUpdateParamsAddACL
- type ACLBatchUpdateParamsRemoveACL
- type ACLBatchUpdateResponse
- type ACLFindAndDeleteParams
- type ACLListParams
- type ACLListParamsIDsUnion
- type ACLNewParams
- type ACLObjectType
- type ACLService
- func (r *ACLService) BatchUpdate(ctx context.Context, body ACLBatchUpdateParams, opts ...option.RequestOption) (res *shared.ACLBatchUpdateResponse, err error)
- func (r *ACLService) Delete(ctx context.Context, aclID string, opts ...option.RequestOption) (res *shared.ACL, err error)
- func (r *ACLService) FindAndDelete(ctx context.Context, body ACLFindAndDeleteParams, opts ...option.RequestOption) (res *shared.ACL, err error)
- func (r *ACLService) Get(ctx context.Context, aclID string, opts ...option.RequestOption) (res *shared.ACL, err error)
- func (r *ACLService) List(ctx context.Context, query ACLListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.ACL], err error)
- func (r *ACLService) ListAutoPaging(ctx context.Context, query ACLListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.ACL]
- func (r *ACLService) New(ctx context.Context, body ACLNewParams, opts ...option.RequestOption) (res *shared.ACL, err error)
- type AISecret
- type AISecretFindAndDeleteParams
- type AISecretListParams
- type AISecretListParamsAISecretTypeUnion
- type AISecretListParamsIDsUnion
- type AISecretNewParams
- type AISecretReplaceParams
- type AISecretService
- func (r *AISecretService) Delete(ctx context.Context, aiSecretID string, opts ...option.RequestOption) (res *shared.AISecret, err error)
- func (r *AISecretService) FindAndDelete(ctx context.Context, body AISecretFindAndDeleteParams, ...) (res *shared.AISecret, err error)
- func (r *AISecretService) Get(ctx context.Context, aiSecretID string, opts ...option.RequestOption) (res *shared.AISecret, err error)
- func (r *AISecretService) List(ctx context.Context, query AISecretListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.AISecret], err error)
- func (r *AISecretService) ListAutoPaging(ctx context.Context, query AISecretListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.AISecret]
- func (r *AISecretService) New(ctx context.Context, body AISecretNewParams, opts ...option.RequestOption) (res *shared.AISecret, err error)
- func (r *AISecretService) Replace(ctx context.Context, body AISecretReplaceParams, opts ...option.RequestOption) (res *shared.AISecret, err error)
- func (r *AISecretService) Update(ctx context.Context, aiSecretID string, body AISecretUpdateParams, ...) (res *shared.AISecret, err error)
- type AISecretUpdateParams
- type APIKey
- type APIKeyListParams
- type APIKeyListParamsIDsUnion
- type APIKeyNewParams
- type APIKeyService
- func (r *APIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *shared.APIKey, err error)
- func (r *APIKeyService) Get(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *shared.APIKey, err error)
- func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.APIKey], err error)
- func (r *APIKeyService) ListAutoPaging(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.APIKey]
- func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *shared.CreateAPIKeyOutput, err error)
- type ChatCompletionContentPartImage
- type ChatCompletionContentPartImageImageURL
- type ChatCompletionContentPartImageImageURLDetail
- type ChatCompletionContentPartImageImageURLParam
- type ChatCompletionContentPartImageParam
- type ChatCompletionContentPartImageType
- type ChatCompletionContentPartText
- type ChatCompletionContentPartTextParam
- type ChatCompletionContentPartTextType
- type ChatCompletionMessageToolCall
- type ChatCompletionMessageToolCallFunction
- type ChatCompletionMessageToolCallFunctionParam
- type ChatCompletionMessageToolCallParam
- type ChatCompletionMessageToolCallType
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CodeBundle
- type CodeBundleLocationExperiment
- type CodeBundleLocationExperimentParam
- type CodeBundleLocationExperimentPositionScorer
- type CodeBundleLocationExperimentPositionScorerParam
- type CodeBundleLocationExperimentPositionType
- type CodeBundleLocationExperimentPositionTypeParam
- type CodeBundleLocationExperimentPositionUnion
- type CodeBundleLocationExperimentPositionUnionParam
- type CodeBundleLocationFunction
- type CodeBundleLocationFunctionParam
- type CodeBundleLocationUnion
- type CodeBundleLocationUnionParam
- type CodeBundleParam
- type CodeBundleRuntimeContext
- type CodeBundleRuntimeContextParam
- type CreateAPIKeyOutput
- type DataSummary
- type Dataset
- type DatasetEvent
- type DatasetEventMetadata
- type DatasetFeedbackParams
- type DatasetFetchParams
- type DatasetFetchPostParams
- type DatasetInsertParams
- type DatasetListParams
- type DatasetListParamsIDsUnion
- type DatasetNewParams
- type DatasetService
- func (r *DatasetService) Delete(ctx context.Context, datasetID string, opts ...option.RequestOption) (res *shared.Dataset, err error)
- func (r *DatasetService) Feedback(ctx context.Context, datasetID string, body DatasetFeedbackParams, ...) (res *shared.FeedbackResponseSchema, err error)
- func (r *DatasetService) Fetch(ctx context.Context, datasetID string, query DatasetFetchParams, ...) (res *shared.FetchDatasetEventsResponse, err error)
- func (r *DatasetService) FetchPost(ctx context.Context, datasetID string, body DatasetFetchPostParams, ...) (res *shared.FetchDatasetEventsResponse, err error)
- func (r *DatasetService) Get(ctx context.Context, datasetID string, opts ...option.RequestOption) (res *shared.Dataset, err error)
- func (r *DatasetService) Insert(ctx context.Context, datasetID string, body DatasetInsertParams, ...) (res *shared.InsertEventsResponse, err error)
- func (r *DatasetService) List(ctx context.Context, query DatasetListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Dataset], err error)
- func (r *DatasetService) ListAutoPaging(ctx context.Context, query DatasetListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Dataset]
- func (r *DatasetService) New(ctx context.Context, body DatasetNewParams, opts ...option.RequestOption) (res *shared.Dataset, err error)
- func (r *DatasetService) Summarize(ctx context.Context, datasetID string, query DatasetSummarizeParams, ...) (res *shared.SummarizeDatasetResponse, err error)
- func (r *DatasetService) Update(ctx context.Context, datasetID string, body DatasetUpdateParams, ...) (res *shared.Dataset, err error)
- type DatasetSummarizeParams
- type DatasetUpdateParams
- type EnvVar
- type EnvVarListParams
- type EnvVarListParamsIDsUnion
- type EnvVarListResponse
- type EnvVarNewParams
- type EnvVarNewParamsObjectType
- type EnvVarObjectType
- type EnvVarReplaceParams
- type EnvVarReplaceParamsObjectType
- type EnvVarService
- func (r *EnvVarService) Delete(ctx context.Context, envVarID string, opts ...option.RequestOption) (res *shared.EnvVar, err error)
- func (r *EnvVarService) Get(ctx context.Context, envVarID string, opts ...option.RequestOption) (res *shared.EnvVar, err error)
- func (r *EnvVarService) List(ctx context.Context, query EnvVarListParams, opts ...option.RequestOption) (res *EnvVarListResponse, err error)
- func (r *EnvVarService) New(ctx context.Context, body EnvVarNewParams, opts ...option.RequestOption) (res *shared.EnvVar, err error)
- func (r *EnvVarService) Replace(ctx context.Context, body EnvVarReplaceParams, opts ...option.RequestOption) (res *shared.EnvVar, err error)
- func (r *EnvVarService) Update(ctx context.Context, envVarID string, body EnvVarUpdateParams, ...) (res *shared.EnvVar, err error)
- type EnvVarUpdateParams
- type Error
- type EvalNewParams
- type EvalNewParamsDataDatasetID
- type EvalNewParamsDataDatasetRows
- type EvalNewParamsDataProjectDatasetName
- type EvalNewParamsDataUnion
- func (u EvalNewParamsDataUnion) GetData() []any
- func (u EvalNewParamsDataUnion) GetDatasetID() *string
- func (u EvalNewParamsDataUnion) GetDatasetName() *string
- func (u EvalNewParamsDataUnion) GetInternalBtql() map[string]any
- func (u EvalNewParamsDataUnion) GetProjectName() *string
- func (u EvalNewParamsDataUnion) MarshalJSON() ([]byte, error)
- func (u *EvalNewParamsDataUnion) UnmarshalJSON(data []byte) error
- type EvalNewParamsGitMetadataSettings
- type EvalNewParamsParentSpanParentStruct
- type EvalNewParamsParentSpanParentStructRowIDs
- type EvalNewParamsParentUnion
- type EvalNewParamsScoreFunctionID
- type EvalNewParamsScoreGlobalFunction
- type EvalNewParamsScoreInlineCode
- type EvalNewParamsScoreInlineCodeInlineContext
- type EvalNewParamsScoreInlinePrompt
- type EvalNewParamsScoreProjectSlug
- type EvalNewParamsScorePromptSessionID
- type EvalNewParamsScoreUnion
- func (u EvalNewParamsScoreUnion) GetCode() *string
- func (u EvalNewParamsScoreUnion) GetFunctionID() *string
- func (u EvalNewParamsScoreUnion) GetGlobalFunction() *string
- func (u EvalNewParamsScoreUnion) GetInlineContext() *EvalNewParamsScoreInlineCodeInlineContext
- func (u EvalNewParamsScoreUnion) GetInlinePrompt() *shared.PromptDataParam
- func (u EvalNewParamsScoreUnion) GetName() *string
- func (u EvalNewParamsScoreUnion) GetProjectName() *string
- func (u EvalNewParamsScoreUnion) GetPromptSessionFunctionID() *string
- func (u EvalNewParamsScoreUnion) GetPromptSessionID() *string
- func (u EvalNewParamsScoreUnion) GetSlug() *string
- func (u EvalNewParamsScoreUnion) GetVersion() *string
- func (u EvalNewParamsScoreUnion) MarshalJSON() ([]byte, error)
- func (u *EvalNewParamsScoreUnion) UnmarshalJSON(data []byte) error
- type EvalNewParamsTaskFunctionID
- type EvalNewParamsTaskGlobalFunction
- type EvalNewParamsTaskInlineCode
- type EvalNewParamsTaskInlineCodeInlineContext
- type EvalNewParamsTaskInlinePrompt
- type EvalNewParamsTaskProjectSlug
- type EvalNewParamsTaskPromptSessionID
- type EvalNewParamsTaskUnion
- func (u EvalNewParamsTaskUnion) GetCode() *string
- func (u EvalNewParamsTaskUnion) GetFunctionID() *string
- func (u EvalNewParamsTaskUnion) GetGlobalFunction() *string
- func (u EvalNewParamsTaskUnion) GetInlineContext() *EvalNewParamsTaskInlineCodeInlineContext
- func (u EvalNewParamsTaskUnion) GetInlinePrompt() *shared.PromptDataParam
- func (u EvalNewParamsTaskUnion) GetName() *string
- func (u EvalNewParamsTaskUnion) GetProjectName() *string
- func (u EvalNewParamsTaskUnion) GetPromptSessionFunctionID() *string
- func (u EvalNewParamsTaskUnion) GetPromptSessionID() *string
- func (u EvalNewParamsTaskUnion) GetSlug() *string
- func (u EvalNewParamsTaskUnion) GetVersion() *string
- func (u EvalNewParamsTaskUnion) MarshalJSON() ([]byte, error)
- func (u *EvalNewParamsTaskUnion) UnmarshalJSON(data []byte) error
- type EvalService
- type Experiment
- type ExperimentEvent
- type ExperimentEventContext
- type ExperimentEventMetadata
- type ExperimentEventMetrics
- type ExperimentFeedbackParams
- type ExperimentFetchParams
- type ExperimentFetchPostParams
- type ExperimentInsertParams
- type ExperimentListParams
- type ExperimentListParamsIDsUnion
- type ExperimentNewParams
- type ExperimentService
- func (r *ExperimentService) Delete(ctx context.Context, experimentID string, opts ...option.RequestOption) (res *shared.Experiment, err error)
- func (r *ExperimentService) Feedback(ctx context.Context, experimentID string, body ExperimentFeedbackParams, ...) (res *shared.FeedbackResponseSchema, err error)
- func (r *ExperimentService) Fetch(ctx context.Context, experimentID string, query ExperimentFetchParams, ...) (res *shared.FetchExperimentEventsResponse, err error)
- func (r *ExperimentService) FetchPost(ctx context.Context, experimentID string, body ExperimentFetchPostParams, ...) (res *shared.FetchExperimentEventsResponse, err error)
- func (r *ExperimentService) Get(ctx context.Context, experimentID string, opts ...option.RequestOption) (res *shared.Experiment, err error)
- func (r *ExperimentService) Insert(ctx context.Context, experimentID string, body ExperimentInsertParams, ...) (res *shared.InsertEventsResponse, err error)
- func (r *ExperimentService) List(ctx context.Context, query ExperimentListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Experiment], err error)
- func (r *ExperimentService) ListAutoPaging(ctx context.Context, query ExperimentListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Experiment]
- func (r *ExperimentService) New(ctx context.Context, body ExperimentNewParams, opts ...option.RequestOption) (res *shared.Experiment, err error)
- func (r *ExperimentService) Summarize(ctx context.Context, experimentID string, query ExperimentSummarizeParams, ...) (res *shared.SummarizeExperimentResponse, err error)
- func (r *ExperimentService) Update(ctx context.Context, experimentID string, body ExperimentUpdateParams, ...) (res *shared.Experiment, err error)
- type ExperimentSummarizeParams
- type ExperimentUpdateParams
- type FeedbackDatasetItemParam
- type FeedbackDatasetItemSource
- type FeedbackExperimentItemParam
- type FeedbackExperimentItemSource
- type FeedbackProjectLogsItemParam
- type FeedbackProjectLogsItemSource
- type FeedbackResponseSchema
- type FeedbackResponseSchemaStatus
- type FetchDatasetEventsResponse
- type FetchExperimentEventsResponse
- type FetchProjectLogsEventsResponse
- type Function
- type FunctionFunctionDataCode
- type FunctionFunctionDataCodeDataBundle
- type FunctionFunctionDataCodeDataInline
- type FunctionFunctionDataCodeDataInlineRuntimeContext
- type FunctionFunctionDataCodeDataUnion
- type FunctionFunctionDataGlobal
- type FunctionFunctionDataPrompt
- type FunctionFunctionDataUnion
- type FunctionFunctionSchema
- type FunctionFunctionType
- type FunctionInvokeParams
- type FunctionInvokeParamsMessageAssistant
- type FunctionInvokeParamsMessageAssistantFunctionCall
- type FunctionInvokeParamsMessageFallback
- type FunctionInvokeParamsMessageFunction
- type FunctionInvokeParamsMessageSystem
- type FunctionInvokeParamsMessageTool
- type FunctionInvokeParamsMessageUnion
- func (u FunctionInvokeParamsMessageUnion) GetContent() (res functionInvokeParamsMessageUnionContent)
- func (u FunctionInvokeParamsMessageUnion) GetFunctionCall() *FunctionInvokeParamsMessageAssistantFunctionCall
- func (u FunctionInvokeParamsMessageUnion) GetName() *string
- func (u FunctionInvokeParamsMessageUnion) GetRole() *string
- func (u FunctionInvokeParamsMessageUnion) GetToolCallID() *string
- func (u FunctionInvokeParamsMessageUnion) GetToolCalls() []shared.ChatCompletionMessageToolCallParam
- func (u FunctionInvokeParamsMessageUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionInvokeParamsMessageUnion) UnmarshalJSON(data []byte) error
- type FunctionInvokeParamsMessageUser
- type FunctionInvokeParamsMessageUserContentArrayItemUnion
- func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) GetImageURL() *shared.ChatCompletionContentPartImageImageURLParam
- func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) GetText() *string
- func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) GetType() *string
- func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionInvokeParamsMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
- type FunctionInvokeParamsMessageUserContentUnion
- type FunctionInvokeParamsMode
- type FunctionInvokeParamsParentSpanParentStruct
- type FunctionInvokeParamsParentSpanParentStructRowIDs
- type FunctionInvokeParamsParentUnion
- type FunctionInvokeResponse
- type FunctionListParams
- type FunctionListParamsIDsUnion
- type FunctionLogID
- type FunctionNewParams
- type FunctionNewParamsFunctionDataCode
- type FunctionNewParamsFunctionDataCodeDataBundle
- type FunctionNewParamsFunctionDataCodeDataInline
- type FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext
- type FunctionNewParamsFunctionDataCodeDataUnion
- func (u FunctionNewParamsFunctionDataCodeDataUnion) GetBundleID() *string
- func (u FunctionNewParamsFunctionDataCodeDataUnion) GetCode() *string
- func (u FunctionNewParamsFunctionDataCodeDataUnion) GetLocation() *shared.CodeBundleLocationUnionParam
- func (u FunctionNewParamsFunctionDataCodeDataUnion) GetPreview() *string
- func (u FunctionNewParamsFunctionDataCodeDataUnion) GetRuntimeContext() (res functionNewParamsFunctionDataCodeDataUnionRuntimeContext)
- func (u FunctionNewParamsFunctionDataCodeDataUnion) GetType() *string
- func (u FunctionNewParamsFunctionDataCodeDataUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionNewParamsFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
- type FunctionNewParamsFunctionDataGlobal
- type FunctionNewParamsFunctionDataPrompt
- type FunctionNewParamsFunctionDataUnion
- func (u FunctionNewParamsFunctionDataUnion) GetData() *FunctionNewParamsFunctionDataCodeDataUnion
- func (u FunctionNewParamsFunctionDataUnion) GetName() *string
- func (u FunctionNewParamsFunctionDataUnion) GetType() *string
- func (u FunctionNewParamsFunctionDataUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionNewParamsFunctionDataUnion) UnmarshalJSON(data []byte) error
- type FunctionNewParamsFunctionSchema
- type FunctionNewParamsFunctionType
- type FunctionNewParamsOrigin
- type FunctionOrigin
- type FunctionReplaceParams
- type FunctionReplaceParamsFunctionDataCode
- type FunctionReplaceParamsFunctionDataCodeDataBundle
- type FunctionReplaceParamsFunctionDataCodeDataInline
- type FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext
- type FunctionReplaceParamsFunctionDataCodeDataUnion
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetBundleID() *string
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetCode() *string
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetLocation() *shared.CodeBundleLocationUnionParam
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetPreview() *string
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetRuntimeContext() (res functionReplaceParamsFunctionDataCodeDataUnionRuntimeContext)
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetType() *string
- func (u FunctionReplaceParamsFunctionDataCodeDataUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionReplaceParamsFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
- type FunctionReplaceParamsFunctionDataGlobal
- type FunctionReplaceParamsFunctionDataPrompt
- type FunctionReplaceParamsFunctionDataUnion
- func (u FunctionReplaceParamsFunctionDataUnion) GetData() *FunctionReplaceParamsFunctionDataCodeDataUnion
- func (u FunctionReplaceParamsFunctionDataUnion) GetName() *string
- func (u FunctionReplaceParamsFunctionDataUnion) GetType() *string
- func (u FunctionReplaceParamsFunctionDataUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionReplaceParamsFunctionDataUnion) UnmarshalJSON(data []byte) error
- type FunctionReplaceParamsFunctionSchema
- type FunctionReplaceParamsFunctionType
- type FunctionReplaceParamsOrigin
- type FunctionService
- func (r *FunctionService) Delete(ctx context.Context, functionID string, opts ...option.RequestOption) (res *shared.Function, err error)
- func (r *FunctionService) Get(ctx context.Context, functionID string, opts ...option.RequestOption) (res *shared.Function, err error)
- func (r *FunctionService) Invoke(ctx context.Context, functionID string, body FunctionInvokeParams, ...) (res *FunctionInvokeResponse, err error)
- func (r *FunctionService) List(ctx context.Context, query FunctionListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Function], err error)
- func (r *FunctionService) ListAutoPaging(ctx context.Context, query FunctionListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Function]
- func (r *FunctionService) New(ctx context.Context, body FunctionNewParams, opts ...option.RequestOption) (res *shared.Function, err error)
- func (r *FunctionService) Replace(ctx context.Context, body FunctionReplaceParams, opts ...option.RequestOption) (res *shared.Function, err error)
- func (r *FunctionService) Update(ctx context.Context, functionID string, body FunctionUpdateParams, ...) (res *shared.Function, err error)
- type FunctionUpdateParams
- type FunctionUpdateParamsFunctionDataCode
- type FunctionUpdateParamsFunctionDataCodeDataBundle
- type FunctionUpdateParamsFunctionDataCodeDataInline
- type FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext
- type FunctionUpdateParamsFunctionDataCodeDataUnion
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetBundleID() *string
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetCode() *string
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetLocation() *shared.CodeBundleLocationUnionParam
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetPreview() *string
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetRuntimeContext() (res functionUpdateParamsFunctionDataCodeDataUnionRuntimeContext)
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetType() *string
- func (u FunctionUpdateParamsFunctionDataCodeDataUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionUpdateParamsFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
- type FunctionUpdateParamsFunctionDataGlobal
- type FunctionUpdateParamsFunctionDataPrompt
- type FunctionUpdateParamsFunctionDataUnion
- func (u FunctionUpdateParamsFunctionDataUnion) GetData() *FunctionUpdateParamsFunctionDataCodeDataUnion
- func (u FunctionUpdateParamsFunctionDataUnion) GetName() *string
- func (u FunctionUpdateParamsFunctionDataUnion) GetType() *string
- func (u FunctionUpdateParamsFunctionDataUnion) MarshalJSON() ([]byte, error)
- func (u *FunctionUpdateParamsFunctionDataUnion) UnmarshalJSON(data []byte) error
- type Group
- type GroupListParams
- type GroupListParamsIDsUnion
- type GroupNewParams
- type GroupReplaceParams
- type GroupService
- func (r *GroupService) Delete(ctx context.Context, groupID string, opts ...option.RequestOption) (res *shared.Group, err error)
- func (r *GroupService) Get(ctx context.Context, groupID string, opts ...option.RequestOption) (res *shared.Group, err error)
- func (r *GroupService) List(ctx context.Context, query GroupListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Group], err error)
- func (r *GroupService) ListAutoPaging(ctx context.Context, query GroupListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Group]
- func (r *GroupService) New(ctx context.Context, body GroupNewParams, opts ...option.RequestOption) (res *shared.Group, err error)
- func (r *GroupService) Replace(ctx context.Context, body GroupReplaceParams, opts ...option.RequestOption) (res *shared.Group, err error)
- func (r *GroupService) Update(ctx context.Context, groupID string, body GroupUpdateParams, ...) (res *shared.Group, err error)
- type GroupUpdateParams
- type InsertDatasetEventMetadataParam
- type InsertDatasetEventParam
- type InsertEventsResponse
- type InsertExperimentEventContextParam
- type InsertExperimentEventMetadataParam
- type InsertExperimentEventMetricsParam
- type InsertExperimentEventParam
- type InsertProjectLogsEventContextParam
- type InsertProjectLogsEventMetadataParam
- type InsertProjectLogsEventMetricsParam
- type InsertProjectLogsEventParam
- type MetricSummary
- type ObjectReference
- type ObjectReferenceObjectType
- type ObjectReferenceParam
- type OnlineScoreConfig
- type OnlineScoreConfigParam
- type OnlineScoreConfigScorerFunction
- type OnlineScoreConfigScorerFunctionParam
- type OnlineScoreConfigScorerGlobal
- type OnlineScoreConfigScorerGlobalParam
- type OnlineScoreConfigScorerUnion
- type OnlineScoreConfigScorerUnionParam
- type Organization
- type OrganizationListParams
- type OrganizationListParamsIDsUnion
- type OrganizationMemberService
- type OrganizationMemberUpdateParams
- type OrganizationMemberUpdateParamsInviteUsers
- type OrganizationMemberUpdateParamsRemoveUsers
- type OrganizationService
- func (r *OrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *shared.Organization, err error)
- func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *shared.Organization, err error)
- func (r *OrganizationService) List(ctx context.Context, query OrganizationListParams, ...) (res *pagination.ListObjects[shared.Organization], err error)
- func (r *OrganizationService) ListAutoPaging(ctx context.Context, query OrganizationListParams, ...) *pagination.ListObjectsAutoPager[shared.Organization]
- func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, ...) (res *shared.Organization, err error)
- type OrganizationUpdateParams
- type PatchOrganizationMembersOutput
- type PatchOrganizationMembersOutputStatus
- type Permission
- type Project
- type ProjectListParams
- type ProjectListParamsIDsUnion
- type ProjectLogFeedbackParams
- type ProjectLogFetchParams
- type ProjectLogFetchPostParams
- type ProjectLogInsertParams
- type ProjectLogService
- func (r *ProjectLogService) Feedback(ctx context.Context, projectID string, body ProjectLogFeedbackParams, ...) (res *shared.FeedbackResponseSchema, err error)
- func (r *ProjectLogService) Fetch(ctx context.Context, projectID string, query ProjectLogFetchParams, ...) (res *shared.FetchProjectLogsEventsResponse, err error)
- func (r *ProjectLogService) FetchPost(ctx context.Context, projectID string, body ProjectLogFetchPostParams, ...) (res *shared.FetchProjectLogsEventsResponse, err error)
- func (r *ProjectLogService) Insert(ctx context.Context, projectID string, body ProjectLogInsertParams, ...) (res *shared.InsertEventsResponse, err error)
- type ProjectLogsEvent
- type ProjectLogsEventContext
- type ProjectLogsEventLogID
- type ProjectLogsEventMetadata
- type ProjectLogsEventMetrics
- type ProjectNewParams
- type ProjectScore
- type ProjectScoreCategoriesUnion
- type ProjectScoreCategory
- type ProjectScoreCategoryParam
- type ProjectScoreConfig
- type ProjectScoreConfigParam
- type ProjectScoreListParams
- type ProjectScoreListParamsIDsUnion
- type ProjectScoreListParamsScoreTypeUnion
- type ProjectScoreNewParams
- type ProjectScoreNewParamsCategoriesUnion
- type ProjectScoreReplaceParams
- type ProjectScoreReplaceParamsCategoriesUnion
- type ProjectScoreService
- func (r *ProjectScoreService) Delete(ctx context.Context, projectScoreID string, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
- func (r *ProjectScoreService) Get(ctx context.Context, projectScoreID string, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
- func (r *ProjectScoreService) List(ctx context.Context, query ProjectScoreListParams, ...) (res *pagination.ListObjects[shared.ProjectScore], err error)
- func (r *ProjectScoreService) ListAutoPaging(ctx context.Context, query ProjectScoreListParams, ...) *pagination.ListObjectsAutoPager[shared.ProjectScore]
- func (r *ProjectScoreService) New(ctx context.Context, body ProjectScoreNewParams, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
- func (r *ProjectScoreService) Replace(ctx context.Context, body ProjectScoreReplaceParams, ...) (res *shared.ProjectScore, err error)
- func (r *ProjectScoreService) Update(ctx context.Context, projectScoreID string, body ProjectScoreUpdateParams, ...) (res *shared.ProjectScore, err error)
- type ProjectScoreType
- type ProjectScoreUpdateParams
- type ProjectScoreUpdateParamsCategoriesUnion
- type ProjectService
- func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (res *shared.Project, err error)
- func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *shared.Project, err error)
- func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Project], err error)
- func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Project]
- func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *shared.Project, err error)
- func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, ...) (res *shared.Project, err error)
- type ProjectSettings
- type ProjectSettingsParam
- type ProjectSettingsSpanFieldOrder
- type ProjectSettingsSpanFieldOrderLayout
- type ProjectSettingsSpanFieldOrderParam
- type ProjectTag
- type ProjectTagListParams
- type ProjectTagListParamsIDsUnion
- type ProjectTagNewParams
- type ProjectTagReplaceParams
- type ProjectTagService
- func (r *ProjectTagService) Delete(ctx context.Context, projectTagID string, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
- func (r *ProjectTagService) Get(ctx context.Context, projectTagID string, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
- func (r *ProjectTagService) List(ctx context.Context, query ProjectTagListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.ProjectTag], err error)
- func (r *ProjectTagService) ListAutoPaging(ctx context.Context, query ProjectTagListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.ProjectTag]
- func (r *ProjectTagService) New(ctx context.Context, body ProjectTagNewParams, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
- func (r *ProjectTagService) Replace(ctx context.Context, body ProjectTagReplaceParams, ...) (res *shared.ProjectTag, err error)
- func (r *ProjectTagService) Update(ctx context.Context, projectTagID string, body ProjectTagUpdateParams, ...) (res *shared.ProjectTag, err error)
- type ProjectTagUpdateParams
- type ProjectUpdateParams
- type Prompt
- type PromptData
- type PromptDataOrigin
- type PromptDataOriginParam
- type PromptDataParam
- type PromptDataParser
- type PromptDataParserParam
- type PromptDataPromptChat
- type PromptDataPromptChatMessageAssistant
- type PromptDataPromptChatMessageAssistantFunctionCall
- type PromptDataPromptChatMessageAssistantFunctionCallParam
- type PromptDataPromptChatMessageAssistantParam
- type PromptDataPromptChatMessageFallback
- type PromptDataPromptChatMessageFallbackParam
- type PromptDataPromptChatMessageFunction
- type PromptDataPromptChatMessageFunctionParam
- type PromptDataPromptChatMessageSystem
- type PromptDataPromptChatMessageSystemParam
- type PromptDataPromptChatMessageTool
- type PromptDataPromptChatMessageToolParam
- type PromptDataPromptChatMessageUnion
- type PromptDataPromptChatMessageUnionParam
- type PromptDataPromptChatMessageUser
- type PromptDataPromptChatMessageUserContentArrayItemUnion
- type PromptDataPromptChatMessageUserContentArrayItemUnionParam
- type PromptDataPromptChatMessageUserContentUnion
- type PromptDataPromptChatMessageUserContentUnionParam
- type PromptDataPromptChatMessageUserParam
- type PromptDataPromptChatParam
- type PromptDataPromptCompletion
- type PromptDataPromptCompletionParam
- type PromptDataPromptUnion
- type PromptDataPromptUnionParam
- type PromptDataToolFunctionFunction
- type PromptDataToolFunctionFunctionParam
- type PromptDataToolFunctionGlobal
- type PromptDataToolFunctionGlobalParam
- type PromptDataToolFunctionUnion
- type PromptDataToolFunctionUnionParam
- type PromptFunctionType
- type PromptListParams
- type PromptListParamsIDsUnion
- type PromptLogID
- type PromptNewParams
- type PromptNewParamsFunctionType
- type PromptOptions
- type PromptOptionsParam
- type PromptOptionsParamsAnthropicModelParams
- type PromptOptionsParamsAnthropicModelParamsParam
- type PromptOptionsParamsGoogleModelParams
- type PromptOptionsParamsGoogleModelParamsParam
- type PromptOptionsParamsJsCompletionParams
- type PromptOptionsParamsJsCompletionParamsParam
- type PromptOptionsParamsOpenAIModelParams
- type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction
- type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam
- type PromptOptionsParamsOpenAIModelParamsFunctionCallString
- type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion
- type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam
- type PromptOptionsParamsOpenAIModelParamsParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatText
- type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam
- type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion
- type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam
- type PromptOptionsParamsOpenAIModelParamsToolChoiceString
- type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion
- type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam
- type PromptOptionsParamsUnion
- type PromptOptionsParamsUnionParam
- type PromptOptionsParamsWindowAIModelParams
- type PromptOptionsParamsWindowAIModelParamsParam
- type PromptReplaceParams
- type PromptReplaceParamsFunctionType
- type PromptService
- func (r *PromptService) Delete(ctx context.Context, promptID string, opts ...option.RequestOption) (res *shared.Prompt, err error)
- func (r *PromptService) Get(ctx context.Context, promptID string, opts ...option.RequestOption) (res *shared.Prompt, err error)
- func (r *PromptService) List(ctx context.Context, query PromptListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Prompt], err error)
- func (r *PromptService) ListAutoPaging(ctx context.Context, query PromptListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Prompt]
- func (r *PromptService) New(ctx context.Context, body PromptNewParams, opts ...option.RequestOption) (res *shared.Prompt, err error)
- func (r *PromptService) Replace(ctx context.Context, body PromptReplaceParams, opts ...option.RequestOption) (res *shared.Prompt, err error)
- func (r *PromptService) Update(ctx context.Context, promptID string, body PromptUpdateParams, ...) (res *shared.Prompt, err error)
- type PromptUpdateParams
- type RepoInfo
- type RepoInfoParam
- type Role
- type RoleListParams
- type RoleListParamsIDsUnion
- type RoleMemberPermission
- type RoleNewParams
- type RoleNewParamsMemberPermission
- type RoleReplaceParams
- type RoleReplaceParamsMemberPermission
- type RoleService
- func (r *RoleService) Delete(ctx context.Context, roleID string, opts ...option.RequestOption) (res *shared.Role, err error)
- func (r *RoleService) Get(ctx context.Context, roleID string, opts ...option.RequestOption) (res *shared.Role, err error)
- func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Role], err error)
- func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Role]
- func (r *RoleService) New(ctx context.Context, body RoleNewParams, opts ...option.RequestOption) (res *shared.Role, err error)
- func (r *RoleService) Replace(ctx context.Context, body RoleReplaceParams, opts ...option.RequestOption) (res *shared.Role, err error)
- func (r *RoleService) Update(ctx context.Context, roleID string, body RoleUpdateParams, ...) (res *shared.Role, err error)
- type RoleUpdateParams
- type RoleUpdateParamsAddMemberPermission
- type RoleUpdateParamsRemoveMemberPermission
- type ScoreSummary
- type SpanAttributes
- type SpanAttributesParam
- type SpanIFrame
- type SpanIframeListParams
- type SpanIframeListParamsIDsUnion
- type SpanIframeNewParams
- type SpanIframeReplaceParams
- type SpanIframeService
- func (r *SpanIframeService) Delete(ctx context.Context, spanIframeID string, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
- func (r *SpanIframeService) Get(ctx context.Context, spanIframeID string, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
- func (r *SpanIframeService) List(ctx context.Context, query SpanIframeListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.SpanIFrame], err error)
- func (r *SpanIframeService) ListAutoPaging(ctx context.Context, query SpanIframeListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.SpanIFrame]
- func (r *SpanIframeService) New(ctx context.Context, body SpanIframeNewParams, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
- func (r *SpanIframeService) Replace(ctx context.Context, body SpanIframeReplaceParams, ...) (res *shared.SpanIFrame, err error)
- func (r *SpanIframeService) Update(ctx context.Context, spanIframeID string, body SpanIframeUpdateParams, ...) (res *shared.SpanIFrame, err error)
- type SpanIframeUpdateParams
- type SpanType
- type SummarizeDatasetResponse
- type SummarizeExperimentResponse
- type TopLevelService
- type User
- type UserListParams
- type UserListParamsEmailUnion
- type UserListParamsFamilyNameUnion
- type UserListParamsGivenNameUnion
- type UserListParamsIDsUnion
- type UserService
- func (r *UserService) Get(ctx context.Context, userID string, opts ...option.RequestOption) (res *shared.User, err error)
- func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.User], err error)
- func (r *UserService) ListAutoPaging(ctx context.Context, query UserListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.User]
- type View
- type ViewData
- type ViewDataParam
- type ViewDataSearch
- type ViewDataSearchParam
- type ViewDeleteParams
- type ViewGetParams
- type ViewListParams
- type ViewListParamsIDsUnion
- type ViewNewParams
- type ViewNewParamsViewType
- type ViewOptions
- type ViewOptionsParam
- type ViewReplaceParams
- type ViewReplaceParamsViewType
- type ViewService
- func (r *ViewService) Delete(ctx context.Context, viewID string, body ViewDeleteParams, ...) (res *shared.View, err error)
- func (r *ViewService) Get(ctx context.Context, viewID string, query ViewGetParams, ...) (res *shared.View, err error)
- func (r *ViewService) List(ctx context.Context, query ViewListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.View], err error)
- func (r *ViewService) ListAutoPaging(ctx context.Context, query ViewListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.View]
- func (r *ViewService) New(ctx context.Context, body ViewNewParams, opts ...option.RequestOption) (res *shared.View, err error)
- func (r *ViewService) Replace(ctx context.Context, body ViewReplaceParams, opts ...option.RequestOption) (res *shared.View, err error)
- func (r *ViewService) Update(ctx context.Context, viewID string, body ViewUpdateParams, ...) (res *shared.View, err error)
- type ViewType
- type ViewUpdateParams
- type ViewUpdateParamsViewType
- type ViewViewType
Constants ¶
const ACLObjectTypeDataset = shared.ACLObjectTypeDataset
Equals "dataset"
const ACLObjectTypeExperiment = shared.ACLObjectTypeExperiment
Equals "experiment"
const ACLObjectTypeGroup = shared.ACLObjectTypeGroup
Equals "group"
const ACLObjectTypeOrgMember = shared.ACLObjectTypeOrgMember
Equals "org_member"
const ACLObjectTypeOrgProject = shared.ACLObjectTypeOrgProject
Equals "org_project"
const ACLObjectTypeOrganization = shared.ACLObjectTypeOrganization
Equals "organization"
const ACLObjectTypeProject = shared.ACLObjectTypeProject
Equals "project"
const ACLObjectTypeProjectLog = shared.ACLObjectTypeProjectLog
Equals "project_log"
const ACLObjectTypePrompt = shared.ACLObjectTypePrompt
Equals "prompt"
const ACLObjectTypePromptSession = shared.ACLObjectTypePromptSession
Equals "prompt_session"
const ACLObjectTypeRole = shared.ACLObjectTypeRole
Equals "role"
const ChatCompletionContentPartImageImageURLDetailAuto = shared.ChatCompletionContentPartImageImageURLDetailAuto
Equals "auto"
const ChatCompletionContentPartImageImageURLDetailHigh = shared.ChatCompletionContentPartImageImageURLDetailHigh
Equals "high"
const ChatCompletionContentPartImageImageURLDetailLow = shared.ChatCompletionContentPartImageImageURLDetailLow
Equals "low"
const ChatCompletionContentPartImageTypeImageURL = shared.ChatCompletionContentPartImageTypeImageURL
Equals "image_url"
const ChatCompletionContentPartTextTypeText = shared.ChatCompletionContentPartTextTypeText
Equals "text"
const ChatCompletionMessageToolCallTypeFunction = shared.ChatCompletionMessageToolCallTypeFunction
Equals "function"
const EnvVarObjectTypeFunction = shared.EnvVarObjectTypeFunction
Equals "function"
const EnvVarObjectTypeOrganization = shared.EnvVarObjectTypeOrganization
Equals "organization"
const EnvVarObjectTypeProject = shared.EnvVarObjectTypeProject
Equals "project"
const FeedbackDatasetItemSourceAPI = shared.FeedbackDatasetItemSourceAPI
Equals "api"
const FeedbackDatasetItemSourceApp = shared.FeedbackDatasetItemSourceApp
Equals "app"
const FeedbackDatasetItemSourceExternal = shared.FeedbackDatasetItemSourceExternal
Equals "external"
const FeedbackExperimentItemSourceAPI = shared.FeedbackExperimentItemSourceAPI
Equals "api"
const FeedbackExperimentItemSourceApp = shared.FeedbackExperimentItemSourceApp
Equals "app"
const FeedbackExperimentItemSourceExternal = shared.FeedbackExperimentItemSourceExternal
Equals "external"
const FeedbackProjectLogsItemSourceAPI = shared.FeedbackProjectLogsItemSourceAPI
Equals "api"
const FeedbackProjectLogsItemSourceApp = shared.FeedbackProjectLogsItemSourceApp
Equals "app"
const FeedbackProjectLogsItemSourceExternal = shared.FeedbackProjectLogsItemSourceExternal
Equals "external"
const FeedbackResponseSchemaStatusSuccess = shared.FeedbackResponseSchemaStatusSuccess
Equals "success"
const FunctionFunctionTypeLlm = shared.FunctionFunctionTypeLlm
Equals "llm"
const FunctionFunctionTypeScorer = shared.FunctionFunctionTypeScorer
Equals "scorer"
const FunctionFunctionTypeTask = shared.FunctionFunctionTypeTask
Equals "task"
const FunctionFunctionTypeTool = shared.FunctionFunctionTypeTool
Equals "tool"
const FunctionLogIDP = shared.FunctionLogIDP
Equals "p"
const ObjectReferenceObjectTypeDataset = shared.ObjectReferenceObjectTypeDataset
Equals "dataset"
const ObjectReferenceObjectTypeExperiment = shared.ObjectReferenceObjectTypeExperiment
Equals "experiment"
const ObjectReferenceObjectTypeFunction = shared.ObjectReferenceObjectTypeFunction
Equals "function"
const ObjectReferenceObjectTypeProjectLogs = shared.ObjectReferenceObjectTypeProjectLogs
Equals "project_logs"
const ObjectReferenceObjectTypePrompt = shared.ObjectReferenceObjectTypePrompt
Equals "prompt"
const ObjectReferenceObjectTypePromptSession = shared.ObjectReferenceObjectTypePromptSession
Equals "prompt_session"
const PatchOrganizationMembersOutputStatusSuccess = shared.PatchOrganizationMembersOutputStatusSuccess
Equals "success"
const PermissionCreate = shared.PermissionCreate
Equals "create"
const PermissionCreateACLs = shared.PermissionCreateACLs
Equals "create_acls"
const PermissionDelete = shared.PermissionDelete
Equals "delete"
const PermissionDeleteACLs = shared.PermissionDeleteACLs
Equals "delete_acls"
const PermissionRead = shared.PermissionRead
Equals "read"
const PermissionReadACLs = shared.PermissionReadACLs
Equals "read_acls"
const PermissionUpdate = shared.PermissionUpdate
Equals "update"
const PermissionUpdateACLs = shared.PermissionUpdateACLs
Equals "update_acls"
const ProjectLogsEventLogIDG = shared.ProjectLogsEventLogIDG
Equals "g"
const ProjectScoreTypeCategorical = shared.ProjectScoreTypeCategorical
Equals "categorical"
const ProjectScoreTypeFreeForm = shared.ProjectScoreTypeFreeForm
Equals "free-form"
const ProjectScoreTypeMaximum = shared.ProjectScoreTypeMaximum
Equals "maximum"
const ProjectScoreTypeMinimum = shared.ProjectScoreTypeMinimum
Equals "minimum"
const ProjectScoreTypeOnline = shared.ProjectScoreTypeOnline
Equals "online"
const ProjectScoreTypeSlider = shared.ProjectScoreTypeSlider
Equals "slider"
const ProjectScoreTypeWeighted = shared.ProjectScoreTypeWeighted
Equals "weighted"
const ProjectSettingsSpanFieldOrderLayoutFull = shared.ProjectSettingsSpanFieldOrderLayoutFull
Equals "full"
const ProjectSettingsSpanFieldOrderLayoutTwoColumn = shared.ProjectSettingsSpanFieldOrderLayoutTwoColumn
Equals "two_column"
const PromptFunctionTypeLlm = shared.PromptFunctionTypeLlm
Equals "llm"
const PromptFunctionTypeScorer = shared.PromptFunctionTypeScorer
Equals "scorer"
const PromptFunctionTypeTask = shared.PromptFunctionTypeTask
Equals "task"
const PromptFunctionTypeTool = shared.PromptFunctionTypeTool
Equals "tool"
const PromptLogIDP = shared.PromptLogIDP
Equals "p"
const PromptOptionsParamsOpenAIModelParamsFunctionCallStringAuto = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallStringAuto
Equals "auto"
const PromptOptionsParamsOpenAIModelParamsFunctionCallStringNone = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallStringNone
Equals "none"
const PromptOptionsParamsOpenAIModelParamsToolChoiceStringAuto = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceStringAuto
Equals "auto"
const PromptOptionsParamsOpenAIModelParamsToolChoiceStringNone = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceStringNone
Equals "none"
const PromptOptionsParamsOpenAIModelParamsToolChoiceStringRequired = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceStringRequired
Equals "required"
const SpanTypeEval = shared.SpanTypeEval
Equals "eval"
const SpanTypeFunction = shared.SpanTypeFunction
Equals "function"
const SpanTypeLlm = shared.SpanTypeLlm
Equals "llm"
const SpanTypeScore = shared.SpanTypeScore
Equals "score"
const SpanTypeTask = shared.SpanTypeTask
Equals "task"
const SpanTypeTool = shared.SpanTypeTool
Equals "tool"
const ViewTypeDataset = shared.ViewTypeDataset
Equals "dataset"
const ViewTypeDatasets = shared.ViewTypeDatasets
Equals "datasets"
const ViewTypeExperiment = shared.ViewTypeExperiment
Equals "experiment"
const ViewTypeExperiments = shared.ViewTypeExperiments
Equals "experiments"
const ViewTypeLogs = shared.ViewTypeLogs
Equals "logs"
const ViewTypePlayground = shared.ViewTypePlayground
Equals "playground"
const ViewTypePlaygrounds = shared.ViewTypePlaygrounds
Equals "playgrounds"
const ViewTypeProjects = shared.ViewTypeProjects
Equals "projects"
const ViewTypePrompts = shared.ViewTypePrompts
Equals "prompts"
const ViewTypeScorers = shared.ViewTypeScorers
Equals "scorers"
const ViewTypeTools = shared.ViewTypeTools
Equals "tools"
const ViewViewTypeDataset = shared.ViewViewTypeDataset
Equals "dataset"
const ViewViewTypeDatasets = shared.ViewViewTypeDatasets
Equals "datasets"
const ViewViewTypeExperiment = shared.ViewViewTypeExperiment
Equals "experiment"
const ViewViewTypeExperiments = shared.ViewViewTypeExperiments
Equals "experiments"
const ViewViewTypeLogs = shared.ViewViewTypeLogs
Equals "logs"
const ViewViewTypePlayground = shared.ViewViewTypePlayground
Equals "playground"
const ViewViewTypePlaygrounds = shared.ViewViewTypePlaygrounds
Equals "playgrounds"
const ViewViewTypeProjects = shared.ViewViewTypeProjects
Equals "projects"
const ViewViewTypePrompts = shared.ViewViewTypePrompts
Equals "prompts"
const ViewViewTypeScorers = shared.ViewViewTypeScorers
Equals "scorers"
const ViewViewTypeTools = shared.ViewViewTypeTools
Equals "tools"
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶ added in v0.6.0
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (BRAINTRUST_API_KEY, BRAINTRUST_BASE_URL). This should be used to initialize new clients.
func Opt ¶ added in v0.8.0
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type ACL ¶ added in v0.2.0
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.
This is an alias to an internal type.
type ACLBatchUpdateParams ¶ added in v0.4.0
type ACLBatchUpdateParams struct { // An ACL grants a certain permission or role to a certain user or group on an // object. // // ACLs are inherited across the object hierarchy. So for example, if a user has // read permissions on a project, they will also have read permissions on any // experiment, dataset, etc. created within that project. // // To restrict a grant to a particular sub-object, you may specify // `restrict_object_type` in the ACL, as part of a direct permission grant or as // part of a role. AddACLs []ACLBatchUpdateParamsAddACL `json:"add_acls,omitzero"` // 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. RemoveACLs []ACLBatchUpdateParamsRemoveACL `json:"remove_acls,omitzero"` // contains filtered or unexported fields }
func (ACLBatchUpdateParams) MarshalJSON ¶ added in v0.4.0
func (r ACLBatchUpdateParams) MarshalJSON() (data []byte, err error)
func (*ACLBatchUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ACLBatchUpdateParams) UnmarshalJSON(data []byte) error
type ACLBatchUpdateParamsAddACL ¶ added in v0.4.0
type ACLBatchUpdateParamsAddACL struct { // The id of the object the ACL applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided GroupID param.Opt[string] `json:"group_id,omitzero" format:"uuid"` // Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be // provided RoleID param.Opt[string] `json:"role_id,omitzero" format:"uuid"` // Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Permission the ACL grants. Exactly one of `permission` and `role_id` will be // provided // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero"` // When setting a permission directly, optionally restricts the permission grant to // just the specified object type. Cannot be set alongside a `role_id`. // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
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.
The properties ObjectID, ObjectType are required.
func (ACLBatchUpdateParamsAddACL) MarshalJSON ¶ added in v0.4.0
func (r ACLBatchUpdateParamsAddACL) MarshalJSON() (data []byte, err error)
func (*ACLBatchUpdateParamsAddACL) UnmarshalJSON ¶ added in v0.8.0
func (r *ACLBatchUpdateParamsAddACL) UnmarshalJSON(data []byte) error
type ACLBatchUpdateParamsRemoveACL ¶ added in v0.4.0
type ACLBatchUpdateParamsRemoveACL struct { // The id of the object the ACL applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided GroupID param.Opt[string] `json:"group_id,omitzero" format:"uuid"` // Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be // provided RoleID param.Opt[string] `json:"role_id,omitzero" format:"uuid"` // Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Permission the ACL grants. Exactly one of `permission` and `role_id` will be // provided // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero"` // When setting a permission directly, optionally restricts the permission grant to // just the specified object type. Cannot be set alongside a `role_id`. // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
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.
The properties ObjectID, ObjectType are required.
func (ACLBatchUpdateParamsRemoveACL) MarshalJSON ¶ added in v0.4.0
func (r ACLBatchUpdateParamsRemoveACL) MarshalJSON() (data []byte, err error)
func (*ACLBatchUpdateParamsRemoveACL) UnmarshalJSON ¶ added in v0.8.0
func (r *ACLBatchUpdateParamsRemoveACL) UnmarshalJSON(data []byte) error
type ACLBatchUpdateResponse ¶ added in v0.4.0
type ACLBatchUpdateResponse = shared.ACLBatchUpdateResponse
This is an alias to an internal type.
type ACLFindAndDeleteParams ¶ added in v0.4.0
type ACLFindAndDeleteParams struct { // The id of the object the ACL applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided GroupID param.Opt[string] `json:"group_id,omitzero" format:"uuid"` // Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be // provided RoleID param.Opt[string] `json:"role_id,omitzero" format:"uuid"` // Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Permission the ACL grants. Exactly one of `permission` and `role_id` will be // provided // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero"` // When setting a permission directly, optionally restricts the permission grant to // just the specified object type. Cannot be set alongside a `role_id`. // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
func (ACLFindAndDeleteParams) MarshalJSON ¶ added in v0.4.0
func (r ACLFindAndDeleteParams) MarshalJSON() (data []byte, err error)
func (*ACLFindAndDeleteParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ACLFindAndDeleteParams) UnmarshalJSON(data []byte) error
type ACLListParams ¶ added in v0.2.0
type ACLListParams struct { // The id of the object the ACL applies to ObjectID string `query:"object_id,required" format:"uuid" json:"-"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `query:"object_type,omitzero,required" json:"-"` // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs ACLListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (ACLListParams) URLQuery ¶ added in v0.2.0
func (r ACLListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ACLListParams's query parameters as `url.Values`.
type ACLListParamsIDsUnion ¶ added in v0.2.0
type ACLListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ACLNewParams ¶ added in v0.2.0
type ACLNewParams struct { // The id of the object the ACL applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided GroupID param.Opt[string] `json:"group_id,omitzero" format:"uuid"` // Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be // provided RoleID param.Opt[string] `json:"role_id,omitzero" format:"uuid"` // Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will // be provided UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Permission the ACL grants. Exactly one of `permission` and `role_id` will be // provided // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero"` // When setting a permission directly, optionally restricts the permission grant to // just the specified object type. Cannot be set alongside a `role_id`. // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
func (ACLNewParams) MarshalJSON ¶ added in v0.2.0
func (r ACLNewParams) MarshalJSON() (data []byte, err error)
func (*ACLNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ACLNewParams) UnmarshalJSON(data []byte) error
type ACLObjectType ¶ added in v0.2.0
type ACLObjectType = shared.ACLObjectType
The object type that the ACL applies to
This is an alias to an internal type.
type ACLService ¶ added in v0.2.0
type ACLService struct {
Options []option.RequestOption
}
ACLService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewACLService method instead.
func NewACLService ¶ added in v0.2.0
func NewACLService(opts ...option.RequestOption) (r ACLService)
NewACLService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ACLService) BatchUpdate ¶ added in v0.4.0
func (r *ACLService) BatchUpdate(ctx context.Context, body ACLBatchUpdateParams, opts ...option.RequestOption) (res *shared.ACLBatchUpdateResponse, err error)
Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect.
func (*ACLService) Delete ¶ added in v0.2.0
func (r *ACLService) Delete(ctx context.Context, aclID string, opts ...option.RequestOption) (res *shared.ACL, err error)
Delete an acl object by its id
func (*ACLService) FindAndDelete ¶ added in v0.4.0
func (r *ACLService) FindAndDelete(ctx context.Context, body ACLFindAndDeleteParams, opts ...option.RequestOption) (res *shared.ACL, err error)
Delete a single acl
func (*ACLService) Get ¶ added in v0.2.0
func (r *ACLService) Get(ctx context.Context, aclID string, opts ...option.RequestOption) (res *shared.ACL, err error)
Get an acl object by its id
func (*ACLService) List ¶ added in v0.2.0
func (r *ACLService) List(ctx context.Context, query ACLListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.ACL], err error)
List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first
func (*ACLService) ListAutoPaging ¶ added in v0.2.0
func (r *ACLService) ListAutoPaging(ctx context.Context, query ACLListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.ACL]
List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first
func (*ACLService) New ¶ added in v0.2.0
func (r *ACLService) New(ctx context.Context, body ACLNewParams, opts ...option.RequestOption) (res *shared.ACL, err error)
Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified
type AISecretFindAndDeleteParams ¶ added in v0.4.0
type AISecretFindAndDeleteParams struct { // Name of the AI secret Name string `json:"name,required"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the AI Secret belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // contains filtered or unexported fields }
func (AISecretFindAndDeleteParams) MarshalJSON ¶ added in v0.4.0
func (r AISecretFindAndDeleteParams) MarshalJSON() (data []byte, err error)
func (*AISecretFindAndDeleteParams) UnmarshalJSON ¶ added in v0.8.0
func (r *AISecretFindAndDeleteParams) UnmarshalJSON(data []byte) error
type AISecretListParams ¶ added in v0.4.0
type AISecretListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Name of the ai_secret to search for AISecretName param.Opt[string] `query:"ai_secret_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` AISecretType AISecretListParamsAISecretTypeUnion `query:"ai_secret_type,omitzero" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs AISecretListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (AISecretListParams) URLQuery ¶ added in v0.4.0
func (r AISecretListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AISecretListParams's query parameters as `url.Values`.
type AISecretListParamsAISecretTypeUnion ¶ added in v0.4.0
type AISecretListParamsAISecretTypeUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type AISecretListParamsIDsUnion ¶ added in v0.4.0
type AISecretListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type AISecretNewParams ¶ added in v0.4.0
type AISecretNewParams struct { // Name of the AI secret Name string `json:"name,required"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the AI Secret belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // Secret value. If omitted in a PUT request, the existing secret value will be // left intact, not replaced with null. Secret param.Opt[string] `json:"secret,omitzero"` Type param.Opt[string] `json:"type,omitzero"` Metadata map[string]any `json:"metadata,omitzero"` // contains filtered or unexported fields }
func (AISecretNewParams) MarshalJSON ¶ added in v0.4.0
func (r AISecretNewParams) MarshalJSON() (data []byte, err error)
func (*AISecretNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *AISecretNewParams) UnmarshalJSON(data []byte) error
type AISecretReplaceParams ¶ added in v0.4.0
type AISecretReplaceParams struct { // Name of the AI secret Name string `json:"name,required"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the AI Secret belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // Secret value. If omitted in a PUT request, the existing secret value will be // left intact, not replaced with null. Secret param.Opt[string] `json:"secret,omitzero"` Type param.Opt[string] `json:"type,omitzero"` Metadata map[string]any `json:"metadata,omitzero"` // contains filtered or unexported fields }
func (AISecretReplaceParams) MarshalJSON ¶ added in v0.4.0
func (r AISecretReplaceParams) MarshalJSON() (data []byte, err error)
func (*AISecretReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *AISecretReplaceParams) UnmarshalJSON(data []byte) error
type AISecretService ¶ added in v0.4.0
type AISecretService struct {
Options []option.RequestOption
}
AISecretService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAISecretService method instead.
func NewAISecretService ¶ added in v0.4.0
func NewAISecretService(opts ...option.RequestOption) (r AISecretService)
NewAISecretService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AISecretService) Delete ¶ added in v0.4.0
func (r *AISecretService) Delete(ctx context.Context, aiSecretID string, opts ...option.RequestOption) (res *shared.AISecret, err error)
Delete an ai_secret object by its id
func (*AISecretService) FindAndDelete ¶ added in v0.4.0
func (r *AISecretService) FindAndDelete(ctx context.Context, body AISecretFindAndDeleteParams, opts ...option.RequestOption) (res *shared.AISecret, err error)
Delete a single ai_secret
func (*AISecretService) Get ¶ added in v0.4.0
func (r *AISecretService) Get(ctx context.Context, aiSecretID string, opts ...option.RequestOption) (res *shared.AISecret, err error)
Get an ai_secret object by its id
func (*AISecretService) List ¶ added in v0.4.0
func (r *AISecretService) List(ctx context.Context, query AISecretListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.AISecret], err error)
List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first
func (*AISecretService) ListAutoPaging ¶ added in v0.4.0
func (r *AISecretService) ListAutoPaging(ctx context.Context, query AISecretListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.AISecret]
List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first
func (*AISecretService) New ¶ added in v0.4.0
func (r *AISecretService) New(ctx context.Context, body AISecretNewParams, opts ...option.RequestOption) (res *shared.AISecret, err error)
Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified
func (*AISecretService) Replace ¶ added in v0.4.0
func (r *AISecretService) Replace(ctx context.Context, body AISecretReplaceParams, opts ...option.RequestOption) (res *shared.AISecret, err error)
Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields
func (*AISecretService) Update ¶ added in v0.4.0
func (r *AISecretService) Update(ctx context.Context, aiSecretID string, body AISecretUpdateParams, opts ...option.RequestOption) (res *shared.AISecret, err error)
Partially update an ai_secret object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type AISecretUpdateParams ¶ added in v0.4.0
type AISecretUpdateParams struct { // Name of the AI secret Name param.Opt[string] `json:"name,omitzero"` Secret param.Opt[string] `json:"secret,omitzero"` Type param.Opt[string] `json:"type,omitzero"` Metadata map[string]any `json:"metadata,omitzero"` // contains filtered or unexported fields }
func (AISecretUpdateParams) MarshalJSON ¶ added in v0.4.0
func (r AISecretUpdateParams) MarshalJSON() (data []byte, err error)
func (*AISecretUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *AISecretUpdateParams) UnmarshalJSON(data []byte) error
type APIKeyListParams ¶ added in v0.2.0
type APIKeyListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Name of the api_key to search for APIKeyName param.Opt[string] `query:"api_key_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs APIKeyListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (APIKeyListParams) URLQuery ¶ added in v0.2.0
func (r APIKeyListParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIKeyListParams's query parameters as `url.Values`.
type APIKeyListParamsIDsUnion ¶ added in v0.2.0
type APIKeyListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type APIKeyNewParams ¶ added in v0.2.0
type APIKeyNewParams struct { // Name of the api key. Does not have to be unique Name string `json:"name,required"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the API key belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // contains filtered or unexported fields }
func (APIKeyNewParams) MarshalJSON ¶ added in v0.2.0
func (r APIKeyNewParams) MarshalJSON() (data []byte, err error)
func (*APIKeyNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *APIKeyNewParams) UnmarshalJSON(data []byte) error
type APIKeyService ¶ added in v0.2.0
type APIKeyService struct {
Options []option.RequestOption
}
APIKeyService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIKeyService method instead.
func NewAPIKeyService ¶ added in v0.2.0
func NewAPIKeyService(opts ...option.RequestOption) (r APIKeyService)
NewAPIKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIKeyService) Delete ¶ added in v0.2.0
func (r *APIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *shared.APIKey, err error)
Delete an api_key object by its id
func (*APIKeyService) Get ¶ added in v0.2.0
func (r *APIKeyService) Get(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *shared.APIKey, err error)
Get an api_key object by its id
func (*APIKeyService) List ¶ added in v0.2.0
func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.APIKey], err error)
List out all api_keys. The api_keys are sorted by creation date, with the most recently-created api_keys coming first
func (*APIKeyService) ListAutoPaging ¶ added in v0.2.0
func (r *APIKeyService) ListAutoPaging(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.APIKey]
List out all api_keys. The api_keys are sorted by creation date, with the most recently-created api_keys coming first
func (*APIKeyService) New ¶ added in v0.2.0
func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *shared.CreateAPIKeyOutput, err error)
Create a new api_key. It is possible to have multiple API keys with the same name. There is no de-duplication
type ChatCompletionContentPartImage ¶ added in v0.4.0
type ChatCompletionContentPartImage = shared.ChatCompletionContentPartImage
This is an alias to an internal type.
type ChatCompletionContentPartImageImageURL ¶ added in v0.4.0
type ChatCompletionContentPartImageImageURL = shared.ChatCompletionContentPartImageImageURL
This is an alias to an internal type.
type ChatCompletionContentPartImageImageURLDetail ¶ added in v0.4.0
type ChatCompletionContentPartImageImageURLDetail = shared.ChatCompletionContentPartImageImageURLDetail
This is an alias to an internal type.
type ChatCompletionContentPartImageImageURLParam ¶ added in v0.4.0
type ChatCompletionContentPartImageImageURLParam = shared.ChatCompletionContentPartImageImageURLParam
This is an alias to an internal type.
type ChatCompletionContentPartImageParam ¶ added in v0.4.0
type ChatCompletionContentPartImageParam = shared.ChatCompletionContentPartImageParam
This is an alias to an internal type.
type ChatCompletionContentPartImageType ¶ added in v0.4.0
type ChatCompletionContentPartImageType = shared.ChatCompletionContentPartImageType
This is an alias to an internal type.
type ChatCompletionContentPartText ¶ added in v0.4.0
type ChatCompletionContentPartText = shared.ChatCompletionContentPartText
This is an alias to an internal type.
type ChatCompletionContentPartTextParam ¶ added in v0.4.0
type ChatCompletionContentPartTextParam = shared.ChatCompletionContentPartTextParam
This is an alias to an internal type.
type ChatCompletionContentPartTextType ¶ added in v0.4.0
type ChatCompletionContentPartTextType = shared.ChatCompletionContentPartTextType
This is an alias to an internal type.
type ChatCompletionMessageToolCall ¶ added in v0.4.0
type ChatCompletionMessageToolCall = shared.ChatCompletionMessageToolCall
This is an alias to an internal type.
type ChatCompletionMessageToolCallFunction ¶ added in v0.4.0
type ChatCompletionMessageToolCallFunction = shared.ChatCompletionMessageToolCallFunction
This is an alias to an internal type.
type ChatCompletionMessageToolCallFunctionParam ¶ added in v0.4.0
type ChatCompletionMessageToolCallFunctionParam = shared.ChatCompletionMessageToolCallFunctionParam
This is an alias to an internal type.
type ChatCompletionMessageToolCallParam ¶ added in v0.4.0
type ChatCompletionMessageToolCallParam = shared.ChatCompletionMessageToolCallParam
This is an alias to an internal type.
type ChatCompletionMessageToolCallType ¶ added in v0.4.0
type ChatCompletionMessageToolCallType = shared.ChatCompletionMessageToolCallType
This is an alias to an internal type.
type Client ¶
type Client struct { Options []option.RequestOption TopLevel TopLevelService Projects ProjectService Experiments ExperimentService Datasets DatasetService Prompts PromptService Roles RoleService Groups GroupService ACLs ACLService Users UserService ProjectScores ProjectScoreService ProjectTags ProjectTagService SpanIframes SpanIframeService Functions FunctionService Views ViewService Organizations OrganizationService APIKeys APIKeyService AISecrets AISecretService EnvVars EnvVarService Evals EvalService }
Client creates a struct with services and top level methods that help with interacting with the braintrust API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (BRAINTRUST_API_KEY, BRAINTRUST_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶ added in v0.2.0
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶ added in v0.2.0
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶ added in v0.2.0
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶ added in v0.2.0
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶ added in v0.2.0
func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CodeBundle ¶ added in v0.4.0
type CodeBundle = shared.CodeBundle
This is an alias to an internal type.
type CodeBundleLocationExperiment ¶ added in v0.4.0
type CodeBundleLocationExperiment = shared.CodeBundleLocationExperiment
This is an alias to an internal type.
type CodeBundleLocationExperimentParam ¶ added in v0.4.0
type CodeBundleLocationExperimentParam = shared.CodeBundleLocationExperimentParam
This is an alias to an internal type.
type CodeBundleLocationExperimentPositionScorer ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorer = shared.CodeBundleLocationExperimentPositionScorer
This is an alias to an internal type.
type CodeBundleLocationExperimentPositionScorerParam ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionScorerParam = shared.CodeBundleLocationExperimentPositionScorerParam
This is an alias to an internal type.
type CodeBundleLocationExperimentPositionType ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionType = shared.CodeBundleLocationExperimentPositionType
This is an alias to an internal type.
type CodeBundleLocationExperimentPositionTypeParam ¶ added in v0.5.0
type CodeBundleLocationExperimentPositionTypeParam = shared.CodeBundleLocationExperimentPositionTypeParam
This is an alias to an internal type.
type CodeBundleLocationExperimentPositionUnion ¶ added in v0.8.0
type CodeBundleLocationExperimentPositionUnion = shared.CodeBundleLocationExperimentPositionUnion
This is an alias to an internal type.
type CodeBundleLocationExperimentPositionUnionParam ¶ added in v0.4.0
type CodeBundleLocationExperimentPositionUnionParam = shared.CodeBundleLocationExperimentPositionUnionParam
This is an alias to an internal type.
type CodeBundleLocationFunction ¶ added in v0.4.0
type CodeBundleLocationFunction = shared.CodeBundleLocationFunction
This is an alias to an internal type.
type CodeBundleLocationFunctionParam ¶ added in v0.4.0
type CodeBundleLocationFunctionParam = shared.CodeBundleLocationFunctionParam
This is an alias to an internal type.
type CodeBundleLocationUnion ¶ added in v0.8.0
type CodeBundleLocationUnion = shared.CodeBundleLocationUnion
This is an alias to an internal type.
type CodeBundleLocationUnionParam ¶ added in v0.4.0
type CodeBundleLocationUnionParam = shared.CodeBundleLocationUnionParam
This is an alias to an internal type.
type CodeBundleParam ¶ added in v0.4.0
type CodeBundleParam = shared.CodeBundleParam
This is an alias to an internal type.
type CodeBundleRuntimeContext ¶ added in v0.4.0
type CodeBundleRuntimeContext = shared.CodeBundleRuntimeContext
This is an alias to an internal type.
type CodeBundleRuntimeContextParam ¶ added in v0.4.0
type CodeBundleRuntimeContextParam = shared.CodeBundleRuntimeContextParam
This is an alias to an internal type.
type CreateAPIKeyOutput ¶ added in v0.2.0
type CreateAPIKeyOutput = shared.CreateAPIKeyOutput
This is an alias to an internal type.
type DataSummary ¶ added in v0.2.0
type DataSummary = shared.DataSummary
Summary of a dataset's data
This is an alias to an internal type.
type DatasetEvent ¶ added in v0.2.0
type DatasetEvent = shared.DatasetEvent
This is an alias to an internal type.
type DatasetEventMetadata ¶ added in v0.6.0
type DatasetEventMetadata = shared.DatasetEventMetadata
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
This is an alias to an internal type.
type DatasetFeedbackParams ¶
type DatasetFeedbackParams struct { // A list of dataset feedback items Feedback []shared.FeedbackDatasetItemParam `json:"feedback,omitzero,required"` // contains filtered or unexported fields }
func (DatasetFeedbackParams) MarshalJSON ¶
func (r DatasetFeedbackParams) MarshalJSON() (data []byte, err error)
func (*DatasetFeedbackParams) UnmarshalJSON ¶ added in v0.8.0
func (r *DatasetFeedbackParams) UnmarshalJSON(data []byte) error
type DatasetFetchParams ¶
type DatasetFetchParams struct { // limit the number of traces fetched // // Fetch queries may be paginated if the total result size is expected to be large // (e.g. project_logs which accumulate over a long time). Note that fetch queries // only support pagination in descending time order (from latest to earliest // `_xact_id`. Furthermore, later pages may return rows which showed up in earlier // pages, except with an earlier `_xact_id`. This happens because pagination occurs // over the whole version history of the event log. You will most likely want to // exclude any such duplicate, outdated rows (by `id`) from your combined result // set. // // The `limit` parameter controls the number of full traces to return. So you may // end up with more individual rows than the specified limit if you are fetching // events containing traces. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxRootSpanID param.Opt[string] `query:"max_root_span_id,omitzero" json:"-"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxXactID param.Opt[string] `query:"max_xact_id,omitzero" json:"-"` // Retrieve a snapshot of events from a past time // // The version id is essentially a filter on the latest event transaction id. You // can use the `max_xact_id` returned by a past fetch as the version to reproduce // that exact fetch. Version param.Opt[string] `query:"version,omitzero" json:"-"` // contains filtered or unexported fields }
func (DatasetFetchParams) URLQuery ¶
func (r DatasetFetchParams) URLQuery() (v url.Values, err error)
URLQuery serializes DatasetFetchParams's query parameters as `url.Values`.
type DatasetFetchPostParams ¶
type DatasetFetchPostParams struct { // An opaque string to be used as a cursor for the next page of results, in order // from latest to earliest. // // The string can be obtained directly from the `cursor` property of the previous // fetch query Cursor param.Opt[string] `json:"cursor,omitzero"` // limit the number of traces fetched // // Fetch queries may be paginated if the total result size is expected to be large // (e.g. project_logs which accumulate over a long time). Note that fetch queries // only support pagination in descending time order (from latest to earliest // `_xact_id`. Furthermore, later pages may return rows which showed up in earlier // pages, except with an earlier `_xact_id`. This happens because pagination occurs // over the whole version history of the event log. You will most likely want to // exclude any such duplicate, outdated rows (by `id`) from your combined result // set. // // The `limit` parameter controls the number of full traces to return. So you may // end up with more individual rows than the specified limit if you are fetching // events containing traces. Limit param.Opt[int64] `json:"limit,omitzero"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxRootSpanID param.Opt[string] `json:"max_root_span_id,omitzero"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxXactID param.Opt[string] `json:"max_xact_id,omitzero"` // Retrieve a snapshot of events from a past time // // The version id is essentially a filter on the latest event transaction id. You // can use the `max_xact_id` returned by a past fetch as the version to reproduce // that exact fetch. Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
func (DatasetFetchPostParams) MarshalJSON ¶
func (r DatasetFetchPostParams) MarshalJSON() (data []byte, err error)
func (*DatasetFetchPostParams) UnmarshalJSON ¶ added in v0.8.0
func (r *DatasetFetchPostParams) UnmarshalJSON(data []byte) error
type DatasetInsertParams ¶
type DatasetInsertParams struct { // A list of dataset events to insert Events []shared.InsertDatasetEventParam `json:"events,omitzero,required"` // contains filtered or unexported fields }
func (DatasetInsertParams) MarshalJSON ¶
func (r DatasetInsertParams) MarshalJSON() (data []byte, err error)
func (*DatasetInsertParams) UnmarshalJSON ¶ added in v0.8.0
func (r *DatasetInsertParams) UnmarshalJSON(data []byte) error
type DatasetListParams ¶
type DatasetListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Name of the dataset to search for DatasetName param.Opt[string] `query:"dataset_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Project id ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs DatasetListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (DatasetListParams) URLQuery ¶
func (r DatasetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DatasetListParams's query parameters as `url.Values`.
type DatasetListParamsIDsUnion ¶ added in v0.2.0
type DatasetListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type DatasetNewParams ¶
type DatasetNewParams struct { // Name of the dataset. Within a project, dataset names are unique Name string `json:"name,required"` // Unique identifier for the project that the dataset belongs under ProjectID string `json:"project_id,required" format:"uuid"` // Textual description of the dataset Description param.Opt[string] `json:"description,omitzero"` // User-controlled metadata about the dataset Metadata map[string]any `json:"metadata,omitzero"` // contains filtered or unexported fields }
func (DatasetNewParams) MarshalJSON ¶
func (r DatasetNewParams) MarshalJSON() (data []byte, err error)
func (*DatasetNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *DatasetNewParams) UnmarshalJSON(data []byte) error
type DatasetService ¶
type DatasetService struct {
Options []option.RequestOption
}
DatasetService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDatasetService method instead.
func NewDatasetService ¶
func NewDatasetService(opts ...option.RequestOption) (r DatasetService)
NewDatasetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DatasetService) Delete ¶
func (r *DatasetService) Delete(ctx context.Context, datasetID string, opts ...option.RequestOption) (res *shared.Dataset, err error)
Delete a dataset object by its id
func (*DatasetService) Feedback ¶
func (r *DatasetService) Feedback(ctx context.Context, datasetID string, body DatasetFeedbackParams, opts ...option.RequestOption) (res *shared.FeedbackResponseSchema, err error)
Log feedback for a set of dataset events
func (*DatasetService) Fetch ¶
func (r *DatasetService) Fetch(ctx context.Context, datasetID string, query DatasetFetchParams, opts ...option.RequestOption) (res *shared.FetchDatasetEventsResponse, err error)
Fetch the events in a dataset. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.
func (*DatasetService) FetchPost ¶
func (r *DatasetService) FetchPost(ctx context.Context, datasetID string, body DatasetFetchPostParams, opts ...option.RequestOption) (res *shared.FetchDatasetEventsResponse, err error)
Fetch the events in a dataset. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.
func (*DatasetService) Get ¶
func (r *DatasetService) Get(ctx context.Context, datasetID string, opts ...option.RequestOption) (res *shared.Dataset, err error)
Get a dataset object by its id
func (*DatasetService) Insert ¶
func (r *DatasetService) Insert(ctx context.Context, datasetID string, body DatasetInsertParams, opts ...option.RequestOption) (res *shared.InsertEventsResponse, err error)
Insert a set of events into the dataset
func (*DatasetService) List ¶
func (r *DatasetService) List(ctx context.Context, query DatasetListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Dataset], err error)
List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first
func (*DatasetService) ListAutoPaging ¶
func (r *DatasetService) ListAutoPaging(ctx context.Context, query DatasetListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Dataset]
List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first
func (*DatasetService) New ¶
func (r *DatasetService) New(ctx context.Context, body DatasetNewParams, opts ...option.RequestOption) (res *shared.Dataset, err error)
Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified
func (*DatasetService) Summarize ¶ added in v0.2.0
func (r *DatasetService) Summarize(ctx context.Context, datasetID string, query DatasetSummarizeParams, opts ...option.RequestOption) (res *shared.SummarizeDatasetResponse, err error)
Summarize dataset
func (*DatasetService) Update ¶
func (r *DatasetService) Update(ctx context.Context, datasetID string, body DatasetUpdateParams, opts ...option.RequestOption) (res *shared.Dataset, err error)
Partially update a dataset object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type DatasetSummarizeParams ¶ added in v0.2.0
type DatasetSummarizeParams struct { // Whether to summarize the data. If false (or omitted), only the metadata will be // returned. SummarizeData param.Opt[bool] `query:"summarize_data,omitzero" json:"-"` // contains filtered or unexported fields }
func (DatasetSummarizeParams) URLQuery ¶ added in v0.2.0
func (r DatasetSummarizeParams) URLQuery() (v url.Values, err error)
URLQuery serializes DatasetSummarizeParams's query parameters as `url.Values`.
type DatasetUpdateParams ¶
type DatasetUpdateParams struct { // Textual description of the dataset Description param.Opt[string] `json:"description,omitzero"` // Name of the dataset. Within a project, dataset names are unique Name param.Opt[string] `json:"name,omitzero"` // User-controlled metadata about the dataset Metadata map[string]any `json:"metadata,omitzero"` // contains filtered or unexported fields }
func (DatasetUpdateParams) MarshalJSON ¶
func (r DatasetUpdateParams) MarshalJSON() (data []byte, err error)
func (*DatasetUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *DatasetUpdateParams) UnmarshalJSON(data []byte) error
type EnvVarListParams ¶ added in v0.4.0
type EnvVarListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Name of the env_var to search for EnvVarName param.Opt[string] `query:"env_var_name,omitzero" json:"-"` // The id of the object the environment variable is scoped for ObjectID param.Opt[string] `query:"object_id,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs EnvVarListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // The type of the object the environment variable is scoped for // // Any of "organization", "project", "function". ObjectType shared.EnvVarObjectType `query:"object_type,omitzero" json:"-"` // contains filtered or unexported fields }
func (EnvVarListParams) URLQuery ¶ added in v0.4.0
func (r EnvVarListParams) URLQuery() (v url.Values, err error)
URLQuery serializes EnvVarListParams's query parameters as `url.Values`.
type EnvVarListParamsIDsUnion ¶ added in v0.4.0
type EnvVarListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type EnvVarListResponse ¶ added in v0.4.0
type EnvVarListResponse struct { // A list of env_var objects Objects []shared.EnvVar `json:"objects,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Objects respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (EnvVarListResponse) RawJSON ¶ added in v0.8.0
func (r EnvVarListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EnvVarListResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *EnvVarListResponse) UnmarshalJSON(data []byte) error
type EnvVarNewParams ¶ added in v0.4.0
type EnvVarNewParams struct { // The name of the environment variable Name string `json:"name,required"` // The id of the object the environment variable is scoped for ObjectID string `json:"object_id,required" format:"uuid"` // The type of the object the environment variable is scoped for // // Any of "organization", "project", "function". ObjectType EnvVarNewParamsObjectType `json:"object_type,omitzero,required"` // The value of the environment variable. Will be encrypted at rest. Value param.Opt[string] `json:"value,omitzero"` // contains filtered or unexported fields }
func (EnvVarNewParams) MarshalJSON ¶ added in v0.4.0
func (r EnvVarNewParams) MarshalJSON() (data []byte, err error)
func (*EnvVarNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *EnvVarNewParams) UnmarshalJSON(data []byte) error
type EnvVarNewParamsObjectType ¶ added in v0.4.0
type EnvVarNewParamsObjectType string
The type of the object the environment variable is scoped for
const ( EnvVarNewParamsObjectTypeOrganization EnvVarNewParamsObjectType = "organization" EnvVarNewParamsObjectTypeProject EnvVarNewParamsObjectType = "project" EnvVarNewParamsObjectTypeFunction EnvVarNewParamsObjectType = "function" )
type EnvVarObjectType ¶ added in v0.4.0
type EnvVarObjectType = shared.EnvVarObjectType
The type of the object the environment variable is scoped for
This is an alias to an internal type.
type EnvVarReplaceParams ¶ added in v0.4.0
type EnvVarReplaceParams struct { // The name of the environment variable Name string `json:"name,required"` // The id of the object the environment variable is scoped for ObjectID string `json:"object_id,required" format:"uuid"` // The type of the object the environment variable is scoped for // // Any of "organization", "project", "function". ObjectType EnvVarReplaceParamsObjectType `json:"object_type,omitzero,required"` // The value of the environment variable. Will be encrypted at rest. Value param.Opt[string] `json:"value,omitzero"` // contains filtered or unexported fields }
func (EnvVarReplaceParams) MarshalJSON ¶ added in v0.4.0
func (r EnvVarReplaceParams) MarshalJSON() (data []byte, err error)
func (*EnvVarReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *EnvVarReplaceParams) UnmarshalJSON(data []byte) error
type EnvVarReplaceParamsObjectType ¶ added in v0.4.0
type EnvVarReplaceParamsObjectType string
The type of the object the environment variable is scoped for
const ( EnvVarReplaceParamsObjectTypeOrganization EnvVarReplaceParamsObjectType = "organization" EnvVarReplaceParamsObjectTypeProject EnvVarReplaceParamsObjectType = "project" EnvVarReplaceParamsObjectTypeFunction EnvVarReplaceParamsObjectType = "function" )
type EnvVarService ¶ added in v0.4.0
type EnvVarService struct {
Options []option.RequestOption
}
EnvVarService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEnvVarService method instead.
func NewEnvVarService ¶ added in v0.4.0
func NewEnvVarService(opts ...option.RequestOption) (r EnvVarService)
NewEnvVarService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EnvVarService) Delete ¶ added in v0.4.0
func (r *EnvVarService) Delete(ctx context.Context, envVarID string, opts ...option.RequestOption) (res *shared.EnvVar, err error)
Delete an env_var object by its id
func (*EnvVarService) Get ¶ added in v0.4.0
func (r *EnvVarService) Get(ctx context.Context, envVarID string, opts ...option.RequestOption) (res *shared.EnvVar, err error)
Get an env_var object by its id
func (*EnvVarService) List ¶ added in v0.4.0
func (r *EnvVarService) List(ctx context.Context, query EnvVarListParams, opts ...option.RequestOption) (res *EnvVarListResponse, err error)
List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first
func (*EnvVarService) New ¶ added in v0.4.0
func (r *EnvVarService) New(ctx context.Context, body EnvVarNewParams, opts ...option.RequestOption) (res *shared.EnvVar, err error)
Create a new env_var. If there is an existing env_var with the same name as the one specified in the request, will return the existing env_var unmodified
func (*EnvVarService) Replace ¶ added in v0.4.0
func (r *EnvVarService) Replace(ctx context.Context, body EnvVarReplaceParams, opts ...option.RequestOption) (res *shared.EnvVar, err error)
Create or replace env_var. If there is an existing env_var with the same name as the one specified in the request, will replace the existing env_var with the provided fields
func (*EnvVarService) Update ¶ added in v0.4.0
func (r *EnvVarService) Update(ctx context.Context, envVarID string, body EnvVarUpdateParams, opts ...option.RequestOption) (res *shared.EnvVar, err error)
Partially update an env_var object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type EnvVarUpdateParams ¶ added in v0.4.0
type EnvVarUpdateParams struct { // The name of the environment variable Name string `json:"name,required"` // The value of the environment variable. Will be encrypted at rest. Value param.Opt[string] `json:"value,omitzero"` // contains filtered or unexported fields }
func (EnvVarUpdateParams) MarshalJSON ¶ added in v0.4.0
func (r EnvVarUpdateParams) MarshalJSON() (data []byte, err error)
func (*EnvVarUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *EnvVarUpdateParams) UnmarshalJSON(data []byte) error
type EvalNewParams ¶ added in v0.4.0
type EvalNewParams struct { // The dataset to use Data EvalNewParamsDataUnion `json:"data,omitzero,required"` // Unique identifier for the project to run the eval in ProjectID string `json:"project_id,required"` // The functions to score the eval on Scores []EvalNewParamsScoreUnion `json:"scores,omitzero,required"` // The function to evaluate Task EvalNewParamsTaskUnion `json:"task,omitzero,required"` // An optional experiment id to use as a base. If specified, the new experiment // will be summarized and compared to this experiment. BaseExperimentID param.Opt[string] `json:"base_experiment_id,omitzero"` // An optional experiment name to use as a base. If specified, the new experiment // will be summarized and compared to this experiment. BaseExperimentName param.Opt[string] `json:"base_experiment_name,omitzero"` // Whether the experiment should be public. Defaults to false. IsPublic param.Opt[bool] `json:"is_public,omitzero"` // The maximum number of tasks/scorers that will be run concurrently. Defaults to // undefined, in which case there is no max concurrency. MaxConcurrency param.Opt[float64] `json:"max_concurrency,omitzero"` // The maximum duration, in milliseconds, to run the evaluation. Defaults to // undefined, in which case there is no timeout. Timeout param.Opt[float64] `json:"timeout,omitzero"` // The number of times to run the evaluator per input. This is useful for // evaluating applications that have non-deterministic behavior and gives you both // a stronger aggregate measure and a sense of the variance in the results. TrialCount param.Opt[float64] `json:"trial_count,omitzero"` // An optional name for the experiment created by this eval. If it conflicts with // an existing experiment, it will be suffixed with a unique identifier. ExperimentName param.Opt[string] `json:"experiment_name,omitzero"` // Whether to stream the results of the eval. If true, the request will return two // events: one to indicate the experiment has started, and another upon completion. // If false, the request will return the evaluation's summary upon completion. Stream param.Opt[bool] `json:"stream,omitzero"` // Optional settings for collecting git metadata. By default, will collect all git // metadata fields allowed in org-level settings. GitMetadataSettings EvalNewParamsGitMetadataSettings `json:"git_metadata_settings,omitzero"` // Metadata about the state of the repo when the experiment was created RepoInfo shared.RepoInfoParam `json:"repo_info,omitzero"` // Optional experiment-level metadata to store about the evaluation. You can later // use this to slice & dice across experiments. Metadata map[string]any `json:"metadata,omitzero"` // Options for tracing the evaluation Parent EvalNewParamsParentUnion `json:"parent,omitzero"` // contains filtered or unexported fields }
func (EvalNewParams) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParams) MarshalJSON() (data []byte, err error)
func (*EvalNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParams) UnmarshalJSON(data []byte) error
type EvalNewParamsDataDatasetID ¶ added in v0.4.0
type EvalNewParamsDataDatasetID struct { DatasetID string `json:"dataset_id,required"` InternalBtql map[string]any `json:"_internal_btql,omitzero"` // contains filtered or unexported fields }
Dataset id
The property DatasetID is required.
func (EvalNewParamsDataDatasetID) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsDataDatasetID) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsDataDatasetID) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsDataDatasetID) UnmarshalJSON(data []byte) error
type EvalNewParamsDataDatasetRows ¶ added in v0.6.0
type EvalNewParamsDataDatasetRows struct { Data []any `json:"data,omitzero,required"` // contains filtered or unexported fields }
Dataset rows
The property Data is required.
func (EvalNewParamsDataDatasetRows) MarshalJSON ¶ added in v0.6.0
func (r EvalNewParamsDataDatasetRows) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsDataDatasetRows) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsDataDatasetRows) UnmarshalJSON(data []byte) error
type EvalNewParamsDataProjectDatasetName ¶ added in v0.4.0
type EvalNewParamsDataProjectDatasetName struct { DatasetName string `json:"dataset_name,required"` ProjectName string `json:"project_name,required"` InternalBtql map[string]any `json:"_internal_btql,omitzero"` // contains filtered or unexported fields }
Project and dataset name
The properties DatasetName, ProjectName are required.
func (EvalNewParamsDataProjectDatasetName) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsDataProjectDatasetName) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsDataProjectDatasetName) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsDataProjectDatasetName) UnmarshalJSON(data []byte) error
type EvalNewParamsDataUnion ¶ added in v0.4.0
type EvalNewParamsDataUnion struct { OfDatasetID *EvalNewParamsDataDatasetID `json:",omitzero,inline"` OfProjectDatasetName *EvalNewParamsDataProjectDatasetName `json:",omitzero,inline"` OfDatasetRows *EvalNewParamsDataDatasetRows `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (EvalNewParamsDataUnion) GetData ¶ added in v0.8.0
func (u EvalNewParamsDataUnion) GetData() []any
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsDataUnion) GetDatasetID ¶ added in v0.8.0
func (u EvalNewParamsDataUnion) GetDatasetID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsDataUnion) GetDatasetName ¶ added in v0.8.0
func (u EvalNewParamsDataUnion) GetDatasetName() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsDataUnion) GetInternalBtql ¶ added in v0.8.0
func (u EvalNewParamsDataUnion) GetInternalBtql() map[string]any
Returns a pointer to the underlying variant's InternalBtql property, if present.
func (EvalNewParamsDataUnion) GetProjectName ¶ added in v0.8.0
func (u EvalNewParamsDataUnion) GetProjectName() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsDataUnion) MarshalJSON ¶ added in v0.8.0
func (u EvalNewParamsDataUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *EvalNewParamsDataUnion) UnmarshalJSON(data []byte) error
type EvalNewParamsGitMetadataSettings ¶ added in v0.5.0
type EvalNewParamsGitMetadataSettings struct { // Any of "all", "none", "some". Collect string `json:"collect,omitzero,required"` // Any of "commit", "branch", "tag", "dirty", "author_name", "author_email", // "commit_message", "commit_time", "git_diff". Fields []string `json:"fields,omitzero"` // contains filtered or unexported fields }
Optional settings for collecting git metadata. By default, will collect all git metadata fields allowed in org-level settings.
The property Collect is required.
func (EvalNewParamsGitMetadataSettings) MarshalJSON ¶ added in v0.5.0
func (r EvalNewParamsGitMetadataSettings) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsGitMetadataSettings) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsGitMetadataSettings) UnmarshalJSON(data []byte) error
type EvalNewParamsParentSpanParentStruct ¶ added in v0.6.0
type EvalNewParamsParentSpanParentStruct struct { // The id of the container object you are logging to ObjectID string `json:"object_id,required"` // Any of "project_logs", "experiment", "playground_logs". ObjectType string `json:"object_type,omitzero,required"` // Include these properties in every span created under this parent PropagatedEvent map[string]any `json:"propagated_event,omitzero"` // Identifiers for the row to to log a subspan under RowIDs EvalNewParamsParentSpanParentStructRowIDs `json:"row_ids,omitzero"` // contains filtered or unexported fields }
Span parent properties
The properties ObjectID, ObjectType are required.
func (EvalNewParamsParentSpanParentStruct) MarshalJSON ¶ added in v0.6.0
func (r EvalNewParamsParentSpanParentStruct) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParentSpanParentStruct) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsParentSpanParentStruct) UnmarshalJSON(data []byte) error
type EvalNewParamsParentSpanParentStructRowIDs ¶ added in v0.6.0
type EvalNewParamsParentSpanParentStructRowIDs struct { // The id of the row ID string `json:"id,required"` // The root_span_id of the row RootSpanID string `json:"root_span_id,required"` // The span_id of the row SpanID string `json:"span_id,required"` // contains filtered or unexported fields }
Identifiers for the row to to log a subspan under
The properties ID, RootSpanID, SpanID are required.
func (EvalNewParamsParentSpanParentStructRowIDs) MarshalJSON ¶ added in v0.6.0
func (r EvalNewParamsParentSpanParentStructRowIDs) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParentSpanParentStructRowIDs) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsParentSpanParentStructRowIDs) UnmarshalJSON(data []byte) error
type EvalNewParamsParentUnion ¶ added in v0.6.0
type EvalNewParamsParentUnion struct { OfSpanParentStruct *EvalNewParamsParentSpanParentStruct `json:",omitzero,inline"` OfString param.Opt[string] `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (EvalNewParamsParentUnion) MarshalJSON ¶ added in v0.8.0
func (u EvalNewParamsParentUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsParentUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *EvalNewParamsParentUnion) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreFunctionID ¶ added in v0.8.0
type EvalNewParamsScoreFunctionID struct { // The ID of the function FunctionID string `json:"function_id,required"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
Function id
The property FunctionID is required.
func (EvalNewParamsScoreFunctionID) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScoreFunctionID) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScoreFunctionID) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScoreFunctionID) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreGlobalFunction ¶ added in v0.8.0
type EvalNewParamsScoreGlobalFunction struct { // The name of the global function. Currently, the global namespace includes the // functions in autoevals GlobalFunction string `json:"global_function,required"` // contains filtered or unexported fields }
Global function name
The property GlobalFunction is required.
func (EvalNewParamsScoreGlobalFunction) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScoreGlobalFunction) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScoreGlobalFunction) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScoreGlobalFunction) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreInlineCode ¶ added in v0.8.0
type EvalNewParamsScoreInlineCode struct { // The inline code to execute Code string `json:"code,required"` InlineContext EvalNewParamsScoreInlineCodeInlineContext `json:"inline_context,omitzero,required"` // The name of the inline code function Name param.Opt[string] `json:"name,omitzero"` // contains filtered or unexported fields }
Inline code function
The properties Code, InlineContext are required.
func (EvalNewParamsScoreInlineCode) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScoreInlineCode) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScoreInlineCode) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScoreInlineCode) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreInlineCodeInlineContext ¶ added in v0.8.0
type EvalNewParamsScoreInlineCodeInlineContext struct { // Any of "node", "python". Runtime string `json:"runtime,omitzero,required"` Version string `json:"version,required"` // contains filtered or unexported fields }
The properties Runtime, Version are required.
func (EvalNewParamsScoreInlineCodeInlineContext) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScoreInlineCodeInlineContext) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScoreInlineCodeInlineContext) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScoreInlineCodeInlineContext) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreInlinePrompt ¶ added in v0.8.0
type EvalNewParamsScoreInlinePrompt struct { // The prompt, model, and its parameters InlinePrompt shared.PromptDataParam `json:"inline_prompt,omitzero,required"` // The name of the inline prompt Name param.Opt[string] `json:"name,omitzero"` // contains filtered or unexported fields }
Inline prompt definition
The property InlinePrompt is required.
func (EvalNewParamsScoreInlinePrompt) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScoreInlinePrompt) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScoreInlinePrompt) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScoreInlinePrompt) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreProjectSlug ¶ added in v0.8.0
type EvalNewParamsScoreProjectSlug struct { // The name of the project containing the function ProjectName string `json:"project_name,required"` // The slug of the function Slug string `json:"slug,required"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
Project name and slug
The properties ProjectName, Slug are required.
func (EvalNewParamsScoreProjectSlug) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScoreProjectSlug) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScoreProjectSlug) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScoreProjectSlug) UnmarshalJSON(data []byte) error
type EvalNewParamsScorePromptSessionID ¶ added in v0.8.0
type EvalNewParamsScorePromptSessionID struct { // The ID of the function in the prompt session PromptSessionFunctionID string `json:"prompt_session_function_id,required"` // The ID of the prompt session PromptSessionID string `json:"prompt_session_id,required"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
Prompt session id
The properties PromptSessionFunctionID, PromptSessionID are required.
func (EvalNewParamsScorePromptSessionID) MarshalJSON ¶ added in v0.8.0
func (r EvalNewParamsScorePromptSessionID) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsScorePromptSessionID) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsScorePromptSessionID) UnmarshalJSON(data []byte) error
type EvalNewParamsScoreUnion ¶ added in v0.4.0
type EvalNewParamsScoreUnion struct { OfFunctionID *EvalNewParamsScoreFunctionID `json:",omitzero,inline"` OfProjectSlug *EvalNewParamsScoreProjectSlug `json:",omitzero,inline"` OfGlobalFunction *EvalNewParamsScoreGlobalFunction `json:",omitzero,inline"` OfPromptSessionID *EvalNewParamsScorePromptSessionID `json:",omitzero,inline"` OfInlineCode *EvalNewParamsScoreInlineCode `json:",omitzero,inline"` OfInlinePrompt *EvalNewParamsScoreInlinePrompt `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (EvalNewParamsScoreUnion) GetCode ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetCode() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetFunctionID ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetFunctionID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetGlobalFunction ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetGlobalFunction() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetInlineContext ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetInlineContext() *EvalNewParamsScoreInlineCodeInlineContext
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetInlinePrompt ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetInlinePrompt() *shared.PromptDataParam
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetName ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetProjectName ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetProjectName() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetPromptSessionFunctionID ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetPromptSessionFunctionID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetPromptSessionID ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetPromptSessionID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetSlug ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetSlug() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) GetVersion ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) GetVersion() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsScoreUnion) MarshalJSON ¶ added in v0.8.0
func (u EvalNewParamsScoreUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsScoreUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *EvalNewParamsScoreUnion) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskFunctionID ¶ added in v0.4.0
type EvalNewParamsTaskFunctionID struct { // The ID of the function FunctionID string `json:"function_id,required"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
Function id
The property FunctionID is required.
func (EvalNewParamsTaskFunctionID) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskFunctionID) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskFunctionID) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskFunctionID) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskGlobalFunction ¶ added in v0.4.0
type EvalNewParamsTaskGlobalFunction struct { // The name of the global function. Currently, the global namespace includes the // functions in autoevals GlobalFunction string `json:"global_function,required"` // contains filtered or unexported fields }
Global function name
The property GlobalFunction is required.
func (EvalNewParamsTaskGlobalFunction) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskGlobalFunction) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskGlobalFunction) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskGlobalFunction) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskInlineCode ¶ added in v0.4.0
type EvalNewParamsTaskInlineCode struct { // The inline code to execute Code string `json:"code,required"` InlineContext EvalNewParamsTaskInlineCodeInlineContext `json:"inline_context,omitzero,required"` // The name of the inline code function Name param.Opt[string] `json:"name,omitzero"` // contains filtered or unexported fields }
Inline code function
The properties Code, InlineContext are required.
func (EvalNewParamsTaskInlineCode) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskInlineCode) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskInlineCode) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskInlineCode) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskInlineCodeInlineContext ¶ added in v0.4.0
type EvalNewParamsTaskInlineCodeInlineContext struct { // Any of "node", "python". Runtime string `json:"runtime,omitzero,required"` Version string `json:"version,required"` // contains filtered or unexported fields }
The properties Runtime, Version are required.
func (EvalNewParamsTaskInlineCodeInlineContext) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskInlineCodeInlineContext) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskInlineCodeInlineContext) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskInlineCodeInlineContext) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskInlinePrompt ¶ added in v0.4.0
type EvalNewParamsTaskInlinePrompt struct { // The prompt, model, and its parameters InlinePrompt shared.PromptDataParam `json:"inline_prompt,omitzero,required"` // The name of the inline prompt Name param.Opt[string] `json:"name,omitzero"` // contains filtered or unexported fields }
Inline prompt definition
The property InlinePrompt is required.
func (EvalNewParamsTaskInlinePrompt) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskInlinePrompt) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskInlinePrompt) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskInlinePrompt) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskProjectSlug ¶ added in v0.4.0
type EvalNewParamsTaskProjectSlug struct { // The name of the project containing the function ProjectName string `json:"project_name,required"` // The slug of the function Slug string `json:"slug,required"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
Project name and slug
The properties ProjectName, Slug are required.
func (EvalNewParamsTaskProjectSlug) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskProjectSlug) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskProjectSlug) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskProjectSlug) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskPromptSessionID ¶ added in v0.4.0
type EvalNewParamsTaskPromptSessionID struct { // The ID of the function in the prompt session PromptSessionFunctionID string `json:"prompt_session_function_id,required"` // The ID of the prompt session PromptSessionID string `json:"prompt_session_id,required"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
Prompt session id
The properties PromptSessionFunctionID, PromptSessionID are required.
func (EvalNewParamsTaskPromptSessionID) MarshalJSON ¶ added in v0.4.0
func (r EvalNewParamsTaskPromptSessionID) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsTaskPromptSessionID) UnmarshalJSON ¶ added in v0.8.0
func (r *EvalNewParamsTaskPromptSessionID) UnmarshalJSON(data []byte) error
type EvalNewParamsTaskUnion ¶ added in v0.4.0
type EvalNewParamsTaskUnion struct { OfFunctionID *EvalNewParamsTaskFunctionID `json:",omitzero,inline"` OfProjectSlug *EvalNewParamsTaskProjectSlug `json:",omitzero,inline"` OfGlobalFunction *EvalNewParamsTaskGlobalFunction `json:",omitzero,inline"` OfPromptSessionID *EvalNewParamsTaskPromptSessionID `json:",omitzero,inline"` OfInlineCode *EvalNewParamsTaskInlineCode `json:",omitzero,inline"` OfInlinePrompt *EvalNewParamsTaskInlinePrompt `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (EvalNewParamsTaskUnion) GetCode ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetCode() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetFunctionID ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetFunctionID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetGlobalFunction ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetGlobalFunction() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetInlineContext ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetInlineContext() *EvalNewParamsTaskInlineCodeInlineContext
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetInlinePrompt ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetInlinePrompt() *shared.PromptDataParam
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetName ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetProjectName ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetProjectName() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetPromptSessionFunctionID ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetPromptSessionFunctionID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetPromptSessionID ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetPromptSessionID() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetSlug ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetSlug() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) GetVersion ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) GetVersion() *string
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsTaskUnion) MarshalJSON ¶ added in v0.8.0
func (u EvalNewParamsTaskUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsTaskUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *EvalNewParamsTaskUnion) UnmarshalJSON(data []byte) error
type EvalService ¶ added in v0.4.0
type EvalService struct {
Options []option.RequestOption
}
EvalService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvalService method instead.
func NewEvalService ¶ added in v0.4.0
func NewEvalService(opts ...option.RequestOption) (r EvalService)
NewEvalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvalService) New ¶ added in v0.4.0
func (r *EvalService) New(ctx context.Context, body EvalNewParams, opts ...option.RequestOption) (res *shared.SummarizeExperimentResponse, err error)
Launch an evaluation. This is the API-equivalent of the `Eval` function that is built into the Braintrust SDK. In the Eval API, you provide pointers to a dataset, task function, and scoring functions. The API will then run the evaluation, create an experiment, and return the results along with a link to the experiment. To learn more about evals, see the [Evals guide](https://www.braintrust.dev/docs/guides/evals).
type ExperimentEvent ¶ added in v0.2.0
type ExperimentEvent = shared.ExperimentEvent
This is an alias to an internal type.
type ExperimentEventContext ¶ added in v0.2.0
type ExperimentEventContext = shared.ExperimentEventContext
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
This is an alias to an internal type.
type ExperimentEventMetadata ¶ added in v0.6.0
type ExperimentEventMetadata = shared.ExperimentEventMetadata
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
This is an alias to an internal type.
type ExperimentEventMetrics ¶ added in v0.2.0
type ExperimentEventMetrics = shared.ExperimentEventMetrics
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
This is an alias to an internal type.
type ExperimentFeedbackParams ¶
type ExperimentFeedbackParams struct { // A list of experiment feedback items Feedback []shared.FeedbackExperimentItemParam `json:"feedback,omitzero,required"` // contains filtered or unexported fields }
func (ExperimentFeedbackParams) MarshalJSON ¶
func (r ExperimentFeedbackParams) MarshalJSON() (data []byte, err error)
func (*ExperimentFeedbackParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ExperimentFeedbackParams) UnmarshalJSON(data []byte) error
type ExperimentFetchParams ¶
type ExperimentFetchParams struct { // limit the number of traces fetched // // Fetch queries may be paginated if the total result size is expected to be large // (e.g. project_logs which accumulate over a long time). Note that fetch queries // only support pagination in descending time order (from latest to earliest // `_xact_id`. Furthermore, later pages may return rows which showed up in earlier // pages, except with an earlier `_xact_id`. This happens because pagination occurs // over the whole version history of the event log. You will most likely want to // exclude any such duplicate, outdated rows (by `id`) from your combined result // set. // // The `limit` parameter controls the number of full traces to return. So you may // end up with more individual rows than the specified limit if you are fetching // events containing traces. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxRootSpanID param.Opt[string] `query:"max_root_span_id,omitzero" json:"-"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxXactID param.Opt[string] `query:"max_xact_id,omitzero" json:"-"` // Retrieve a snapshot of events from a past time // // The version id is essentially a filter on the latest event transaction id. You // can use the `max_xact_id` returned by a past fetch as the version to reproduce // that exact fetch. Version param.Opt[string] `query:"version,omitzero" json:"-"` // contains filtered or unexported fields }
func (ExperimentFetchParams) URLQuery ¶
func (r ExperimentFetchParams) URLQuery() (v url.Values, err error)
URLQuery serializes ExperimentFetchParams's query parameters as `url.Values`.
type ExperimentFetchPostParams ¶
type ExperimentFetchPostParams struct { // An opaque string to be used as a cursor for the next page of results, in order // from latest to earliest. // // The string can be obtained directly from the `cursor` property of the previous // fetch query Cursor param.Opt[string] `json:"cursor,omitzero"` // limit the number of traces fetched // // Fetch queries may be paginated if the total result size is expected to be large // (e.g. project_logs which accumulate over a long time). Note that fetch queries // only support pagination in descending time order (from latest to earliest // `_xact_id`. Furthermore, later pages may return rows which showed up in earlier // pages, except with an earlier `_xact_id`. This happens because pagination occurs // over the whole version history of the event log. You will most likely want to // exclude any such duplicate, outdated rows (by `id`) from your combined result // set. // // The `limit` parameter controls the number of full traces to return. So you may // end up with more individual rows than the specified limit if you are fetching // events containing traces. Limit param.Opt[int64] `json:"limit,omitzero"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxRootSpanID param.Opt[string] `json:"max_root_span_id,omitzero"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxXactID param.Opt[string] `json:"max_xact_id,omitzero"` // Retrieve a snapshot of events from a past time // // The version id is essentially a filter on the latest event transaction id. You // can use the `max_xact_id` returned by a past fetch as the version to reproduce // that exact fetch. Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
func (ExperimentFetchPostParams) MarshalJSON ¶
func (r ExperimentFetchPostParams) MarshalJSON() (data []byte, err error)
func (*ExperimentFetchPostParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ExperimentFetchPostParams) UnmarshalJSON(data []byte) error
type ExperimentInsertParams ¶
type ExperimentInsertParams struct { // A list of experiment events to insert Events []shared.InsertExperimentEventParam `json:"events,omitzero,required"` // contains filtered or unexported fields }
func (ExperimentInsertParams) MarshalJSON ¶
func (r ExperimentInsertParams) MarshalJSON() (data []byte, err error)
func (*ExperimentInsertParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ExperimentInsertParams) UnmarshalJSON(data []byte) error
type ExperimentListParams ¶
type ExperimentListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Name of the experiment to search for ExperimentName param.Opt[string] `query:"experiment_name,omitzero" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Project id ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs ExperimentListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (ExperimentListParams) URLQuery ¶
func (r ExperimentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ExperimentListParams's query parameters as `url.Values`.
type ExperimentListParamsIDsUnion ¶ added in v0.2.0
type ExperimentListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ExperimentNewParams ¶
type ExperimentNewParams struct { // Unique identifier for the project that the experiment belongs under ProjectID string `json:"project_id,required" format:"uuid"` // Id of default base experiment to compare against when viewing this experiment BaseExpID param.Opt[string] `json:"base_exp_id,omitzero" format:"uuid"` // Identifier of the linked dataset, or null if the experiment is not linked to a // dataset DatasetID param.Opt[string] `json:"dataset_id,omitzero" format:"uuid"` // Version number of the linked dataset the experiment was run against. This can be // used to reproduce the experiment after the dataset has been modified. DatasetVersion param.Opt[string] `json:"dataset_version,omitzero"` // Textual description of the experiment Description param.Opt[string] `json:"description,omitzero"` // Normally, creating an experiment with the same name as an existing experiment // will return the existing one un-modified. But if `ensure_new` is true, // registration will generate a new experiment with a unique name in case of a // conflict. EnsureNew param.Opt[bool] `json:"ensure_new,omitzero"` // Name of the experiment. Within a project, experiment names are unique Name param.Opt[string] `json:"name,omitzero"` // Whether or not the experiment is public. Public experiments can be viewed by // anybody inside or outside the organization Public param.Opt[bool] `json:"public,omitzero"` // User-controlled metadata about the experiment Metadata map[string]any `json:"metadata,omitzero"` // Metadata about the state of the repo when the experiment was created RepoInfo shared.RepoInfoParam `json:"repo_info,omitzero"` // contains filtered or unexported fields }
func (ExperimentNewParams) MarshalJSON ¶
func (r ExperimentNewParams) MarshalJSON() (data []byte, err error)
func (*ExperimentNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ExperimentNewParams) UnmarshalJSON(data []byte) error
type ExperimentService ¶
type ExperimentService struct {
Options []option.RequestOption
}
ExperimentService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewExperimentService method instead.
func NewExperimentService ¶
func NewExperimentService(opts ...option.RequestOption) (r ExperimentService)
NewExperimentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ExperimentService) Delete ¶
func (r *ExperimentService) Delete(ctx context.Context, experimentID string, opts ...option.RequestOption) (res *shared.Experiment, err error)
Delete an experiment object by its id
func (*ExperimentService) Feedback ¶
func (r *ExperimentService) Feedback(ctx context.Context, experimentID string, body ExperimentFeedbackParams, opts ...option.RequestOption) (res *shared.FeedbackResponseSchema, err error)
Log feedback for a set of experiment events
func (*ExperimentService) Fetch ¶
func (r *ExperimentService) Fetch(ctx context.Context, experimentID string, query ExperimentFetchParams, opts ...option.RequestOption) (res *shared.FetchExperimentEventsResponse, err error)
Fetch the events in an experiment. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.
func (*ExperimentService) FetchPost ¶
func (r *ExperimentService) FetchPost(ctx context.Context, experimentID string, body ExperimentFetchPostParams, opts ...option.RequestOption) (res *shared.FetchExperimentEventsResponse, err error)
Fetch the events in an experiment. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.
func (*ExperimentService) Get ¶
func (r *ExperimentService) Get(ctx context.Context, experimentID string, opts ...option.RequestOption) (res *shared.Experiment, err error)
Get an experiment object by its id
func (*ExperimentService) Insert ¶
func (r *ExperimentService) Insert(ctx context.Context, experimentID string, body ExperimentInsertParams, opts ...option.RequestOption) (res *shared.InsertEventsResponse, err error)
Insert a set of events into the experiment
func (*ExperimentService) List ¶
func (r *ExperimentService) List(ctx context.Context, query ExperimentListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Experiment], err error)
List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first
func (*ExperimentService) ListAutoPaging ¶
func (r *ExperimentService) ListAutoPaging(ctx context.Context, query ExperimentListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Experiment]
List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first
func (*ExperimentService) New ¶
func (r *ExperimentService) New(ctx context.Context, body ExperimentNewParams, opts ...option.RequestOption) (res *shared.Experiment, err error)
Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified
func (*ExperimentService) Summarize ¶ added in v0.2.0
func (r *ExperimentService) Summarize(ctx context.Context, experimentID string, query ExperimentSummarizeParams, opts ...option.RequestOption) (res *shared.SummarizeExperimentResponse, err error)
Summarize experiment
func (*ExperimentService) Update ¶
func (r *ExperimentService) Update(ctx context.Context, experimentID string, body ExperimentUpdateParams, opts ...option.RequestOption) (res *shared.Experiment, err error)
Partially update an experiment object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type ExperimentSummarizeParams ¶ added in v0.2.0
type ExperimentSummarizeParams struct { // Whether to summarize the scores and metrics. If false (or omitted), only the // metadata will be returned. SummarizeScores param.Opt[bool] `query:"summarize_scores,omitzero" json:"-"` // The experiment to compare against, if summarizing scores and metrics. If // omitted, will fall back to the `base_exp_id` stored in the experiment metadata, // and then to the most recent experiment run in the same project. Must pass // `summarize_scores=true` for this id to be used ComparisonExperimentID param.Opt[string] `query:"comparison_experiment_id,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (ExperimentSummarizeParams) URLQuery ¶ added in v0.2.0
func (r ExperimentSummarizeParams) URLQuery() (v url.Values, err error)
URLQuery serializes ExperimentSummarizeParams's query parameters as `url.Values`.
type ExperimentUpdateParams ¶
type ExperimentUpdateParams struct { // Id of default base experiment to compare against when viewing this experiment BaseExpID param.Opt[string] `json:"base_exp_id,omitzero" format:"uuid"` // Identifier of the linked dataset, or null if the experiment is not linked to a // dataset DatasetID param.Opt[string] `json:"dataset_id,omitzero" format:"uuid"` // Version number of the linked dataset the experiment was run against. This can be // used to reproduce the experiment after the dataset has been modified. DatasetVersion param.Opt[string] `json:"dataset_version,omitzero"` // Textual description of the experiment Description param.Opt[string] `json:"description,omitzero"` // Name of the experiment. Within a project, experiment names are unique Name param.Opt[string] `json:"name,omitzero"` // Whether or not the experiment is public. Public experiments can be viewed by // anybody inside or outside the organization Public param.Opt[bool] `json:"public,omitzero"` // User-controlled metadata about the experiment Metadata map[string]any `json:"metadata,omitzero"` // Metadata about the state of the repo when the experiment was created RepoInfo shared.RepoInfoParam `json:"repo_info,omitzero"` // contains filtered or unexported fields }
func (ExperimentUpdateParams) MarshalJSON ¶
func (r ExperimentUpdateParams) MarshalJSON() (data []byte, err error)
func (*ExperimentUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ExperimentUpdateParams) UnmarshalJSON(data []byte) error
type FeedbackDatasetItemParam ¶ added in v0.2.0
type FeedbackDatasetItemParam = shared.FeedbackDatasetItemParam
This is an alias to an internal type.
type FeedbackDatasetItemSource ¶ added in v0.2.0
type FeedbackDatasetItemSource = shared.FeedbackDatasetItemSource
The source of the feedback. Must be one of "external" (default), "app", or "api"
This is an alias to an internal type.
type FeedbackExperimentItemParam ¶ added in v0.2.0
type FeedbackExperimentItemParam = shared.FeedbackExperimentItemParam
This is an alias to an internal type.
type FeedbackExperimentItemSource ¶ added in v0.2.0
type FeedbackExperimentItemSource = shared.FeedbackExperimentItemSource
The source of the feedback. Must be one of "external" (default), "app", or "api"
This is an alias to an internal type.
type FeedbackProjectLogsItemParam ¶ added in v0.2.0
type FeedbackProjectLogsItemParam = shared.FeedbackProjectLogsItemParam
This is an alias to an internal type.
type FeedbackProjectLogsItemSource ¶ added in v0.2.0
type FeedbackProjectLogsItemSource = shared.FeedbackProjectLogsItemSource
The source of the feedback. Must be one of "external" (default), "app", or "api"
This is an alias to an internal type.
type FeedbackResponseSchema ¶ added in v0.4.0
type FeedbackResponseSchema = shared.FeedbackResponseSchema
This is an alias to an internal type.
type FeedbackResponseSchemaStatus ¶ added in v0.4.0
type FeedbackResponseSchemaStatus = shared.FeedbackResponseSchemaStatus
This is an alias to an internal type.
type FetchDatasetEventsResponse ¶ added in v0.2.0
type FetchDatasetEventsResponse = shared.FetchDatasetEventsResponse
This is an alias to an internal type.
type FetchExperimentEventsResponse ¶ added in v0.2.0
type FetchExperimentEventsResponse = shared.FetchExperimentEventsResponse
This is an alias to an internal type.
type FetchProjectLogsEventsResponse ¶ added in v0.2.0
type FetchProjectLogsEventsResponse = shared.FetchProjectLogsEventsResponse
This is an alias to an internal type.
type FunctionFunctionDataCode ¶ added in v0.2.0
type FunctionFunctionDataCode = shared.FunctionFunctionDataCode
This is an alias to an internal type.
type FunctionFunctionDataCodeDataBundle ¶ added in v0.4.0
type FunctionFunctionDataCodeDataBundle = shared.FunctionFunctionDataCodeDataBundle
This is an alias to an internal type.
type FunctionFunctionDataCodeDataInline ¶ added in v0.4.0
type FunctionFunctionDataCodeDataInline = shared.FunctionFunctionDataCodeDataInline
This is an alias to an internal type.
type FunctionFunctionDataCodeDataInlineRuntimeContext ¶ added in v0.4.0
type FunctionFunctionDataCodeDataInlineRuntimeContext = shared.FunctionFunctionDataCodeDataInlineRuntimeContext
This is an alias to an internal type.
type FunctionFunctionDataCodeDataUnion ¶ added in v0.8.0
type FunctionFunctionDataCodeDataUnion = shared.FunctionFunctionDataCodeDataUnion
This is an alias to an internal type.
type FunctionFunctionDataGlobal ¶ added in v0.2.0
type FunctionFunctionDataGlobal = shared.FunctionFunctionDataGlobal
This is an alias to an internal type.
type FunctionFunctionDataPrompt ¶ added in v0.2.0
type FunctionFunctionDataPrompt = shared.FunctionFunctionDataPrompt
This is an alias to an internal type.
type FunctionFunctionDataUnion ¶ added in v0.8.0
type FunctionFunctionDataUnion = shared.FunctionFunctionDataUnion
This is an alias to an internal type.
type FunctionFunctionSchema ¶ added in v0.4.0
type FunctionFunctionSchema = shared.FunctionFunctionSchema
JSON schema for the function's parameters and return type
This is an alias to an internal type.
type FunctionFunctionType ¶ added in v0.4.0
type FunctionFunctionType = shared.FunctionFunctionType
This is an alias to an internal type.
type FunctionInvokeParams ¶ added in v0.4.0
type FunctionInvokeParams struct { // Whether to stream the response. If true, results will be returned in the // Braintrust SSE format. Stream param.Opt[bool] `json:"stream,omitzero"` // The version of the function Version param.Opt[string] `json:"version,omitzero"` // Any relevant metadata Metadata map[string]any `json:"metadata,omitzero"` // The mode format of the returned value (defaults to 'auto') // // Any of "auto", "parallel". Mode FunctionInvokeParamsMode `json:"mode,omitzero"` // The expected output of the function Expected any `json:"expected,omitzero"` // Argument to the function, which can be any JSON serializable value Input any `json:"input,omitzero"` // If the function is an LLM, additional messages to pass along to it Messages []FunctionInvokeParamsMessageUnion `json:"messages,omitzero"` // Options for tracing the function call Parent FunctionInvokeParamsParentUnion `json:"parent,omitzero"` // contains filtered or unexported fields }
func (FunctionInvokeParams) MarshalJSON ¶ added in v0.4.0
func (r FunctionInvokeParams) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParams) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParams) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageAssistant ¶ added in v0.8.0
type FunctionInvokeParamsMessageAssistant struct { // Any of "assistant". Role string `json:"role,omitzero,required"` Content param.Opt[string] `json:"content,omitzero"` Name param.Opt[string] `json:"name,omitzero"` FunctionCall FunctionInvokeParamsMessageAssistantFunctionCall `json:"function_call,omitzero"` ToolCalls []shared.ChatCompletionMessageToolCallParam `json:"tool_calls,omitzero"` // contains filtered or unexported fields }
The property Role is required.
func (FunctionInvokeParamsMessageAssistant) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageAssistant) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageAssistant) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageAssistant) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageAssistantFunctionCall ¶ added in v0.8.0
type FunctionInvokeParamsMessageAssistantFunctionCall struct { Arguments string `json:"arguments,required"` Name string `json:"name,required"` // contains filtered or unexported fields }
The properties Arguments, Name are required.
func (FunctionInvokeParamsMessageAssistantFunctionCall) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageAssistantFunctionCall) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageAssistantFunctionCall) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageAssistantFunctionCall) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageFallback ¶ added in v0.8.0
type FunctionInvokeParamsMessageFallback struct { // Any of "model". Role string `json:"role,omitzero,required"` Content param.Opt[string] `json:"content,omitzero"` // contains filtered or unexported fields }
The property Role is required.
func (FunctionInvokeParamsMessageFallback) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageFallback) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageFallback) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageFallback) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageFunction ¶ added in v0.8.0
type FunctionInvokeParamsMessageFunction struct { Name string `json:"name,required"` // Any of "function". Role string `json:"role,omitzero,required"` Content param.Opt[string] `json:"content,omitzero"` // contains filtered or unexported fields }
The properties Name, Role are required.
func (FunctionInvokeParamsMessageFunction) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageFunction) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageFunction) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageFunction) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageSystem ¶ added in v0.8.0
type FunctionInvokeParamsMessageSystem struct { // Any of "system". Role string `json:"role,omitzero,required"` Content param.Opt[string] `json:"content,omitzero"` Name param.Opt[string] `json:"name,omitzero"` // contains filtered or unexported fields }
The property Role is required.
func (FunctionInvokeParamsMessageSystem) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageSystem) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageSystem) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageSystem) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageTool ¶ added in v0.8.0
type FunctionInvokeParamsMessageTool struct { // Any of "tool". Role string `json:"role,omitzero,required"` Content param.Opt[string] `json:"content,omitzero"` ToolCallID param.Opt[string] `json:"tool_call_id,omitzero"` // contains filtered or unexported fields }
The property Role is required.
func (FunctionInvokeParamsMessageTool) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageTool) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageTool) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageTool) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageUnion ¶ added in v0.4.0
type FunctionInvokeParamsMessageUnion struct { OfSystem *FunctionInvokeParamsMessageSystem `json:",omitzero,inline"` OfUser *FunctionInvokeParamsMessageUser `json:",omitzero,inline"` OfAssistant *FunctionInvokeParamsMessageAssistant `json:",omitzero,inline"` OfTool *FunctionInvokeParamsMessageTool `json:",omitzero,inline"` OfFunction *FunctionInvokeParamsMessageFunction `json:",omitzero,inline"` OfFallback *FunctionInvokeParamsMessageFallback `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionInvokeParamsMessageUnion) GetContent ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) GetContent() (res functionInvokeParamsMessageUnionContent)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (FunctionInvokeParamsMessageUnion) GetFunctionCall ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) GetFunctionCall() *FunctionInvokeParamsMessageAssistantFunctionCall
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUnion) GetName ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUnion) GetRole ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) GetRole() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUnion) GetToolCallID ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) GetToolCallID() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUnion) GetToolCalls ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) GetToolCalls() []shared.ChatCompletionMessageToolCallParam
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUnion) MarshalJSON() ([]byte, error)
func (*FunctionInvokeParamsMessageUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionInvokeParamsMessageUnion) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageUser ¶ added in v0.8.0
type FunctionInvokeParamsMessageUser struct { // Any of "user". Role string `json:"role,omitzero,required"` Name param.Opt[string] `json:"name,omitzero"` Content FunctionInvokeParamsMessageUserContentUnion `json:"content,omitzero"` // contains filtered or unexported fields }
The property Role is required.
func (FunctionInvokeParamsMessageUser) MarshalJSON ¶ added in v0.8.0
func (r FunctionInvokeParamsMessageUser) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsMessageUser) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsMessageUser) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageUserContentArrayItemUnion ¶ added in v0.8.0
type FunctionInvokeParamsMessageUserContentArrayItemUnion struct { OfText *shared.ChatCompletionContentPartTextParam `json:",omitzero,inline"` OfImageURL *shared.ChatCompletionContentPartImageParam `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionInvokeParamsMessageUserContentArrayItemUnion) GetImageURL ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) GetImageURL() *shared.ChatCompletionContentPartImageImageURLParam
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUserContentArrayItemUnion) GetText ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUserContentArrayItemUnion) GetType ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionInvokeParamsMessageUserContentArrayItemUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUserContentArrayItemUnion) MarshalJSON() ([]byte, error)
func (*FunctionInvokeParamsMessageUserContentArrayItemUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionInvokeParamsMessageUserContentArrayItemUnion) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMessageUserContentUnion ¶ added in v0.8.0
type FunctionInvokeParamsMessageUserContentUnion struct { OfString param.Opt[string] `json:",omitzero,inline"` OfArray []FunctionInvokeParamsMessageUserContentArrayItemUnion `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionInvokeParamsMessageUserContentUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionInvokeParamsMessageUserContentUnion) MarshalJSON() ([]byte, error)
func (*FunctionInvokeParamsMessageUserContentUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionInvokeParamsMessageUserContentUnion) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsMode ¶ added in v0.4.0
type FunctionInvokeParamsMode string
The mode format of the returned value (defaults to 'auto')
const ( FunctionInvokeParamsModeAuto FunctionInvokeParamsMode = "auto" FunctionInvokeParamsModeParallel FunctionInvokeParamsMode = "parallel" )
type FunctionInvokeParamsParentSpanParentStruct ¶ added in v0.4.0
type FunctionInvokeParamsParentSpanParentStruct struct { // The id of the container object you are logging to ObjectID string `json:"object_id,required"` // Any of "project_logs", "experiment", "playground_logs". ObjectType string `json:"object_type,omitzero,required"` // Include these properties in every span created under this parent PropagatedEvent map[string]any `json:"propagated_event,omitzero"` // Identifiers for the row to to log a subspan under RowIDs FunctionInvokeParamsParentSpanParentStructRowIDs `json:"row_ids,omitzero"` // contains filtered or unexported fields }
Span parent properties
The properties ObjectID, ObjectType are required.
func (FunctionInvokeParamsParentSpanParentStruct) MarshalJSON ¶ added in v0.4.0
func (r FunctionInvokeParamsParentSpanParentStruct) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsParentSpanParentStruct) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsParentSpanParentStruct) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsParentSpanParentStructRowIDs ¶ added in v0.4.0
type FunctionInvokeParamsParentSpanParentStructRowIDs struct { // The id of the row ID string `json:"id,required"` // The root_span_id of the row RootSpanID string `json:"root_span_id,required"` // The span_id of the row SpanID string `json:"span_id,required"` // contains filtered or unexported fields }
Identifiers for the row to to log a subspan under
The properties ID, RootSpanID, SpanID are required.
func (FunctionInvokeParamsParentSpanParentStructRowIDs) MarshalJSON ¶ added in v0.4.0
func (r FunctionInvokeParamsParentSpanParentStructRowIDs) MarshalJSON() (data []byte, err error)
func (*FunctionInvokeParamsParentSpanParentStructRowIDs) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionInvokeParamsParentSpanParentStructRowIDs) UnmarshalJSON(data []byte) error
type FunctionInvokeParamsParentUnion ¶ added in v0.4.0
type FunctionInvokeParamsParentUnion struct { OfSpanParentStruct *FunctionInvokeParamsParentSpanParentStruct `json:",omitzero,inline"` OfString param.Opt[string] `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionInvokeParamsParentUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionInvokeParamsParentUnion) MarshalJSON() ([]byte, error)
func (*FunctionInvokeParamsParentUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionInvokeParamsParentUnion) UnmarshalJSON(data []byte) error
type FunctionInvokeResponse ¶ added in v0.4.0
type FunctionInvokeResponse = any
type FunctionListParams ¶ added in v0.2.0
type FunctionListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Name of the function to search for FunctionName param.Opt[string] `query:"function_name,omitzero" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Project id ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Retrieve prompt with a specific slug Slug param.Opt[string] `query:"slug,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Retrieve prompt at a specific version. // // The version id can either be a transaction id (e.g. '1000192656880881099') or a // version identifier (e.g. '81cd05ee665fdfb3'). Version param.Opt[string] `query:"version,omitzero" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs FunctionListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (FunctionListParams) URLQuery ¶ added in v0.2.0
func (r FunctionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes FunctionListParams's query parameters as `url.Values`.
type FunctionListParamsIDsUnion ¶ added in v0.2.0
type FunctionListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type FunctionLogID ¶ added in v0.2.0
type FunctionLogID = shared.FunctionLogID
A literal 'p' which identifies the object as a project prompt
This is an alias to an internal type.
type FunctionNewParams ¶ added in v0.2.0
type FunctionNewParams struct { FunctionData FunctionNewParamsFunctionDataUnion `json:"function_data,omitzero,required"` // Name of the prompt Name string `json:"name,required"` // 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"` // Textual description of the prompt Description param.Opt[string] `json:"description,omitzero"` // JSON schema for the function's parameters and return type FunctionSchema FunctionNewParamsFunctionSchema `json:"function_schema,omitzero"` // Any of "llm", "scorer", "task", "tool". FunctionType FunctionNewParamsFunctionType `json:"function_type,omitzero"` Origin FunctionNewParamsOrigin `json:"origin,omitzero"` // The prompt, model, and its parameters PromptData shared.PromptDataParam `json:"prompt_data,omitzero"` // A list of tags for the prompt Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (FunctionNewParams) MarshalJSON ¶ added in v0.2.0
func (r FunctionNewParams) MarshalJSON() (data []byte, err error)
func (*FunctionNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParams) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataCode ¶ added in v0.3.0
type FunctionNewParamsFunctionDataCode struct { Data FunctionNewParamsFunctionDataCodeDataUnion `json:"data,omitzero,required"` // Any of "code". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Data, Type are required.
func (FunctionNewParamsFunctionDataCode) MarshalJSON ¶ added in v0.3.0
func (r FunctionNewParamsFunctionDataCode) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsFunctionDataCode) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsFunctionDataCode) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataCodeDataBundle ¶ added in v0.4.0
type FunctionNewParamsFunctionDataCodeDataBundle struct { Type string `json:"type,omitzero,required"` shared.CodeBundleParam }
func (FunctionNewParamsFunctionDataCodeDataBundle) MarshalJSON ¶ added in v0.4.0
func (r FunctionNewParamsFunctionDataCodeDataBundle) MarshalJSON() (data []byte, err error)
type FunctionNewParamsFunctionDataCodeDataInline ¶ added in v0.4.0
type FunctionNewParamsFunctionDataCodeDataInline struct { Code string `json:"code,required"` RuntimeContext FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext `json:"runtime_context,omitzero,required"` // Any of "inline". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Code, RuntimeContext, Type are required.
func (FunctionNewParamsFunctionDataCodeDataInline) MarshalJSON ¶ added in v0.4.0
func (r FunctionNewParamsFunctionDataCodeDataInline) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsFunctionDataCodeDataInline) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsFunctionDataCodeDataInline) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext ¶ added in v0.4.0
type FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext struct { // Any of "node", "python". Runtime string `json:"runtime,omitzero,required"` Version string `json:"version,required"` // contains filtered or unexported fields }
The properties Runtime, Version are required.
func (FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext) MarshalJSON ¶ added in v0.4.0
func (r FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataCodeDataUnion ¶ added in v0.4.0
type FunctionNewParamsFunctionDataCodeDataUnion struct { OfBundle *FunctionNewParamsFunctionDataCodeDataBundle `json:",omitzero,inline"` OfInline *FunctionNewParamsFunctionDataCodeDataInline `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionNewParamsFunctionDataCodeDataUnion) GetBundleID ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) GetBundleID() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataCodeDataUnion) GetCode ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) GetCode() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataCodeDataUnion) GetLocation ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) GetLocation() *shared.CodeBundleLocationUnionParam
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataCodeDataUnion) GetPreview ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) GetPreview() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataCodeDataUnion) GetRuntimeContext ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) GetRuntimeContext() (res functionNewParamsFunctionDataCodeDataUnionRuntimeContext)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (FunctionNewParamsFunctionDataCodeDataUnion) GetType ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataCodeDataUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataCodeDataUnion) MarshalJSON() ([]byte, error)
func (*FunctionNewParamsFunctionDataCodeDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionNewParamsFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataGlobal ¶ added in v0.3.0
type FunctionNewParamsFunctionDataGlobal struct { Name string `json:"name,required"` // Any of "global". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Name, Type are required.
func (FunctionNewParamsFunctionDataGlobal) MarshalJSON ¶ added in v0.3.0
func (r FunctionNewParamsFunctionDataGlobal) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsFunctionDataGlobal) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsFunctionDataGlobal) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataPrompt ¶ added in v0.3.0
type FunctionNewParamsFunctionDataPrompt struct { // Any of "prompt". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The property Type is required.
func (FunctionNewParamsFunctionDataPrompt) MarshalJSON ¶ added in v0.3.0
func (r FunctionNewParamsFunctionDataPrompt) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsFunctionDataPrompt) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsFunctionDataPrompt) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionDataUnion ¶ added in v0.3.0
type FunctionNewParamsFunctionDataUnion struct { OfPrompt *FunctionNewParamsFunctionDataPrompt `json:",omitzero,inline"` OfCode *FunctionNewParamsFunctionDataCode `json:",omitzero,inline"` OfGlobal *FunctionNewParamsFunctionDataGlobal `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionNewParamsFunctionDataUnion) GetData ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataUnion) GetData() *FunctionNewParamsFunctionDataCodeDataUnion
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataUnion) GetName ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataUnion) GetType ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionNewParamsFunctionDataUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionNewParamsFunctionDataUnion) MarshalJSON() ([]byte, error)
func (*FunctionNewParamsFunctionDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionNewParamsFunctionDataUnion) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionSchema ¶ added in v0.4.0
type FunctionNewParamsFunctionSchema struct { Parameters any `json:"parameters,omitzero"` Returns any `json:"returns,omitzero"` // contains filtered or unexported fields }
JSON schema for the function's parameters and return type
func (FunctionNewParamsFunctionSchema) MarshalJSON ¶ added in v0.4.0
func (r FunctionNewParamsFunctionSchema) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsFunctionSchema) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsFunctionSchema) UnmarshalJSON(data []byte) error
type FunctionNewParamsFunctionType ¶ added in v0.4.0
type FunctionNewParamsFunctionType string
const ( FunctionNewParamsFunctionTypeLlm FunctionNewParamsFunctionType = "llm" FunctionNewParamsFunctionTypeScorer FunctionNewParamsFunctionType = "scorer" FunctionNewParamsFunctionTypeTask FunctionNewParamsFunctionType = "task" FunctionNewParamsFunctionTypeTool FunctionNewParamsFunctionType = "tool" )
type FunctionNewParamsOrigin ¶ added in v0.4.0
type FunctionNewParamsOrigin struct { // Id of the object the function is originating from ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // The function exists for internal purposes and should not be displayed in the // list of functions. Internal param.Opt[bool] `json:"internal,omitzero"` // contains filtered or unexported fields }
The properties ObjectID, ObjectType are required.
func (FunctionNewParamsOrigin) MarshalJSON ¶ added in v0.4.0
func (r FunctionNewParamsOrigin) MarshalJSON() (data []byte, err error)
func (*FunctionNewParamsOrigin) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionNewParamsOrigin) UnmarshalJSON(data []byte) error
type FunctionOrigin ¶ added in v0.4.0
type FunctionOrigin = shared.FunctionOrigin
This is an alias to an internal type.
type FunctionReplaceParams ¶ added in v0.2.0
type FunctionReplaceParams struct { FunctionData FunctionReplaceParamsFunctionDataUnion `json:"function_data,omitzero,required"` // Name of the prompt Name string `json:"name,required"` // 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"` // Textual description of the prompt Description param.Opt[string] `json:"description,omitzero"` // JSON schema for the function's parameters and return type FunctionSchema FunctionReplaceParamsFunctionSchema `json:"function_schema,omitzero"` // Any of "llm", "scorer", "task", "tool". FunctionType FunctionReplaceParamsFunctionType `json:"function_type,omitzero"` Origin FunctionReplaceParamsOrigin `json:"origin,omitzero"` // The prompt, model, and its parameters PromptData shared.PromptDataParam `json:"prompt_data,omitzero"` // A list of tags for the prompt Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (FunctionReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r FunctionReplaceParams) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParams) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataCode ¶ added in v0.3.0
type FunctionReplaceParamsFunctionDataCode struct { Data FunctionReplaceParamsFunctionDataCodeDataUnion `json:"data,omitzero,required"` // Any of "code". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Data, Type are required.
func (FunctionReplaceParamsFunctionDataCode) MarshalJSON ¶ added in v0.3.0
func (r FunctionReplaceParamsFunctionDataCode) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsFunctionDataCode) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsFunctionDataCode) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataCodeDataBundle ¶ added in v0.4.0
type FunctionReplaceParamsFunctionDataCodeDataBundle struct { Type string `json:"type,omitzero,required"` shared.CodeBundleParam }
func (FunctionReplaceParamsFunctionDataCodeDataBundle) MarshalJSON ¶ added in v0.4.0
func (r FunctionReplaceParamsFunctionDataCodeDataBundle) MarshalJSON() (data []byte, err error)
type FunctionReplaceParamsFunctionDataCodeDataInline ¶ added in v0.4.0
type FunctionReplaceParamsFunctionDataCodeDataInline struct { Code string `json:"code,required"` RuntimeContext FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext `json:"runtime_context,omitzero,required"` // Any of "inline". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Code, RuntimeContext, Type are required.
func (FunctionReplaceParamsFunctionDataCodeDataInline) MarshalJSON ¶ added in v0.4.0
func (r FunctionReplaceParamsFunctionDataCodeDataInline) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsFunctionDataCodeDataInline) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsFunctionDataCodeDataInline) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext ¶ added in v0.4.0
type FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext struct { // Any of "node", "python". Runtime string `json:"runtime,omitzero,required"` Version string `json:"version,required"` // contains filtered or unexported fields }
The properties Runtime, Version are required.
func (FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext) MarshalJSON ¶ added in v0.4.0
func (r FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataCodeDataUnion ¶ added in v0.4.0
type FunctionReplaceParamsFunctionDataCodeDataUnion struct { OfBundle *FunctionReplaceParamsFunctionDataCodeDataBundle `json:",omitzero,inline"` OfInline *FunctionReplaceParamsFunctionDataCodeDataInline `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionReplaceParamsFunctionDataCodeDataUnion) GetBundleID ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetBundleID() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataCodeDataUnion) GetCode ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetCode() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataCodeDataUnion) GetLocation ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetLocation() *shared.CodeBundleLocationUnionParam
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataCodeDataUnion) GetPreview ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetPreview() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataCodeDataUnion) GetRuntimeContext ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetRuntimeContext() (res functionReplaceParamsFunctionDataCodeDataUnionRuntimeContext)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (FunctionReplaceParamsFunctionDataCodeDataUnion) GetType ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataCodeDataUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataCodeDataUnion) MarshalJSON() ([]byte, error)
func (*FunctionReplaceParamsFunctionDataCodeDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionReplaceParamsFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataGlobal ¶ added in v0.3.0
type FunctionReplaceParamsFunctionDataGlobal struct { Name string `json:"name,required"` // Any of "global". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Name, Type are required.
func (FunctionReplaceParamsFunctionDataGlobal) MarshalJSON ¶ added in v0.3.0
func (r FunctionReplaceParamsFunctionDataGlobal) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsFunctionDataGlobal) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsFunctionDataGlobal) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataPrompt ¶ added in v0.3.0
type FunctionReplaceParamsFunctionDataPrompt struct { // Any of "prompt". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The property Type is required.
func (FunctionReplaceParamsFunctionDataPrompt) MarshalJSON ¶ added in v0.3.0
func (r FunctionReplaceParamsFunctionDataPrompt) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsFunctionDataPrompt) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsFunctionDataPrompt) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionDataUnion ¶ added in v0.3.0
type FunctionReplaceParamsFunctionDataUnion struct { OfPrompt *FunctionReplaceParamsFunctionDataPrompt `json:",omitzero,inline"` OfCode *FunctionReplaceParamsFunctionDataCode `json:",omitzero,inline"` OfGlobal *FunctionReplaceParamsFunctionDataGlobal `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionReplaceParamsFunctionDataUnion) GetData ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataUnion) GetData() *FunctionReplaceParamsFunctionDataCodeDataUnion
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataUnion) GetName ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataUnion) GetType ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionReplaceParamsFunctionDataUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionReplaceParamsFunctionDataUnion) MarshalJSON() ([]byte, error)
func (*FunctionReplaceParamsFunctionDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionReplaceParamsFunctionDataUnion) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionSchema ¶ added in v0.4.0
type FunctionReplaceParamsFunctionSchema struct { Parameters any `json:"parameters,omitzero"` Returns any `json:"returns,omitzero"` // contains filtered or unexported fields }
JSON schema for the function's parameters and return type
func (FunctionReplaceParamsFunctionSchema) MarshalJSON ¶ added in v0.4.0
func (r FunctionReplaceParamsFunctionSchema) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsFunctionSchema) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsFunctionSchema) UnmarshalJSON(data []byte) error
type FunctionReplaceParamsFunctionType ¶ added in v0.4.0
type FunctionReplaceParamsFunctionType string
const ( FunctionReplaceParamsFunctionTypeLlm FunctionReplaceParamsFunctionType = "llm" FunctionReplaceParamsFunctionTypeScorer FunctionReplaceParamsFunctionType = "scorer" FunctionReplaceParamsFunctionTypeTask FunctionReplaceParamsFunctionType = "task" FunctionReplaceParamsFunctionTypeTool FunctionReplaceParamsFunctionType = "tool" )
type FunctionReplaceParamsOrigin ¶ added in v0.4.0
type FunctionReplaceParamsOrigin struct { // Id of the object the function is originating from ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // The function exists for internal purposes and should not be displayed in the // list of functions. Internal param.Opt[bool] `json:"internal,omitzero"` // contains filtered or unexported fields }
The properties ObjectID, ObjectType are required.
func (FunctionReplaceParamsOrigin) MarshalJSON ¶ added in v0.4.0
func (r FunctionReplaceParamsOrigin) MarshalJSON() (data []byte, err error)
func (*FunctionReplaceParamsOrigin) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionReplaceParamsOrigin) UnmarshalJSON(data []byte) error
type FunctionService ¶ added in v0.2.0
type FunctionService struct {
Options []option.RequestOption
}
FunctionService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFunctionService method instead.
func NewFunctionService ¶ added in v0.2.0
func NewFunctionService(opts ...option.RequestOption) (r FunctionService)
NewFunctionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FunctionService) Delete ¶ added in v0.2.0
func (r *FunctionService) Delete(ctx context.Context, functionID string, opts ...option.RequestOption) (res *shared.Function, err error)
Delete a function object by its id
func (*FunctionService) Get ¶ added in v0.2.0
func (r *FunctionService) Get(ctx context.Context, functionID string, opts ...option.RequestOption) (res *shared.Function, err error)
Get a function object by its id
func (*FunctionService) Invoke ¶ added in v0.4.0
func (r *FunctionService) Invoke(ctx context.Context, functionID string, body FunctionInvokeParams, opts ...option.RequestOption) (res *FunctionInvokeResponse, err error)
Invoke a function.
func (*FunctionService) List ¶ added in v0.2.0
func (r *FunctionService) List(ctx context.Context, query FunctionListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Function], err error)
List out all functions. The functions are sorted by creation date, with the most recently-created functions coming first
func (*FunctionService) ListAutoPaging ¶ added in v0.2.0
func (r *FunctionService) ListAutoPaging(ctx context.Context, query FunctionListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Function]
List out all functions. The functions are sorted by creation date, with the most recently-created functions coming first
func (*FunctionService) New ¶ added in v0.2.0
func (r *FunctionService) New(ctx context.Context, body FunctionNewParams, opts ...option.RequestOption) (res *shared.Function, err error)
Create a new function. If there is an existing function in the project with the same slug as the one specified in the request, will return the existing function unmodified
func (*FunctionService) Replace ¶ added in v0.2.0
func (r *FunctionService) Replace(ctx context.Context, body FunctionReplaceParams, opts ...option.RequestOption) (res *shared.Function, err error)
Create or replace function. If there is an existing function in the project with the same slug as the one specified in the request, will replace the existing function with the provided fields
func (*FunctionService) Update ¶ added in v0.2.0
func (r *FunctionService) Update(ctx context.Context, functionID string, body FunctionUpdateParams, opts ...option.RequestOption) (res *shared.Function, err error)
Partially update a function object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type FunctionUpdateParams ¶ added in v0.2.0
type FunctionUpdateParams struct { // Textual description of the prompt Description param.Opt[string] `json:"description,omitzero"` // Name of the prompt Name param.Opt[string] `json:"name,omitzero"` FunctionData FunctionUpdateParamsFunctionDataUnion `json:"function_data,omitzero"` // The prompt, model, and its parameters PromptData shared.PromptDataParam `json:"prompt_data,omitzero"` // A list of tags for the prompt Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (FunctionUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r FunctionUpdateParams) MarshalJSON() (data []byte, err error)
func (*FunctionUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionUpdateParams) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataCode ¶ added in v0.3.0
type FunctionUpdateParamsFunctionDataCode struct { Data FunctionUpdateParamsFunctionDataCodeDataUnion `json:"data,omitzero,required"` // Any of "code". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Data, Type are required.
func (FunctionUpdateParamsFunctionDataCode) MarshalJSON ¶ added in v0.3.0
func (r FunctionUpdateParamsFunctionDataCode) MarshalJSON() (data []byte, err error)
func (*FunctionUpdateParamsFunctionDataCode) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionUpdateParamsFunctionDataCode) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataCodeDataBundle ¶ added in v0.4.0
type FunctionUpdateParamsFunctionDataCodeDataBundle struct { Type string `json:"type,omitzero,required"` shared.CodeBundleParam }
func (FunctionUpdateParamsFunctionDataCodeDataBundle) MarshalJSON ¶ added in v0.4.0
func (r FunctionUpdateParamsFunctionDataCodeDataBundle) MarshalJSON() (data []byte, err error)
type FunctionUpdateParamsFunctionDataCodeDataInline ¶ added in v0.4.0
type FunctionUpdateParamsFunctionDataCodeDataInline struct { Code string `json:"code,required"` RuntimeContext FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext `json:"runtime_context,omitzero,required"` // Any of "inline". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Code, RuntimeContext, Type are required.
func (FunctionUpdateParamsFunctionDataCodeDataInline) MarshalJSON ¶ added in v0.4.0
func (r FunctionUpdateParamsFunctionDataCodeDataInline) MarshalJSON() (data []byte, err error)
func (*FunctionUpdateParamsFunctionDataCodeDataInline) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionUpdateParamsFunctionDataCodeDataInline) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext ¶ added in v0.4.0
type FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext struct { // Any of "node", "python". Runtime string `json:"runtime,omitzero,required"` Version string `json:"version,required"` // contains filtered or unexported fields }
The properties Runtime, Version are required.
func (FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext) MarshalJSON ¶ added in v0.4.0
func (r FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext) MarshalJSON() (data []byte, err error)
func (*FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionUpdateParamsFunctionDataCodeDataInlineRuntimeContext) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataCodeDataUnion ¶ added in v0.4.0
type FunctionUpdateParamsFunctionDataCodeDataUnion struct { OfBundle *FunctionUpdateParamsFunctionDataCodeDataBundle `json:",omitzero,inline"` OfInline *FunctionUpdateParamsFunctionDataCodeDataInline `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionUpdateParamsFunctionDataCodeDataUnion) GetBundleID ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetBundleID() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataCodeDataUnion) GetCode ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetCode() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataCodeDataUnion) GetLocation ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetLocation() *shared.CodeBundleLocationUnionParam
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataCodeDataUnion) GetPreview ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetPreview() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataCodeDataUnion) GetRuntimeContext ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetRuntimeContext() (res functionUpdateParamsFunctionDataCodeDataUnionRuntimeContext)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (FunctionUpdateParamsFunctionDataCodeDataUnion) GetType ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataCodeDataUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataCodeDataUnion) MarshalJSON() ([]byte, error)
func (*FunctionUpdateParamsFunctionDataCodeDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionUpdateParamsFunctionDataCodeDataUnion) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataGlobal ¶ added in v0.3.0
type FunctionUpdateParamsFunctionDataGlobal struct { Name string `json:"name,required"` // Any of "global". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The properties Name, Type are required.
func (FunctionUpdateParamsFunctionDataGlobal) MarshalJSON ¶ added in v0.3.0
func (r FunctionUpdateParamsFunctionDataGlobal) MarshalJSON() (data []byte, err error)
func (*FunctionUpdateParamsFunctionDataGlobal) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionUpdateParamsFunctionDataGlobal) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataPrompt ¶ added in v0.3.0
type FunctionUpdateParamsFunctionDataPrompt struct { // Any of "prompt". Type string `json:"type,omitzero,required"` // contains filtered or unexported fields }
The property Type is required.
func (FunctionUpdateParamsFunctionDataPrompt) MarshalJSON ¶ added in v0.3.0
func (r FunctionUpdateParamsFunctionDataPrompt) MarshalJSON() (data []byte, err error)
func (*FunctionUpdateParamsFunctionDataPrompt) UnmarshalJSON ¶ added in v0.8.0
func (r *FunctionUpdateParamsFunctionDataPrompt) UnmarshalJSON(data []byte) error
type FunctionUpdateParamsFunctionDataUnion ¶ added in v0.3.0
type FunctionUpdateParamsFunctionDataUnion struct { OfPrompt *FunctionUpdateParamsFunctionDataPrompt `json:",omitzero,inline"` OfCode *FunctionUpdateParamsFunctionDataCode `json:",omitzero,inline"` OfGlobal *FunctionUpdateParamsFunctionDataGlobal `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (FunctionUpdateParamsFunctionDataUnion) GetData ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataUnion) GetData() *FunctionUpdateParamsFunctionDataCodeDataUnion
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataUnion) GetName ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataUnion) GetType ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FunctionUpdateParamsFunctionDataUnion) MarshalJSON ¶ added in v0.8.0
func (u FunctionUpdateParamsFunctionDataUnion) MarshalJSON() ([]byte, error)
func (*FunctionUpdateParamsFunctionDataUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *FunctionUpdateParamsFunctionDataUnion) UnmarshalJSON(data []byte) error
type Group ¶ added in v0.2.0
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
This is an alias to an internal type.
type GroupListParams ¶ added in v0.2.0
type GroupListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Name of the group to search for GroupName param.Opt[string] `query:"group_name,omitzero" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs GroupListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (GroupListParams) URLQuery ¶ added in v0.2.0
func (r GroupListParams) URLQuery() (v url.Values, err error)
URLQuery serializes GroupListParams's query parameters as `url.Values`.
type GroupListParamsIDsUnion ¶ added in v0.2.0
type GroupListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type GroupNewParams ¶ added in v0.2.0
type GroupNewParams struct { // Name of the group Name string `json:"name,required"` // Textual description of the group Description param.Opt[string] `json:"description,omitzero"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the group belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // 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,omitzero" format:"uuid"` // Ids of users which belong to this group MemberUsers []string `json:"member_users,omitzero" format:"uuid"` // contains filtered or unexported fields }
func (GroupNewParams) MarshalJSON ¶ added in v0.2.0
func (r GroupNewParams) MarshalJSON() (data []byte, err error)
func (*GroupNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *GroupNewParams) UnmarshalJSON(data []byte) error
type GroupReplaceParams ¶ added in v0.2.0
type GroupReplaceParams struct { // Name of the group Name string `json:"name,required"` // Textual description of the group Description param.Opt[string] `json:"description,omitzero"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the group belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // 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,omitzero" format:"uuid"` // Ids of users which belong to this group MemberUsers []string `json:"member_users,omitzero" format:"uuid"` // contains filtered or unexported fields }
func (GroupReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r GroupReplaceParams) MarshalJSON() (data []byte, err error)
func (*GroupReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *GroupReplaceParams) UnmarshalJSON(data []byte) error
type GroupService ¶ added in v0.2.0
type GroupService struct {
Options []option.RequestOption
}
GroupService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGroupService method instead.
func NewGroupService ¶ added in v0.2.0
func NewGroupService(opts ...option.RequestOption) (r GroupService)
NewGroupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*GroupService) Delete ¶ added in v0.2.0
func (r *GroupService) Delete(ctx context.Context, groupID string, opts ...option.RequestOption) (res *shared.Group, err error)
Delete a group object by its id
func (*GroupService) Get ¶ added in v0.2.0
func (r *GroupService) Get(ctx context.Context, groupID string, opts ...option.RequestOption) (res *shared.Group, err error)
Get a group object by its id
func (*GroupService) List ¶ added in v0.2.0
func (r *GroupService) List(ctx context.Context, query GroupListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Group], err error)
List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first
func (*GroupService) ListAutoPaging ¶ added in v0.2.0
func (r *GroupService) ListAutoPaging(ctx context.Context, query GroupListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Group]
List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first
func (*GroupService) New ¶ added in v0.2.0
func (r *GroupService) New(ctx context.Context, body GroupNewParams, opts ...option.RequestOption) (res *shared.Group, err error)
Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified
func (*GroupService) Replace ¶ added in v0.2.0
func (r *GroupService) Replace(ctx context.Context, body GroupReplaceParams, opts ...option.RequestOption) (res *shared.Group, err error)
Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields
func (*GroupService) Update ¶ added in v0.2.0
func (r *GroupService) Update(ctx context.Context, groupID string, body GroupUpdateParams, opts ...option.RequestOption) (res *shared.Group, err error)
Partially update a group object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type GroupUpdateParams ¶ added in v0.2.0
type GroupUpdateParams struct { // Textual description of the group Description param.Opt[string] `json:"description,omitzero"` // Name of the group Name param.Opt[string] `json:"name,omitzero"` // A list of group IDs to add to the group's inheriting-from set AddMemberGroups []string `json:"add_member_groups,omitzero" format:"uuid"` // A list of user IDs to add to the group AddMemberUsers []string `json:"add_member_users,omitzero" format:"uuid"` // A list of group IDs to remove from the group's inheriting-from set RemoveMemberGroups []string `json:"remove_member_groups,omitzero" format:"uuid"` // A list of user IDs to remove from the group RemoveMemberUsers []string `json:"remove_member_users,omitzero" format:"uuid"` // contains filtered or unexported fields }
func (GroupUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r GroupUpdateParams) MarshalJSON() (data []byte, err error)
func (*GroupUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *GroupUpdateParams) UnmarshalJSON(data []byte) error
type InsertDatasetEventMetadataParam ¶ added in v0.6.0
type InsertDatasetEventMetadataParam = shared.InsertDatasetEventMetadataParam
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
This is an alias to an internal type.
type InsertDatasetEventParam ¶ added in v0.5.0
type InsertDatasetEventParam = shared.InsertDatasetEventParam
A dataset event
This is an alias to an internal type.
type InsertEventsResponse ¶ added in v0.2.0
type InsertEventsResponse = shared.InsertEventsResponse
This is an alias to an internal type.
type InsertExperimentEventContextParam ¶ added in v0.5.0
type InsertExperimentEventContextParam = shared.InsertExperimentEventContextParam
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
This is an alias to an internal type.
type InsertExperimentEventMetadataParam ¶ added in v0.6.0
type InsertExperimentEventMetadataParam = shared.InsertExperimentEventMetadataParam
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
This is an alias to an internal type.
type InsertExperimentEventMetricsParam ¶ added in v0.5.0
type InsertExperimentEventMetricsParam = shared.InsertExperimentEventMetricsParam
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
This is an alias to an internal type.
type InsertExperimentEventParam ¶ added in v0.5.0
type InsertExperimentEventParam = shared.InsertExperimentEventParam
An experiment event
This is an alias to an internal type.
type InsertProjectLogsEventContextParam ¶ added in v0.5.0
type InsertProjectLogsEventContextParam = shared.InsertProjectLogsEventContextParam
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
This is an alias to an internal type.
type InsertProjectLogsEventMetadataParam ¶ added in v0.6.0
type InsertProjectLogsEventMetadataParam = shared.InsertProjectLogsEventMetadataParam
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
This is an alias to an internal type.
type InsertProjectLogsEventMetricsParam ¶ added in v0.5.0
type InsertProjectLogsEventMetricsParam = shared.InsertProjectLogsEventMetricsParam
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
This is an alias to an internal type.
type InsertProjectLogsEventParam ¶ added in v0.5.0
type InsertProjectLogsEventParam = shared.InsertProjectLogsEventParam
A project logs event
This is an alias to an internal type.
type MetricSummary ¶ added in v0.2.0
type MetricSummary = shared.MetricSummary
Summary of a metric's performance
This is an alias to an internal type.
type ObjectReference ¶ added in v0.6.0
type ObjectReference = shared.ObjectReference
Indicates the event was copied from another object.
This is an alias to an internal type.
type ObjectReferenceObjectType ¶ added in v0.6.0
type ObjectReferenceObjectType = shared.ObjectReferenceObjectType
Type of the object the event is originating from.
This is an alias to an internal type.
type ObjectReferenceParam ¶ added in v0.6.0
type ObjectReferenceParam = shared.ObjectReferenceParam
Indicates the event was copied from another object.
This is an alias to an internal type.
type OnlineScoreConfig ¶ added in v0.4.0
type OnlineScoreConfig = shared.OnlineScoreConfig
This is an alias to an internal type.
type OnlineScoreConfigParam ¶ added in v0.4.0
type OnlineScoreConfigParam = shared.OnlineScoreConfigParam
This is an alias to an internal type.
type OnlineScoreConfigScorerFunction ¶ added in v0.8.0
type OnlineScoreConfigScorerFunction = shared.OnlineScoreConfigScorerFunction
This is an alias to an internal type.
type OnlineScoreConfigScorerFunctionParam ¶ added in v0.8.0
type OnlineScoreConfigScorerFunctionParam = shared.OnlineScoreConfigScorerFunctionParam
This is an alias to an internal type.
type OnlineScoreConfigScorerGlobal ¶ added in v0.8.0
type OnlineScoreConfigScorerGlobal = shared.OnlineScoreConfigScorerGlobal
This is an alias to an internal type.
type OnlineScoreConfigScorerGlobalParam ¶ added in v0.8.0
type OnlineScoreConfigScorerGlobalParam = shared.OnlineScoreConfigScorerGlobalParam
This is an alias to an internal type.
type OnlineScoreConfigScorerUnion ¶ added in v0.8.0
type OnlineScoreConfigScorerUnion = shared.OnlineScoreConfigScorerUnion
This is an alias to an internal type.
type OnlineScoreConfigScorerUnionParam ¶ added in v0.8.0
type OnlineScoreConfigScorerUnionParam = shared.OnlineScoreConfigScorerUnionParam
This is an alias to an internal type.
type Organization ¶ added in v0.2.0
type Organization = shared.Organization
This is an alias to an internal type.
type OrganizationListParams ¶ added in v0.2.0
type OrganizationListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs OrganizationListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (OrganizationListParams) URLQuery ¶ added in v0.2.0
func (r OrganizationListParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrganizationListParams's query parameters as `url.Values`.
type OrganizationListParamsIDsUnion ¶ added in v0.2.0
type OrganizationListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type OrganizationMemberService ¶ added in v0.2.0
type OrganizationMemberService struct {
Options []option.RequestOption
}
OrganizationMemberService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationMemberService method instead.
func NewOrganizationMemberService ¶ added in v0.2.0
func NewOrganizationMemberService(opts ...option.RequestOption) (r OrganizationMemberService)
NewOrganizationMemberService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OrganizationMemberService) Update ¶ added in v0.2.0
func (r *OrganizationMemberService) Update(ctx context.Context, body OrganizationMemberUpdateParams, opts ...option.RequestOption) (res *shared.PatchOrganizationMembersOutput, err error)
Modify organization membership
type OrganizationMemberUpdateParams ¶ added in v0.2.0
type OrganizationMemberUpdateParams struct { // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, or in case you want to // explicitly assert the organization you are modifying, you may specify the id of // the organization. OrgID param.Opt[string] `json:"org_id,omitzero"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, or in case you want to // explicitly assert the organization you are modifying, you may specify the name // of the organization. OrgName param.Opt[string] `json:"org_name,omitzero"` // Users to invite to the organization InviteUsers OrganizationMemberUpdateParamsInviteUsers `json:"invite_users,omitzero"` // Users to remove from the organization RemoveUsers OrganizationMemberUpdateParamsRemoveUsers `json:"remove_users,omitzero"` // contains filtered or unexported fields }
func (OrganizationMemberUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r OrganizationMemberUpdateParams) MarshalJSON() (data []byte, err error)
func (*OrganizationMemberUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *OrganizationMemberUpdateParams) UnmarshalJSON(data []byte) error
type OrganizationMemberUpdateParamsInviteUsers ¶ added in v0.3.0
type OrganizationMemberUpdateParamsInviteUsers struct { // Singular form of group_ids GroupID param.Opt[string] `json:"group_id,omitzero" format:"uuid"` // Singular form of group_names GroupName param.Opt[string] `json:"group_name,omitzero"` // If true, send invite emails to the users who wore actually added SendInviteEmails param.Opt[bool] `json:"send_invite_emails,omitzero"` // Emails of users to invite Emails []string `json:"emails,omitzero"` // Optional list of group ids to add newly-invited users to. GroupIDs []string `json:"group_ids,omitzero" format:"uuid"` // Optional list of group names to add newly-invited users to. GroupNames []string `json:"group_names,omitzero"` // Ids of existing users to invite IDs []string `json:"ids,omitzero" format:"uuid"` // contains filtered or unexported fields }
Users to invite to the organization
func (OrganizationMemberUpdateParamsInviteUsers) MarshalJSON ¶ added in v0.3.0
func (r OrganizationMemberUpdateParamsInviteUsers) MarshalJSON() (data []byte, err error)
func (*OrganizationMemberUpdateParamsInviteUsers) UnmarshalJSON ¶ added in v0.8.0
func (r *OrganizationMemberUpdateParamsInviteUsers) UnmarshalJSON(data []byte) error
type OrganizationMemberUpdateParamsRemoveUsers ¶ added in v0.3.0
type OrganizationMemberUpdateParamsRemoveUsers struct { // Emails of users to remove Emails []string `json:"emails,omitzero"` // Ids of users to remove IDs []string `json:"ids,omitzero" format:"uuid"` // contains filtered or unexported fields }
Users to remove from the organization
func (OrganizationMemberUpdateParamsRemoveUsers) MarshalJSON ¶ added in v0.3.0
func (r OrganizationMemberUpdateParamsRemoveUsers) MarshalJSON() (data []byte, err error)
func (*OrganizationMemberUpdateParamsRemoveUsers) UnmarshalJSON ¶ added in v0.8.0
func (r *OrganizationMemberUpdateParamsRemoveUsers) UnmarshalJSON(data []byte) error
type OrganizationService ¶ added in v0.2.0
type OrganizationService struct { Options []option.RequestOption Members OrganizationMemberService }
OrganizationService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationService method instead.
func NewOrganizationService ¶ added in v0.2.0
func NewOrganizationService(opts ...option.RequestOption) (r OrganizationService)
NewOrganizationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OrganizationService) Delete ¶ added in v0.2.0
func (r *OrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *shared.Organization, err error)
Delete an organization object by its id
func (*OrganizationService) Get ¶ added in v0.2.0
func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *shared.Organization, err error)
Get an organization object by its id
func (*OrganizationService) List ¶ added in v0.2.0
func (r *OrganizationService) List(ctx context.Context, query OrganizationListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Organization], err error)
List out all organizations. The organizations are sorted by creation date, with the most recently-created organizations coming first
func (*OrganizationService) ListAutoPaging ¶ added in v0.2.0
func (r *OrganizationService) ListAutoPaging(ctx context.Context, query OrganizationListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Organization]
List out all organizations. The organizations are sorted by creation date, with the most recently-created organizations coming first
func (*OrganizationService) Update ¶ added in v0.2.0
func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, opts ...option.RequestOption) (res *shared.Organization, err error)
Partially update an organization object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type OrganizationUpdateParams ¶ added in v0.2.0
type OrganizationUpdateParams struct { APIURL param.Opt[string] `json:"api_url,omitzero"` IsUniversalAPI param.Opt[bool] `json:"is_universal_api,omitzero"` // Name of the organization Name param.Opt[string] `json:"name,omitzero"` ProxyURL param.Opt[string] `json:"proxy_url,omitzero"` RealtimeURL param.Opt[string] `json:"realtime_url,omitzero"` // contains filtered or unexported fields }
func (OrganizationUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r OrganizationUpdateParams) MarshalJSON() (data []byte, err error)
func (*OrganizationUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *OrganizationUpdateParams) UnmarshalJSON(data []byte) error
type PatchOrganizationMembersOutput ¶ added in v0.4.0
type PatchOrganizationMembersOutput = shared.PatchOrganizationMembersOutput
This is an alias to an internal type.
type PatchOrganizationMembersOutputStatus ¶ added in v0.4.0
type PatchOrganizationMembersOutputStatus = shared.PatchOrganizationMembersOutputStatus
This is an alias to an internal type.
type Permission ¶ added in v0.7.0
type Permission = shared.Permission
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
This is an alias to an internal type.
type ProjectListParams ¶
type ProjectListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs ProjectListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (ProjectListParams) URLQuery ¶
func (r ProjectListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectListParams's query parameters as `url.Values`.
type ProjectListParamsIDsUnion ¶ added in v0.2.0
type ProjectListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ProjectLogFeedbackParams ¶
type ProjectLogFeedbackParams struct { // A list of project logs feedback items Feedback []shared.FeedbackProjectLogsItemParam `json:"feedback,omitzero,required"` // contains filtered or unexported fields }
func (ProjectLogFeedbackParams) MarshalJSON ¶
func (r ProjectLogFeedbackParams) MarshalJSON() (data []byte, err error)
func (*ProjectLogFeedbackParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectLogFeedbackParams) UnmarshalJSON(data []byte) error
type ProjectLogFetchParams ¶
type ProjectLogFetchParams struct { // limit the number of traces fetched // // Fetch queries may be paginated if the total result size is expected to be large // (e.g. project_logs which accumulate over a long time). Note that fetch queries // only support pagination in descending time order (from latest to earliest // `_xact_id`. Furthermore, later pages may return rows which showed up in earlier // pages, except with an earlier `_xact_id`. This happens because pagination occurs // over the whole version history of the event log. You will most likely want to // exclude any such duplicate, outdated rows (by `id`) from your combined result // set. // // The `limit` parameter controls the number of full traces to return. So you may // end up with more individual rows than the specified limit if you are fetching // events containing traces. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxRootSpanID param.Opt[string] `query:"max_root_span_id,omitzero" json:"-"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxXactID param.Opt[string] `query:"max_xact_id,omitzero" json:"-"` // Retrieve a snapshot of events from a past time // // The version id is essentially a filter on the latest event transaction id. You // can use the `max_xact_id` returned by a past fetch as the version to reproduce // that exact fetch. Version param.Opt[string] `query:"version,omitzero" json:"-"` // contains filtered or unexported fields }
func (ProjectLogFetchParams) URLQuery ¶
func (r ProjectLogFetchParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectLogFetchParams's query parameters as `url.Values`.
type ProjectLogFetchPostParams ¶
type ProjectLogFetchPostParams struct { // An opaque string to be used as a cursor for the next page of results, in order // from latest to earliest. // // The string can be obtained directly from the `cursor` property of the previous // fetch query Cursor param.Opt[string] `json:"cursor,omitzero"` // limit the number of traces fetched // // Fetch queries may be paginated if the total result size is expected to be large // (e.g. project_logs which accumulate over a long time). Note that fetch queries // only support pagination in descending time order (from latest to earliest // `_xact_id`. Furthermore, later pages may return rows which showed up in earlier // pages, except with an earlier `_xact_id`. This happens because pagination occurs // over the whole version history of the event log. You will most likely want to // exclude any such duplicate, outdated rows (by `id`) from your combined result // set. // // The `limit` parameter controls the number of full traces to return. So you may // end up with more individual rows than the specified limit if you are fetching // events containing traces. Limit param.Opt[int64] `json:"limit,omitzero"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxRootSpanID param.Opt[string] `json:"max_root_span_id,omitzero"` // DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in // favor of the explicit 'cursor' returned by object fetch requests. Please prefer // the 'cursor' argument going forwards. // // Together, `max_xact_id` and `max_root_span_id` form a pagination cursor // // Since a paginated fetch query returns results in order from latest to earliest, // the cursor for the next page can be found as the row with the minimum (earliest) // value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` // for an overview of paginating fetch queries. MaxXactID param.Opt[string] `json:"max_xact_id,omitzero"` // Retrieve a snapshot of events from a past time // // The version id is essentially a filter on the latest event transaction id. You // can use the `max_xact_id` returned by a past fetch as the version to reproduce // that exact fetch. Version param.Opt[string] `json:"version,omitzero"` // contains filtered or unexported fields }
func (ProjectLogFetchPostParams) MarshalJSON ¶
func (r ProjectLogFetchPostParams) MarshalJSON() (data []byte, err error)
func (*ProjectLogFetchPostParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectLogFetchPostParams) UnmarshalJSON(data []byte) error
type ProjectLogInsertParams ¶
type ProjectLogInsertParams struct { // A list of project logs events to insert Events []shared.InsertProjectLogsEventParam `json:"events,omitzero,required"` // contains filtered or unexported fields }
func (ProjectLogInsertParams) MarshalJSON ¶
func (r ProjectLogInsertParams) MarshalJSON() (data []byte, err error)
func (*ProjectLogInsertParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectLogInsertParams) UnmarshalJSON(data []byte) error
type ProjectLogService ¶
type ProjectLogService struct {
Options []option.RequestOption
}
ProjectLogService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectLogService method instead.
func NewProjectLogService ¶
func NewProjectLogService(opts ...option.RequestOption) (r ProjectLogService)
NewProjectLogService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectLogService) Feedback ¶
func (r *ProjectLogService) Feedback(ctx context.Context, projectID string, body ProjectLogFeedbackParams, opts ...option.RequestOption) (res *shared.FeedbackResponseSchema, err error)
Log feedback for a set of project logs events
func (*ProjectLogService) Fetch ¶
func (r *ProjectLogService) Fetch(ctx context.Context, projectID string, query ProjectLogFetchParams, opts ...option.RequestOption) (res *shared.FetchProjectLogsEventsResponse, err error)
Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.
func (*ProjectLogService) FetchPost ¶
func (r *ProjectLogService) FetchPost(ctx context.Context, projectID string, body ProjectLogFetchPostParams, opts ...option.RequestOption) (res *shared.FetchProjectLogsEventsResponse, err error)
Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.
func (*ProjectLogService) Insert ¶
func (r *ProjectLogService) Insert(ctx context.Context, projectID string, body ProjectLogInsertParams, opts ...option.RequestOption) (res *shared.InsertEventsResponse, err error)
Insert a set of events into the project logs
type ProjectLogsEvent ¶ added in v0.2.0
type ProjectLogsEvent = shared.ProjectLogsEvent
This is an alias to an internal type.
type ProjectLogsEventContext ¶ added in v0.2.0
type ProjectLogsEventContext = shared.ProjectLogsEventContext
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
This is an alias to an internal type.
type ProjectLogsEventLogID ¶ added in v0.2.0
type ProjectLogsEventLogID = shared.ProjectLogsEventLogID
A literal 'g' which identifies the log as a project log
This is an alias to an internal type.
type ProjectLogsEventMetadata ¶ added in v0.6.0
type ProjectLogsEventMetadata = shared.ProjectLogsEventMetadata
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
This is an alias to an internal type.
type ProjectLogsEventMetrics ¶ added in v0.2.0
type ProjectLogsEventMetrics = shared.ProjectLogsEventMetrics
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
This is an alias to an internal type.
type ProjectNewParams ¶
type ProjectNewParams struct { // Name of the project Name string `json:"name,required"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the project belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // contains filtered or unexported fields }
func (ProjectNewParams) MarshalJSON ¶
func (r ProjectNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectNewParams) UnmarshalJSON(data []byte) error
type ProjectScore ¶ added in v0.2.0
type ProjectScore = shared.ProjectScore
A project score is a user-configured score, which can be manually-labeled through the UI
This is an alias to an internal type.
type ProjectScoreCategoriesUnion ¶ added in v0.2.0
type ProjectScoreCategoriesUnion = shared.ProjectScoreCategoriesUnion
For categorical-type project scores, the list of all categories
This is an alias to an internal type.
type ProjectScoreCategory ¶ added in v0.2.0
type ProjectScoreCategory = shared.ProjectScoreCategory
For categorical-type project scores, defines a single category
This is an alias to an internal type.
type ProjectScoreCategoryParam ¶ added in v0.2.0
type ProjectScoreCategoryParam = shared.ProjectScoreCategoryParam
For categorical-type project scores, defines a single category
This is an alias to an internal type.
type ProjectScoreConfig ¶ added in v0.2.0
type ProjectScoreConfig = shared.ProjectScoreConfig
This is an alias to an internal type.
type ProjectScoreConfigParam ¶ added in v0.4.0
type ProjectScoreConfigParam = shared.ProjectScoreConfigParam
This is an alias to an internal type.
type ProjectScoreListParams ¶ added in v0.2.0
type ProjectScoreListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Project id ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Name of the project_score to search for ProjectScoreName param.Opt[string] `query:"project_score_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs ProjectScoreListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // The type of the configured score ScoreType ProjectScoreListParamsScoreTypeUnion `query:"score_type,omitzero" json:"-"` // contains filtered or unexported fields }
func (ProjectScoreListParams) URLQuery ¶ added in v0.2.0
func (r ProjectScoreListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectScoreListParams's query parameters as `url.Values`.
type ProjectScoreListParamsIDsUnion ¶ added in v0.2.0
type ProjectScoreListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ProjectScoreListParamsScoreTypeUnion ¶ added in v0.4.0
type ProjectScoreListParamsScoreTypeUnion struct { // Check if union is this variant with // !param.IsOmitted(union.OfProjectScoreTypeSingle) OfProjectScoreTypeSingle param.Opt[shared.ProjectScoreType] `query:",omitzero,inline"` OfProjectScoreTypeArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ProjectScoreNewParams ¶ added in v0.2.0
type ProjectScoreNewParams struct { // Name of the project score Name string `json:"name,required"` // Unique identifier for the project that the project score belongs under ProjectID string `json:"project_id,required" format:"uuid"` // The type of the configured score // // Any of "slider", "categorical", "weighted", "minimum", "maximum", "online", // "free-form". ScoreType shared.ProjectScoreType `json:"score_type,omitzero,required"` // Textual description of the project score Description param.Opt[string] `json:"description,omitzero"` // For categorical-type project scores, the list of all categories Categories ProjectScoreNewParamsCategoriesUnion `json:"categories,omitzero"` Config shared.ProjectScoreConfigParam `json:"config,omitzero"` // contains filtered or unexported fields }
func (ProjectScoreNewParams) MarshalJSON ¶ added in v0.2.0
func (r ProjectScoreNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectScoreNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectScoreNewParams) UnmarshalJSON(data []byte) error
type ProjectScoreNewParamsCategoriesUnion ¶ added in v0.3.0
type ProjectScoreNewParamsCategoriesUnion struct { OfCategorical []shared.ProjectScoreCategoryParam `json:",omitzero,inline"` OfMinimum []string `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (ProjectScoreNewParamsCategoriesUnion) MarshalJSON ¶ added in v0.8.0
func (u ProjectScoreNewParamsCategoriesUnion) MarshalJSON() ([]byte, error)
func (*ProjectScoreNewParamsCategoriesUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *ProjectScoreNewParamsCategoriesUnion) UnmarshalJSON(data []byte) error
type ProjectScoreReplaceParams ¶ added in v0.2.0
type ProjectScoreReplaceParams struct { // Name of the project score Name string `json:"name,required"` // Unique identifier for the project that the project score belongs under ProjectID string `json:"project_id,required" format:"uuid"` // The type of the configured score // // Any of "slider", "categorical", "weighted", "minimum", "maximum", "online", // "free-form". ScoreType shared.ProjectScoreType `json:"score_type,omitzero,required"` // Textual description of the project score Description param.Opt[string] `json:"description,omitzero"` // For categorical-type project scores, the list of all categories Categories ProjectScoreReplaceParamsCategoriesUnion `json:"categories,omitzero"` Config shared.ProjectScoreConfigParam `json:"config,omitzero"` // contains filtered or unexported fields }
func (ProjectScoreReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r ProjectScoreReplaceParams) MarshalJSON() (data []byte, err error)
func (*ProjectScoreReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectScoreReplaceParams) UnmarshalJSON(data []byte) error
type ProjectScoreReplaceParamsCategoriesUnion ¶ added in v0.3.0
type ProjectScoreReplaceParamsCategoriesUnion struct { OfCategorical []shared.ProjectScoreCategoryParam `json:",omitzero,inline"` OfMinimum []string `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (ProjectScoreReplaceParamsCategoriesUnion) MarshalJSON ¶ added in v0.8.0
func (u ProjectScoreReplaceParamsCategoriesUnion) MarshalJSON() ([]byte, error)
func (*ProjectScoreReplaceParamsCategoriesUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *ProjectScoreReplaceParamsCategoriesUnion) UnmarshalJSON(data []byte) error
type ProjectScoreService ¶ added in v0.2.0
type ProjectScoreService struct {
Options []option.RequestOption
}
ProjectScoreService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectScoreService method instead.
func NewProjectScoreService ¶ added in v0.2.0
func NewProjectScoreService(opts ...option.RequestOption) (r ProjectScoreService)
NewProjectScoreService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectScoreService) Delete ¶ added in v0.2.0
func (r *ProjectScoreService) Delete(ctx context.Context, projectScoreID string, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
Delete a project_score object by its id
func (*ProjectScoreService) Get ¶ added in v0.2.0
func (r *ProjectScoreService) Get(ctx context.Context, projectScoreID string, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
Get a project_score object by its id
func (*ProjectScoreService) List ¶ added in v0.2.0
func (r *ProjectScoreService) List(ctx context.Context, query ProjectScoreListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.ProjectScore], err error)
List out all project_scores. The project_scores are sorted by creation date, with the most recently-created project_scores coming first
func (*ProjectScoreService) ListAutoPaging ¶ added in v0.2.0
func (r *ProjectScoreService) ListAutoPaging(ctx context.Context, query ProjectScoreListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.ProjectScore]
List out all project_scores. The project_scores are sorted by creation date, with the most recently-created project_scores coming first
func (*ProjectScoreService) New ¶ added in v0.2.0
func (r *ProjectScoreService) New(ctx context.Context, body ProjectScoreNewParams, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
Create a new project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will return the existing project_score unmodified
func (*ProjectScoreService) Replace ¶ added in v0.2.0
func (r *ProjectScoreService) Replace(ctx context.Context, body ProjectScoreReplaceParams, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
Create or replace project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will replace the existing project_score with the provided fields
func (*ProjectScoreService) Update ¶ added in v0.2.0
func (r *ProjectScoreService) Update(ctx context.Context, projectScoreID string, body ProjectScoreUpdateParams, opts ...option.RequestOption) (res *shared.ProjectScore, err error)
Partially update a project_score object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type ProjectScoreType ¶ added in v0.4.0
type ProjectScoreType = shared.ProjectScoreType
The type of the configured score
This is an alias to an internal type.
type ProjectScoreUpdateParams ¶ added in v0.2.0
type ProjectScoreUpdateParams struct { // Textual description of the project score Description param.Opt[string] `json:"description,omitzero"` // Name of the project score Name param.Opt[string] `json:"name,omitzero"` // For categorical-type project scores, the list of all categories Categories ProjectScoreUpdateParamsCategoriesUnion `json:"categories,omitzero"` Config shared.ProjectScoreConfigParam `json:"config,omitzero"` // The type of the configured score // // Any of "slider", "categorical", "weighted", "minimum", "maximum", "online", // "free-form". ScoreType shared.ProjectScoreType `json:"score_type,omitzero"` // contains filtered or unexported fields }
func (ProjectScoreUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r ProjectScoreUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProjectScoreUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectScoreUpdateParams) UnmarshalJSON(data []byte) error
type ProjectScoreUpdateParamsCategoriesUnion ¶ added in v0.3.0
type ProjectScoreUpdateParamsCategoriesUnion struct { OfCategorical []shared.ProjectScoreCategoryParam `json:",omitzero,inline"` OfMinimum []string `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (ProjectScoreUpdateParamsCategoriesUnion) MarshalJSON ¶ added in v0.8.0
func (u ProjectScoreUpdateParamsCategoriesUnion) MarshalJSON() ([]byte, error)
func (*ProjectScoreUpdateParamsCategoriesUnion) UnmarshalJSON ¶ added in v0.8.0
func (u *ProjectScoreUpdateParamsCategoriesUnion) UnmarshalJSON(data []byte) error
type ProjectService ¶
type ProjectService struct { Options []option.RequestOption Logs ProjectLogService }
ProjectService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectService method instead.
func NewProjectService ¶
func NewProjectService(opts ...option.RequestOption) (r ProjectService)
NewProjectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectService) Delete ¶
func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (res *shared.Project, err error)
Delete a project object by its id
func (*ProjectService) Get ¶
func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *shared.Project, err error)
Get a project object by its id
func (*ProjectService) List ¶
func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Project], err error)
List out all projects. The projects are sorted by creation date, with the most recently-created projects coming first
func (*ProjectService) ListAutoPaging ¶
func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Project]
List out all projects. The projects are sorted by creation date, with the most recently-created projects coming first
func (*ProjectService) New ¶
func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *shared.Project, err error)
Create a new project. If there is an existing project with the same name as the one specified in the request, will return the existing project unmodified
func (*ProjectService) Update ¶
func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, opts ...option.RequestOption) (res *shared.Project, err error)
Partially update a project object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type ProjectSettings ¶ added in v0.2.0
type ProjectSettings = shared.ProjectSettings
This is an alias to an internal type.
type ProjectSettingsParam ¶ added in v0.4.0
type ProjectSettingsParam = shared.ProjectSettingsParam
This is an alias to an internal type.
type ProjectSettingsSpanFieldOrder ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrder = shared.ProjectSettingsSpanFieldOrder
This is an alias to an internal type.
type ProjectSettingsSpanFieldOrderLayout ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrderLayout = shared.ProjectSettingsSpanFieldOrderLayout
This is an alias to an internal type.
type ProjectSettingsSpanFieldOrderParam ¶ added in v0.6.0
type ProjectSettingsSpanFieldOrderParam = shared.ProjectSettingsSpanFieldOrderParam
This is an alias to an internal type.
type ProjectTag ¶ added in v0.2.0
type ProjectTag = shared.ProjectTag
A project tag is a user-configured tag for tracking and filtering your experiments, logs, and other data
This is an alias to an internal type.
type ProjectTagListParams ¶ added in v0.2.0
type ProjectTagListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Project id ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Name of the project_tag to search for ProjectTagName param.Opt[string] `query:"project_tag_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs ProjectTagListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (ProjectTagListParams) URLQuery ¶ added in v0.2.0
func (r ProjectTagListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ProjectTagListParams's query parameters as `url.Values`.
type ProjectTagListParamsIDsUnion ¶ added in v0.2.0
type ProjectTagListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ProjectTagNewParams ¶ added in v0.2.0
type ProjectTagNewParams struct { // 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"` // Color of the tag for the UI Color param.Opt[string] `json:"color,omitzero"` // Textual description of the project tag Description param.Opt[string] `json:"description,omitzero"` // contains filtered or unexported fields }
func (ProjectTagNewParams) MarshalJSON ¶ added in v0.2.0
func (r ProjectTagNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectTagNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectTagNewParams) UnmarshalJSON(data []byte) error
type ProjectTagReplaceParams ¶ added in v0.2.0
type ProjectTagReplaceParams struct { // 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"` // Color of the tag for the UI Color param.Opt[string] `json:"color,omitzero"` // Textual description of the project tag Description param.Opt[string] `json:"description,omitzero"` // contains filtered or unexported fields }
func (ProjectTagReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r ProjectTagReplaceParams) MarshalJSON() (data []byte, err error)
func (*ProjectTagReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectTagReplaceParams) UnmarshalJSON(data []byte) error
type ProjectTagService ¶ added in v0.2.0
type ProjectTagService struct {
Options []option.RequestOption
}
ProjectTagService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectTagService method instead.
func NewProjectTagService ¶ added in v0.2.0
func NewProjectTagService(opts ...option.RequestOption) (r ProjectTagService)
NewProjectTagService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectTagService) Delete ¶ added in v0.2.0
func (r *ProjectTagService) Delete(ctx context.Context, projectTagID string, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
Delete a project_tag object by its id
func (*ProjectTagService) Get ¶ added in v0.2.0
func (r *ProjectTagService) Get(ctx context.Context, projectTagID string, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
Get a project_tag object by its id
func (*ProjectTagService) List ¶ added in v0.2.0
func (r *ProjectTagService) List(ctx context.Context, query ProjectTagListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.ProjectTag], err error)
List out all project_tags. The project_tags are sorted by creation date, with the most recently-created project_tags coming first
func (*ProjectTagService) ListAutoPaging ¶ added in v0.2.0
func (r *ProjectTagService) ListAutoPaging(ctx context.Context, query ProjectTagListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.ProjectTag]
List out all project_tags. The project_tags are sorted by creation date, with the most recently-created project_tags coming first
func (*ProjectTagService) New ¶ added in v0.2.0
func (r *ProjectTagService) New(ctx context.Context, body ProjectTagNewParams, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
Create a new project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will return the existing project_tag unmodified
func (*ProjectTagService) Replace ¶ added in v0.2.0
func (r *ProjectTagService) Replace(ctx context.Context, body ProjectTagReplaceParams, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
Create or replace project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will replace the existing project_tag with the provided fields
func (*ProjectTagService) Update ¶ added in v0.2.0
func (r *ProjectTagService) Update(ctx context.Context, projectTagID string, body ProjectTagUpdateParams, opts ...option.RequestOption) (res *shared.ProjectTag, err error)
Partially update a project_tag object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type ProjectTagUpdateParams ¶ added in v0.2.0
type ProjectTagUpdateParams struct { // Color of the tag for the UI Color param.Opt[string] `json:"color,omitzero"` // Textual description of the project tag Description param.Opt[string] `json:"description,omitzero"` // Name of the project tag Name param.Opt[string] `json:"name,omitzero"` // contains filtered or unexported fields }
func (ProjectTagUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r ProjectTagUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProjectTagUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectTagUpdateParams) UnmarshalJSON(data []byte) error
type ProjectUpdateParams ¶
type ProjectUpdateParams struct { // Name of the project Name param.Opt[string] `json:"name,omitzero"` // Project settings. Patch operations replace all settings, so make sure you // include all settings you want to keep. Settings shared.ProjectSettingsParam `json:"settings,omitzero"` // contains filtered or unexported fields }
func (ProjectUpdateParams) MarshalJSON ¶
func (r ProjectUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProjectUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ProjectUpdateParams) UnmarshalJSON(data []byte) error
type PromptData ¶ added in v0.2.0
type PromptData = shared.PromptData
The prompt, model, and its parameters
This is an alias to an internal type.
type PromptDataOrigin ¶ added in v0.2.0
type PromptDataOrigin = shared.PromptDataOrigin
This is an alias to an internal type.
type PromptDataOriginParam ¶ added in v0.2.0
type PromptDataOriginParam = shared.PromptDataOriginParam
This is an alias to an internal type.
type PromptDataParam ¶ added in v0.2.0
type PromptDataParam = shared.PromptDataParam
The prompt, model, and its parameters
This is an alias to an internal type.
type PromptDataParser ¶ added in v0.4.0
type PromptDataParser = shared.PromptDataParser
This is an alias to an internal type.
type PromptDataParserParam ¶ added in v0.4.0
type PromptDataParserParam = shared.PromptDataParserParam
This is an alias to an internal type.
type PromptDataPromptChat ¶ added in v0.2.0
type PromptDataPromptChat = shared.PromptDataPromptChat
This is an alias to an internal type.
type PromptDataPromptChatMessageAssistant ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistant = shared.PromptDataPromptChatMessageAssistant
This is an alias to an internal type.
type PromptDataPromptChatMessageAssistantFunctionCall ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistantFunctionCall = shared.PromptDataPromptChatMessageAssistantFunctionCall
This is an alias to an internal type.
type PromptDataPromptChatMessageAssistantFunctionCallParam ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistantFunctionCallParam = shared.PromptDataPromptChatMessageAssistantFunctionCallParam
This is an alias to an internal type.
type PromptDataPromptChatMessageAssistantParam ¶ added in v0.8.0
type PromptDataPromptChatMessageAssistantParam = shared.PromptDataPromptChatMessageAssistantParam
This is an alias to an internal type.
type PromptDataPromptChatMessageFallback ¶ added in v0.8.0
type PromptDataPromptChatMessageFallback = shared.PromptDataPromptChatMessageFallback
This is an alias to an internal type.
type PromptDataPromptChatMessageFallbackParam ¶ added in v0.8.0
type PromptDataPromptChatMessageFallbackParam = shared.PromptDataPromptChatMessageFallbackParam
This is an alias to an internal type.
type PromptDataPromptChatMessageFunction ¶ added in v0.8.0
type PromptDataPromptChatMessageFunction = shared.PromptDataPromptChatMessageFunction
This is an alias to an internal type.
type PromptDataPromptChatMessageFunctionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageFunctionParam = shared.PromptDataPromptChatMessageFunctionParam
This is an alias to an internal type.
type PromptDataPromptChatMessageSystem ¶ added in v0.8.0
type PromptDataPromptChatMessageSystem = shared.PromptDataPromptChatMessageSystem
This is an alias to an internal type.
type PromptDataPromptChatMessageSystemParam ¶ added in v0.8.0
type PromptDataPromptChatMessageSystemParam = shared.PromptDataPromptChatMessageSystemParam
This is an alias to an internal type.
type PromptDataPromptChatMessageTool ¶ added in v0.8.0
type PromptDataPromptChatMessageTool = shared.PromptDataPromptChatMessageTool
This is an alias to an internal type.
type PromptDataPromptChatMessageToolParam ¶ added in v0.8.0
type PromptDataPromptChatMessageToolParam = shared.PromptDataPromptChatMessageToolParam
This is an alias to an internal type.
type PromptDataPromptChatMessageUnion ¶ added in v0.8.0
type PromptDataPromptChatMessageUnion = shared.PromptDataPromptChatMessageUnion
This is an alias to an internal type.
type PromptDataPromptChatMessageUnionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUnionParam = shared.PromptDataPromptChatMessageUnionParam
This is an alias to an internal type.
type PromptDataPromptChatMessageUser ¶ added in v0.8.0
type PromptDataPromptChatMessageUser = shared.PromptDataPromptChatMessageUser
This is an alias to an internal type.
type PromptDataPromptChatMessageUserContentArrayItemUnion ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentArrayItemUnion = shared.PromptDataPromptChatMessageUserContentArrayItemUnion
This is an alias to an internal type.
type PromptDataPromptChatMessageUserContentArrayItemUnionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentArrayItemUnionParam = shared.PromptDataPromptChatMessageUserContentArrayItemUnionParam
This is an alias to an internal type.
type PromptDataPromptChatMessageUserContentUnion ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentUnion = shared.PromptDataPromptChatMessageUserContentUnion
This is an alias to an internal type.
type PromptDataPromptChatMessageUserContentUnionParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUserContentUnionParam = shared.PromptDataPromptChatMessageUserContentUnionParam
This is an alias to an internal type.
type PromptDataPromptChatMessageUserParam ¶ added in v0.8.0
type PromptDataPromptChatMessageUserParam = shared.PromptDataPromptChatMessageUserParam
This is an alias to an internal type.
type PromptDataPromptChatParam ¶ added in v0.2.0
type PromptDataPromptChatParam = shared.PromptDataPromptChatParam
This is an alias to an internal type.
type PromptDataPromptCompletion ¶ added in v0.2.0
type PromptDataPromptCompletion = shared.PromptDataPromptCompletion
This is an alias to an internal type.
type PromptDataPromptCompletionParam ¶ added in v0.2.0
type PromptDataPromptCompletionParam = shared.PromptDataPromptCompletionParam
This is an alias to an internal type.
type PromptDataPromptUnion ¶ added in v0.8.0
type PromptDataPromptUnion = shared.PromptDataPromptUnion
This is an alias to an internal type.
type PromptDataPromptUnionParam ¶ added in v0.2.0
type PromptDataPromptUnionParam = shared.PromptDataPromptUnionParam
This is an alias to an internal type.
type PromptDataToolFunctionFunction ¶ added in v0.8.0
type PromptDataToolFunctionFunction = shared.PromptDataToolFunctionFunction
This is an alias to an internal type.
type PromptDataToolFunctionFunctionParam ¶ added in v0.8.0
type PromptDataToolFunctionFunctionParam = shared.PromptDataToolFunctionFunctionParam
This is an alias to an internal type.
type PromptDataToolFunctionGlobal ¶ added in v0.8.0
type PromptDataToolFunctionGlobal = shared.PromptDataToolFunctionGlobal
This is an alias to an internal type.
type PromptDataToolFunctionGlobalParam ¶ added in v0.8.0
type PromptDataToolFunctionGlobalParam = shared.PromptDataToolFunctionGlobalParam
This is an alias to an internal type.
type PromptDataToolFunctionUnion ¶ added in v0.8.0
type PromptDataToolFunctionUnion = shared.PromptDataToolFunctionUnion
This is an alias to an internal type.
type PromptDataToolFunctionUnionParam ¶ added in v0.8.0
type PromptDataToolFunctionUnionParam = shared.PromptDataToolFunctionUnionParam
This is an alias to an internal type.
type PromptFunctionType ¶ added in v0.4.0
type PromptFunctionType = shared.PromptFunctionType
This is an alias to an internal type.
type PromptListParams ¶ added in v0.2.0
type PromptListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Project id ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"` // Name of the project to search for ProjectName param.Opt[string] `query:"project_name,omitzero" json:"-"` // Name of the prompt to search for PromptName param.Opt[string] `query:"prompt_name,omitzero" json:"-"` // Retrieve prompt with a specific slug Slug param.Opt[string] `query:"slug,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Retrieve prompt at a specific version. // // The version id can either be a transaction id (e.g. '1000192656880881099') or a // version identifier (e.g. '81cd05ee665fdfb3'). Version param.Opt[string] `query:"version,omitzero" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs PromptListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (PromptListParams) URLQuery ¶ added in v0.2.0
func (r PromptListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PromptListParams's query parameters as `url.Values`.
type PromptListParamsIDsUnion ¶ added in v0.2.0
type PromptListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type PromptLogID ¶ added in v0.2.0
type PromptLogID = shared.PromptLogID
A literal 'p' which identifies the object as a project prompt
This is an alias to an internal type.
type PromptNewParams ¶ added in v0.2.0
type PromptNewParams struct { // Name of the prompt Name string `json:"name,required"` // 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"` // Textual description of the prompt Description param.Opt[string] `json:"description,omitzero"` // Any of "llm", "scorer", "task", "tool". FunctionType PromptNewParamsFunctionType `json:"function_type,omitzero"` // The prompt, model, and its parameters PromptData shared.PromptDataParam `json:"prompt_data,omitzero"` // A list of tags for the prompt Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (PromptNewParams) MarshalJSON ¶ added in v0.2.0
func (r PromptNewParams) MarshalJSON() (data []byte, err error)
func (*PromptNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptNewParams) UnmarshalJSON(data []byte) error
type PromptNewParamsFunctionType ¶ added in v0.4.0
type PromptNewParamsFunctionType string
const ( PromptNewParamsFunctionTypeLlm PromptNewParamsFunctionType = "llm" PromptNewParamsFunctionTypeScorer PromptNewParamsFunctionType = "scorer" PromptNewParamsFunctionTypeTask PromptNewParamsFunctionType = "task" PromptNewParamsFunctionTypeTool PromptNewParamsFunctionType = "tool" )
type PromptOptions ¶ added in v0.5.0
type PromptOptions = shared.PromptOptions
This is an alias to an internal type.
type PromptOptionsParam ¶ added in v0.5.0
type PromptOptionsParam = shared.PromptOptionsParam
This is an alias to an internal type.
type PromptOptionsParamsAnthropicModelParams ¶ added in v0.5.0
type PromptOptionsParamsAnthropicModelParams = shared.PromptOptionsParamsAnthropicModelParams
This is an alias to an internal type.
type PromptOptionsParamsAnthropicModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsAnthropicModelParamsParam = shared.PromptOptionsParamsAnthropicModelParamsParam
This is an alias to an internal type.
type PromptOptionsParamsGoogleModelParams ¶ added in v0.5.0
type PromptOptionsParamsGoogleModelParams = shared.PromptOptionsParamsGoogleModelParams
This is an alias to an internal type.
type PromptOptionsParamsGoogleModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsGoogleModelParamsParam = shared.PromptOptionsParamsGoogleModelParamsParam
This is an alias to an internal type.
type PromptOptionsParamsJsCompletionParams ¶ added in v0.5.0
type PromptOptionsParamsJsCompletionParams = shared.PromptOptionsParamsJsCompletionParams
This is an alias to an internal type.
type PromptOptionsParamsJsCompletionParamsParam ¶ added in v0.5.0
type PromptOptionsParamsJsCompletionParamsParam = shared.PromptOptionsParamsJsCompletionParamsParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParams ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParams = shared.PromptOptionsParamsOpenAIModelParams
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunction = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallFunction
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallFunctionParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsFunctionCallString ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallString = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallString
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnion = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallUnion
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam = shared.PromptOptionsParamsOpenAIModelParamsFunctionCallUnionParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsParam = shared.PromptOptionsParamsOpenAIModelParamsParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObject
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonObjectParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchema
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchema
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaJsonSchemaParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatJsonSchemaParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatText ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatText = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatText
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatTextParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion ¶ added in v0.8.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnion = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatUnion
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam = shared.PromptOptionsParamsOpenAIModelParamsResponseFormatUnionParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunction = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceFunction
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunction
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionFunctionParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceFunctionParam
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceString ¶ added in v0.6.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceString = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceString
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnion = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceUnion
This is an alias to an internal type.
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam ¶ added in v0.5.0
type PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam = shared.PromptOptionsParamsOpenAIModelParamsToolChoiceUnionParam
This is an alias to an internal type.
type PromptOptionsParamsUnion ¶ added in v0.5.0
type PromptOptionsParamsUnion = shared.PromptOptionsParamsUnion
This is an alias to an internal type.
type PromptOptionsParamsUnionParam ¶ added in v0.5.0
type PromptOptionsParamsUnionParam = shared.PromptOptionsParamsUnionParam
This is an alias to an internal type.
type PromptOptionsParamsWindowAIModelParams ¶ added in v0.5.0
type PromptOptionsParamsWindowAIModelParams = shared.PromptOptionsParamsWindowAIModelParams
This is an alias to an internal type.
type PromptOptionsParamsWindowAIModelParamsParam ¶ added in v0.5.0
type PromptOptionsParamsWindowAIModelParamsParam = shared.PromptOptionsParamsWindowAIModelParamsParam
This is an alias to an internal type.
type PromptReplaceParams ¶ added in v0.2.0
type PromptReplaceParams struct { // Name of the prompt Name string `json:"name,required"` // 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"` // Textual description of the prompt Description param.Opt[string] `json:"description,omitzero"` // Any of "llm", "scorer", "task", "tool". FunctionType PromptReplaceParamsFunctionType `json:"function_type,omitzero"` // The prompt, model, and its parameters PromptData shared.PromptDataParam `json:"prompt_data,omitzero"` // A list of tags for the prompt Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (PromptReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r PromptReplaceParams) MarshalJSON() (data []byte, err error)
func (*PromptReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptReplaceParams) UnmarshalJSON(data []byte) error
type PromptReplaceParamsFunctionType ¶ added in v0.4.0
type PromptReplaceParamsFunctionType string
const ( PromptReplaceParamsFunctionTypeLlm PromptReplaceParamsFunctionType = "llm" PromptReplaceParamsFunctionTypeScorer PromptReplaceParamsFunctionType = "scorer" PromptReplaceParamsFunctionTypeTask PromptReplaceParamsFunctionType = "task" PromptReplaceParamsFunctionTypeTool PromptReplaceParamsFunctionType = "tool" )
type PromptService ¶ added in v0.2.0
type PromptService struct {
Options []option.RequestOption
}
PromptService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPromptService method instead.
func NewPromptService ¶ added in v0.2.0
func NewPromptService(opts ...option.RequestOption) (r PromptService)
NewPromptService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PromptService) Delete ¶ added in v0.2.0
func (r *PromptService) Delete(ctx context.Context, promptID string, opts ...option.RequestOption) (res *shared.Prompt, err error)
Delete a prompt object by its id
func (*PromptService) Get ¶ added in v0.2.0
func (r *PromptService) Get(ctx context.Context, promptID string, opts ...option.RequestOption) (res *shared.Prompt, err error)
Get a prompt object by its id
func (*PromptService) List ¶ added in v0.2.0
func (r *PromptService) List(ctx context.Context, query PromptListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Prompt], err error)
List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first
func (*PromptService) ListAutoPaging ¶ added in v0.2.0
func (r *PromptService) ListAutoPaging(ctx context.Context, query PromptListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Prompt]
List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first
func (*PromptService) New ¶ added in v0.2.0
func (r *PromptService) New(ctx context.Context, body PromptNewParams, opts ...option.RequestOption) (res *shared.Prompt, err error)
Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified
func (*PromptService) Replace ¶ added in v0.2.0
func (r *PromptService) Replace(ctx context.Context, body PromptReplaceParams, opts ...option.RequestOption) (res *shared.Prompt, err error)
Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields
func (*PromptService) Update ¶ added in v0.2.0
func (r *PromptService) Update(ctx context.Context, promptID string, body PromptUpdateParams, opts ...option.RequestOption) (res *shared.Prompt, err error)
Partially update a prompt object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type PromptUpdateParams ¶ added in v0.2.0
type PromptUpdateParams struct { // Textual description of the prompt Description param.Opt[string] `json:"description,omitzero"` // Name of the prompt Name param.Opt[string] `json:"name,omitzero"` // Unique identifier for the prompt Slug param.Opt[string] `json:"slug,omitzero"` // The prompt, model, and its parameters PromptData shared.PromptDataParam `json:"prompt_data,omitzero"` // A list of tags for the prompt Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (PromptUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r PromptUpdateParams) MarshalJSON() (data []byte, err error)
func (*PromptUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *PromptUpdateParams) UnmarshalJSON(data []byte) error
type RepoInfo ¶ added in v0.2.0
Metadata about the state of the repo when the experiment was created
This is an alias to an internal type.
type RepoInfoParam ¶ added in v0.2.0
type RepoInfoParam = shared.RepoInfoParam
Metadata about the state of the repo when the experiment was created
This is an alias to an internal type.
type Role ¶ added in v0.2.0
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
This is an alias to an internal type.
type RoleListParams ¶ added in v0.2.0
type RoleListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Name of the role to search for RoleName param.Opt[string] `query:"role_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs RoleListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (RoleListParams) URLQuery ¶ added in v0.2.0
func (r RoleListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RoleListParams's query parameters as `url.Values`.
type RoleListParamsIDsUnion ¶ added in v0.2.0
type RoleListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type RoleMemberPermission ¶ added in v0.2.0
type RoleMemberPermission = shared.RoleMemberPermission
This is an alias to an internal type.
type RoleNewParams ¶ added in v0.2.0
type RoleNewParams struct { // Name of the role Name string `json:"name,required"` // Textual description of the role Description param.Opt[string] `json:"description,omitzero"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the role belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // (permission, restrict_object_type) tuples which belong to this role MemberPermissions []RoleNewParamsMemberPermission `json:"member_permissions,omitzero"` // 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,omitzero" format:"uuid"` // contains filtered or unexported fields }
func (RoleNewParams) MarshalJSON ¶ added in v0.2.0
func (r RoleNewParams) MarshalJSON() (data []byte, err error)
func (*RoleNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleNewParams) UnmarshalJSON(data []byte) error
type RoleNewParamsMemberPermission ¶ added in v0.3.0
type RoleNewParamsMemberPermission struct { // Each permission permits a certain type of operation on an object in the system // // Permissions can be assigned to to objects on an individual basis, or grouped // into roles // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero,required"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
The property Permission is required.
func (RoleNewParamsMemberPermission) MarshalJSON ¶ added in v0.3.0
func (r RoleNewParamsMemberPermission) MarshalJSON() (data []byte, err error)
func (*RoleNewParamsMemberPermission) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleNewParamsMemberPermission) UnmarshalJSON(data []byte) error
type RoleReplaceParams ¶ added in v0.2.0
type RoleReplaceParams struct { // Name of the role Name string `json:"name,required"` // Textual description of the role Description param.Opt[string] `json:"description,omitzero"` // For nearly all users, this parameter should be unnecessary. But in the rare case // that your API key belongs to multiple organizations, you may specify the name of // the organization the role belongs in. OrgName param.Opt[string] `json:"org_name,omitzero"` // (permission, restrict_object_type) tuples which belong to this role MemberPermissions []RoleReplaceParamsMemberPermission `json:"member_permissions,omitzero"` // 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,omitzero" format:"uuid"` // contains filtered or unexported fields }
func (RoleReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r RoleReplaceParams) MarshalJSON() (data []byte, err error)
func (*RoleReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleReplaceParams) UnmarshalJSON(data []byte) error
type RoleReplaceParamsMemberPermission ¶ added in v0.3.0
type RoleReplaceParamsMemberPermission struct { // Each permission permits a certain type of operation on an object in the system // // Permissions can be assigned to to objects on an individual basis, or grouped // into roles // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero,required"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
The property Permission is required.
func (RoleReplaceParamsMemberPermission) MarshalJSON ¶ added in v0.3.0
func (r RoleReplaceParamsMemberPermission) MarshalJSON() (data []byte, err error)
func (*RoleReplaceParamsMemberPermission) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleReplaceParamsMemberPermission) UnmarshalJSON(data []byte) error
type RoleService ¶ added in v0.2.0
type RoleService struct {
Options []option.RequestOption
}
RoleService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRoleService method instead.
func NewRoleService ¶ added in v0.2.0
func NewRoleService(opts ...option.RequestOption) (r RoleService)
NewRoleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RoleService) Delete ¶ added in v0.2.0
func (r *RoleService) Delete(ctx context.Context, roleID string, opts ...option.RequestOption) (res *shared.Role, err error)
Delete a role object by its id
func (*RoleService) Get ¶ added in v0.2.0
func (r *RoleService) Get(ctx context.Context, roleID string, opts ...option.RequestOption) (res *shared.Role, err error)
Get a role object by its id
func (*RoleService) List ¶ added in v0.2.0
func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.Role], err error)
List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first
func (*RoleService) ListAutoPaging ¶ added in v0.2.0
func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.Role]
List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first
func (*RoleService) New ¶ added in v0.2.0
func (r *RoleService) New(ctx context.Context, body RoleNewParams, opts ...option.RequestOption) (res *shared.Role, err error)
Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified
func (*RoleService) Replace ¶ added in v0.2.0
func (r *RoleService) Replace(ctx context.Context, body RoleReplaceParams, opts ...option.RequestOption) (res *shared.Role, err error)
Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields
func (*RoleService) Update ¶ added in v0.2.0
func (r *RoleService) Update(ctx context.Context, roleID string, body RoleUpdateParams, opts ...option.RequestOption) (res *shared.Role, err error)
Partially update a role object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type RoleUpdateParams ¶ added in v0.2.0
type RoleUpdateParams struct { // Textual description of the role Description param.Opt[string] `json:"description,omitzero"` // Name of the role Name param.Opt[string] `json:"name,omitzero"` // A list of permissions to add to the role AddMemberPermissions []RoleUpdateParamsAddMemberPermission `json:"add_member_permissions,omitzero"` // A list of role IDs to add to the role's inheriting-from set AddMemberRoles []string `json:"add_member_roles,omitzero" format:"uuid"` // A list of permissions to remove from the role RemoveMemberPermissions []RoleUpdateParamsRemoveMemberPermission `json:"remove_member_permissions,omitzero"` // A list of role IDs to remove from the role's inheriting-from set RemoveMemberRoles []string `json:"remove_member_roles,omitzero" format:"uuid"` // contains filtered or unexported fields }
func (RoleUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r RoleUpdateParams) MarshalJSON() (data []byte, err error)
func (*RoleUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleUpdateParams) UnmarshalJSON(data []byte) error
type RoleUpdateParamsAddMemberPermission ¶ added in v0.3.0
type RoleUpdateParamsAddMemberPermission struct { // Each permission permits a certain type of operation on an object in the system // // Permissions can be assigned to to objects on an individual basis, or grouped // into roles // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero,required"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
The property Permission is required.
func (RoleUpdateParamsAddMemberPermission) MarshalJSON ¶ added in v0.3.0
func (r RoleUpdateParamsAddMemberPermission) MarshalJSON() (data []byte, err error)
func (*RoleUpdateParamsAddMemberPermission) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleUpdateParamsAddMemberPermission) UnmarshalJSON(data []byte) error
type RoleUpdateParamsRemoveMemberPermission ¶ added in v0.3.0
type RoleUpdateParamsRemoveMemberPermission struct { // Each permission permits a certain type of operation on an object in the system // // Permissions can be assigned to to objects on an individual basis, or grouped // into roles // // Any of "create", "read", "update", "delete", "create_acls", "read_acls", // "update_acls", "delete_acls". Permission shared.Permission `json:"permission,omitzero,required"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". RestrictObjectType shared.ACLObjectType `json:"restrict_object_type,omitzero"` // contains filtered or unexported fields }
The property Permission is required.
func (RoleUpdateParamsRemoveMemberPermission) MarshalJSON ¶ added in v0.3.0
func (r RoleUpdateParamsRemoveMemberPermission) MarshalJSON() (data []byte, err error)
func (*RoleUpdateParamsRemoveMemberPermission) UnmarshalJSON ¶ added in v0.8.0
func (r *RoleUpdateParamsRemoveMemberPermission) UnmarshalJSON(data []byte) error
type ScoreSummary ¶ added in v0.2.0
type ScoreSummary = shared.ScoreSummary
Summary of a score's performance
This is an alias to an internal type.
type SpanAttributes ¶ added in v0.5.0
type SpanAttributes = shared.SpanAttributes
Human-identifying attributes of the span, such as name, type, etc.
This is an alias to an internal type.
type SpanAttributesParam ¶ added in v0.5.0
type SpanAttributesParam = shared.SpanAttributesParam
Human-identifying attributes of the span, such as name, type, etc.
This is an alias to an internal type.
type SpanIFrame ¶ added in v0.5.0
type SpanIFrame = shared.SpanIFrame
This is an alias to an internal type.
type SpanIframeListParams ¶ added in v0.5.0
type SpanIframeListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Name of the span_iframe to search for SpanIframeName param.Opt[string] `query:"span_iframe_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs SpanIframeListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (SpanIframeListParams) URLQuery ¶ added in v0.5.0
func (r SpanIframeListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SpanIframeListParams's query parameters as `url.Values`.
type SpanIframeListParamsIDsUnion ¶ added in v0.5.0
type SpanIframeListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type SpanIframeNewParams ¶ added in v0.5.0
type SpanIframeNewParams struct { // Name of the span iframe Name string `json:"name,required"` // Unique identifier for the project that the span iframe belongs under ProjectID string `json:"project_id,required" format:"uuid"` // URL to embed the project viewer in an iframe URL string `json:"url,required"` // Textual description of the span iframe Description param.Opt[string] `json:"description,omitzero"` // Whether to post messages to the iframe containing the span's data. This is // useful when you want to render more data than fits in the URL. PostMessage param.Opt[bool] `json:"post_message,omitzero"` // contains filtered or unexported fields }
func (SpanIframeNewParams) MarshalJSON ¶ added in v0.5.0
func (r SpanIframeNewParams) MarshalJSON() (data []byte, err error)
func (*SpanIframeNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *SpanIframeNewParams) UnmarshalJSON(data []byte) error
type SpanIframeReplaceParams ¶ added in v0.5.0
type SpanIframeReplaceParams struct { // Name of the span iframe Name string `json:"name,required"` // Unique identifier for the project that the span iframe belongs under ProjectID string `json:"project_id,required" format:"uuid"` // URL to embed the project viewer in an iframe URL string `json:"url,required"` // Textual description of the span iframe Description param.Opt[string] `json:"description,omitzero"` // Whether to post messages to the iframe containing the span's data. This is // useful when you want to render more data than fits in the URL. PostMessage param.Opt[bool] `json:"post_message,omitzero"` // contains filtered or unexported fields }
func (SpanIframeReplaceParams) MarshalJSON ¶ added in v0.5.0
func (r SpanIframeReplaceParams) MarshalJSON() (data []byte, err error)
func (*SpanIframeReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *SpanIframeReplaceParams) UnmarshalJSON(data []byte) error
type SpanIframeService ¶ added in v0.5.0
type SpanIframeService struct {
Options []option.RequestOption
}
SpanIframeService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSpanIframeService method instead.
func NewSpanIframeService ¶ added in v0.5.0
func NewSpanIframeService(opts ...option.RequestOption) (r SpanIframeService)
NewSpanIframeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SpanIframeService) Delete ¶ added in v0.5.0
func (r *SpanIframeService) Delete(ctx context.Context, spanIframeID string, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
Delete a span_iframe object by its id
func (*SpanIframeService) Get ¶ added in v0.5.0
func (r *SpanIframeService) Get(ctx context.Context, spanIframeID string, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
Get a span_iframe object by its id
func (*SpanIframeService) List ¶ added in v0.5.0
func (r *SpanIframeService) List(ctx context.Context, query SpanIframeListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.SpanIFrame], err error)
List out all span_iframes. The span_iframes are sorted by creation date, with the most recently-created span_iframes coming first
func (*SpanIframeService) ListAutoPaging ¶ added in v0.5.0
func (r *SpanIframeService) ListAutoPaging(ctx context.Context, query SpanIframeListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.SpanIFrame]
List out all span_iframes. The span_iframes are sorted by creation date, with the most recently-created span_iframes coming first
func (*SpanIframeService) New ¶ added in v0.5.0
func (r *SpanIframeService) New(ctx context.Context, body SpanIframeNewParams, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
Create a new span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will return the existing span_iframe unmodified
func (*SpanIframeService) Replace ¶ added in v0.5.0
func (r *SpanIframeService) Replace(ctx context.Context, body SpanIframeReplaceParams, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
Create or replace span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will replace the existing span_iframe with the provided fields
func (*SpanIframeService) Update ¶ added in v0.5.0
func (r *SpanIframeService) Update(ctx context.Context, spanIframeID string, body SpanIframeUpdateParams, opts ...option.RequestOption) (res *shared.SpanIFrame, err error)
Partially update a span_iframe object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type SpanIframeUpdateParams ¶ added in v0.5.0
type SpanIframeUpdateParams struct { // Textual description of the span iframe Description param.Opt[string] `json:"description,omitzero"` // Name of the span iframe Name param.Opt[string] `json:"name,omitzero"` // Whether to post messages to the iframe containing the span's data. This is // useful when you want to render more data than fits in the URL. PostMessage param.Opt[bool] `json:"post_message,omitzero"` // URL to embed the project viewer in an iframe URL param.Opt[string] `json:"url,omitzero"` // contains filtered or unexported fields }
func (SpanIframeUpdateParams) MarshalJSON ¶ added in v0.5.0
func (r SpanIframeUpdateParams) MarshalJSON() (data []byte, err error)
func (*SpanIframeUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *SpanIframeUpdateParams) UnmarshalJSON(data []byte) error
type SpanType ¶ added in v0.7.0
Type of the span, for display purposes only
This is an alias to an internal type.
type SummarizeDatasetResponse ¶ added in v0.2.0
type SummarizeDatasetResponse = shared.SummarizeDatasetResponse
Summary of a dataset
This is an alias to an internal type.
type SummarizeExperimentResponse ¶ added in v0.2.0
type SummarizeExperimentResponse = shared.SummarizeExperimentResponse
Summary of an experiment
This is an alias to an internal type.
type TopLevelService ¶
type TopLevelService struct {
Options []option.RequestOption
}
TopLevelService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTopLevelService method instead.
func NewTopLevelService ¶
func NewTopLevelService(opts ...option.RequestOption) (r TopLevelService)
NewTopLevelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TopLevelService) HelloWorld ¶
func (r *TopLevelService) HelloWorld(ctx context.Context, opts ...option.RequestOption) (res *string, err error)
Default endpoint. Simply replies with 'Hello, World!'. Authorization is not required
type UserListParams ¶ added in v0.2.0
type UserListParams struct { // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Filter search results to within a particular organization OrgName param.Opt[string] `query:"org_name,omitzero" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Email of the user to search for. You may pass the param multiple times to filter // for more than one email Email UserListParamsEmailUnion `query:"email,omitzero" json:"-"` // Family name of the user to search for. You may pass the param multiple times to // filter for more than one family name FamilyName UserListParamsFamilyNameUnion `query:"family_name,omitzero" json:"-"` // Given name of the user to search for. You may pass the param multiple times to // filter for more than one given name GivenName UserListParamsGivenNameUnion `query:"given_name,omitzero" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs UserListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (UserListParams) URLQuery ¶ added in v0.2.0
func (r UserListParams) URLQuery() (v url.Values, err error)
URLQuery serializes UserListParams's query parameters as `url.Values`.
type UserListParamsEmailUnion ¶ added in v0.2.0
type UserListParamsEmailUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type UserListParamsFamilyNameUnion ¶ added in v0.2.0
type UserListParamsFamilyNameUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type UserListParamsGivenNameUnion ¶ added in v0.2.0
type UserListParamsGivenNameUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type UserListParamsIDsUnion ¶ added in v0.2.0
type UserListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type UserService ¶ added in v0.2.0
type UserService struct {
Options []option.RequestOption
}
UserService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserService method instead.
func NewUserService ¶ added in v0.2.0
func NewUserService(opts ...option.RequestOption) (r UserService)
NewUserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*UserService) Get ¶ added in v0.2.0
func (r *UserService) Get(ctx context.Context, userID string, opts ...option.RequestOption) (res *shared.User, err error)
Get a user object by its id
func (*UserService) List ¶ added in v0.2.0
func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.User], err error)
List out all users. The users are sorted by creation date, with the most recently-created users coming first
func (*UserService) ListAutoPaging ¶ added in v0.2.0
func (r *UserService) ListAutoPaging(ctx context.Context, query UserListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.User]
List out all users. The users are sorted by creation date, with the most recently-created users coming first
type ViewDataParam ¶ added in v0.2.0
type ViewDataParam = shared.ViewDataParam
The view definition
This is an alias to an internal type.
type ViewDataSearch ¶ added in v0.2.0
type ViewDataSearch = shared.ViewDataSearch
This is an alias to an internal type.
type ViewDataSearchParam ¶ added in v0.2.0
type ViewDataSearchParam = shared.ViewDataSearchParam
This is an alias to an internal type.
type ViewDeleteParams ¶ added in v0.2.0
type ViewDeleteParams struct { // The id of the object the view applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // contains filtered or unexported fields }
func (ViewDeleteParams) MarshalJSON ¶ added in v0.2.0
func (r ViewDeleteParams) MarshalJSON() (data []byte, err error)
func (*ViewDeleteParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewDeleteParams) UnmarshalJSON(data []byte) error
type ViewGetParams ¶ added in v0.2.0
type ViewGetParams struct { // The id of the object the ACL applies to ObjectID string `query:"object_id,required" format:"uuid" json:"-"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `query:"object_type,omitzero,required" json:"-"` // contains filtered or unexported fields }
func (ViewGetParams) URLQuery ¶ added in v0.2.0
func (r ViewGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes ViewGetParams's query parameters as `url.Values`.
type ViewListParams ¶ added in v0.2.0
type ViewListParams struct { // The id of the object the ACL applies to ObjectID string `query:"object_id,required" format:"uuid" json:"-"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `query:"object_type,omitzero,required" json:"-"` // Limit the number of objects to return Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Pagination cursor id. // // For example, if the initial item in the last page you fetched had an id of // `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only // pass one of `starting_after` and `ending_before` EndingBefore param.Opt[string] `query:"ending_before,omitzero" format:"uuid" json:"-"` // Pagination cursor id. // // For example, if the final item in the last page you fetched had an id of `foo`, // pass `starting_after=foo` to fetch the next page. Note: you may only pass one of // `starting_after` and `ending_before` StartingAfter param.Opt[string] `query:"starting_after,omitzero" format:"uuid" json:"-"` // Name of the view to search for ViewName param.Opt[string] `query:"view_name,omitzero" json:"-"` // Type of table that the view corresponds to. // // Any of "projects", "experiments", "experiment", "playgrounds", "playground", // "datasets", "dataset", "prompts", "tools", "scorers", "logs". ViewType shared.ViewType `query:"view_type,omitzero" json:"-"` // Filter search results to a particular set of object IDs. To specify a list of // IDs, include the query param multiple times IDs ViewListParamsIDsUnion `query:"ids,omitzero" format:"uuid" json:"-"` // contains filtered or unexported fields }
func (ViewListParams) URLQuery ¶ added in v0.2.0
func (r ViewListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ViewListParams's query parameters as `url.Values`.
type ViewListParamsIDsUnion ¶ added in v0.2.0
type ViewListParamsIDsUnion struct { OfString param.Opt[string] `query:",omitzero,inline"` OfStringArray []string `query:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
type ViewNewParams ¶ added in v0.2.0
type ViewNewParams struct { // Type of table that the view corresponds to. // // Any of "projects", "experiments", "experiment", "playgrounds", "playground", // "datasets", "dataset", "prompts", "tools", "scorers", "logs". ViewType ViewNewParamsViewType `json:"view_type,omitzero,required"` // Name of the view Name string `json:"name,required"` // The id of the object the view applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Date of role deletion, or null if the role is still active DeletedAt param.Opt[time.Time] `json:"deleted_at,omitzero" format:"date-time"` // Identifies the user who created the view UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Options for the view in the app Options shared.ViewOptionsParam `json:"options,omitzero"` // The view definition ViewData shared.ViewDataParam `json:"view_data,omitzero"` // contains filtered or unexported fields }
func (ViewNewParams) MarshalJSON ¶ added in v0.2.0
func (r ViewNewParams) MarshalJSON() (data []byte, err error)
func (*ViewNewParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewNewParams) UnmarshalJSON(data []byte) error
type ViewNewParamsViewType ¶ added in v0.3.0
type ViewNewParamsViewType string
Type of table that the view corresponds to.
const ( ViewNewParamsViewTypeProjects ViewNewParamsViewType = "projects" ViewNewParamsViewTypeExperiments ViewNewParamsViewType = "experiments" ViewNewParamsViewTypeExperiment ViewNewParamsViewType = "experiment" ViewNewParamsViewTypePlaygrounds ViewNewParamsViewType = "playgrounds" ViewNewParamsViewTypePlayground ViewNewParamsViewType = "playground" ViewNewParamsViewTypeDatasets ViewNewParamsViewType = "datasets" ViewNewParamsViewTypeDataset ViewNewParamsViewType = "dataset" ViewNewParamsViewTypePrompts ViewNewParamsViewType = "prompts" ViewNewParamsViewTypeTools ViewNewParamsViewType = "tools" ViewNewParamsViewTypeScorers ViewNewParamsViewType = "scorers" ViewNewParamsViewTypeLogs ViewNewParamsViewType = "logs" )
type ViewOptions ¶ added in v0.2.0
type ViewOptions = shared.ViewOptions
Options for the view in the app
This is an alias to an internal type.
type ViewOptionsParam ¶ added in v0.2.0
type ViewOptionsParam = shared.ViewOptionsParam
Options for the view in the app
This is an alias to an internal type.
type ViewReplaceParams ¶ added in v0.2.0
type ViewReplaceParams struct { // Type of table that the view corresponds to. // // Any of "projects", "experiments", "experiment", "playgrounds", "playground", // "datasets", "dataset", "prompts", "tools", "scorers", "logs". ViewType ViewReplaceParamsViewType `json:"view_type,omitzero,required"` // Name of the view Name string `json:"name,required"` // The id of the object the view applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Date of role deletion, or null if the role is still active DeletedAt param.Opt[time.Time] `json:"deleted_at,omitzero" format:"date-time"` // Identifies the user who created the view UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Options for the view in the app Options shared.ViewOptionsParam `json:"options,omitzero"` // The view definition ViewData shared.ViewDataParam `json:"view_data,omitzero"` // contains filtered or unexported fields }
func (ViewReplaceParams) MarshalJSON ¶ added in v0.2.0
func (r ViewReplaceParams) MarshalJSON() (data []byte, err error)
func (*ViewReplaceParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewReplaceParams) UnmarshalJSON(data []byte) error
type ViewReplaceParamsViewType ¶ added in v0.3.0
type ViewReplaceParamsViewType string
Type of table that the view corresponds to.
const ( ViewReplaceParamsViewTypeProjects ViewReplaceParamsViewType = "projects" ViewReplaceParamsViewTypeExperiments ViewReplaceParamsViewType = "experiments" ViewReplaceParamsViewTypeExperiment ViewReplaceParamsViewType = "experiment" ViewReplaceParamsViewTypePlaygrounds ViewReplaceParamsViewType = "playgrounds" ViewReplaceParamsViewTypePlayground ViewReplaceParamsViewType = "playground" ViewReplaceParamsViewTypeDatasets ViewReplaceParamsViewType = "datasets" ViewReplaceParamsViewTypeDataset ViewReplaceParamsViewType = "dataset" ViewReplaceParamsViewTypePrompts ViewReplaceParamsViewType = "prompts" ViewReplaceParamsViewTypeTools ViewReplaceParamsViewType = "tools" ViewReplaceParamsViewTypeScorers ViewReplaceParamsViewType = "scorers" ViewReplaceParamsViewTypeLogs ViewReplaceParamsViewType = "logs" )
type ViewService ¶ added in v0.2.0
type ViewService struct {
Options []option.RequestOption
}
ViewService contains methods and other services that help with interacting with the braintrust API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewViewService method instead.
func NewViewService ¶ added in v0.2.0
func NewViewService(opts ...option.RequestOption) (r ViewService)
NewViewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ViewService) Delete ¶ added in v0.2.0
func (r *ViewService) Delete(ctx context.Context, viewID string, body ViewDeleteParams, opts ...option.RequestOption) (res *shared.View, err error)
Delete a view object by its id
func (*ViewService) Get ¶ added in v0.2.0
func (r *ViewService) Get(ctx context.Context, viewID string, query ViewGetParams, opts ...option.RequestOption) (res *shared.View, err error)
Get a view object by its id
func (*ViewService) List ¶ added in v0.2.0
func (r *ViewService) List(ctx context.Context, query ViewListParams, opts ...option.RequestOption) (res *pagination.ListObjects[shared.View], err error)
List out all views. The views are sorted by creation date, with the most recently-created views coming first
func (*ViewService) ListAutoPaging ¶ added in v0.2.0
func (r *ViewService) ListAutoPaging(ctx context.Context, query ViewListParams, opts ...option.RequestOption) *pagination.ListObjectsAutoPager[shared.View]
List out all views. The views are sorted by creation date, with the most recently-created views coming first
func (*ViewService) New ¶ added in v0.2.0
func (r *ViewService) New(ctx context.Context, body ViewNewParams, opts ...option.RequestOption) (res *shared.View, err error)
Create a new view. If there is an existing view with the same name as the one specified in the request, will return the existing view unmodified
func (*ViewService) Replace ¶ added in v0.2.0
func (r *ViewService) Replace(ctx context.Context, body ViewReplaceParams, opts ...option.RequestOption) (res *shared.View, err error)
Create or replace view. If there is an existing view with the same name as the one specified in the request, will replace the existing view with the provided fields
func (*ViewService) Update ¶ added in v0.2.0
func (r *ViewService) Update(ctx context.Context, viewID string, body ViewUpdateParams, opts ...option.RequestOption) (res *shared.View, err error)
Partially update a view object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
type ViewType ¶ added in v0.7.0
Type of table that the view corresponds to.
This is an alias to an internal type.
type ViewUpdateParams ¶ added in v0.2.0
type ViewUpdateParams struct { // The id of the object the view applies to ObjectID string `json:"object_id,required" format:"uuid"` // The object type that the ACL applies to // // Any of "organization", "project", "experiment", "dataset", "prompt", // "prompt_session", "group", "role", "org_member", "project_log", "org_project". ObjectType shared.ACLObjectType `json:"object_type,omitzero,required"` // Name of the view Name param.Opt[string] `json:"name,omitzero"` // Identifies the user who created the view UserID param.Opt[string] `json:"user_id,omitzero" format:"uuid"` // Options for the view in the app Options shared.ViewOptionsParam `json:"options,omitzero"` // The view definition ViewData shared.ViewDataParam `json:"view_data,omitzero"` // Type of table that the view corresponds to. // // Any of "projects", "experiments", "experiment", "playgrounds", "playground", // "datasets", "dataset", "prompts", "tools", "scorers", "logs". ViewType ViewUpdateParamsViewType `json:"view_type,omitzero"` // contains filtered or unexported fields }
func (ViewUpdateParams) MarshalJSON ¶ added in v0.2.0
func (r ViewUpdateParams) MarshalJSON() (data []byte, err error)
func (*ViewUpdateParams) UnmarshalJSON ¶ added in v0.8.0
func (r *ViewUpdateParams) UnmarshalJSON(data []byte) error
type ViewUpdateParamsViewType ¶ added in v0.3.0
type ViewUpdateParamsViewType string
Type of table that the view corresponds to.
const ( ViewUpdateParamsViewTypeProjects ViewUpdateParamsViewType = "projects" ViewUpdateParamsViewTypeExperiments ViewUpdateParamsViewType = "experiments" ViewUpdateParamsViewTypeExperiment ViewUpdateParamsViewType = "experiment" ViewUpdateParamsViewTypePlaygrounds ViewUpdateParamsViewType = "playgrounds" ViewUpdateParamsViewTypePlayground ViewUpdateParamsViewType = "playground" ViewUpdateParamsViewTypeDatasets ViewUpdateParamsViewType = "datasets" ViewUpdateParamsViewTypeDataset ViewUpdateParamsViewType = "dataset" ViewUpdateParamsViewTypePrompts ViewUpdateParamsViewType = "prompts" ViewUpdateParamsViewTypeTools ViewUpdateParamsViewType = "tools" ViewUpdateParamsViewTypeScorers ViewUpdateParamsViewType = "scorers" ViewUpdateParamsViewTypeLogs ViewUpdateParamsViewType = "logs" )
type ViewViewType ¶ added in v0.2.0
type ViewViewType = shared.ViewViewType
Type of table that the view corresponds to.
This is an alias to an internal type.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
packages
|
|