testAIED / app.py
Xavier Antonio Ochoa Chehab
New
2b3c3e9
import chainlit as cl
from langflow.load import run_flow_from_json
TWEAKS = {
"ChatInput-w2pkG": {},
"Prompt-6H4qF": {},
"ChatOutput-Xju6V": {},
"GoogleGenerativeAIModel-xh97T": {"user id": "user_id"}
}
@cl.on_message
async def main(message: cl.Message):
response = run_flow_from_json(flow="Basic Prompting.json",
tweaks=TWEAKS,
input_value=message.content,
session_id="1234",
cache="InMemoryCache")
await cl.Message(response[0].outputs[0].results["message"].text).send()