def translate_text()

in functions/function_app.py [0:0]


def translate_text(text: str, language: str) -> str:
    param_provider = lambda: {"text": text, "language": language}
    return llm_call(
        model=model_to_use,
        system_template = (
            "You're a helpful translator assistant who translates the provided {text} into specified {language}."
            "A user will pass in a text and language that this text should be translated to. Make sure that the meaning of the translated text is as closer as possible to the original text"
            "Return this text in form useful for museums brochures."
        ),
        human_template="Text: {text}\nLanguage: {language}",
        param_provider=param_provider,
        custom_output_parser= CustomOutputParser())