diff --git a/generated_types.json b/generated_types.json index 3d9798f92..2303b7183 100644 --- a/generated_types.json +++ b/generated_types.json @@ -4208,7 +4208,7 @@ "type": "null" } ], - "description": "For prompt-backed scorers: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor." + "description": "For prompt-backed functions: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor." }, "Project": { "type": "object", @@ -6057,6 +6057,17 @@ "required": ["data"], "description": "Dataset rows", "title": "dataset_rows" + }, + { + "type": "object", + "properties": { + "experiment_name": { + "type": "string" + } + }, + "required": ["experiment_name"], + "description": "Experiment whose inputs and outputs should be used as dataset inputs and expected values", + "title": "experiment_name" } ], "description": "The dataset to use" @@ -6525,7 +6536,7 @@ "type": "null" } ], - "description": "Execution scope for topic automation. Defaults to span-level execution." + "description": "Execution scope for topic automation." }, "data_scope": { "$ref": "#/components/schemas/TopicAutomationDataScope" @@ -6695,7 +6706,17 @@ }, "source_facet": { "type": "string", - "description": "The facet field name to use as input for classification" + "description": "Materialized facet field name used when source_facet_function is absent" + }, + "source_facet_function": { + "allOf": [ + { + "$ref": "#/components/schemas/SavedFunctionId" + }, + { + "description": "The stable function reference for the source facet" + } + ] }, "embedding_model": { "type": "string", diff --git a/js/src/generated_plain_types.ts b/js/src/generated_plain_types.ts index b03f1fddc..dcaf1935a 100644 --- a/js/src/generated_plain_types.ts +++ b/js/src/generated_plain_types.ts @@ -1,4 +1,4 @@ -// Auto-generated file (content hash 776b6c295e852681) -- do not modify +// Auto-generated file (content hash e392acbca346c32a) -- do not modify export type AclObjectTypeType = /** @@ -773,6 +773,26 @@ export type FacetPreprocessorIdType = code: string; } | null; +export type SavedFunctionIdType = + | { + /** + * @enum function + */ + type: "function"; + id: string; + version?: /** + * The version of the function + */ + string | undefined; + } + | { + /** + * @enum global + */ + type: "global"; + name: string; + function_type: FunctionTypeEnumType; + }; export type TopicMapGenerationSettingsType = { /** * @enum hdbscan, kmeans, community @@ -795,9 +815,15 @@ export type TopicMapDataType = { */ type: "topic_map"; /** - * The facet field name to use as input for classification + * Materialized facet field name used when source_facet_function is absent */ source_facet: string; + source_facet_function?: + | (SavedFunctionIdType & + /** + * The stable function reference for the source facet + */ unknown) + | undefined; /** * The embedding model to use for embedding facet values */ @@ -1517,26 +1543,6 @@ export type ObjectReferenceNullishType = * Indicates the event was copied from another object. */ | null; -export type SavedFunctionIdType = - | { - /** - * @enum function - */ - type: "function"; - id: string; - version?: /** - * The version of the function - */ - string | undefined; - } - | { - /** - * @enum global - */ - type: "global"; - name: string; - function_type: FunctionTypeEnumType; - }; export type DatasetEventType = { /** * A unique identifier for the dataset event. If you don't provide one, Braintrust will generate one for you @@ -2748,7 +2754,7 @@ export type PromptParserNullishType = { } | null; export type PreprocessorSavedFunctionIdType = /** - * For prompt-backed scorers: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor. + * For prompt-backed functions: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor. */ | { /** @@ -4946,7 +4952,7 @@ export type TopicAutomationConfigType = { topic_map_functions: Array; scope?: | /** - * Execution scope for topic automation. Defaults to span-level execution. + * Execution scope for topic automation. */ (SpanScopeType | TraceScopeType | GroupScopeType | null) | undefined; @@ -6393,6 +6399,12 @@ export type RunEvalType = { */ | { data: Array; + } + /** + * Experiment whose inputs and outputs should be used as dataset inputs and expected values + */ + | { + experiment_name: string; }; name?: /** * The name of the eval to run when multiple evals available diff --git a/js/src/generated_types.ts b/js/src/generated_types.ts index fd807dcc5..ebf0f4be8 100644 --- a/js/src/generated_types.ts +++ b/js/src/generated_types.ts @@ -1,4 +1,4 @@ -// Auto-generated file (content hash 776b6c295e852681) -- do not modify +// Auto-generated file (content hash e392acbca346c32a) -- do not modify import { z } from "zod/v3"; @@ -273,6 +273,19 @@ export const FacetPreprocessorId = z.union([ z.null(), ]); export type FacetPreprocessorIdType = z.infer; +export const SavedFunctionId = z.union([ + z.object({ + type: z.literal("function"), + id: z.string(), + version: z.string().optional(), + }), + z.object({ + type: z.literal("global"), + name: z.string(), + function_type: FunctionTypeEnum.optional().default("scorer"), + }), +]); +export type SavedFunctionIdType = z.infer; export const TopicMapGenerationSettings = z.object({ algorithm: z.enum(["hdbscan", "kmeans", "community"]), dimension_reduction: z.enum(["umap", "pca", "none"]), @@ -289,6 +302,7 @@ export type TopicMapGenerationSettingsType = z.infer< export const TopicMapData = z.object({ type: z.literal("topic_map"), source_facet: z.string(), + source_facet_function: SavedFunctionId.and(z.unknown()).optional(), embedding_model: z.string(), bundle_key: z.string().optional(), report_key: z.string().optional(), @@ -629,19 +643,6 @@ export const ObjectReferenceNullish = z.union([ z.null(), ]); export type ObjectReferenceNullishType = z.infer; -export const SavedFunctionId = z.union([ - z.object({ - type: z.literal("function"), - id: z.string(), - version: z.string().optional(), - }), - z.object({ - type: z.literal("global"), - name: z.string(), - function_type: FunctionTypeEnum.optional().default("scorer"), - }), -]); -export type SavedFunctionIdType = z.infer; export const DatasetEvent = z.object({ id: z.string(), _xact_id: z.string(), @@ -2170,6 +2171,7 @@ export const RunEval = z.object({ .optional(), }), z.object({ data: z.array(z.unknown()) }), + z.object({ experiment_name: z.string() }), ]), name: z.string().optional(), parameters: z.object({}).partial().passthrough().optional(), diff --git a/js/util/generated_plain_types.ts b/js/util/generated_plain_types.ts index b03f1fddc..dcaf1935a 100644 --- a/js/util/generated_plain_types.ts +++ b/js/util/generated_plain_types.ts @@ -1,4 +1,4 @@ -// Auto-generated file (content hash 776b6c295e852681) -- do not modify +// Auto-generated file (content hash e392acbca346c32a) -- do not modify export type AclObjectTypeType = /** @@ -773,6 +773,26 @@ export type FacetPreprocessorIdType = code: string; } | null; +export type SavedFunctionIdType = + | { + /** + * @enum function + */ + type: "function"; + id: string; + version?: /** + * The version of the function + */ + string | undefined; + } + | { + /** + * @enum global + */ + type: "global"; + name: string; + function_type: FunctionTypeEnumType; + }; export type TopicMapGenerationSettingsType = { /** * @enum hdbscan, kmeans, community @@ -795,9 +815,15 @@ export type TopicMapDataType = { */ type: "topic_map"; /** - * The facet field name to use as input for classification + * Materialized facet field name used when source_facet_function is absent */ source_facet: string; + source_facet_function?: + | (SavedFunctionIdType & + /** + * The stable function reference for the source facet + */ unknown) + | undefined; /** * The embedding model to use for embedding facet values */ @@ -1517,26 +1543,6 @@ export type ObjectReferenceNullishType = * Indicates the event was copied from another object. */ | null; -export type SavedFunctionIdType = - | { - /** - * @enum function - */ - type: "function"; - id: string; - version?: /** - * The version of the function - */ - string | undefined; - } - | { - /** - * @enum global - */ - type: "global"; - name: string; - function_type: FunctionTypeEnumType; - }; export type DatasetEventType = { /** * A unique identifier for the dataset event. If you don't provide one, Braintrust will generate one for you @@ -2748,7 +2754,7 @@ export type PromptParserNullishType = { } | null; export type PreprocessorSavedFunctionIdType = /** - * For prompt-backed scorers: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor. + * For prompt-backed functions: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor. */ | { /** @@ -4946,7 +4952,7 @@ export type TopicAutomationConfigType = { topic_map_functions: Array; scope?: | /** - * Execution scope for topic automation. Defaults to span-level execution. + * Execution scope for topic automation. */ (SpanScopeType | TraceScopeType | GroupScopeType | null) | undefined; @@ -6393,6 +6399,12 @@ export type RunEvalType = { */ | { data: Array; + } + /** + * Experiment whose inputs and outputs should be used as dataset inputs and expected values + */ + | { + experiment_name: string; }; name?: /** * The name of the eval to run when multiple evals available diff --git a/js/util/generated_types.ts b/js/util/generated_types.ts index fd807dcc5..ebf0f4be8 100644 --- a/js/util/generated_types.ts +++ b/js/util/generated_types.ts @@ -1,4 +1,4 @@ -// Auto-generated file (content hash 776b6c295e852681) -- do not modify +// Auto-generated file (content hash e392acbca346c32a) -- do not modify import { z } from "zod/v3"; @@ -273,6 +273,19 @@ export const FacetPreprocessorId = z.union([ z.null(), ]); export type FacetPreprocessorIdType = z.infer; +export const SavedFunctionId = z.union([ + z.object({ + type: z.literal("function"), + id: z.string(), + version: z.string().optional(), + }), + z.object({ + type: z.literal("global"), + name: z.string(), + function_type: FunctionTypeEnum.optional().default("scorer"), + }), +]); +export type SavedFunctionIdType = z.infer; export const TopicMapGenerationSettings = z.object({ algorithm: z.enum(["hdbscan", "kmeans", "community"]), dimension_reduction: z.enum(["umap", "pca", "none"]), @@ -289,6 +302,7 @@ export type TopicMapGenerationSettingsType = z.infer< export const TopicMapData = z.object({ type: z.literal("topic_map"), source_facet: z.string(), + source_facet_function: SavedFunctionId.and(z.unknown()).optional(), embedding_model: z.string(), bundle_key: z.string().optional(), report_key: z.string().optional(), @@ -629,19 +643,6 @@ export const ObjectReferenceNullish = z.union([ z.null(), ]); export type ObjectReferenceNullishType = z.infer; -export const SavedFunctionId = z.union([ - z.object({ - type: z.literal("function"), - id: z.string(), - version: z.string().optional(), - }), - z.object({ - type: z.literal("global"), - name: z.string(), - function_type: FunctionTypeEnum.optional().default("scorer"), - }), -]); -export type SavedFunctionIdType = z.infer; export const DatasetEvent = z.object({ id: z.string(), _xact_id: z.string(), @@ -2170,6 +2171,7 @@ export const RunEval = z.object({ .optional(), }), z.object({ data: z.array(z.unknown()) }), + z.object({ experiment_name: z.string() }), ]), name: z.string().optional(), parameters: z.object({}).partial().passthrough().optional(),