frida-cortex / baml_client /sync_request.py
Adán Flores Ramírez
Frida Command interpreter to Gradio
a3643ce
###############################################################################
#
# Welcome to Baml! To use this generated code, please run the following:
#
# $ pip install baml-py
#
###############################################################################
# This file was generated by BAML: please do not edit it. Instead, edit the
# BAML files and re-generate this code.
#
# ruff: noqa: E501,F401
# flake8: noqa: E501,F401
# pylint: disable=unused-import,line-too-long
# fmt: off
from typing import Any, Dict, List, Optional, Union, TypedDict, Type
from typing_extensions import NotRequired, Literal
import baml_py
from . import types
from .types import Checked, Check
from .type_builder import TypeBuilder
class BamlCallOptions(TypedDict, total=False):
tb: NotRequired[TypeBuilder]
client_registry: NotRequired[baml_py.baml_py.ClientRegistry]
class HttpRequest:
__runtime: baml_py.BamlRuntime
__ctx_manager: baml_py.BamlCtxManager
def __init__(self, runtime: baml_py.BamlRuntime, ctx_manager: baml_py.BamlCtxManager):
self.__runtime = runtime
self.__ctx_manager = ctx_manager
def AugmentedResponse(
self,
relevant_document: str,user_instruction: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"AugmentedResponse",
{
"relevant_document": relevant_document,"user_instruction": user_instruction,
},
self.__ctx_manager.get(),
tb,
__cr__,
False,
)
def GenerateCommandList(
self,
request: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"GenerateCommandList",
{
"request": request,
},
self.__ctx_manager.get(),
tb,
__cr__,
False,
)
def GenerateCommandListFineTuned(
self,
request: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"GenerateCommandListFineTuned",
{
"request": request,
},
self.__ctx_manager.get(),
tb,
__cr__,
False,
)
def GenerateEnrichedAndReorderedCommand(
self,
request: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"GenerateEnrichedAndReorderedCommand",
{
"request": request,
},
self.__ctx_manager.get(),
tb,
__cr__,
False,
)
class HttpStreamRequest:
__runtime: baml_py.BamlRuntime
__ctx_manager: baml_py.BamlCtxManager
def __init__(self, runtime: baml_py.BamlRuntime, ctx_manager: baml_py.BamlCtxManager):
self.__runtime = runtime
self.__ctx_manager = ctx_manager
def AugmentedResponse(
self,
relevant_document: str,user_instruction: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"AugmentedResponse",
{
"relevant_document": relevant_document,"user_instruction": user_instruction,
},
self.__ctx_manager.get(),
tb,
__cr__,
True,
)
def GenerateCommandList(
self,
request: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"GenerateCommandList",
{
"request": request,
},
self.__ctx_manager.get(),
tb,
__cr__,
True,
)
def GenerateCommandListFineTuned(
self,
request: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"GenerateCommandListFineTuned",
{
"request": request,
},
self.__ctx_manager.get(),
tb,
__cr__,
True,
)
def GenerateEnrichedAndReorderedCommand(
self,
request: str,
baml_options: BamlCallOptions = {},
) -> baml_py.HTTPRequest:
__tb__ = baml_options.get("tb", None)
if __tb__ is not None:
tb = __tb__._tb # type: ignore (we know how to use this private attribute)
else:
tb = None
__cr__ = baml_options.get("client_registry", None)
return self.__runtime.build_request_sync(
"GenerateEnrichedAndReorderedCommand",
{
"request": request,
},
self.__ctx_manager.get(),
tb,
__cr__,
True,
)
__all__ = ["HttpRequest", "HttpStreamRequest"]