# ----------------------------------------------------------------------------
#
#  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 BamlCallOptions, DoNotUseDirectlyCallManager


class LlmResponseParser:
    __options: DoNotUseDirectlyCallManager

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

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

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


class LlmStreamParser:
    __options: DoNotUseDirectlyCallManager

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

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

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