# ----------------------------------------------------------------------------
#
#  Welcome to Baml! To use this generated code, please run the following:
#
#  $ pip install baml
#
# ----------------------------------------------------------------------------

# This file was generated by BAML: please do not edit it. Instead, edit the
# BAML files and re-generate this code using: baml-cli generate
# baml-cli is available with the baml package.

import typing
import typing_extensions
from enum import Enum


from pydantic import BaseModel, ConfigDict


import baml_py

CheckT = typing_extensions.TypeVar('CheckT')
CheckName = typing_extensions.TypeVar('CheckName', bound=str)

class Check(BaseModel):
    name: str
    expression: str
    status: str
class Checked(BaseModel, typing.Generic[CheckT, CheckName]):
    value: CheckT
    checks: typing.Dict[CheckName, Check]

def get_checks(checks: typing.Dict[CheckName, Check]) -> typing.List[Check]:
    return list(checks.values())

def all_succeeded(checks: typing.Dict[CheckName, Check]) -> bool:
    return all(check.status == "succeeded" for check in get_checks(checks))
# #########################################################################
# Generated enums (0)
# #########################################################################

# #########################################################################
# Generated classes (6)
# #########################################################################

class Feedback(BaseModel):
    response: str
    reason: str

class History(BaseModel):
    page_id: str
    layout: typing.Optional[str] = None
    description: typing.Optional[str] = None
    prev_action: typing.Optional[str] = None

class Output(BaseModel):
    model_config = ConfigDict(extra='allow')

class PageAbstract(BaseModel):
    name: str
    description: str
    layout: str

class Step(BaseModel):
    condition: str
    action: str
    expectation: str

class TestCase(BaseModel):
    name: str
    steps: typing.List["Step"]

# #########################################################################
# Generated type aliases (2)
# #########################################################################


ExtractedData: typing_extensions.TypeAlias = typing.Union["Output", str, int, float, bool, typing.List["Output"], typing.List[typing.Union[str, int, float, bool]]]


Primitives: typing_extensions.TypeAlias = typing.Union[str, int, float, bool]
