# ----------------------------------------------------------------------------
#
#  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 . import stream_types, types
from .runtime import DoNotUseDirectlyCallManager, BamlCallOptions

class LlmResponseParser:
    __options: DoNotUseDirectlyCallManager

    def __init__(self, options: DoNotUseDirectlyCallManager):
        self.__options = options

    def AbstractPage(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> types.PageAbstract:
        result = self.__options.merge_options(baml_options).parse_response(function_name="AbstractPage", llm_response=llm_response, mode="request")
        return typing.cast(types.PageAbstract, result)

    def ExtractFromElement(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> types.Output:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ExtractFromElement", llm_response=llm_response, mode="request")
        return typing.cast(types.Output, result)

    def ExtractFromState(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> types.Output:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ExtractFromState", llm_response=llm_response, mode="request")
        return typing.cast(types.Output, result)

    def ExtractTestCase(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> types.TestCase:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ExtractTestCase", llm_response=llm_response, mode="request")
        return typing.cast(types.TestCase, result)

    def GeneratePostcondition(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="GeneratePostcondition", llm_response=llm_response, mode="request")
        return typing.cast(str, result)

    def GeneratePrecondition(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="GeneratePrecondition", llm_response=llm_response, mode="request")
        return typing.cast(str, result)

    def ImplicitGeneration(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> types.TestCase:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ImplicitGeneration", llm_response=llm_response, mode="request")
        return typing.cast(types.TestCase, result)

    def IsSameLogicalPage(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> bool:
        result = self.__options.merge_options(baml_options).parse_response(function_name="IsSameLogicalPage", llm_response=llm_response, mode="request")
        return typing.cast(bool, result)

    def LocateUIElement(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="LocateUIElement", llm_response=llm_response, mode="request")
        return typing.cast(str, result)

    def ProposeActions(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ProposeActions", llm_response=llm_response, mode="request")
        return typing.cast(str, result)

    

class LlmStreamParser:
    __options: DoNotUseDirectlyCallManager

    def __init__(self, options: DoNotUseDirectlyCallManager):
        self.__options = options

    def AbstractPage(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> stream_types.PageAbstract:
        result = self.__options.merge_options(baml_options).parse_response(function_name="AbstractPage", llm_response=llm_response, mode="stream")
        return typing.cast(stream_types.PageAbstract, result)

    def ExtractFromElement(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> stream_types.Output:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ExtractFromElement", llm_response=llm_response, mode="stream")
        return typing.cast(stream_types.Output, result)

    def ExtractFromState(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> stream_types.Output:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ExtractFromState", llm_response=llm_response, mode="stream")
        return typing.cast(stream_types.Output, result)

    def ExtractTestCase(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> stream_types.TestCase:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ExtractTestCase", llm_response=llm_response, mode="stream")
        return typing.cast(stream_types.TestCase, result)

    def GeneratePostcondition(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="GeneratePostcondition", llm_response=llm_response, mode="stream")
        return typing.cast(str, result)

    def GeneratePrecondition(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="GeneratePrecondition", llm_response=llm_response, mode="stream")
        return typing.cast(str, result)

    def ImplicitGeneration(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> stream_types.TestCase:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ImplicitGeneration", llm_response=llm_response, mode="stream")
        return typing.cast(stream_types.TestCase, result)

    def IsSameLogicalPage(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> bool:
        result = self.__options.merge_options(baml_options).parse_response(function_name="IsSameLogicalPage", llm_response=llm_response, mode="stream")
        return typing.cast(bool, result)

    def LocateUIElement(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="LocateUIElement", llm_response=llm_response, mode="stream")
        return typing.cast(str, result)

    def ProposeActions(
        self, llm_response: str, baml_options: BamlCallOptions = {},
    ) -> str:
        result = self.__options.merge_options(baml_options).parse_response(function_name="ProposeActions", llm_response=llm_response, mode="stream")
        return typing.cast(str, result)

    