diff --git a/generated_types.json b/generated_types.json index 4543d4fe..4f681eb7 100644 --- a/generated_types.json +++ b/generated_types.json @@ -3919,7 +3919,7 @@ }, "cwd": { "type": "string", - "pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\)", + "pattern": "^(?:[/]|[A-Za-z]:[\\\\/]|\\\\\\\\)", "description": "Absolute working directory for the ACP session on the execution host" }, "permissions": { @@ -4876,7 +4876,7 @@ "null" ], "additionalProperties": {}, - "description": "Any relevant metadata. This will be logged and available as the `metadata` argument." + "description": "Any relevant metadata to log on the span. For prompts, this is available as the `metadata` template variable. For code functions, this is passed through hooks and is not added to `input`." }, "tags": { "type": [ @@ -7499,6 +7499,174 @@ "content" ], "title": "completion" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "decisions" + ] + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "system", + "developer", + "user", + "assistant" + ] + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChatCompletionContentPartText" + } + } + ] + } + }, + "required": [ + "role", + "content" + ] + } + } + ] + }, + "questions": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "instructions": { + "type": "string" + } + }, + "required": [ + "instructions" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "predicate" + ] + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "choice" + ] + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "description": { + "type": "string" + } + }, + "required": [ + "value" + ] + } + } + }, + "required": [ + "type", + "choices" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "score" + ] + }, + "levels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "label" + ] + } + } + }, + "required": [ + "type", + "levels" + ] + } + ] + } + ] + } + } + }, + "required": [ + "type", + "input", + "questions" + ], + "title": "decisions" } ] }, @@ -7548,6 +7716,174 @@ ], "title": "completion" }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "decisions" + ] + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "system", + "developer", + "user", + "assistant" + ] + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChatCompletionContentPartText" + } + } + ] + } + }, + "required": [ + "role", + "content" + ] + } + } + ] + }, + "questions": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "instructions": { + "type": "string" + } + }, + "required": [ + "instructions" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "predicate" + ] + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "choice" + ] + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "description": { + "type": "string" + } + }, + "required": [ + "value" + ] + } + } + }, + "required": [ + "type", + "choices" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "score" + ] + }, + "levels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "label" + ] + } + } + }, + "required": [ + "type", + "levels" + ] + } + ] + } + ] + } + } + }, + "required": [ + "type", + "input", + "questions" + ], + "title": "decisions" + }, { "type": "null" } @@ -10431,17 +10767,9 @@ ] }, "id": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "string", - "enum": [ - "overview" - ] - } + "type": "string", + "enum": [ + "overview" ] } }, diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index 8e5807f0..c6a81e83 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -2239,11 +2239,121 @@ class PromptBlockDataPromptBlockData1(TypedDict): content: str +class PromptBlockDataPromptBlockData2InputItem(TypedDict): + role: Literal['system', 'developer', 'user', 'assistant'] + content: str | Sequence[ChatCompletionContentPartText] + + +class QuestionQuestion(TypedDict): + type: Literal['predicate'] + + +class QuestionQuestion1Choice(TypedDict): + value: str | bool + description: NotRequired[str | None] + + +class QuestionQuestion1(TypedDict): + type: Literal['choice'] + choices: Sequence[QuestionQuestion1Choice] + + +class QuestionQuestion2Level(TypedDict): + label: str + description: NotRequired[str | None] + + +class QuestionQuestion2(TypedDict): + type: Literal['score'] + levels: Sequence[QuestionQuestion2Level] + + +class QuestionQuestion3(TypedDict): + name: NotRequired[str | None] + instructions: str + + +class QuestionQuestion4(QuestionQuestion, QuestionQuestion3): + pass + + +class QuestionQuestion5(QuestionQuestion1, QuestionQuestion3): + pass + + +class QuestionQuestion6(QuestionQuestion2, QuestionQuestion3): + pass + + +Question: TypeAlias = QuestionQuestion4 | QuestionQuestion5 | QuestionQuestion6 + + +class PromptBlockDataPromptBlockData2(TypedDict): + type: Literal['decisions'] + input: str | Sequence[PromptBlockDataPromptBlockData2InputItem] + questions: Sequence[Question] + + class PromptBlockDataNullishPromptBlockDataNullish1(TypedDict): type: Literal['completion'] content: str +class PromptBlockDataNullishPromptBlockDataNullish2InputItem(TypedDict): + role: Literal['system', 'developer', 'user', 'assistant'] + content: str | Sequence[ChatCompletionContentPartText] + + +class Question1Question1(TypedDict): + type: Literal['predicate'] + + +class Question1Question11Choice(TypedDict): + value: str | bool + description: NotRequired[str | None] + + +class Question1Question11(TypedDict): + type: Literal['choice'] + choices: Sequence[Question1Question11Choice] + + +class Question1Question12Level(TypedDict): + label: str + description: NotRequired[str | None] + + +class Question1Question12(TypedDict): + type: Literal['score'] + levels: Sequence[Question1Question12Level] + + +class Question1Question13(TypedDict): + name: NotRequired[str | None] + instructions: str + + +class Question1Question14(Question1Question1, Question1Question13): + pass + + +class Question1Question15(Question1Question11, Question1Question13): + pass + + +class Question1Question16(Question1Question12, Question1Question13): + pass + + +Question1: TypeAlias = Question1Question14 | Question1Question15 | Question1Question16 + + +class PromptBlockDataNullishPromptBlockDataNullish2(TypedDict): + type: Literal['decisions'] + input: str | Sequence[PromptBlockDataNullishPromptBlockDataNullish2InputItem] + questions: Sequence[Question1] + + class PromptDataOrigin(TypedDict): prompt_id: NotRequired[str | None] project_id: NotRequired[str | None] @@ -3267,7 +3377,7 @@ class WindowedAutomationConfigWindow(TypedDict): class WindowedAutomationConfigLoopTarget(TypedDict): type: Literal['dashboard'] - id: str | Literal['overview'] + id: Literal['overview'] class WindowedAutomationConfigLoop(TypedDict): @@ -3766,7 +3876,7 @@ class InvokeFunctionInvokeFunction7(TypedDict): """ metadata: NotRequired[Mapping[str, Any] | None] """ - Any relevant metadata. This will be logged and available as the `metadata` argument. + Any relevant metadata to log on the span. For prompts, this is available as the `metadata` template variable. For code functions, this is passed through hooks and is not added to `input`. """ tags: NotRequired[Sequence[str] | None] """ @@ -4054,7 +4164,9 @@ class PromptBlockDataPromptBlockData(TypedDict): PromptBlockData: TypeAlias = ( - PromptBlockDataPromptBlockData | PromptBlockDataPromptBlockData1 + PromptBlockDataPromptBlockData + | PromptBlockDataPromptBlockData1 + | PromptBlockDataPromptBlockData2 ) @@ -4067,6 +4179,7 @@ class PromptBlockDataNullishPromptBlockDataNullish(TypedDict): PromptBlockDataNullish: TypeAlias = ( PromptBlockDataNullishPromptBlockDataNullish | PromptBlockDataNullishPromptBlockDataNullish1 + | PromptBlockDataNullishPromptBlockDataNullish2 | None ) diff --git a/py/src/braintrust/generated_types.py b/py/src/braintrust/generated_types.py index 4995ac09..e8a41ac7 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash cf7b7e6d0ca18d3a) -- do not modify""" +"""Auto-generated file (content hash 82ae75924e108923) -- do not modify""" from ._generated_types import ( Acl,