| 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"} | |
| } | |
| 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() |