araeyn commited on
Commit
146328c
1 Parent(s): a7310e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -17
app.py CHANGED
@@ -123,22 +123,6 @@ print("-------")
123
  print("started")
124
  print("-------")
125
 
126
- response = conversational_rag_chain.invoke(
127
- {"input": input()},
128
- config={
129
- "configurable": {"session_id": "test"}
130
- },
131
- )["answer"]
132
- print(response)
133
-
134
- response = conversational_rag_chain.invoke(
135
- {"input": input()},
136
- config={
137
- "configurable": {"session_id": "test"}
138
- },
139
- )["answer"]
140
- print(response)
141
-
142
  async def echo(websocket):
143
  async for message in websocket:
144
  data = json.loads(message)
@@ -163,4 +147,11 @@ async def main():
163
  async with serve(echo, "0.0.0.0", 7860):
164
  await asyncio.Future()
165
 
166
- asyncio.run(main())
 
 
 
 
 
 
 
 
123
  print("started")
124
  print("-------")
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  async def echo(websocket):
127
  async for message in websocket:
128
  data = json.loads(message)
 
147
  async with serve(echo, "0.0.0.0", 7860):
148
  await asyncio.Future()
149
 
150
+ asyncio.run(main())
151
+ """
152
+ websocket
153
+ streamlit app ~> backend
154
+ {"token": "random", "message": "what is something"} ~> backend
155
+ backend ~> {"response": "something is something"}
156
+ streamlit app ~> display response
157
+ """