#!/usr/bin/env python3

from restapi_helper import LangChainHelper
from langchain.schema import HumanMessage

print('==Simple message predict==')
with LangChainHelper() as lch:
    text = 'Hey there!'
    messages = [HumanMessage(content=text)]
    print(lch.predict_messages(messages))

print('==As English teacher - know the answer==')
with LangChainHelper() as lch:
    role = 'English teacher'
    text = 'What is a plural form of child?'
    print(lch.get_answer_as_role(role, text))

print('==As English teacher - does not know the answer==')
with LangChainHelper() as lch:
    role = 'English teacher'
    text = 'How old am I?'
    print(lch.get_answer_as_role(role, text))

langchain.schema.HumanMessage
[((157, 174), 'restapi_helper.LangChainHelper', 'LangChainHelper', ([], {}), '()\n', (172, 174), False, 'from restapi_helper import LangChainHelper\n'), ((355, 372), 'restapi_helper.LangChainHelper', 'LangChainHelper', ([], {}), '()\n', (370, 372), False, 'from restapi_helper import LangChainHelper\n'), ((572, 589), 'restapi_helper.LangChainHelper', 'LangChainHelper', ([], {}), '()\n', (587, 589), False, 'from restapi_helper import LangChainHelper\n'), ((225, 251), 'langchain.schema.HumanMessage', 'HumanMessage', ([], {'content': 'text'}), '(content=text)\n', (237, 251), False, 'from langchain.schema import HumanMessage\n')]