diff --git a/generated_types.json b/generated_types.json index 10d270f0..7a0c2081 100644 --- a/generated_types.json +++ b/generated_types.json @@ -799,14 +799,7 @@ ] }, "preprocessor": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableSavedFunctionId" - }, - { - "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." - } - ] + "$ref": "#/components/schemas/FacetPreprocessorId" }, "facets": { "type": "array", @@ -3168,14 +3161,7 @@ ] }, "preprocessor": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableSavedFunctionId" - }, - { - "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." - } - ] + "$ref": "#/components/schemas/FacetPreprocessorId" }, "prompt": { "type": "string", @@ -3200,6 +3186,80 @@ ], "title": "facet" }, + "FacetPreprocessorId": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "id": { + "type": "string" + }, + "version": { + "type": "string", + "description": "The version of the function" + } + }, + "required": [ + "type", + "id" + ], + "title": "function" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "global" + ] + }, + "name": { + "type": "string" + }, + "function_type": { + "$ref": "#/components/schemas/FunctionTypeEnum" + } + }, + "required": [ + "type", + "name" + ], + "title": "global" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "inline" + ] + }, + "code": { + "type": "string", + "minLength": 1, + "description": "The complete JavaScript preprocessor implementation, including its handler." + } + }, + "required": [ + "type", + "code" + ], + "title": "preprocessor_inline" + }, + { + "type": "null" + } + ], + "description": "The saved, global, or inline preprocessor to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." + }, "Function": { "type": "object", "properties": { @@ -5951,6 +6011,72 @@ "config" ] }, + "ProjectGroup": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the project group" + }, + "org_id": { + "type": "string", + "format": "uuid", + "description": "Unique id for the organization that the project group belongs under\n\nIt is forbidden to change the org after creating a project group" + }, + "user_id": { + "type": [ + "string", + "null" + ], + "format": "uuid", + "description": "Identifies the user who created the project group" + }, + "created": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Date of project group creation" + }, + "name": { + "type": "string", + "description": "Name of the project group" + }, + "description": { + "type": [ + "string", + "null" + ], + "description": "Textual description of the project group" + }, + "deleted_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Date of project group deletion, or null if the project group is still active" + }, + "member_projects": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 10000, + "description": "Sorted ids of active projects in this project group" + } + }, + "required": [ + "id", + "org_id", + "name", + "member_projects" + ], + "description": "A project group is a collection of projects which can inherit access from project-group ACLs" + }, "ProjectLogsEvent": { "type": "object", "properties": { @@ -8637,7 +8763,8 @@ "type": "string", "enum": [ "hdbscan", - "kmeans" + "kmeans", + "community" ] }, "dimension_reduction": { @@ -8892,6 +9019,13 @@ "type": "string", "description": "Name of the view" }, + "description": { + "type": [ + "string", + "null" + ], + "description": "Textual description of the view" + }, "created": { "type": [ "string", @@ -8900,6 +9034,14 @@ "format": "date-time", "description": "Date of view creation" }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Date of last view update" + }, "view_data": { "$ref": "#/components/schemas/ViewData" }, diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index 0101d33e..6a204021 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -230,23 +230,6 @@ class AsyncScoringStateAsyncScoringState1(TypedDict): """ -class PreprocessorPreprocessor(TypedDict): - type: Literal['function'] - id: str - version: NotRequired[str | None] - """ - The version of the function - """ - - -class PreprocessorPreprocessor2(TypedDict): - pass - - -class PreprocessorPreprocessor3(PreprocessorPreprocessor, PreprocessorPreprocessor2): - pass - - class BatchedFacetDataFacet(TypedDict): name: str """ @@ -811,7 +794,7 @@ class ExternalAttachmentReference(TypedDict): """ -class Preprocessor1Preprocessor1(TypedDict): +class FacetPreprocessorIdFacetPreprocessorId(TypedDict): type: Literal['function'] id: str version: NotRequired[str | None] @@ -820,14 +803,12 @@ class Preprocessor1Preprocessor1(TypedDict): """ -class Preprocessor1Preprocessor12(TypedDict): - pass - - -class Preprocessor1Preprocessor13( - Preprocessor1Preprocessor1, Preprocessor1Preprocessor12 -): - pass +class FacetPreprocessorIdFacetPreprocessorId2(TypedDict): + type: Literal['inline'] + code: str + """ + The complete JavaScript preprocessor implementation, including its handler. + """ class FunctionOrigin(TypedDict): @@ -1845,6 +1826,43 @@ class ProjectAutomationConfig4(TypedDict): """ +class ProjectGroup(TypedDict): + id: str + """ + Unique identifier for the project group + """ + org_id: str + """ + Unique id for the organization that the project group belongs under + + It is forbidden to change the org after creating a project group + """ + user_id: NotRequired[str | None] + """ + Identifies the user who created the project group + """ + created: NotRequired[str | None] + """ + Date of project group creation + """ + name: str + """ + Name of the project group + """ + description: NotRequired[str | None] + """ + Textual description of the project group + """ + deleted_at: NotRequired[str | None] + """ + Date of project group deletion, or null if the project group is still active + """ + member_projects: Sequence[str] + """ + Sorted ids of active projects in this project group + """ + + class ProjectLogsEventMetadata(TypedDict): model: NotRequired[str | None] """ @@ -2697,7 +2715,7 @@ class TopicMapFunctionAutomation(TypedDict): class TopicMapGenerationSettings(TypedDict): - algorithm: Literal['hdbscan', 'kmeans'] + algorithm: Literal['hdbscan', 'kmeans', 'community'] dimension_reduction: Literal['umap', 'pca', 'none'] sample_size: NotRequired[int | None] n_clusters: NotRequired[int | None] @@ -3163,19 +3181,6 @@ class AttachmentStatus(TypedDict): """ -class PreprocessorPreprocessor1(TypedDict): - type: Literal['global'] - name: str - function_type: NotRequired[FunctionTypeEnum | None] - - -class PreprocessorPreprocessor4(PreprocessorPreprocessor1, PreprocessorPreprocessor2): - pass - - -Preprocessor: TypeAlias = PreprocessorPreprocessor3 | PreprocessorPreprocessor4 - - ChatCompletionContentPart: TypeAlias = ( ChatCompletionContentPartTextWithTitle | ChatCompletionContentPartImageWithTitle @@ -3385,40 +3390,21 @@ class ExtendedSavedFunctionIdExtendedSavedFunctionId1(TypedDict): ) -class Preprocessor1Preprocessor11(TypedDict): +class FacetPreprocessorIdFacetPreprocessorId1(TypedDict): type: Literal['global'] name: str function_type: NotRequired[FunctionTypeEnum | None] -class Preprocessor1Preprocessor14( - Preprocessor1Preprocessor11, Preprocessor1Preprocessor12 -): - pass - - -Preprocessor1: TypeAlias = Preprocessor1Preprocessor13 | Preprocessor1Preprocessor14 - - -class FacetData(TypedDict): - type: Literal['facet'] - preprocessor: NotRequired[Preprocessor1 | None] - prompt: str - """ - The prompt to use for LLM extraction. The preprocessed text will be provided as context. - """ - model: NotRequired[str | None] - """ - The model to use for facet extraction - """ - embedding_model: NotRequired[str | None] - """ - The embedding model to use for vectorizing facet results. - """ - no_match_pattern: NotRequired[str | None] - """ - Regex pattern to identify outputs that do not match the facet. If the output matches, the facet will be saved as 'no_match' - """ +FacetPreprocessorId: TypeAlias = ( + FacetPreprocessorIdFacetPreprocessorId + | FacetPreprocessorIdFacetPreprocessorId1 + | FacetPreprocessorIdFacetPreprocessorId2 + | None +) +""" +The saved, global, or inline preprocessor to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor. +""" class FunctionDataFunctionData3(TypedDict): @@ -3909,7 +3895,7 @@ class BatchedFacetDataTopicMap(TypedDict): class BatchedFacetData(TypedDict): type: Literal['batched_facet'] - preprocessor: NotRequired[Preprocessor | None] + preprocessor: NotRequired[FacetPreprocessorId | None] facets: Sequence[BatchedFacetDataFacet] topic_maps: NotRequired[Mapping[str, Sequence[BatchedFacetDataTopicMap]] | None] """ @@ -4014,6 +4000,27 @@ class ExperimentEvent(TypedDict): """ +class FacetData(TypedDict): + type: Literal['facet'] + preprocessor: NotRequired[FacetPreprocessorId | None] + prompt: str + """ + The prompt to use for LLM extraction. The preprocessed text will be provided as context. + """ + model: NotRequired[str | None] + """ + The model to use for facet extraction + """ + embedding_model: NotRequired[str | None] + """ + The embedding model to use for vectorizing facet results. + """ + no_match_pattern: NotRequired[str | None] + """ + Regex pattern to identify outputs that do not match the facet. If the output matches, the facet will be saved as 'no_match' + """ + + class GraphNodeGraphNode7(TypedDict): description: NotRequired[str | None] """ @@ -4311,10 +4318,18 @@ class View(TypedDict): """ Name of the view """ + description: NotRequired[str | None] + """ + Textual description of the view + """ created: NotRequired[str | None] """ Date of view creation """ + updated_at: NotRequired[str | None] + """ + Date of last view update + """ view_data: NotRequired[ViewData | None] options: NotRequired[ViewOptions | None] user_id: NotRequired[str | None] diff --git a/py/src/braintrust/generated_types.py b/py/src/braintrust/generated_types.py index edf78d30..bfbd0624 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash 223c6db3c25381f8) -- do not modify""" +"""Auto-generated file (content hash 776b6c295e852681) -- do not modify""" from ._generated_types import ( Acl, @@ -37,6 +37,7 @@ ExtendedSavedFunctionId, ExternalAttachmentReference, FacetData, + FacetPreprocessorId, Function, FunctionData, FunctionFormat, @@ -69,6 +70,7 @@ PreprocessorSavedFunctionId, Project, ProjectAutomation, + ProjectGroup, ProjectLogsEvent, ProjectScore, ProjectScoreCategories, @@ -160,6 +162,7 @@ "ExtendedSavedFunctionId", "ExternalAttachmentReference", "FacetData", + "FacetPreprocessorId", "Function", "FunctionData", "FunctionFormat", @@ -192,6 +195,7 @@ "PreprocessorSavedFunctionId", "Project", "ProjectAutomation", + "ProjectGroup", "ProjectLogsEvent", "ProjectScore", "ProjectScoreCategories",