CoolFace
Apppublic

JanfNavf/Multilingual_Character-Style_Chatbot

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
app.py21 linesDownload Raw Back to root
1from chains import multilingual_character_chain2from options import characters, languages3 4 5def respond(message, chat_history, character, language):6    chat_history.append({"role": "user", "content": message})7    response = multilingual_character_chain.invoke(8        {"messages": chat_history, "character": character, "language": language}9    )10    chat_history.append({"role": "assistant", "content": response})11 12    return response13 14 15def get_characters():16    return characters17 18 19def get_languages():20    return languages21