Spaces:
Runtime error
Runtime error
| # ---------------------------------------------------------------------------- | |
| # | |
| # 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 AssessDetections( | |
| self, llm_response: str, baml_options: BamlCallOptions = {}, | |
| ) -> typing.List["types.DetectionVerdict"]: | |
| __result__ = self.__options.merge_options(baml_options).parse_response(function_name="AssessDetections", llm_response=llm_response, mode="request") | |
| return typing.cast(typing.List["types.DetectionVerdict"], __result__) | |
| def PlanMission( | |
| self, llm_response: str, baml_options: BamlCallOptions = {}, | |
| ) -> types.MissionPlan: | |
| __result__ = self.__options.merge_options(baml_options).parse_response(function_name="PlanMission", llm_response=llm_response, mode="request") | |
| return typing.cast(types.MissionPlan, __result__) | |
| def SuggestMissions( | |
| self, llm_response: str, baml_options: BamlCallOptions = {}, | |
| ) -> typing.List["types.MissionSuggestion"]: | |
| __result__ = self.__options.merge_options(baml_options).parse_response(function_name="SuggestMissions", llm_response=llm_response, mode="request") | |
| return typing.cast(typing.List["types.MissionSuggestion"], __result__) | |
| class LlmStreamParser: | |
| __options: DoNotUseDirectlyCallManager | |
| def __init__(self, options: DoNotUseDirectlyCallManager): | |
| self.__options = options | |
| def AssessDetections( | |
| self, llm_response: str, baml_options: BamlCallOptions = {}, | |
| ) -> typing.List["stream_types.DetectionVerdict"]: | |
| __result__ = self.__options.merge_options(baml_options).parse_response(function_name="AssessDetections", llm_response=llm_response, mode="stream") | |
| return typing.cast(typing.List["stream_types.DetectionVerdict"], __result__) | |
| def PlanMission( | |
| self, llm_response: str, baml_options: BamlCallOptions = {}, | |
| ) -> stream_types.MissionPlan: | |
| __result__ = self.__options.merge_options(baml_options).parse_response(function_name="PlanMission", llm_response=llm_response, mode="stream") | |
| return typing.cast(stream_types.MissionPlan, __result__) | |
| def SuggestMissions( | |
| self, llm_response: str, baml_options: BamlCallOptions = {}, | |
| ) -> typing.List["stream_types.MissionSuggestion"]: | |
| __result__ = self.__options.merge_options(baml_options).parse_response(function_name="SuggestMissions", llm_response=llm_response, mode="stream") | |
| return typing.cast(typing.List["stream_types.MissionSuggestion"], __result__) | |